Skip to content

Commit 3dc55db

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: 1) Limit xt_hashlimit hash table size to avoid OOM or hung tasks, from Cong Wang. 2) Fix deadlock in xsk by publishing global consumer pointers when NAPI is finished, from Magnus Karlsson. 3) Set table field properly to RT_TABLE_COMPAT when necessary, from Jethro Beekman. 4) NLA_STRING attributes are not necessary NULL terminated, deal wiht that in IFLA_ALT_IFNAME. From Eric Dumazet. 5) Fix checksum handling in atlantic driver, from Dmitry Bezrukov. 6) Handle mtu==0 devices properly in wireguard, from Jason A. Donenfeld. 7) Fix several lockdep warnings in bonding, from Taehee Yoo. 8) Fix cls_flower port blocking, from Jason Baron. 9) Sanitize internal map names in libbpf, from Toke Høiland-Jørgensen. 10) Fix RDMA race in qede driver, from Michal Kalderon. 11) Fix several false lockdep warnings by adding conditions to list_for_each_entry_rcu(), from Madhuparna Bhowmik. 12) Fix sleep in atomic in mlx5 driver, from Huy Nguyen. 13) Fix potential deadlock in bpf_map_do_batch(), from Yonghong Song. 14) Hey, variables declared in switch statement before any case statements are not initialized. I learn something every day. Get rids of this stuff in several parts of the networking, from Kees Cook. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (99 commits) bnxt_en: Issue PCIe FLR in kdump kernel to cleanup pending DMAs. bnxt_en: Improve device shutdown method. net: netlink: cap max groups which will be considered in netlink_bind() net: thunderx: workaround BGX TX Underflow issue ionic: fix fw_status read net: disable BRIDGE_NETFILTER by default net: macb: Properly handle phylink on at91rm9200 s390/qeth: fix off-by-one in RX copybreak check s390/qeth: don't warn for napi with 0 budget s390/qeth: vnicc Fix EOPNOTSUPP precedence openvswitch: Distribute switch variables for initialization net: ip6_gre: Distribute switch variables for initialization net: core: Distribute switch variables for initialization udp: rehash on disconnect net/tls: Fix to avoid gettig invalid tls record bpf: Fix a potential deadlock with bpf_map_do_batch bpf: Do not grab the bucket spinlock by default on htab batch ops ice: Wait for VF to be reset/ready before configuration ice: Don't tell the OS that link is going down ice: Don't reject odd values of usecs set by user ...
2 parents b0dd1eb + 36a44bc commit 3dc55db

104 files changed

Lines changed: 1132 additions & 506 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎drivers/net/bonding/bond_main.c‎

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,18 +3526,65 @@ static void bond_fold_stats(struct rtnl_link_stats64 *_res,
35263526
}
35273527
}
35283528

3529+
#ifdef CONFIG_LOCKDEP
3530+
static int bond_get_lowest_level_rcu(struct net_device *dev)
3531+
{
3532+
struct net_device *ldev, *next, *now, *dev_stack[MAX_NEST_DEV + 1];
3533+
struct list_head *niter, *iter, *iter_stack[MAX_NEST_DEV + 1];
3534+
int cur = 0, max = 0;
3535+
3536+
now = dev;
3537+
iter = &dev->adj_list.lower;
3538+
3539+
while (1) {
3540+
next = NULL;
3541+
while (1) {
3542+
ldev = netdev_next_lower_dev_rcu(now, &iter);
3543+
if (!ldev)
3544+
break;
3545+
3546+
next = ldev;
3547+
niter = &ldev->adj_list.lower;
3548+
dev_stack[cur] = now;
3549+
iter_stack[cur++] = iter;
3550+
if (max <= cur)
3551+
max = cur;
3552+
break;
3553+
}
3554+
3555+
if (!next) {
3556+
if (!cur)
3557+
return max;
3558+
next = dev_stack[--cur];
3559+
niter = iter_stack[cur];
3560+
}
3561+
3562+
now = next;
3563+
iter = niter;
3564+
}
3565+
3566+
return max;
3567+
}
3568+
#endif
3569+
35293570
static void bond_get_stats(struct net_device *bond_dev,
35303571
struct rtnl_link_stats64 *stats)
35313572
{
35323573
struct bonding *bond = netdev_priv(bond_dev);
35333574
struct rtnl_link_stats64 temp;
35343575
struct list_head *iter;
35353576
struct slave *slave;
3577+
int nest_level = 0;
35363578

3537-
spin_lock(&bond->stats_lock);
3538-
memcpy(stats, &bond->bond_stats, sizeof(*stats));
35393579

35403580
rcu_read_lock();
3581+
#ifdef CONFIG_LOCKDEP
3582+
nest_level = bond_get_lowest_level_rcu(bond_dev);
3583+
#endif
3584+
3585+
spin_lock_nested(&bond->stats_lock, nest_level);
3586+
memcpy(stats, &bond->bond_stats, sizeof(*stats));
3587+
35413588
bond_for_each_slave_rcu(bond, slave, iter) {
35423589
const struct rtnl_link_stats64 *new =
35433590
dev_get_stats(slave->dev, &temp);
@@ -3547,10 +3594,10 @@ static void bond_get_stats(struct net_device *bond_dev,
35473594
/* save off the slave stats for the next run */
35483595
memcpy(&slave->slave_stats, new, sizeof(*new));
35493596
}
3550-
rcu_read_unlock();
35513597

35523598
memcpy(&bond->bond_stats, stats, sizeof(*stats));
35533599
spin_unlock(&bond->stats_lock);
3600+
rcu_read_unlock();
35543601
}
35553602

35563603
static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd)
@@ -3640,6 +3687,8 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
36403687
case BOND_RELEASE_OLD:
36413688
case SIOCBONDRELEASE:
36423689
res = bond_release(bond_dev, slave_dev);
3690+
if (!res)
3691+
netdev_update_lockdep_key(slave_dev);
36433692
break;
36443693
case BOND_SETHWADDR_OLD:
36453694
case SIOCBONDSETHWADDR:

