@@ -5275,6 +5275,8 @@ static void ixgbe_clean_rx_ring(struct ixgbe_ring *rx_ring)
5275
5275
static int ixgbe_fwd_ring_up (struct ixgbe_adapter * adapter ,
5276
5276
struct ixgbe_fwd_adapter * accel )
5277
5277
{
5278
+ u16 rss_i = adapter -> ring_feature [RING_F_RSS ].indices ;
5279
+ int num_tc = netdev_get_num_tc (adapter -> netdev );
5278
5280
struct net_device * vdev = accel -> netdev ;
5279
5281
int i , baseq , err ;
5280
5282
@@ -5286,6 +5288,11 @@ static int ixgbe_fwd_ring_up(struct ixgbe_adapter *adapter,
5286
5288
accel -> rx_base_queue = baseq ;
5287
5289
accel -> tx_base_queue = baseq ;
5288
5290
5291
+ /* record configuration for macvlan interface in vdev */
5292
+ for (i = 0 ; i < num_tc ; i ++ )
5293
+ netdev_bind_sb_channel_queue (adapter -> netdev , vdev ,
5294
+ i , rss_i , baseq + (rss_i * i ));
5295
+
5289
5296
for (i = 0 ; i < adapter -> num_rx_queues_per_pool ; i ++ )
5290
5297
adapter -> rx_ring [baseq + i ]-> netdev = vdev ;
5291
5298
@@ -5310,6 +5317,10 @@ static int ixgbe_fwd_ring_up(struct ixgbe_adapter *adapter,
5310
5317
5311
5318
netdev_err (vdev , "L2FW offload disabled due to L2 filter error\n" );
5312
5319
5320
+ /* unbind the queues and drop the subordinate channel config */
5321
+ netdev_unbind_sb_channel (adapter -> netdev , vdev );
5322
+ netdev_set_sb_channel (vdev , 0 );
5323
+
5313
5324
clear_bit (accel -> pool , adapter -> fwd_bitmask );
5314
5325
kfree (accel );
5315
5326
@@ -8201,18 +8212,22 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb,
8201
8212
void * accel_priv , select_queue_fallback_t fallback )
8202
8213
{
8203
8214
struct ixgbe_fwd_adapter * fwd_adapter = accel_priv ;
8204
- struct ixgbe_adapter * adapter ;
8205
- int txq ;
8206
8215
#ifdef IXGBE_FCOE
8216
+ struct ixgbe_adapter * adapter ;
8207
8217
struct ixgbe_ring_feature * f ;
8208
8218
#endif
8219
+ int txq ;
8209
8220
8210
8221
if (fwd_adapter ) {
8211
- adapter = netdev_priv (dev );
8212
- txq = reciprocal_scale (skb_get_hash (skb ),
8213
- adapter -> num_rx_queues_per_pool );
8222
+ u8 tc = netdev_get_num_tc (dev ) ?
8223
+ netdev_get_prio_tc_map (dev , skb -> priority ) : 0 ;
8224
+ struct net_device * vdev = fwd_adapter -> netdev ;
8225
+
8226
+ txq = vdev -> tc_to_txq [tc ].offset ;
8227
+ txq += reciprocal_scale (skb_get_hash (skb ),
8228
+ vdev -> tc_to_txq [tc ].count );
8214
8229
8215
- return txq + fwd_adapter -> tx_base_queue ;
8230
+ return txq ;
8216
8231
}
8217
8232
8218
8233
#ifdef IXGBE_FCOE
@@ -8766,6 +8781,11 @@ static int ixgbe_reassign_macvlan_pool(struct net_device *vdev, void *data)
8766
8781
/* if we cannot find a free pool then disable the offload */
8767
8782
netdev_err (vdev , "L2FW offload disabled due to lack of queue resources\n" );
8768
8783
macvlan_release_l2fw_offload (vdev );
8784
+
8785
+ /* unbind the queues and drop the subordinate channel config */
8786
+ netdev_unbind_sb_channel (adapter -> netdev , vdev );
8787
+ netdev_set_sb_channel (vdev , 0 );
8788
+
8769
8789
kfree (accel );
8770
8790
8771
8791
return 0 ;
@@ -9769,6 +9789,13 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)
9769
9789
if (!macvlan_supports_dest_filter (vdev ))
9770
9790
return ERR_PTR (- EMEDIUMTYPE );
9771
9791
9792
+ /* We need to lock down the macvlan to be a single queue device so that
9793
+ * we can reuse the tc_to_txq field in the macvlan netdev to represent
9794
+ * the queue mapping to our netdev.
9795
+ */
9796
+ if (netif_is_multiqueue (vdev ))
9797
+ return ERR_PTR (- ERANGE );
9798
+
9772
9799
pool = find_first_zero_bit (adapter -> fwd_bitmask , adapter -> num_rx_pools );
9773
9800
if (pool == adapter -> num_rx_pools ) {
9774
9801
u16 used_pools = adapter -> num_vfs + adapter -> num_rx_pools ;
@@ -9825,6 +9852,7 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)
9825
9852
return ERR_PTR (- ENOMEM );
9826
9853
9827
9854
set_bit (pool , adapter -> fwd_bitmask );
9855
+ netdev_set_sb_channel (vdev , pool );
9828
9856
accel -> pool = pool ;
9829
9857
accel -> netdev = vdev ;
9830
9858
@@ -9866,6 +9894,10 @@ static void ixgbe_fwd_del(struct net_device *pdev, void *priv)
9866
9894
ring -> netdev = NULL ;
9867
9895
}
9868
9896
9897
+ /* unbind the queues and drop the subordinate channel config */
9898
+ netdev_unbind_sb_channel (pdev , accel -> netdev );
9899
+ netdev_set_sb_channel (accel -> netdev , 0 );
9900
+
9869
9901
clear_bit (accel -> pool , adapter -> fwd_bitmask );
9870
9902
kfree (accel );
9871
9903
}
0 commit comments