Skip to content

Commit d584566

Browse files
committed
Merge branch 'intel-wired-lan-driver-updates-2021-08-18'
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2021-08-18 This series contains updates to i40e and iavf drivers. Arkadiusz fixes Flow Director not using the correct queue due to calling the wrong pick Tx function for i40e. Sylwester resolves traffic loss for iavf when it attempts to change its MAC address when it does not have permissions to do so. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 3167490 + 8da80c9 commit d584566

File tree

4 files changed

+48
-4
lines changed

4 files changed

+48
-4
lines changed

drivers/net/ethernet/intel/i40e/i40e_txrx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3663,8 +3663,7 @@ u16 i40e_lan_select_queue(struct net_device *netdev,
36633663

36643664
/* is DCB enabled at all? */
36653665
if (vsi->tc_config.numtc == 1)
3666-
return i40e_swdcb_skb_tx_hash(netdev, skb,
3667-
netdev->real_num_tx_queues);
3666+
return netdev_pick_tx(netdev, skb, sb_dev);
36683667

36693668
prio = skb->priority;
36703669
hw = &vsi->back->hw;

drivers/net/ethernet/intel/iavf/iavf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ struct iavf_q_vector {
136136
struct iavf_mac_filter {
137137
struct list_head list;
138138
u8 macaddr[ETH_ALEN];
139+
bool is_new_mac; /* filter is new, wait for PF decision */
139140
bool remove; /* filter needs to be removed */
140141
bool add; /* filter needs to be added */
141142
};

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,7 @@ struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
751751

752752
list_add_tail(&f->list, &adapter->mac_filter_list);
753753
f->add = true;
754+
f->is_new_mac = true;
754755
adapter->aq_required |= IAVF_FLAG_AQ_ADD_MAC_FILTER;
755756
} else {
756757
f->remove = false;

drivers/net/ethernet/intel/iavf/iavf_virtchnl.c

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,47 @@ void iavf_del_ether_addrs(struct iavf_adapter *adapter)
540540
kfree(veal);
541541
}
542542

543+
/**
544+
* iavf_mac_add_ok
545+
* @adapter: adapter structure
546+
*
547+
* Submit list of filters based on PF response.
548+
**/
549+
static void iavf_mac_add_ok(struct iavf_adapter *adapter)
550+
{
551+
struct iavf_mac_filter *f, *ftmp;
552+
553+
spin_lock_bh(&adapter->mac_vlan_list_lock);
554+
list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) {
555+
f->is_new_mac = false;
556+
}
557+
spin_unlock_bh(&adapter->mac_vlan_list_lock);
558+
}
559+
560+
/**
561+
* iavf_mac_add_reject
562+
* @adapter: adapter structure
563+
*
564+
* Remove filters from list based on PF response.
565+
**/
566+
static void iavf_mac_add_reject(struct iavf_adapter *adapter)
567+
{
568+
struct net_device *netdev = adapter->netdev;
569+
struct iavf_mac_filter *f, *ftmp;
570+
571+
spin_lock_bh(&adapter->mac_vlan_list_lock);
572+
list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) {
573+
if (f->remove && ether_addr_equal(f->macaddr, netdev->dev_addr))
574+
f->remove = false;
575+
576+
if (f->is_new_mac) {
577+
list_del(&f->list);
578+
kfree(f);
579+
}
580+
}
581+
spin_unlock_bh(&adapter->mac_vlan_list_lock);
582+
}
583+
543584
/**
544585
* iavf_add_vlans
545586
* @adapter: adapter structure
@@ -1492,6 +1533,7 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
14921533
case VIRTCHNL_OP_ADD_ETH_ADDR:
14931534
dev_err(&adapter->pdev->dev, "Failed to add MAC filter, error %s\n",
14941535
iavf_stat_str(&adapter->hw, v_retval));
1536+
iavf_mac_add_reject(adapter);
14951537
/* restore administratively set MAC address */
14961538
ether_addr_copy(adapter->hw.mac.addr, netdev->dev_addr);
14971539
break;
@@ -1639,10 +1681,11 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
16391681
}
16401682
}
16411683
switch (v_opcode) {
1642-
case VIRTCHNL_OP_ADD_ETH_ADDR: {
1684+
case VIRTCHNL_OP_ADD_ETH_ADDR:
1685+
if (!v_retval)
1686+
iavf_mac_add_ok(adapter);
16431687
if (!ether_addr_equal(netdev->dev_addr, adapter->hw.mac.addr))
16441688
ether_addr_copy(netdev->dev_addr, adapter->hw.mac.addr);
1645-
}
16461689
break;
16471690
case VIRTCHNL_OP_GET_STATS: {
16481691
struct iavf_eth_stats *stats =

0 commit comments

Comments
 (0)