netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Alexander Duyck <alexander.h.duyck@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 07/13] ixgbe: Fix interaction between SR-IOV and macvlan offload
Date: Tue,  9 Jan 2018 11:02:27 -0800	[thread overview]
Message-ID: <20180109190233.15206-8-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20180109190233.15206-1-jeffrey.t.kirsher@intel.com>

From: Alexander Duyck <alexander.h.duyck@intel.com>

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 <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index f31254d23146..952663744fc7 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -5428,10 +5428,11 @@ static int ixgbe_fwd_ring_up(struct net_device *vdev,
 		goto fwd_queue_err;
 
 	if (is_valid_ether_addr(vdev->dev_addr))
-		ixgbe_add_mac_filter(adapter, vdev->dev_addr, accel->pool);
+		ixgbe_add_mac_filter(adapter, vdev->dev_addr,
+				     VMDQ_P(accel->pool));
 
 	ixgbe_fwd_psrtype(accel);
-	ixgbe_macvlan_set_rx_mode(vdev, accel->pool, adapter);
+	ixgbe_macvlan_set_rx_mode(vdev, VMDQ_P(accel->pool), adapter);
 	return err;
 fwd_queue_err:
 	ixgbe_fwd_ring_down(vdev, accel);
@@ -9042,6 +9043,7 @@ static int get_macvlan_queue(struct net_device *upper, void *_data)
 static int handle_redirect_action(struct ixgbe_adapter *adapter, int ifindex,
 				  u8 *queue, u64 *action)
 {
+	struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ];
 	unsigned int num_vfs = adapter->num_vfs, vf;
 	struct upper_walk_data data;
 	struct net_device *upper;
@@ -9050,11 +9052,7 @@ static int handle_redirect_action(struct ixgbe_adapter *adapter, int ifindex,
 	for (vf = 0; vf < num_vfs; ++vf) {
 		upper = pci_get_drvdata(adapter->vfinfo[vf].vfdev);
 		if (upper->ifindex == ifindex) {
-			if (adapter->num_rx_pools > 1)
-				*queue = vf * 2;
-			else
-				*queue = vf * adapter->num_rx_queues_per_pool;
-
+			*queue = vf * __ALIGN_MASK(1, ~vmdq->mask);
 			*action = vf + 1;
 			*action <<= ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF;
 			return 0;
-- 
2.15.1

  parent reply	other threads:[~2018-01-09 19:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 19:02 [net-next 00/13][pull request] 10GbE Intel Wired LAN Driver Updates 2018-01-09 Jeff Kirsher
2018-01-09 19:02 ` [net-next 01/13] ixgbe: enable multicast on shutdown for WOL Jeff Kirsher
2018-01-09 19:02 ` [net-next 02/13] ixgbe: remove unused enum latency_range Jeff Kirsher
2018-01-09 19:02 ` [net-next 03/13] ixgbe: advertise highest capable link speed Jeff Kirsher
2018-01-09 19:02 ` [net-next 04/13] ixgbe: extend firmware version support Jeff Kirsher
2018-01-09 19:02 ` [net-next 05/13] ixgbe: Remove an obsolete comment about ITR Jeff Kirsher
2018-01-09 19:02 ` [net-next 06/13] ixgbevf: remove redundant setting of xcast_mode Jeff Kirsher
2018-01-09 19:02 ` Jeff Kirsher [this message]
2018-01-09 19:02 ` [net-next 08/13] ixgbe: Perform reinit any time number of VFs change Jeff Kirsher
2018-01-09 19:02 ` [net-next 09/13] ixgbe: Add support for macvlan offload RSS on X550 and clean-up pool handling Jeff Kirsher
2018-01-09 19:02 ` [net-next 10/13] ixgbe: There is no need to update num_rx_pools in L2 fwd offload Jeff Kirsher
2018-01-09 19:02 ` [net-next 11/13] ixgbe: Fix limitations on macvlan so we can support up to 63 offloaded devices Jeff Kirsher
2018-01-09 19:02 ` [net-next 12/13] ixgbe: Use ring values to test for Tx pending Jeff Kirsher
2018-01-09 19:02 ` [net-next 13/13] ixgbe: Drop l2_accel_priv data pointer from ring struct Jeff Kirsher
2018-01-10 19:45 ` [net-next 00/13][pull request] 10GbE Intel Wired LAN Driver Updates 2018-01-09 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180109190233.15206-8-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=jogreene@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).