Skip to content

Commit 865255b

Browse files
Alexander DuyckJeff Kirsher
authored andcommitted
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: Alexander Duyck <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 3335915 commit 865255b

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ enum ixgbe_ring_state_t {
305305
struct ixgbe_fwd_adapter {
306306
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
307307
struct net_device *netdev;
308-
struct ixgbe_adapter *real_adapter;
309308
unsigned int tx_base_queue;
310309
unsigned int rx_base_queue;
311310
int pool;

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5338,10 +5338,10 @@ static void ixgbe_clean_rx_ring(struct ixgbe_ring *rx_ring)
53385338
rx_ring->next_to_use = 0;
53395339
}
53405340

5341-
static int ixgbe_fwd_ring_up(struct net_device *vdev,
5341+
static int ixgbe_fwd_ring_up(struct ixgbe_adapter *adapter,
53425342
struct ixgbe_fwd_adapter *accel)
53435343
{
5344-
struct ixgbe_adapter *adapter = accel->real_adapter;
5344+
struct net_device *vdev = accel->netdev;
53455345
int i, baseq, err;
53465346

53475347
if (!test_bit(accel->pool, adapter->fwd_bitmask))
@@ -5378,22 +5378,27 @@ static int ixgbe_fwd_ring_up(struct net_device *vdev,
53785378
return err;
53795379
}
53805380

5381-
static int ixgbe_upper_dev_walk(struct net_device *upper, void *data)
5381+
static int ixgbe_macvlan_up(struct net_device *vdev, void *data)
53825382
{
5383-
if (netif_is_macvlan(upper)) {
5384-
struct ixgbe_fwd_adapter *vadapter = macvlan_accel_priv(upper);
5383+
struct ixgbe_adapter *adapter = data;
5384+
struct ixgbe_fwd_adapter *accel;
53855385

5386-
if (vadapter)
5387-
ixgbe_fwd_ring_up(upper, vadapter);
5388-
}
5386+
if (!netif_is_macvlan(vdev))
5387+
return 0;
5388+
5389+
accel = macvlan_accel_priv(vdev);
5390+
if (!accel)
5391+
return 0;
5392+
5393+
ixgbe_fwd_ring_up(adapter, accel);
53895394

53905395
return 0;
53915396
}
53925397

53935398
static void ixgbe_configure_dfwd(struct ixgbe_adapter *adapter)
53945399
{
53955400
netdev_walk_all_upper_dev_rcu(adapter->netdev,
5396-
ixgbe_upper_dev_walk, NULL);
5401+
ixgbe_macvlan_up, adapter);
53975402
}
53985403

53995404
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)
97929797
adapter->ring_feature[RING_F_VMDQ].limit = limit + 1;
97939798

97949799
fwd_adapter->pool = pool;
9795-
fwd_adapter->real_adapter = adapter;
97969800

97979801
/* Force reinit of ring allocation with VMDQ enabled */
97989802
err = ixgbe_setup_tc(pdev, adapter->hw_tcs);
97999803

98009804
if (!err && netif_running(pdev))
9801-
err = ixgbe_fwd_ring_up(vdev, fwd_adapter);
9805+
err = ixgbe_fwd_ring_up(adapter, fwd_adapter);
98029806

98039807
if (!err)
98049808
return fwd_adapter;
@@ -9814,7 +9818,7 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)
98149818
static void ixgbe_fwd_del(struct net_device *pdev, void *priv)
98159819
{
98169820
struct ixgbe_fwd_adapter *accel = priv;
9817-
struct ixgbe_adapter *adapter = accel->real_adapter;
9821+
struct ixgbe_adapter *adapter = netdev_priv(pdev);
98189822
unsigned int rxbase = accel->rx_base_queue;
98199823
unsigned int limit, i;
98209824

0 commit comments

Comments
 (0)