Skip to content

Commit 17bbde2

Browse files
committed
Merge tag 'net-6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from Bluetooth. Current release - new code bugs: - eth: - txgbe: fix the issue of TX failure - ngbe: specify IRQ vector when the number of VFs is 7 Previous releases - regressions: - sched: always pass notifications when child class becomes empty - ipv4: fix stat increase when udp early demux drops the packet - bluetooth: prevent unintended pause by checking if advertising is active - virtio: fix error reporting in virtqueue_resize - eth: - virtio-net: - ensure the received length does not exceed allocated size - fix the xsk frame's length check - lan78xx: fix WARN in __netif_napi_del_locked on disconnect Previous releases - always broken: - bluetooth: mesh: check instances prior disabling advertising - eth: - idpf: convert control queue mutex to a spinlock - dpaa2: fix xdp_rxq_info leak - amd-xgbe: align CL37 AN sequence as per databook" * tag 'net-6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (38 commits) vsock/vmci: Clear the vmci transport packet properly when initializing it dt-bindings: net: sophgo,sg2044-dwmac: Drop status from the example net: ngbe: specify IRQ vector when the number of VFs is 7 net: wangxun: revert the adjustment of the IRQ vector sequence net: txgbe: request MISC IRQ in ndo_open virtio_net: Enforce minimum TX ring size for reliability virtio_net: Cleanup '2+MAX_SKB_FRAGS' virtio_ring: Fix error reporting in virtqueue_resize virtio-net: xsk: rx: fix the frame's length check virtio-net: use the check_mergeable_len helper virtio-net: remove redundant truesize check with PAGE_SIZE virtio-net: ensure the received length does not exceed allocated size net: ipv4: fix stat increase when udp early demux drops the packet net: libwx: fix the incorrect display of the queue number amd-xgbe: do not double read link status net/sched: Always pass notifications when child class becomes empty nui: Fix dma_mapping_error() check rose: fix dangling neighbour pointers in rose_rt_device_down() enic: fix incorrect MTU comparison in enic_change_mtu() amd-xgbe: align CL37 AN sequence as per databook ...
2 parents d32e907 + 223e228 commit 17bbde2

File tree

38 files changed

+494
-296
lines changed

38 files changed

