diff mbox series

[net-queue] ixgbe: Fix setting of TC configuration for macvlan case

Message ID 20180604150647.74618.23221.stgit@ahduyck-green-test.jf.intel.com
State Accepted
Delegated to: Jeff Kirsher
Headers show
Series [net-queue] ixgbe: Fix setting of TC configuration for macvlan case | expand

Commit Message

Duyck, Alexander H June 4, 2018, 3:07 p.m. UTC
When we were enabling macvlan interfaces we weren't correctly configuring
things until ixgbe_setup_tc was called a second time either by tweaking the
number of queues or increasing the macvlan count past 15.

The issue came down to the fact that num_rx_pools is not populated until
after the queues and interrupts are reinitialized.

Instead of trying to set it sooner we can just move the call to setup at
least 1 traffic class to the SR-IOV/VMDq setup function so that we just set
it for this one case. We already had a spot that was configuring the queues
for TC 0 in the code here anyway so it makes sense to also set the number
of TCs here as well.

Fixes: 49cfbeb7a95c ("ixgbe: Fix handling of macvlan Tx offload")
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c  |    8 ++++++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |    8 --------
 2 files changed, 8 insertions(+), 8 deletions(-)

Comments

Bowers, AndrewX June 6, 2018, 4:44 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On
> Behalf Of Alexander Duyck
> Sent: Monday, June 4, 2018 8:07 AM
> To: intel-wired-lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [net-queue PATCH] ixgbe: Fix setting of TC
> configuration for macvlan case
> 
> When we were enabling macvlan interfaces we weren't correctly configuring
> things until ixgbe_setup_tc was called a second time either by tweaking the
> number of queues or increasing the macvlan count past 15.
> 
> The issue came down to the fact that num_rx_pools is not populated until
> after the queues and interrupts are reinitialized.
> 
> Instead of trying to set it sooner we can just move the call to setup at least 1
> traffic class to the SR-IOV/VMDq setup function so that we just set it for this
> one case. We already had a spot that was configuring the queues for TC 0 in
> the code here anyway so it makes sense to also set the number of TCs here
> as well.
> 
> Fixes: 49cfbeb7a95c ("ixgbe: Fix handling of macvlan Tx offload")
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c  |    8 ++++++++
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |    8 --------
>  2 files changed, 8 insertions(+), 8 deletions(-)


Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
index 893a920..d361f57 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
@@ -593,6 +593,14 @@  static bool ixgbe_set_sriov_queues(struct ixgbe_adapter *adapter)
 	}
 
 #endif
+	/* To support macvlan offload we have to use num_tc to
+	 * restrict the queues that can be used by the device.
+	 * By doing this we can avoid reporting a false number of
+	 * queues.
+	 */
+	if (vmdq_i > 1)
+		netdev_set_num_tc(adapter->netdev, 1);
+
 	/* populate TC0 for use by pool 0 */
 	netdev_set_tc_queue(adapter->netdev, 0,
 			    adapter->num_rx_queues_per_pool, 0);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index d40ed93..f460c16 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -8837,14 +8837,6 @@  int ixgbe_setup_tc(struct net_device *dev, u8 tc)
 	} else {
 		netdev_reset_tc(dev);
 
-		/* To support macvlan offload we have to use num_tc to
-		 * restrict the queues that can be used by the device.
-		 * By doing this we can avoid reporting a false number of
-		 * queues.
-		 */
-		if (!tc && adapter->num_rx_pools > 1)
-			netdev_set_num_tc(dev, 1);
-
 		if (adapter->hw.mac.type == ixgbe_mac_82598EB)
 			adapter->hw.fc.requested_mode = adapter->last_lfc_mode;