Skip to content

Commit 8a5c290

Browse files
committed
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2020-11-10 This series contains updates to i40e and igc drivers and the MAINTAINERS file. Slawomir fixes updating VF MAC addresses to fix various issues related to reporting and setting of these addresses for i40e. Dan Carpenter fixes a possible used before being initialized issue for i40e. Vinicius fixes reporting of netdev stats for igc. Tony updates repositories for Intel Ethernet Drivers. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: MAINTAINERS: Update repositories for Intel Ethernet Drivers igc: Fix returning wrong statistics i40e, xsk: uninitialized variable in i40e_clean_rx_irq_zc() i40e: Fix MAC address setting for a VF via Host/VM ==================== Link: https://lore.kernel.org/r/20201111001955.533210-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 9f73bd1 + 5fb7f75 commit 8a5c290

4 files changed

Lines changed: 35 additions & 11 deletions

File tree

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8829,8 +8829,8 @@ S: Supported
88298829
W: http://www.intel.com/support/feedback.htm
88308830
W: http://e1000.sourceforge.net/
88318831
Q: http://patchwork.ozlabs.org/project/intel-wired-lan/list/
8832-
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue.git
8833-
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git
8832+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue.git
8833+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git
88348834
F: Documentation/networking/device_drivers/ethernet/intel/
88358835
F: drivers/net/ethernet/intel/
88368836
F: drivers/net/ethernet/intel/*/

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

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2713,6 +2713,10 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
27132713
spin_unlock_bh(&vsi->mac_filter_hash_lock);
27142714
goto error_param;
27152715
}
2716+
if (is_valid_ether_addr(al->list[i].addr) &&
2717+
is_zero_ether_addr(vf->default_lan_addr.addr))
2718+
ether_addr_copy(vf->default_lan_addr.addr,
2719+
al->list[i].addr);
27162720
}
27172721
}
27182722
spin_unlock_bh(&vsi->mac_filter_hash_lock);
@@ -2740,6 +2744,7 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
27402744
{
27412745
struct virtchnl_ether_addr_list *al =
27422746
(struct virtchnl_ether_addr_list *)msg;
2747+
bool was_unimac_deleted = false;
27432748
struct i40e_pf *pf = vf->pf;
27442749
struct i40e_vsi *vsi = NULL;
27452750
i40e_status ret = 0;
@@ -2759,6 +2764,8 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
27592764
ret = I40E_ERR_INVALID_MAC_ADDR;
27602765
goto error_param;
27612766
}
2767+
if (ether_addr_equal(al->list[i].addr, vf->default_lan_addr.addr))
2768+
was_unimac_deleted = true;
27622769
}
27632770
vsi = pf->vsi[vf->lan_vsi_idx];
27642771

@@ -2779,10 +2786,25 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
27792786
dev_err(&pf->pdev->dev, "Unable to program VF %d MAC filters, error %d\n",
27802787
vf->vf_id, ret);
27812788

2789+
if (vf->trusted && was_unimac_deleted) {
2790+
struct i40e_mac_filter *f;
2791+
struct hlist_node *h;
2792+
u8 *macaddr = NULL;
2793+
int bkt;
2794+
2795+
/* set last unicast mac address as default */
2796+
spin_lock_bh(&vsi->mac_filter_hash_lock);
2797+
hash_for_each_safe(vsi->mac_filter_hash, bkt, h, f, hlist) {
2798+
if (is_valid_ether_addr(f->macaddr))
2799+
macaddr = f->macaddr;
2800+
}
2801+
if (macaddr)
2802+
ether_addr_copy(vf->default_lan_addr.addr, macaddr);
2803+
spin_unlock_bh(&vsi->mac_filter_hash_lock);
2804+
}
27822805
error_param:
27832806
/* send the response to the VF */
2784-
return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_DEL_ETH_ADDR,
2785-
ret);
2807+
return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_DEL_ETH_ADDR, ret);
27862808
}
27872809

27882810
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget)
281281
unsigned int total_rx_bytes = 0, total_rx_packets = 0;
282282
u16 cleaned_count = I40E_DESC_UNUSED(rx_ring);
283283
unsigned int xdp_res, xdp_xmit = 0;
284+
bool failure = false;
284285
struct sk_buff *skb;
285-
bool failure;
286286

287287
while (likely(total_rx_packets < (unsigned int)budget)) {
288288
union i40e_rx_desc *rx_desc;

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3891,21 +3891,23 @@ static int igc_change_mtu(struct net_device *netdev, int new_mtu)
38913891
}
38923892

38933893
/**
3894-
* igc_get_stats - Get System Network Statistics
3894+
* igc_get_stats64 - Get System Network Statistics
38953895
* @netdev: network interface device structure
3896+
* @stats: rtnl_link_stats64 pointer
38963897
*
38973898
* Returns the address of the device statistics structure.
38983899
* The statistics are updated here and also from the timer callback.
38993900
*/
3900-
static struct net_device_stats *igc_get_stats(struct net_device *netdev)
3901+
static void igc_get_stats64(struct net_device *netdev,
3902+
struct rtnl_link_stats64 *stats)
39013903
{
39023904
struct igc_adapter *adapter = netdev_priv(netdev);
39033905

3906+
spin_lock(&adapter->stats64_lock);
39043907
if (!test_bit(__IGC_RESETTING, &adapter->state))
39053908
igc_update_stats(adapter);
3906-
3907-
/* only return the current stats */
3908-
return &netdev->stats;
3909+
memcpy(stats, &adapter->stats64, sizeof(*stats));
3910+
spin_unlock(&adapter->stats64_lock);
39093911
}
39103912

39113913
static netdev_features_t igc_fix_features(struct net_device *netdev,
@@ -4855,7 +4857,7 @@ static const struct net_device_ops igc_netdev_ops = {
48554857
.ndo_set_rx_mode = igc_set_rx_mode,
48564858
.ndo_set_mac_address = igc_set_mac,
48574859
.ndo_change_mtu = igc_change_mtu,
4858-
.ndo_get_stats = igc_get_stats,
4860+
.ndo_get_stats64 = igc_get_stats64,
48594861
.ndo_fix_features = igc_fix_features,
48604862
.ndo_set_features = igc_set_features,
48614863
.ndo_features_check = igc_features_check,

0 commit comments

Comments
 (0)