Skip to content

Commit a992562

Browse files
committed
Merge tag 'net-5.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Networking fixes for 5.11-rc7, including fixes from bpf and mac80211 trees. Current release - regressions: - ip_tunnel: fix mtu calculation - mlx5: fix function calculation for page trees Previous releases - regressions: - vsock: fix the race conditions in multi-transport support - neighbour: prevent a dead entry from updating gc_list - dsa: mv88e6xxx: override existent unicast portvec in port_fdb_add Previous releases - always broken: - bpf, cgroup: two copy_{from,to}_user() warn_on_once splats for BPF cgroup getsockopt infra when user space is trying to race against optlen, from Loris Reiff. - bpf: add missing fput() in BPF inode storage map update helper - udp: ipv4: manipulate network header of NATed UDP GRO fraglist - mac80211: fix station rate table updates on assoc - r8169: work around RTL8125 UDP HW bug - igc: report speed and duplex as unknown when device is runtime suspended - rxrpc: fix deadlock around release of dst cached on udp tunnel" * tag 'net-5.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (36 commits) net: hsr: align sup_multicast_addr in struct hsr_priv to u16 boundary net: ipa: fix two format specifier errors net: ipa: use the right accessor in ipa_endpoint_status_skip() net: ipa: be explicit about endianness net: ipa: add a missing __iomem attribute net: ipa: pass correct dma_handle to dma_free_coherent() r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set net/rds: restrict iovecs length for RDS_CMSG_RDMA_ARGS net: mvpp2: TCAM entry enable should be written after SRAM data net: lapb: Copy the skb before sending a packet net/mlx5e: Release skb in case of failure in tc update skb net/mlx5e: Update max_opened_tc also when channels are closed net/mlx5: Fix leak upon failure of rule creation net/mlx5: Fix function calculation for page trees docs: networking: swap words in icmp_errors_use_inbound_ifaddr doc udp: ipv4: manipulate network header of NATed UDP GRO fraglist net: ip_tunnel: fix mtu calculation vsock: fix the race conditions in multi-transport support net: sched: replaced invalid qdisc tree flush helper in qdisc_replace ibmvnic: device remove has higher precedence over reset ...
2 parents 88bb507 + 6c9f18f commit a992562

File tree

44 files changed

+328
-107
lines changed

Some content is hidden

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

44 files changed

+328
-107
lines changed

Documentation/networking/ip-sysctl.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ icmp_errors_use_inbound_ifaddr - BOOLEAN
11961196

11971197
If non-zero, the message will be sent with the primary address of
11981198
the interface that received the packet that caused the icmp error.
1199-
This is the behaviour network many administrators will expect from
1199+
This is the behaviour many network administrators will expect from
12001200
a router. And it can make debugging complicated network layouts
12011201
much easier.
12021202

drivers/net/arcnet/arc-rimi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static int __init arc_rimi_init(void)
332332
dev->irq = 9;
333333

334334
if (arcrimi_probe(dev)) {
335-
free_netdev(dev);
335+
free_arcdev(dev);
336336
return -EIO;
337337
}
338338

@@ -349,7 +349,7 @@ static void __exit arc_rimi_exit(void)
349349
iounmap(lp->mem_start);
350350
release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1);
351351
free_irq(dev->irq, dev);
352-
free_netdev(dev);
352+
free_arcdev(dev);
353353
}
354354

355355
#ifndef MODULE

drivers/net/arcnet/arcdevice.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ struct arcnet_local {
298298

299299
int excnak_pending; /* We just got an excesive nak interrupt */
300300

301+
/* RESET flag handling */
302+
int reset_in_progress;
303+
struct work_struct reset_work;
304+
301305
struct {
302306
uint16_t sequence; /* sequence number (incs with each packet) */
303307
__be16 aborted_seq;
@@ -350,7 +354,9 @@ void arcnet_dump_skb(struct net_device *dev, struct sk_buff *skb, char *desc)
350354

351355
void arcnet_unregister_proto(struct ArcProto *proto);
352356
irqreturn_t arcnet_interrupt(int irq, void *dev_id);
357+
353358
struct net_device *alloc_arcdev(const char *name);
359+
void free_arcdev(struct net_device *dev);
354360

355361
int arcnet_open(struct net_device *dev);
356362
int arcnet_close(struct net_device *dev);

drivers/net/arcnet/arcnet.c

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,44 @@ static void arcnet_timer(struct timer_list *t)
387387
struct arcnet_local *lp = from_timer(lp, t, timer);
388388
struct net_device *dev = lp->dev;
389389

390-
if (!netif_carrier_ok(dev)) {
390+
spin_lock_irq(&lp->lock);
391+
392+
if (!lp->reset_in_progress && !netif_carrier_ok(dev)) {
391393
netif_carrier_on(dev);
392394
netdev_info(dev, "link up\n");
393395
}
396+
397+
spin_unlock_irq(&lp->lock);
398+
}
399+
400+
static void reset_device_work(struct work_struct *work)
401+
{
402+
struct arcnet_local *lp;
403+
struct net_device *dev;
404+
405+
lp = container_of(work, struct arcnet_local, reset_work);
406+
dev = lp->dev;
407+
408+
/* Do not bring the network interface back up if an ifdown
409+
* was already done.
410+
*/
411+
if (!netif_running(dev) || !lp->reset_in_progress)
412+
return;
413+
414+
rtnl_lock();
415+
416+
/* Do another check, in case of an ifdown that was triggered in
417+
* the small race window between the exit condition above and
418+
* acquiring RTNL.
419+
*/
420+
if (!netif_running(dev) || !lp->reset_in_progress)
421+
goto out;
422+
423+
dev_close(dev);
424+
dev_open(dev, NULL);
425+
426+
out:
427+
rtnl_unlock();
394428
}
395429

396430
static void arcnet_reply_tasklet(unsigned long data)
@@ -452,12 +486,25 @@ struct net_device *alloc_arcdev(const char *name)
452486
lp->dev = dev;
453487
spin_lock_init(&lp->lock);
454488
timer_setup(&lp->timer, arcnet_timer, 0);
489+
INIT_WORK(&lp->reset_work, reset_device_work);
455490
}
456491

457492
return dev;
458493
}
459494
EXPORT_SYMBOL(alloc_arcdev);
460495