+494
-296
lines changed

Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ examples:
8080
interrupt-parent = <&intc>;
8181
interrupts = <296 IRQ_TYPE_LEVEL_HIGH>;
8282
interrupt-names = "macirq";
83+
phy-handle = <&phy0>;
84+
phy-mode = "rgmii-id";
8385
resets = <&rst 30>;
8486
reset-names = "stmmaceth";
8587
snps,multicast-filter-bins = <0>;
@@ -91,7 +93,6 @@ examples:
9193
snps,mtl-rx-config = <&gmac0_mtl_rx_setup>;
9294
snps,mtl-tx-config = <&gmac0_mtl_tx_setup>;
9395
snps,axi-config = <&gmac0_stmmac_axi_setup>;
94-
status = "disabled";
9596
9697
gmac0_mtl_rx_setup: rx-queues-config {
9798
snps,rx-queues-to-use = <8>;

Documentation/networking/tls.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ User interface
1616
Creating a TLS connection
1717
-------------------------
1818

19-
First create a new TCP socket and set the TLS ULP.
19+
First create a new TCP socket and once the connection is established set the
20+
TLS ULP.
2021

2122
.. code-block:: c
2223
2324
sock = socket(AF_INET, SOCK_STREAM, 0);
25+
connect(sock, addr, addrlen);
2426
setsockopt(sock, SOL_TCP, TCP_ULP, "tls", sizeof("tls"));
2527
2628
Setting the TLS ULP allows us to set/get TLS socket options. Currently

Documentation/process/maintainer-netdev.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ Posting as one thread is discouraged because it confuses patchwork
312312
(as of patchwork 2.2.2).
313313

314314
Co-posting selftests
315-
--------------------
315+
~~~~~~~~~~~~~~~~~~~~
316316

317317
Selftests should be part of the same series as the code changes.
318318
Specifically for fixes both code change and related test should go into

MAINTAINERS

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15550,6 +15550,7 @@ F: drivers/net/ethernet/mellanox/mlx4/en_*
1555015550
MELLANOX ETHERNET DRIVER (mlx5e)
1555115551
M: Saeed Mahameed <[email protected]>
1555215552
M: Tariq Toukan <[email protected]>
15553+
M: Mark Bloch <[email protected]>
1555315554
1555415555
S: Maintained
1555515556
W: https://www.nvidia.com/networking/
@@ -15619,6 +15620,7 @@ MELLANOX MLX5 core VPI driver
1561915620
M: Saeed Mahameed <[email protected]>
1562015621
M: Leon Romanovsky <[email protected]>
1562115622
M: Tariq Toukan <[email protected]>
15623+
M: Mark Bloch <[email protected]>
1562215624
1562315625
1562415626
S: Maintained
@@ -21198,7 +21200,7 @@ M: Lad Prabhakar <[email protected]>
2119821200
2119921201
2120021202
S: Maintained
21201-
F: Documentation/devicetree/bindings/net/renesas,r9a09g057-gbeth.yaml
21203+
F: Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml
2120221204
F: drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
2120321205

2120421206
RENESAS RZ/V2H(P) USB2PHY PORT RESET DRIVER
@@ -22586,9 +22588,11 @@ S: Maintained
2258622588
F: drivers/misc/sgi-xp/
2258722589

2258822590
SHARED MEMORY COMMUNICATIONS (SMC) SOCKETS
22591+
M: D. Wythe <[email protected]>
22592+
M: Dust Li <[email protected]>
22593+
M: Sidraya Jayagond <[email protected]>
2258922594
M: Wenjia Zhang <[email protected]>
22590-
M: Jan Karcher <[email protected]>
22591-
R: D. Wythe <[email protected]>
22595+
R: Mahanta Jambigi <[email protected]>
2259222596
R: Tony Lu <[email protected]>
2259322597
R: Wen Gu <[email protected]>
2259422598

drivers/net/ethernet/amd/xgbe/xgbe-common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,8 @@
12691269
#define MDIO_VEND2_CTRL1_SS13 BIT(13)
12701270
#endif
12711271

1272+
#define XGBE_VEND2_MAC_AUTO_SW BIT(9)
1273+
12721274
/* MDIO mask values */
12731275
#define XGBE_AN_CL73_INT_CMPLT BIT(0)
12741276
#define XGBE_AN_CL73_INC_LINK BIT(1)

drivers/net/ethernet/amd/xgbe/xgbe-mdio.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ static void xgbe_an37_set(struct xgbe_prv_data *pdata, bool enable,
266266
reg |= MDIO_VEND2_CTRL1_AN_RESTART;
267267

268268
XMDIO_WRITE(pdata, MDIO_MMD_VEND2, MDIO_CTRL1, reg);
269+
270+
reg = XMDIO_READ(pdata, MDIO_MMD_VEND2, MDIO_PCS_DIG_CTRL);
271+
reg |= XGBE_VEND2_MAC_AUTO_SW;
272+
XMDIO_WRITE(pdata, MDIO_MMD_VEND2, MDIO_PCS_DIG_CTRL, reg);
269273
}
270274

271275
static void xgbe_an37_restart(struct xgbe_prv_data *pdata)
@@ -894,6 +898,11 @@ static void xgbe_an37_init(struct xgbe_prv_data *pdata)
894898

895899
netif_dbg(pdata, link, pdata->netdev, "CL37 AN (%s) initialized\n",
896900
(pdata->an_mode == XGBE_AN_MODE_CL37) ? "BaseX" : "SGMII");
901+
902+
reg = XMDIO_READ(pdata, MDIO_MMD_AN, MDIO_CTRL1);
903+
reg &= ~MDIO_AN_CTRL1_ENABLE;
904+
XMDIO_WRITE(pdata, MDIO_MMD_AN, MDIO_CTRL1, reg);
905+
897906
}
898907

899908
static void xgbe_an73_init(struct xgbe_prv_data *pdata)
@@ -1295,6 +1304,10 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)
12951304

12961305
pdata->phy.link = pdata->phy_if.phy_impl.link_status(pdata,
12971306
&an_restart);
1307+
/* bail out if the link status register read fails */
1308+
if (pdata->phy.link < 0)
1309+
return;
1310+
12981311
if (an_restart) {
12991312
xgbe_phy_config_aneg(pdata);
13001313
goto adjust_link;

drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,8 +2746,7 @@ static bool xgbe_phy_valid_speed(struct xgbe_prv_data *pdata, int speed)
27462746
static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart)
27472747
{
27482748
struct xgbe_phy_data *phy_data = pdata->phy_data;
2749-
unsigned int reg;
2750-
int ret;
2749+
int reg, ret;
27512750

27522751
*an_restart = 0;
27532752

@@ -2781,11 +2780,20 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart)
27812780
return 0;
27822781
}
27832782

2784-
/* Link status is latched low, so read once to clear
2785-
* and then read again to get current state
2786-
*/
2787-
reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
27882783
reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
2784+
if (reg < 0)
2785+
return reg;
2786+
2787+
/* Link status is latched low so that momentary link drops
2788+
* can be detected. If link was already down read again
2789+
* to get the latest state.
2790+
*/
2791+
2792+
if (!pdata->phy.link && !(reg & MDIO_STAT1_LSTATUS)) {
2793+
reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
2794+
if (reg < 0)
2795+
return reg;
2796+
}
27892797

27902798
if (pdata->en_rx_adap) {
27912799
/* if the link is available and adaptation is done,
@@ -2804,9 +2812,7 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart)
28042812
xgbe_phy_set_mode(pdata, phy_data->cur_mode);
28052813
}
28062814

2807-
/* check again for the link and adaptation status */
2808-
reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
2809-
if ((reg & MDIO_STAT1_LSTATUS) && pdata->rx_adapt_done)
2815+
if (pdata->rx_adapt_done)
28102816
return 1;
28112817
} else if (reg & MDIO_STAT1_LSTATUS)
28122818
return 1;

drivers/net/ethernet/amd/xgbe/xgbe.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@
183183
#define XGBE_LINK_TIMEOUT 5
184184
#define XGBE_KR_TRAINING_WAIT_ITER 50
185185

186-
#define XGBE_SGMII_AN_LINK_STATUS BIT(1)
186+
#define XGBE_SGMII_AN_LINK_DUPLEX BIT(1)
187187
#define XGBE_SGMII_AN_LINK_SPEED (BIT(2) | BIT(3))
188188
#define XGBE_SGMII_AN_LINK_SPEED_10 0x00
189189
#define XGBE_SGMII_AN_LINK_SPEED_100 0x04
190190
#define XGBE_SGMII_AN_LINK_SPEED_1000 0x08
191-
#define XGBE_SGMII_AN_LINK_DUPLEX BIT(4)
191+
#define XGBE_SGMII_AN_LINK_STATUS BIT(4)
192192

193193
/* ECC correctable error notification window (seconds) */
194194
#define XGBE_ECC_LIMIT 60

drivers/net/ethernet/atheros/atlx/atl1.c

Lines changed: 57 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,14 +1861,21 @@ static u16 atl1_alloc_rx_buffers(struct atl1_adapter *adapter)
18611861
break;
18621862
}
18631863

