Commit 865255b5 authored by Alexander Duyck's avatar Alexander Duyck Committed by Jeff Kirsher

ixgbe: Drop real_adapter from l2 fwd acceleration structure

This patch drops the real_adapter member from the fwd_adapter structure.
The general idea behind the change is that the real_adapter is carrying
unnecessary data since we could always just grab the adapter structure
from netdev_priv(macvlan->lowerdev) if we really needed to get at it.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 3335915d
...@@ -305,7 +305,6 @@ enum ixgbe_ring_state_t { ...@@ -305,7 +305,6 @@ enum ixgbe_ring_state_t {
struct ixgbe_fwd_adapter { struct ixgbe_fwd_adapter {
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
struct net_device *netdev; struct net_device *netdev;
struct ixgbe_adapter *real_adapter;
unsigned int tx_base_queue; unsigned int tx_base_queue;
unsigned int rx_base_queue; unsigned int rx_base_queue;
int pool; int pool;
......
...@@ -5338,10 +5338,10 @@ static void ixgbe_clean_rx_ring(struct ixgbe_ring *rx_ring) ...@@ -5338,10 +5338,10 @@ static void ixgbe_clean_rx_ring(struct ixgbe_ring *rx_ring)
rx_ring->next_to_use = 0; rx_ring->next_to_use = 0;
} }
static int ixgbe_fwd_ring_up(struct net_device *vdev, static int ixgbe_fwd_ring_up(struct ixgbe_adapter *adapter,
struct ixgbe_fwd_adapter *accel) struct ixgbe_fwd_adapter *accel)
{ {
struct ixgbe_adapter *adapter = accel->real_adapter; struct net_device *vdev = accel->netdev;
int i, baseq, err; int i, baseq, err;
if (!test_bit(accel->pool, adapter->fwd_bitmask)) if (!test_bit(accel->pool, adapter->fwd_bitmask))
...@@ -5378,14 +5378,19 @@ static int ixgbe_fwd_ring_up(struct net_device *vdev, ...@@ -5378,14 +5378,19 @@ static int ixgbe_fwd_ring_up(struct net_device *vdev,
return err; return err;
} }
static int ixgbe_upper_dev_walk(struct net_device *upper, void *data) static int ixgbe_macvlan_up(struct net_device *vdev, void *data)
{ {
if (netif_is_macvlan(upper)) { struct ixgbe_adapter *adapter = data;
struct ixgbe_fwd_adapter *vadapter = macvlan_accel_priv(upper); struct ixgbe_fwd_adapter *accel;
if (vadapter) if (!netif_is_macvlan(vdev))
ixgbe_fwd_ring_up(upper, vadapter); return 0;
}
accel = macvlan_accel_priv(vdev);
if (!accel)
return 0;
ixgbe_fwd_ring_up(adapter, accel);
return 0; return 0;
} }
...@@ -5393,7 +5398,7 @@ static int ixgbe_upper_dev_walk(struct net_device *upper, void *data) ...@@ -5393,7 +5398,7 @@ static int ixgbe_upper_dev_walk(struct net_device *upper, void *data)
static void ixgbe_configure_dfwd(struct ixgbe_adapter *adapter) static void ixgbe_configure_dfwd(struct ixgbe_adapter *adapter)
{ {
netdev_walk_all_upper_dev_rcu(adapter->netdev, netdev_walk_all_upper_dev_rcu(adapter->netdev,
ixgbe_upper_dev_walk, NULL); ixgbe_macvlan_up, adapter);
} }
static void ixgbe_configure(struct ixgbe_adapter *adapter) static void ixgbe_configure(struct ixgbe_adapter *adapter)
...@@ -9792,13 +9797,12 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev) ...@@ -9792,13 +9797,12 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)
adapter->ring_feature[RING_F_VMDQ].limit = limit + 1; adapter->ring_feature[RING_F_VMDQ].limit = limit + 1;
fwd_adapter->pool = pool; fwd_adapter->pool = pool;
fwd_adapter->real_adapter = adapter;
/* Force reinit of ring allocation with VMDQ enabled */ /* Force reinit of ring allocation with VMDQ enabled */
err = ixgbe_setup_tc(pdev, adapter->hw_tcs); err = ixgbe_setup_tc(pdev, adapter->hw_tcs);
if (!err && netif_running(pdev)) if (!err && netif_running(pdev))
err = ixgbe_fwd_ring_up(vdev, fwd_adapter); err = ixgbe_fwd_ring_up(adapter, fwd_adapter);
if (!err) if (!err)
return fwd_adapter; return fwd_adapter;
...@@ -9814,7 +9818,7 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev) ...@@ -9814,7 +9818,7 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)
static void ixgbe_fwd_del(struct net_device *pdev, void *priv) static void ixgbe_fwd_del(struct net_device *pdev, void *priv)
{ {
struct ixgbe_fwd_adapter *accel = priv; struct ixgbe_fwd_adapter *accel = priv;
struct ixgbe_adapter *adapter = accel->real_adapter; struct ixgbe_adapter *adapter = netdev_priv(pdev);
unsigned int rxbase = accel->rx_base_queue; unsigned int rxbase = accel->rx_base_queue;
unsigned int limit, i; unsigned int limit, i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment