Skip to content

Commit 361b534

Browse files
Alexander DuyckJeff Kirsher
authored andcommitted
ixgbe: Fix interaction between SR-IOV and macvlan offload
When SR-IOV was enabled the macvlan offload was configuring several filters with the wrong pool value. This would result in the macvlan interfaces not being able to receive traffic that had to pass over the physical interface. To fix it wrap the pool argument in the VMDQ_P macro which will add the necessary offset to get to the actual VMDq pool Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 1b953e8 commit 361b534

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5428,10 +5428,11 @@ static int ixgbe_fwd_ring_up(struct net_device *vdev,
54285428
goto fwd_queue_err;
54295429

54305430
if (is_valid_ether_addr(vdev->dev_addr))
5431-
ixgbe_add_mac_filter(adapter, vdev->dev_addr, accel->pool);
5431+
ixgbe_add_mac_filter(adapter, vdev->dev_addr,
5432+
VMDQ_P(accel->pool));
54325433

54335434
ixgbe_fwd_psrtype(accel);
5434-
ixgbe_macvlan_set_rx_mode(vdev, accel->pool, adapter);
5435+
ixgbe_macvlan_set_rx_mode(vdev, VMDQ_P(accel->pool), adapter);
54355436
return err;
54365437
fwd_queue_err:
54375438
ixgbe_fwd_ring_down(vdev, accel);
@@ -9042,6 +9043,7 @@ static int get_macvlan_queue(struct net_device *upper, void *_data)
90429043
static int handle_redirect_action(struct ixgbe_adapter *adapter, int ifindex,
90439044
u8 *queue, u64 *action)
90449045
{
9046+
struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ];
90459047
unsigned int num_vfs = adapter->num_vfs, vf;
90469048
struct upper_walk_data data;
90479049
struct net_device *upper;
@@ -9050,11 +9052,7 @@ static int handle_redirect_action(struct ixgbe_adapter *adapter, int ifindex,
90509052
for (vf = 0; vf < num_vfs; ++vf) {
90519053
upper = pci_get_drvdata(adapter->vfinfo[vf].vfdev);
90529054
if (upper->ifindex == ifindex) {
9053-
if (adapter->num_rx_pools > 1)
9054-
*queue = vf * 2;
9055-
else
9056-
*queue = vf * adapter->num_rx_queues_per_pool;
9057-
9055+
*queue = vf * __ALIGN_MASK(1, ~vmdq->mask);
90589056
*action = vf + 1;
90599057
*action <<= ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF;
90609058
return 0;

0 commit comments

Comments
 (0)