1864-
buffer_info->alloced = 1;
1865-
buffer_info->skb = skb;
1866-
buffer_info->length = (u16) adapter->rx_buffer_len;
18671864
page = virt_to_page(skb->data);
18681865
offset = offset_in_page(skb->data);
18691866
buffer_info->dma = dma_map_page(&pdev->dev, page, offset,
18701867
adapter->rx_buffer_len,
18711868
DMA_FROM_DEVICE);
1869+
if (dma_mapping_error(&pdev->dev, buffer_info->dma)) {
1870+
kfree_skb(skb);
1871+
adapter->soft_stats.rx_dropped++;
1872+
break;
1873+
}
1874+
1875+
buffer_info->alloced = 1;
1876+
buffer_info->skb = skb;
1877+
buffer_info->length = (u16)adapter->rx_buffer_len;
1878+
18721879
rfd_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
18731880
rfd_desc->buf_len = cpu_to_le16(adapter->rx_buffer_len);
18741881
rfd_desc->coalese = 0;
@@ -2183,8 +2190,8 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb,
21832190
return 0;
21842191
}
21852192

2186-
static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
2187-
struct tx_packet_desc *ptpd)
2193+
static bool atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
2194+
struct tx_packet_desc *ptpd)
21882195
{
21892196
struct atl1_tpd_ring *tpd_ring = &adapter->tpd_ring;
21902197
struct atl1_buffer *buffer_info;
@@ -2194,13 +2201,15 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
21942201
unsigned int nr_frags;
21952202
unsigned int f;
21962203
int retval;
2204+
u16 first_mapped;
21972205
u16 next_to_use;
21982206
u16 data_len;
21992207
u8 hdr_len;
22002208

22012209
buf_len -= skb->data_len;
22022210
nr_frags = skb_shinfo(skb)->nr_frags;
22032211
next_to_use = atomic_read(&tpd_ring->next_to_use);
2212+
first_mapped = next_to_use;
22042213
buffer_info = &tpd_ring->buffer_info[next_to_use];
22052214
BUG_ON(buffer_info->skb);
22062215
/* put skb in last TPD */
@@ -2216,6 +2225,8 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
22162225
buffer_info->dma = dma_map_page(&adapter->pdev->dev, page,
22172226
offset, hdr_len,
22182227
DMA_TO_DEVICE);
2228+
if (dma_mapping_error(&adapter->pdev->dev, buffer_info->dma))
2229+
goto dma_err;
22192230

22202231
if (++next_to_use == tpd_ring->count)
22212232
next_to_use = 0;
@@ -2242,6 +2253,9 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
22422253
page, offset,
22432254
buffer_info->length,
22442255
DMA_TO_DEVICE);
2256+
if (dma_mapping_error(&adapter->pdev->dev,
2257+
buffer_info->dma))
2258+
goto dma_err;
22452259
if (++next_to_use == tpd_ring->count)
22462260
next_to_use = 0;
22472261
}
@@ -2254,6 +2268,8 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
22542268
buffer_info->dma = dma_map_page(&adapter->pdev->dev, page,
22552269
offset, buf_len,
22562270
DMA_TO_DEVICE);
2271+
if (dma_mapping_error(&adapter->pdev->dev, buffer_info->dma))
2272+
goto dma_err;
22572273
if (++next_to_use == tpd_ring->count)
22582274
next_to_use = 0;
22592275
}
@@ -2277,6 +2293,9 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
22772293
buffer_info->dma = skb_frag_dma_map(&adapter->pdev->dev,
22782294
frag, i * ATL1_MAX_TX_BUF_LEN,
22792295
buffer_info->length, DMA_TO_DEVICE);
2296+
if (dma_mapping_error(&adapter->pdev->dev,
2297+
buffer_info->dma))
2298+
goto dma_err;
22802299

22812300
if (++next_to_use == tpd_ring->count)
22822301
next_to_use = 0;
@@ -2285,6 +2304,22 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
22852304