‎drivers/net/bonding/bond_options.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,6 +1398,8 @@ static int bond_option_slaves_set(struct bonding *bond,
13981398
case '-':
13991399
slave_dbg(bond->dev, dev, "Releasing interface\n");
14001400
ret = bond_release(bond->dev, dev);
1401+
if (!ret)
1402+
netdev_update_lockdep_key(dev);
14011403
break;
14021404

14031405
default:

‎drivers/net/dsa/b53/b53_common.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,9 @@ void b53_vlan_add(struct dsa_switch *ds, int port,
13661366

13671367
b53_get_vlan_entry(dev, vid, vl);
13681368

1369+
if (vid == 0 && vid == b53_default_pvid(dev))
1370+
untagged = true;
1371+
13691372
vl->members |= BIT(port);
13701373
if (untagged && !dsa_is_cpu_port(ds, port))
13711374
vl->untag |= BIT(port);

‎drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,11 @@ static int aq_ethtool_set_priv_flags(struct net_device *ndev, u32 flags)
722722
if (flags & ~AQ_PRIV_FLAGS_MASK)
723723
return -EOPNOTSUPP;
724724

725+
if (hweight32((flags | priv_flags) & AQ_HW_LOOPBACK_MASK) > 1) {
726+
netdev_info(ndev, "Can't enable more than one loopback simultaneously\n");
727+
return -EINVAL;
728+
}
729+
725730
cfg->priv_flags = flags;
726731

727732
if ((priv_flags ^ flags) & BIT(AQ_HW_LOOPBACK_DMA_NET)) {

‎drivers/net/ethernet/aquantia/atlantic/aq_filters.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ aq_check_approve_fvlan(struct aq_nic_s *aq_nic,
163163
}
164164

165165
if ((aq_nic->ndev->features & NETIF_F_HW_VLAN_CTAG_FILTER) &&
166-
(!test_bit(be16_to_cpu(fsp->h_ext.vlan_tci),
166+
(!test_bit(be16_to_cpu(fsp->h_ext.vlan_tci) & VLAN_VID_MASK,
167167
aq_nic->active_vlans))) {
168168
netdev_err(aq_nic->ndev,
169169
"ethtool: unknown vlan-id specified");

‎drivers/net/ethernet/aquantia/atlantic/aq_hw.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ struct aq_fw_ops {
337337

338338
void (*enable_ptp)(struct aq_hw_s *self, int enable);
339339

340+
void (*adjust_ptp)(struct aq_hw_s *self, uint64_t adj);
341+
340342
int (*set_eee_rate)(struct aq_hw_s *self, u32 speed);
341343

342344
int (*get_eee_rate)(struct aq_hw_s *self, u32 *rate,

‎drivers/net/ethernet/aquantia/atlantic/aq_nic.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,10 @@ unsigned int aq_nic_map_skb(struct aq_nic_s *self, struct sk_buff *skb,
533533
dx_buff->len,
534534
DMA_TO_DEVICE);
535535

536-
if (unlikely(dma_mapping_error(aq_nic_get_dev(self), dx_buff->pa)))
536+
if (unlikely(dma_mapping_error(aq_nic_get_dev(self), dx_buff->pa))) {
537+
ret = 0;
537538
goto exit;
539+
}
538540

539541
first = dx_buff;
540542
dx_buff->len_pkt = skb->len;
@@ -655,10 +657,6 @@ int aq_nic_xmit(struct aq_nic_s *self, struct sk_buff *skb)
655657
if (likely(frags)) {
656658
err = self->aq_hw_ops->hw_ring_tx_xmit(self->aq_hw,
657659
ring, frags);
658-
if (err >= 0) {
659-
++ring->stats.tx.packets;
660-
ring->stats.tx.bytes += skb->len;
661-
}
662660
} else {
663661
err = NETDEV_TX_BUSY;
664662
}

‎drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ static int aq_suspend_common(struct device *dev, bool deep)
359359
netif_device_detach(nic->ndev);
360360
netif_tx_stop_all_queues(nic->ndev);
361361

362-
aq_nic_stop(nic);
362+
if (netif_running(nic->ndev))
363+
aq_nic_stop(nic);
363364

364365
if (deep) {
365366
aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol);
@@ -375,7 +376,7 @@ static int atl_resume_common(struct device *dev, bool deep)
375376
{
376377
struct pci_dev *pdev = to_pci_dev(dev);
377378
struct aq_nic_s *nic;
378-
int ret;
379+
int ret = 0;
379380

380381
nic = pci_get_drvdata(pdev);
381382

@@ -390,9 +391,11 @@ static int atl_resume_common(struct device *dev, bool deep)
390391
goto err_exit;
391392
}
392393

393-
ret = aq_nic_start(nic);
394-
if (ret)
395-
goto err_exit;
394+
if (netif_running(nic->ndev)) {
395+
ret = aq_nic_start(nic);
396+
if (ret)
397+
goto err_exit;
398+
}
396399

397400
netif_device_attach(nic->ndev);
398401
netif_tx_start_all_queues(nic->ndev);

‎drivers/net/ethernet/aquantia/atlantic/aq_ring.c‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,12 @@ bool aq_ring_tx_clean(struct aq_ring_s *self)
272272
}
273273
}
274274

275-
if (unlikely(buff->is_eop))
276-
dev_kfree_skb_any(buff->skb);
275+
if (unlikely(buff->is_eop)) {
276+
++self->stats.rx.packets;
277+
self->stats.tx.bytes += buff->skb->len;
277278

279+
dev_kfree_skb_any(buff->skb);
280+
}
278281
buff->pa = 0U;
279282
buff->eop_index = 0xffffU;
280283
self->sw_head = aq_ring_next_dx(self, self->sw_head);
@@ -351,7 +354,8 @@ int aq_ring_rx_clean(struct aq_ring_s *self,
351354
err = 0;
352355
goto err_exit;
353356
}
354-
if (buff->is_error || buff->is_cso_err) {
357+
if (buff->is_error ||
358+
(buff->is_lro && buff->is_cso_err)) {
355359
buff_ = buff;
356360
do {
357361
next_ = buff_->next,

‎drivers/net/ethernet/aquantia/atlantic/aq_ring.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ struct __packed aq_ring_buff_s {
7878
u32 is_cleaned:1;
7979
u32 is_error:1;
8080
u32 is_vlan:1;
81-
u32 rsvd3:4;
81+
u32 is_lro:1;
82+
u32 rsvd3:3;
8283
u16 eop_index;
8384
u16 rsvd4;
8485
};

0 commit comments

Comments
 (0)