Skip to content

Commit fa2e1ba

Browse files
committed
Merge tag 'net-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter, bpf. Quite a handful of old regression fixes but most of those are pre-5.16. Current release - regressions: - fix memory leaks in the skb free deferral scheme if upper layer protocols are used, i.e. in-kernel TCP readers like TLS Current release - new code bugs: - nf_tables: fix NULL check typo in _clone() functions - change the default to y for Vertexcom vendor Kconfig - a couple of fixes to incorrect uses of ref tracking - two fixes for constifying netdev->dev_addr Previous releases - regressions: - bpf: - various verifier fixes mainly around register offset handling when passed to helper functions - fix mount source displayed for bpffs (none -> bpffs) - bonding: - fix extraction of ports for connection hash calculation - fix bond_xmit_broadcast return value when some devices are down - phy: marvell: add Marvell specific PHY loopback - sch_api: don't skip qdisc attach on ingress, prevent ref leak - htb: restore minimal packet size handling in rate control - sfp: fix high power modules without diagnostic monitoring - mscc: ocelot: - don't let phylink re-enable TX PAUSE on the NPI port - don't dereference NULL pointers with shared tc filters - smsc95xx: correct reset handling for LAN9514 - cpsw: avoid alignment faults by taking NET_IP_ALIGN into account - phy: micrel: use kszphy_suspend/_resume for irq aware devices, avoid races with the interrupt Previous releases - always broken: - xdp: check prog type before updating BPF link - smc: resolve various races around abnormal connection termination - sit: allow encapsulated IPv6 traffic to be delivered locally - axienet: fix init/reset handling, add missing barriers, read the right status words, stop queues correctly - add missing dev_put() in sock_timestamping_bind_phc() Misc: - ipv4: prevent accidentally passing RTO_ONLINK to ip_route_output_key_hash() by sanitizing flags - ipv4: avoid quadratic behavior in netns dismantle - stmmac: dwmac-oxnas: add support for OX810SE - fsl: xgmac_mdio: add workaround for erratum A-009885" * tag 'net-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (92 commits) ipv4: add net_hash_mix() dispersion to fib_info_laddrhash keys ipv4: avoid quadratic behavior in netns dismantle net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module powerpc/fsl/dts: Enable WA for erratum A-009885 on fman3l MDIO buses dt-bindings: net: Document fsl,erratum-a009885 net/fsl: xgmac_mdio: Add workaround for erratum A-009885 net: mscc: ocelot: fix using match before it is set net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices net: cpsw: avoid alignment faults by taking NET_IP_ALIGN into account nfc: llcp: fix NULL error pointer dereference on sendmsg() after failed bind() net: axienet: increase default TX ring size to 128 net: axienet: fix for TX busy handling net: axienet: fix number of TX ring slots for available check net: axienet: Fix TX ring slot available check net: axienet: limit minimum TX ring size net: axienet: add missing memory barriers net: axienet: reset core on initialization prior to MDIO access net: axienet: Wait for PhyRstCmplt after core reset net: axienet: increase reset timeout bpf, selftests: Add ringbuf memory type confusion test ...
2 parents f4484d1 + ff9fc0a commit fa2e1ba

Some content is hidden

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

91 files changed

+1041
-414
lines changed

Documentation/devicetree/bindings/net/fsl-fman.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,15 @@ PROPERTIES
410410
The settings and programming routines for internal/external
411411
MDIO are different. Must be included for internal MDIO.
412412

413+
- fsl,erratum-a009885
414+
Usage: optional
415+
Value type: <boolean>
416+
Definition: Indicates the presence of the A009885
417+
erratum describing that the contents of MDIO_DATA may
418+
become corrupt unless it is read within 16 MDC cycles
419+
of MDIO_CFG[BSY] being cleared, when performing an
420+
MDIO read operation.
421+
413422
- fsl,erratum-a011043
414423
Usage: optional
415424
Value type: <boolean>

Documentation/devicetree/bindings/net/oxnas-dwmac.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Required properties on all platforms:
99
- compatible: For the OX820 SoC, it should be :
1010
- "oxsemi,ox820-dwmac" to select glue
1111
- "snps,dwmac-3.512" to select IP version.
12+
For the OX810SE SoC, it should be :
13+
- "oxsemi,ox810se-dwmac" to select glue
14+
- "snps,dwmac-3.512" to select IP version.
1215

1316
- clocks: Should contain phandles to the following clocks
1417
- clock-names: Should contain the following:

arch/powerpc/boot/dts/fsl/qoriq-fman3l-0.dtsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@ fman0: fman@400000 {
7979
#size-cells = <0>;
8080
compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
8181
reg = <0xfc000 0x1000>;
82+
fsl,erratum-a009885;
8283
};
8384