496+
void free_arcdev(struct net_device *dev)
497+
{
498+
struct arcnet_local *lp = netdev_priv(dev);
499+
500+
/* Do not cancel this at ->ndo_close(), as the workqueue itself
501+
* indirectly calls the ifdown path through dev_close().
502+
*/
503+
cancel_work_sync(&lp->reset_work);
504+
free_netdev(dev);
505+
}
506+
EXPORT_SYMBOL(free_arcdev);
507+
461508
/* Open/initialize the board. This is called sometime after booting when
462509
* the 'ifconfig' program is run.
463510
*
@@ -587,6 +634,10 @@ int arcnet_close(struct net_device *dev)
587634

588635
/* shut down the card */
589636
lp->hw.close(dev);
637+
638+
/* reset counters */
639+
lp->reset_in_progress = 0;
640+
590641
module_put(lp->hw.owner);
591642
return 0;
592643
}
@@ -820,6 +871,9 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
820871

821872
spin_lock_irqsave(&lp->lock, flags);
822873

874+
if (lp->reset_in_progress)
875+
goto out;
876+
823877
/* RESET flag was enabled - if device is not running, we must
824878
* clear it right away (but nothing else).
825879
*/
@@ -852,11 +906,14 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
852906
if (status & RESETflag) {
853907
arc_printk(D_NORMAL, dev, "spurious reset (status=%Xh)\n",
854908
status);
855-
arcnet_close(dev);
856-
arcnet_open(dev);
909+
910+
lp->reset_in_progress = 1;
911+
netif_stop_queue(dev);
912+
netif_carrier_off(dev);
913+
schedule_work(&lp->reset_work);
857914

858915
/* get out of the interrupt handler! */
859-
break;
916+
goto out;
860917
}
861918
/* RX is inhibited - we must have received something.
862919
* Prepare to receive into the next buffer.
@@ -1052,6 +1109,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
10521109
udelay(1);
10531110
lp->hw.intmask(dev, lp->intmask);
10541111

1112+
out:
10551113
spin_unlock_irqrestore(&lp->lock, flags);
10561114
return retval;
10571115
}

drivers/net/arcnet/com20020-isa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static int __init com20020_init(void)
169169
dev->irq = 9;
170170

171171
if (com20020isa_probe(dev)) {
172-
free_netdev(dev);
172+
free_arcdev(dev);
173173
return -EIO;
174174
}
175175

@@ -182,7 +182,7 @@ static void __exit com20020_exit(void)
182182
unregister_netdev(my_dev);
183183
free_irq(my_dev->irq, my_dev);
184184
release_region(my_dev->base_addr, ARCNET_TOTAL_SIZE);
185-
free_netdev(my_dev);
185+
free_arcdev(my_dev);
186186
}
187187

188188
#ifndef MODULE

drivers/net/arcnet/com20020-pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ static void com20020pci_remove(struct pci_dev *pdev)
291291

292292
unregister_netdev(dev);
293293
free_irq(dev->irq, dev);
294-
free_netdev(dev);
294+
free_arcdev(dev);
295295
}
296296
}
297297

drivers/net/arcnet/com20020_cs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static void com20020_detach(struct pcmcia_device *link)
177177
dev = info->dev;
178178
if (dev) {
179179
dev_dbg(&link->dev, "kfree...\n");
180-
free_netdev(dev);
180+
free_arcdev(dev);
181181
}
182182
dev_dbg(&link->dev, "kfree2...\n");
183183
kfree(info);

drivers/net/arcnet/com90io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ static int __init com90io_init(void)
396396
err = com90io_probe(dev);
397397

398398
if (err) {
399-
free_netdev(dev);
399+
free_arcdev(dev);
400400
return err;
401401
}
402402

@@ -419,7 +419,7 @@ static void __exit com90io_exit(void)
419419

420420
free_irq(dev->irq, dev);
421421
release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
422-
free_netdev(dev);
422+
free_arcdev(dev);
423423
}
424424

425425
module_init(com90io_init)

drivers/net/arcnet/com90xx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem,
554554
err_release_mem:
555555
release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1);
556556
err_free_dev:
557-
free_netdev(dev);
557+
free_arcdev(dev);
558558
return -EIO;
559559
}
560560

@@ -672,7 +672,7 @@ static void __exit com90xx_exit(void)
672672
release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
673673
release_mem_region(dev->mem_start,
674674
dev->mem_end - dev->mem_start + 1);
675-
free_netdev(dev);
675+
free_arcdev(dev);
676676
}
677677
}
678678

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,11 @@ static int mv88e6xxx_port_db_load_purge(struct mv88e6xxx_chip *chip, int port,
16761676
if (!entry.portvec)
16771677
entry.state = 0;
16781678
} else {
1679-
entry.portvec |= BIT(port);
1679+
if (state == MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC)
1680+
entry.portvec = BIT(port);
1681+
else
1682+
entry.portvec |= BIT(port);
1683+
16801684
entry.state = state;
16811685
}
16821686

0 commit comments

Comments
 (0)