mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
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/20210818174217.4138922-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
d584566c4b
4 changed files with 48 additions and 4 deletions
|
@ -3663,8 +3663,7 @@ u16 i40e_lan_select_queue(struct net_device *netdev,
|
||||||
|
|
||||||
/* is DCB enabled at all? */
|
/* is DCB enabled at all? */
|
||||||
if (vsi->tc_config.numtc == 1)
|
if (vsi->tc_config.numtc == 1)
|
||||||
return i40e_swdcb_skb_tx_hash(netdev, skb,
|
return netdev_pick_tx(netdev, skb, sb_dev);
|
||||||
netdev->real_num_tx_queues);
|
|
||||||
|
|
||||||
prio = skb->priority;
|
prio = skb->priority;
|
||||||
hw = &vsi->back->hw;
|
hw = &vsi->back->hw;
|
||||||
|
|
|
@ -136,6 +136,7 @@ struct iavf_q_vector {
|
||||||
struct iavf_mac_filter {
|
struct iavf_mac_filter {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
u8 macaddr[ETH_ALEN];
|
u8 macaddr[ETH_ALEN];
|
||||||
|
bool is_new_mac; /* filter is new, wait for PF decision */
|
||||||
bool remove; /* filter needs to be removed */
|
bool remove; /* filter needs to be removed */
|
||||||
bool add; /* filter needs to be added */
|
bool add; /* filter needs to be added */
|
||||||
};
|
};
|
||||||
|
|
|
@ -751,6 +751,7 @@ struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
|
||||||
|
|
||||||
list_add_tail(&f->list, &adapter->mac_filter_list);
|
list_add_tail(&f->list, &adapter->mac_filter_list);
|
||||||
f->add = true;
|
f->add = true;
|
||||||
|
f->is_new_mac = true;
|
||||||
adapter->aq_required |= IAVF_FLAG_AQ_ADD_MAC_FILTER;
|
adapter->aq_required |= IAVF_FLAG_AQ_ADD_MAC_FILTER;
|
||||||
} else {
|
} else {
|
||||||
f->remove = false;
|
f->remove = false;
|
||||||
|
|
|
@ -540,6 +540,47 @@ void iavf_del_ether_addrs(struct iavf_adapter *adapter)
|
||||||
kfree(veal);
|
kfree(veal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* iavf_mac_add_ok
|
||||||
|
* @adapter: adapter structure
|
||||||
|
*
|
||||||
|
* Submit list of filters based on PF response.
|
||||||
|
**/
|
||||||
|
static void iavf_mac_add_ok(struct iavf_adapter *adapter)
|
||||||
|
{
|
||||||
|
struct iavf_mac_filter *f, *ftmp;
|
||||||
|
|
||||||
|
spin_lock_bh(&adapter->mac_vlan_list_lock);
|
||||||
|
list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) {
|
||||||
|
f->is_new_mac = false;
|
||||||
|
}
|
||||||
|
spin_unlock_bh(&adapter->mac_vlan_list_lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* iavf_mac_add_reject
|
||||||
|
* @adapter: adapter structure
|
||||||
|
*
|
||||||
|
* Remove filters from list based on PF response.
|
||||||
|
**/
|
||||||
|
static void iavf_mac_add_reject(struct iavf_adapter *adapter)
|
||||||
|
{
|
||||||
|
struct net_device *netdev = adapter->netdev;
|
||||||
|
struct iavf_mac_filter *f, *ftmp;
|
||||||
|
|
||||||
|
spin_lock_bh(&adapter->mac_vlan_list_lock);
|
||||||
|
list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) {
|
||||||
|
if (f->remove && ether_addr_equal(f->macaddr, netdev->dev_addr))
|
||||||
|
f->remove = false;
|
||||||
|
|
||||||
|
if (f->is_new_mac) {
|
||||||
|
list_del(&f->list);
|
||||||
|
kfree(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spin_unlock_bh(&adapter->mac_vlan_list_lock);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* iavf_add_vlans
|
* iavf_add_vlans
|
||||||
* @adapter: adapter structure
|
* @adapter: adapter structure
|
||||||
|
@ -1492,6 +1533,7 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
|
||||||
case VIRTCHNL_OP_ADD_ETH_ADDR:
|
case VIRTCHNL_OP_ADD_ETH_ADDR:
|
||||||
dev_err(&adapter->pdev->dev, "Failed to add MAC filter, error %s\n",
|
dev_err(&adapter->pdev->dev, "Failed to add MAC filter, error %s\n",
|
||||||
iavf_stat_str(&adapter->hw, v_retval));
|
iavf_stat_str(&adapter->hw, v_retval));
|
||||||
|
iavf_mac_add_reject(adapter);
|
||||||
/* restore administratively set MAC address */
|
/* restore administratively set MAC address */
|
||||||
ether_addr_copy(adapter->hw.mac.addr, netdev->dev_addr);
|
ether_addr_copy(adapter->hw.mac.addr, netdev->dev_addr);
|
||||||
break;
|
break;
|
||||||
|
@ -1639,10 +1681,11 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch (v_opcode) {
|
switch (v_opcode) {
|
||||||
case VIRTCHNL_OP_ADD_ETH_ADDR: {
|
case VIRTCHNL_OP_ADD_ETH_ADDR:
|
||||||
|
if (!v_retval)
|
||||||
|
iavf_mac_add_ok(adapter);
|
||||||
if (!ether_addr_equal(netdev->dev_addr, adapter->hw.mac.addr))
|
if (!ether_addr_equal(netdev->dev_addr, adapter->hw.mac.addr))
|
||||||
ether_addr_copy(netdev->dev_addr, adapter->hw.mac.addr);
|
ether_addr_copy(netdev->dev_addr, adapter->hw.mac.addr);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case VIRTCHNL_OP_GET_STATS: {
|
case VIRTCHNL_OP_GET_STATS: {
|
||||||
struct iavf_eth_stats *stats =
|
struct iavf_eth_stats *stats =
|
||||||
|
|
Loading…
Reference in a new issue