8485
xmdio0: mdio@fd000 {
8586
#address-cells = <1>;
8687
#size-cells = <0>;
8788
compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
8889
reg = <0xfd000 0x1000>;
90+
fsl,erratum-a009885;
8991
};
9092
};
9193

drivers/atm/iphase.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ static void ia_hack_tcq(IADEV *dev) {
178178

179179
static u16 get_desc (IADEV *dev, struct ia_vcc *iavcc) {
180180
u_short desc_num, i;
181-
struct sk_buff *skb;
182181
struct ia_vcc *iavcc_r = NULL;
183182
unsigned long delta;
184183
static unsigned long timer = 0;
@@ -202,8 +201,7 @@ static u16 get_desc (IADEV *dev, struct ia_vcc *iavcc) {
202201
else
203202
dev->ffL.tcq_rd -= 2;
204203
*(u_short *)(dev->seg_ram + dev->ffL.tcq_rd) = i+1;
205-
if (!(skb = dev->desc_tbl[i].txskb) ||
206-
!(iavcc_r = dev->desc_tbl[i].iavcc))
204+
if (!dev->desc_tbl[i].txskb || !(iavcc_r = dev->desc_tbl[i].iavcc))
207205
printk("Fatal err, desc table vcc or skb is NULL\n");
208206
else
209207
iavcc_r->vc_desc_cnt--;

drivers/net/bonding/bond_main.c

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3874,8 +3874,8 @@ u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb)
38743874
skb->l4_hash)
38753875
return skb->hash;
38763876

3877-
return __bond_xmit_hash(bond, skb, skb->head, skb->protocol,
3878-
skb->mac_header, skb->network_header,
3877+
return __bond_xmit_hash(bond, skb, skb->data, skb->protocol,
3878+
skb_mac_offset(skb), skb_network_offset(skb),
38793879
skb_headlen(skb));
38803880
}
38813881

@@ -4884,25 +4884,39 @@ static netdev_tx_t bond_xmit_broadcast(struct sk_buff *skb,
48844884
struct bonding *bond = netdev_priv(bond_dev);
48854885
struct slave *slave = NULL;
48864886
struct list_head *iter;
4887+
bool xmit_suc = false;
4888+
bool skb_used = false;
48874889

48884890
bond_for_each_slave_rcu(bond, slave, iter) {
4889-
if (bond_is_last_slave(bond, slave))
4890-
break;
4891-
if (bond_slave_is_up(slave) && slave->link == BOND_LINK_UP) {
4892-
struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
4891+
struct sk_buff *skb2;
4892+
4893+
if (!(bond_slave_is_up(slave) && slave->link == BOND_LINK_UP))
4894+
continue;
48934895

4896+
if (bond_is_last_slave(bond, slave)) {
4897+
skb2 = skb;
4898+
skb_used = true;
4899+
} else {
4900+
skb2 = skb_clone(skb, GFP_ATOMIC);
48944901
if (!skb2) {
48954902
net_err_ratelimited("%s: Error: %s: skb_clone() failed\n",
48964903
bond_dev->name, __func__);
48974904
continue;
48984905
}
4899-
bond_dev_queue_xmit(bond, skb2, slave->dev);
49004906
}
4907+
4908+
if (bond_dev_queue_xmit(bond, skb2, slave->dev) == NETDEV_TX_OK)
4909+
xmit_suc = true;
49014910
}
4902-
if (slave && bond_slave_is_up(slave) && slave->link == BOND_LINK_UP)
4903-
return bond_dev_queue_xmit(bond, skb, slave->dev);
49044911

4905-
return bond_tx_drop(bond_dev, skb);
4912+
if (!skb_used)
4913+
dev_kfree_skb_any(skb);
4914+
4915+
if (xmit_suc)
4916+
return NETDEV_TX_OK;
4917+
4918+
atomic_long_inc(&bond_dev->tx_dropped);
4919+
return NET_XMIT_DROP;
49064920
}
49074921

49084922
/*------------------------- Device initialization ---------------------------*/

drivers/net/ethernet/allwinner/sun4i-emac.c

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ static void emac_update_speed(struct net_device *dev)
106106

107107
/* set EMAC SPEED, depend on PHY */
108108
reg_val = readl(db->membase + EMAC_MAC_SUPP_REG);
109-
reg_val &= ~(0x1 << 8);
109+
reg_val &= ~EMAC_MAC_SUPP_100M;
110110
if (db->speed == SPEED_100)
111-
reg_val |= 1 << 8;
111+
reg_val |= EMAC_MAC_SUPP_100M;
112112
writel(reg_val, db->membase + EMAC_MAC_SUPP_REG);
113113
}
114114

@@ -264,7 +264,7 @@ static void emac_dma_done_callback(void *arg)
264264

265265
/* re enable interrupt */
266266
reg_val = readl(db->membase + EMAC_INT_CTL_REG);
267-
reg_val |= (0x01 << 8);
267+
reg_val |= EMAC_INT_CTL_RX_EN;
268268
writel(reg_val, db->membase + EMAC_INT_CTL_REG);
269269

270270
db->emacrx_completed_flag = 1;
@@ -429,7 +429,7 @@ static unsigned int emac_powerup(struct net_device *ndev)
429429
/* initial EMAC */
430430
/* flush RX FIFO */
431431
reg_val = readl(db->membase + EMAC_RX_CTL_REG);
432-
reg_val |= 0x8;
432+
reg_val |= EMAC_RX_CTL_FLUSH_FIFO;
433433
writel(reg_val, db->membase + EMAC_RX_CTL_REG);
434434
udelay(1);
435435

@@ -441,8 +441,8 @@ static unsigned int emac_powerup(struct net_device *ndev)
441441

442442
/* set MII clock */
443443
reg_val = readl(db->membase + EMAC_MAC_MCFG_REG);
444-
reg_val &= (~(0xf << 2));
445-
reg_val |= (0xD << 2);
444+
reg_val &= ~EMAC_MAC_MCFG_MII_CLKD_MASK;
445+
reg_val |= EMAC_MAC_MCFG_MII_CLKD_72;
446446
writel(reg_val, db->membase + EMAC_MAC_MCFG_REG);
447447

448448
/* clear RX counter */
@@ -506,7 +506,7 @@ static void emac_init_device(struct net_device *dev)
506506

507507
/* enable RX/TX0/RX Hlevel interrup */
508508
reg_val = readl(db->membase + EMAC_INT_CTL_REG);
509-
reg_val |= (0xf << 0) | (0x01 << 8);
509+
reg_val |= (EMAC_INT_CTL_TX_EN | EMAC_INT_CTL_TX_ABRT_EN | EMAC_INT_CTL_RX_EN);
510510
writel(reg_val, db->membase + EMAC_INT_CTL_REG);
511511

512512
spin_unlock_irqrestore(&db->lock, flags);
@@ -637,7 +637,9 @@ static void emac_rx(struct net_device *dev)
637637
if (!rxcount) {
638638
db->emacrx_completed_flag = 1;
639639
reg_val = readl(db->membase + EMAC_INT_CTL_REG);
640-
reg_val |= (0xf << 0) | (0x01 << 8);
640+
reg_val |= (EMAC_INT_CTL_TX_EN |
641+
EMAC_INT_CTL_TX_ABRT_EN |
642+
EMAC_INT_CTL_RX_EN);
641643
writel(reg_val, db->membase + EMAC_INT_CTL_REG);
642644

643645
/* had one stuck? */
@@ -669,7 +671,9 @@ static void emac_rx(struct net_device *dev)
669671
writel(reg_val | EMAC_CTL_RX_EN,
670672
db->membase + EMAC_CTL_REG);
671673
reg_val = readl(db->membase + EMAC_INT_CTL_REG);
672-
reg_val |= (0xf << 0) | (0x01 << 8);
674+
reg_val |= (EMAC_INT_CTL_TX_EN |
675+
EMAC_INT_CTL_TX_ABRT_EN |
676+
EMAC_INT_CTL_RX_EN);
673677
writel(reg_val, db->membase + EMAC_INT_CTL_REG);
674678

675679
db->emacrx_completed_flag = 1;
@@ -783,20 +787,20 @@ static irqreturn_t emac_interrupt(int irq, void *dev_id)
783787
}
784788

785789
/* Transmit Interrupt check */
786-
if (int_status & (0x01 | 0x02))
790+
if (int_status & EMAC_INT_STA_TX_COMPLETE)
787791
emac_tx_done(dev, db, int_status);
788792

789-
if (int_status & (0x04 | 0x08))
793+
if (int_status & EMAC_INT_STA_TX_ABRT)
790794
netdev_info(dev, " ab : %x\n", int_status);
791795

792796
/* Re-enable interrupt mask */
793797
if (db->emacrx_completed_flag == 1) {
794798
reg_val = readl(db->membase + EMAC_INT_CTL_REG);
795-
reg_val |= (0xf << 0) | (0x01 << 8);
799+
reg_val |= (EMAC_INT_CTL_TX_EN | EMAC_INT_CTL_TX_ABRT_EN | EMAC_INT_CTL_RX_EN);
796800
writel(reg_val, db->membase + EMAC_INT_CTL_REG);
797801
} else {
798802
reg_val = readl(db->membase + EMAC_INT_CTL_REG);
799-
reg_val |= (0xf << 0);
803+
reg_val |= (EMAC_INT_CTL_TX_EN | EMAC_INT_CTL_TX_ABRT_EN);
800804
writel(reg_val, db->membase + EMAC_INT_CTL_REG);
801805
}
802806

@@ -1068,6 +1072,7 @@ static int emac_probe(struct platform_device *pdev)
10681072
clk_disable_unprepare(db->clk);
10691073
out_dispose_mapping:
10701074
irq_dispose_mapping(ndev->irq);
1075+
dma_release_channel(db->rx_chan);
10711076
out_iounmap:
10721077
iounmap(db->membase);
10731078
out:

drivers/net/ethernet/allwinner/sun4i-emac.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#define EMAC_RX_CTL_REG (0x3c)
3939
#define EMAC_RX_CTL_AUTO_DRQ_EN (1 << 1)
4040
#define EMAC_RX_CTL_DMA_EN (1 << 2)
41+
#define EMAC_RX_CTL_FLUSH_FIFO (1 << 3)
4142
#define EMAC_RX_CTL_PASS_ALL_EN (1 << 4)
4243
#define EMAC_RX_CTL_PASS_CTL_EN (1 << 5)
4344
#define EMAC_RX_CTL_PASS_CRC_ERR_EN (1 << 6)
@@ -61,7 +62,21 @@
6162
#define EMAC_RX_IO_DATA_STATUS_OK (1 << 7)
6263
#define EMAC_RX_FBC_REG (0x50)
6364
#define EMAC_INT_CTL_REG (0x54)
65+
#define EMAC_INT_CTL_RX_EN (1 << 8)
66+
#define EMAC_INT_CTL_TX0_EN (1)
67+
#define EMAC_INT_CTL_TX1_EN (1 << 1)
68+
#define EMAC_INT_CTL_TX_EN (EMAC_INT_CTL_TX0_EN | EMAC_INT_CTL_TX1_EN)
69+
#define EMAC_INT_CTL_TX0_ABRT_EN (0x1 << 2)
70+
#define EMAC_INT_CTL_TX1_ABRT_EN (0x1 << 3)
71+
#define EMAC_INT_CTL_TX_ABRT_EN (EMAC_INT_CTL_TX0_ABRT_EN | EMAC_INT_CTL_TX1_ABRT_EN)
6472
#define EMAC_INT_STA_REG (0x58)
73+
#define EMAC_INT_STA_TX0_COMPLETE (0x1)
74+
#define EMAC_INT_STA_TX1_COMPLETE (0x1 << 1)
75+
#define EMAC_INT_STA_TX_COMPLETE (EMAC_INT_STA_TX0_COMPLETE | EMAC_INT_STA_TX1_COMPLETE)
76+
#define EMAC_INT_STA_TX0_ABRT (0x1 << 2)
77+
#define EMAC_INT_STA_TX1_ABRT (0x1 << 3)
78+
#define EMAC_INT_STA_TX_ABRT (EMAC_INT_STA_TX0_ABRT | EMAC_INT_STA_TX1_ABRT)
79+
#define EMAC_INT_STA_RX_COMPLETE (0x1 << 8)
6580
#define EMAC_MAC_CTL0_REG (0x5c)
6681
#define EMAC_MAC_CTL0_RX_FLOW_CTL_EN (1 << 2)
6782
#define EMAC_MAC_CTL0_TX_FLOW_CTL_EN (1 << 3)
@@ -87,8 +102,11 @@
87102
#define EMAC_MAC_CLRT_RM (0x0f)
88103
#define EMAC_MAC_MAXF_REG (0x70)
89104
#define EMAC_MAC_SUPP_REG (0x74)
105+
#define EMAC_MAC_SUPP_100M (0x1 << 8)
90106
#define EMAC_MAC_TEST_REG (0x78)
91107
#define EMAC_MAC_MCFG_REG (0x7c)
108+
#define EMAC_MAC_MCFG_MII_CLKD_MASK (0xff << 2)
109+
#define EMAC_MAC_MCFG_MII_CLKD_72 (0x0d << 2)
92110
#define EMAC_MAC_A0_REG (0x98)
93111
#define EMAC_MAC_A1_REG (0x9c)
94112
#define EMAC_MAC_A2_REG (0xa0)

drivers/net/ethernet/apple/bmac.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,7 @@ static int bmac_probe(struct macio_dev *mdev, const struct of_device_id *match)
12371237
struct bmac_data *bp;
12381238
const unsigned char *prop_addr;
12391239
unsigned char addr[6];
1240+
u8 macaddr[6];
12401241
struct net_device *dev;
12411242
int is_bmac_plus = ((int)match->data) != 0;
12421243

@@ -1284,7 +1285,9 @@ static int bmac_probe(struct macio_dev *mdev, const struct of_device_id *match)
12841285

12851286
rev = addr[0] == 0 && addr[1] == 0xA0;
12861287
for (j = 0; j < 6; ++j)
1287-
dev->dev_addr[j] = rev ? bitrev8(addr[j]): addr[j];
1288+
macaddr[j] = rev ? bitrev8(addr[j]): addr[j];
1289+
1290+
eth_hw_addr_set(dev, macaddr);
12881291

12891292
/* Enable chip without interrupts for now */
12901293
bmac_enable_and_reset_chip(dev);

drivers/net/ethernet/apple/mace.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void mace_set_timeout(struct net_device *dev);
9090
static void mace_tx_timeout(struct timer_list *t);
9191
static inline void dbdma_reset(volatile struct dbdma_regs __iomem *dma);
9292
static inline void mace_clean_rings(struct mace_data *mp);
93-
static void __mace_set_address(struct net_device *dev, void *addr);
93+
static void __mace_set_address(struct net_device *dev, const void *addr);
9494

9595
/*
9696
* If we can't get a skbuff when we need it, we use this area for DMA.
@@ -112,6 +112,7 @@ static int mace_probe(struct macio_dev *mdev, const struct of_device_id *match)
112112
struct net_device *dev;
113113
struct mace_data *mp;
114114
const unsigned char *addr;
115+
u8 macaddr[ETH_ALEN];
115116
int j, rev, rc = -EBUSY;
116117

117118
if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) {
@@ -167,8 +168,9 @@ static int mace_probe(struct macio_dev *mdev, const struct of_device_id *match)
167168

168169
rev = addr[0] == 0 && addr[1] == 0xA0;
169170
for (j = 0; j < 6; ++j) {
170-
dev->dev_addr[j] = rev ? bitrev8(addr[j]): addr[j];
171+
macaddr[j] = rev ? bitrev8(addr[j]): addr[j];
171172
}
173+
eth_hw_addr_set(dev, macaddr);
172174
mp->chipid = (in_8(&mp->mace->chipid_hi) << 8) |
173175
in_8(&mp->mace->chipid_lo);
174176

@@ -369,11 +371,12 @@ static void mace_reset(struct net_device *dev)
369371
out_8(&mb->plscc, PORTSEL_GPSI + ENPLSIO);
370372
}
371373

372-
static void __mace_set_address(struct net_device *dev, void *addr)
374+
static void __mace_set_address(struct net_device *dev, const void *addr)
373375
{
374376
struct mace_data *mp = netdev_priv(dev);
375377
volatile struct mace __iomem *mb = mp->mace;
376-
unsigned char *p = addr;
378+
const unsigned char *p = addr;
379+
u8 macaddr[ETH_ALEN];
377380
int i;
378381

379382
/* load up the hardware address */
@@ -385,7 +388,10 @@ static void __mace_set_address(struct net_device *dev, void *addr)
385388
;
386389
}
387390
for (i = 0; i < 6; ++i)
388-
out_8(&mb->padr, dev->dev_addr[i] = p[i]);
391+
out_8(&mb->padr, macaddr[i] = p[i]);
392+
393+
eth_hw_addr_set(dev, macaddr);
394+
389395
if (mp->chipid != BROKEN_ADDRCHG_REV)
390396
out_8(&mb->iac, 0);
391397
}

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4020,10 +4020,12 @@ static int bcmgenet_probe(struct platform_device *pdev)
40204020

40214021
/* Request the WOL interrupt and advertise suspend if available */
40224022
priv->wol_irq_disabled = true;
4023-
err = devm_request_irq(&pdev->dev, priv->wol_irq, bcmgenet_wol_isr, 0,
4024-
dev->name, priv);
4025-
if (!err)
4026-
device_set_wakeup_capable(&pdev->dev, 1);
4023+
if (priv->wol_irq > 0) {
4024+
err = devm_request_irq(&pdev->dev, priv->wol_irq,
4025+
bcmgenet_wol_isr, 0, dev->name, priv);
4026+
if (!err)
4027+
device_set_wakeup_capable(&pdev->dev, 1);
4028+
}
40274029

40284030
/* Set the needed headroom to account for any possible
40294031
* features enabling/disabling at runtime

0 commit comments

Comments
 (0)