22862305
/* last tpd's buffer-info */
22872306
buffer_info->skb = skb;
2307+
2308+
return true;
2309+
2310+
dma_err:
2311+
while (first_mapped != next_to_use) {
2312+
buffer_info = &tpd_ring->buffer_info[first_mapped];
2313+
dma_unmap_page(&adapter->pdev->dev,
2314+
buffer_info->dma,
2315+
buffer_info->length,
2316+
DMA_TO_DEVICE);
2317+
buffer_info->dma = 0;
2318+
2319+
if (++first_mapped == tpd_ring->count)
2320+
first_mapped = 0;
2321+
}
2322+
return false;
22882323
}
22892324

22902325
static void atl1_tx_queue(struct atl1_adapter *adapter, u16 count,
@@ -2355,10 +2390,8 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
23552390

23562391
len = skb_headlen(skb);
23572392

2358-
if (unlikely(skb->len <= 0)) {
2359-
dev_kfree_skb_any(skb);
2360-
return NETDEV_TX_OK;
2361-
}
2393+
if (unlikely(skb->len <= 0))
2394+
goto drop_packet;
23622395

23632396
nr_frags = skb_shinfo(skb)->nr_frags;
23642397
for (f = 0; f < nr_frags; f++) {
@@ -2371,10 +2404,9 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
23712404
if (mss) {
23722405
if (skb->protocol == htons(ETH_P_IP)) {
23732406
proto_hdr_len = skb_tcp_all_headers(skb);
2374-
if (unlikely(proto_hdr_len > len)) {
2375-
dev_kfree_skb_any(skb);
2376-
return NETDEV_TX_OK;
2377-
}
2407+
if (unlikely(proto_hdr_len > len))
2408+
goto drop_packet;
2409+
23782410
/* need additional TPD ? */
23792411
if (proto_hdr_len != len)
23802412
count += (len - proto_hdr_len +
@@ -2406,23 +2438,26 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
24062438
}
24072439

24082440
tso = atl1_tso(adapter, skb, ptpd);
2409-
if (tso < 0) {
2410-
dev_kfree_skb_any(skb);
2411-
return NETDEV_TX_OK;
2412-
}
2441+
if (tso < 0)
2442+
goto drop_packet;
24132443

24142444
if (!tso) {
24152445
ret_val = atl1_tx_csum(adapter, skb, ptpd);
2416-
if (ret_val < 0) {
2417-
dev_kfree_skb_any(skb);
2418-
return NETDEV_TX_OK;
2419-
}
2446+
if (ret_val < 0)
2447+
goto drop_packet;
24202448
}
24212449

2422-
atl1_tx_map(adapter, skb, ptpd);
2450+
if (!atl1_tx_map(adapter, skb, ptpd))
2451+
goto drop_packet;
2452+
24232453
atl1_tx_queue(adapter, count, ptpd);
24242454
atl1_update_mailbox(adapter);
24252455
return NETDEV_TX_OK;
2456+
2457+
drop_packet:
2458+
adapter->soft_stats.tx_errors++;
2459+
dev_kfree_skb_any(skb);
2460+
return NETDEV_TX_OK;
24262461
}
24272462

24282463
static int atl1_rings_clean(struct napi_struct *napi, int budget)

drivers/net/ethernet/cisco/enic/enic_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,10 +1864,10 @@ static int enic_change_mtu(struct net_device *netdev, int new_mtu)
18641864
if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic))
18651865
return -EOPNOTSUPP;
18661866

1867-
if (netdev->mtu > enic->port_mtu)
1867+
if (new_mtu > enic->port_mtu)
18681868
netdev_warn(netdev,
18691869
"interface MTU (%d) set higher than port MTU (%d)\n",
1870-
netdev->mtu, enic->port_mtu);
1870+
new_mtu, enic->port_mtu);
18711871

18721872
return _enic_change_mtu(netdev, new_mtu);
18731873
}

0 commit comments

Comments
 (0)