Skip to content

Commit 95e6ba5

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: 1) More jumbo frame fixes in r8169, from Heiner Kallweit. 2) Fix bpf build in minimal configuration, from Alexei Starovoitov. 3) Use after free in slcan driver, from Jouni Hogander. 4) Flower classifier port ranges don't work properly in the HW offload case, from Yoshiki Komachi. 5) Use after free in hns3_nic_maybe_stop_tx(), from Yunsheng Lin. 6) Out of bounds access in mqprio_dump(), from Vladyslav Tarasiuk. 7) Fix flow dissection in dsa TX path, from Alexander Lobakin. 8) Stale syncookie timestampe fixes from Guillaume Nault. [ Did an evil merge to silence a warning introduced by this pull - Linus ] * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (84 commits) r8169: fix rtl_hw_jumbo_disable for RTL8168evl net_sched: validate TCA_KIND attribute in tc_chain_tmplt_add() r8169: add missing RX enabling for WoL on RTL8125 vhost/vsock: accept only packets with the right dst_cid net: phy: dp83867: fix hfs boot in rgmii mode net: ethernet: ti: cpsw: fix extra rx interrupt inet: protect against too small mtu values. gre: refetch erspan header from skb->data after pskb_may_pull() pppoe: remove redundant BUG_ON() check in pppoe_pernet tcp: Protect accesses to .ts_recent_stamp with {READ,WRITE}_ONCE() tcp: tighten acceptance of ACKs not matching a child socket tcp: fix rejected syncookies due to stale timestamps lpc_eth: kernel BUG on remove tcp: md5: fix potential overestimation of TCP option space net: sched: allow indirect blocks to bind to clsact in TC net: core: rename indirect block ingress cb function net-sysfs: Call dev_hold always in netdev_queue_add_kobject net: dsa: fix flow dissection on Tx path net/tls: Fix return values to avoid ENOTSUPP net: avoid an indirect call in ____sys_recvmsg() ...
2 parents 138f371 + 0fc7521 commit 95e6ba5

File tree

119 files changed

+1025
-628
lines changed

Some content is hidden

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

119 files changed

+1025
-628
lines changed

MAINTAINERS

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10107,6 +10107,15 @@ W: https://linuxtv.org
1010710107
S: Maintained
1010810108
F: drivers/media/radio/radio-maxiradio*
1010910109

10110+
MCAN MMIO DEVICE DRIVER
10111+
M: Sriram Dash <[email protected]>
10112+
10113+
S: Maintained
10114+
F: Documentation/devicetree/bindings/net/can/m_can.txt
10115+
F: drivers/net/can/m_can/m_can.c
10116+
F: drivers/net/can/m_can/m_can.h
10117+
F: drivers/net/can/m_can/m_can_platform.c
10118+
1011010119
MCP4018 AND MCP4531 MICROCHIP DIGITAL POTENTIOMETER DRIVERS
1011110120
M: Peter Rosin <[email protected]>
1011210121
@@ -18139,6 +18148,14 @@ M: Radhey Shyam Pandey <[email protected]>
1813918148
S: Maintained
1814018149
F: drivers/net/ethernet/xilinx/xilinx_axienet*
1814118150

18151+
XILINX CAN DRIVER
18152+
M: Appana Durga Kedareswara rao <[email protected]>
18153+
R: Naga Sureshkumar Relli <[email protected]>
18154+
18155+
S: Maintained
18156+
F: Documentation/devicetree/bindings/net/can/xilinx_can.txt
18157+
F: drivers/net/can/xilinx_can.c
18158+
1814218159
XILINX UARTLITE SERIAL DRIVER
1814318160
M: Peter Korsgaard <[email protected]>
1814418161

drivers/infiniband/core/addr.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,16 +421,15 @@ static int addr6_resolve(struct sockaddr *src_sock,
421421
(const struct sockaddr_in6 *)dst_sock;
422422
struct flowi6 fl6;
423423
struct dst_entry *dst;
424-
int ret;
425424

426425
memset(&fl6, 0, sizeof fl6);
427426
fl6.daddr = dst_in->sin6_addr;
428427
fl6.saddr = src_in->sin6_addr;
429428
fl6.flowi6_oif = addr->bound_dev_if;
430429

431-
ret = ipv6_stub->ipv6_dst_lookup(addr->net, NULL, &dst, &fl6);
432-
if (ret < 0)
433-
return ret;
430+
dst = ipv6_stub->ipv6_dst_lookup_flow(addr->net, NULL, &fl6, NULL);
431+
if (IS_ERR(dst))
432+
return PTR_ERR(dst);
434433

435434
if (ipv6_addr_any(&src_in->sin6_addr))
436435
src_in->sin6_addr = fl6.saddr;

drivers/infiniband/sw/rxe/rxe_net.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ static struct dst_entry *rxe_find_route6(struct net_device *ndev,
117117
memcpy(&fl6.daddr, daddr, sizeof(*daddr));
118118
fl6.flowi6_proto = IPPROTO_UDP;
119119

120-
if (unlikely(ipv6_stub->ipv6_dst_lookup(sock_net(recv_sockets.sk6->sk),
121-
recv_sockets.sk6->sk, &ndst, &fl6))) {
120+
ndst = ipv6_stub->ipv6_dst_lookup_flow(sock_net(recv_sockets.sk6->sk),
121+
recv_sockets.sk6->sk, &fl6,
122+
NULL);
123+
if (unlikely(IS_ERR(ndst))) {
122124
pr_err_ratelimited("no route to %pI6\n", daddr);
123-
goto put;
125+
return NULL;
124126
}
125127

126128
if (unlikely(ndst->error)) {

drivers/net/can/slcan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ static int slcan_open(struct tty_struct *tty)
617617
sl->tty = NULL;
618618
tty->disc_data = NULL;
619619
clear_bit(SLF_INUSE, &sl->flags);
620+
slc_free_netdev(sl->dev);
620621
free_netdev(sl->dev);
621622

622623
err_exit:

drivers/net/can/usb/ucan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ static void ucan_read_bulk_callback(struct urb *urb)
792792
up);
793793

794794
usb_anchor_urb(urb, &up->rx_urbs);
795-
ret = usb_submit_urb(urb, GFP_KERNEL);
795+
ret = usb_submit_urb(urb, GFP_ATOMIC);
796796

797797
if (ret < 0) {
798798
netdev_err(up->netdev,

drivers/net/can/xilinx_can.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -542,16 +542,17 @@ static int xcan_do_set_mode(struct net_device *ndev, enum can_mode mode)
542542

543543
/**
544544
* xcan_write_frame - Write a frame to HW
545-
* @priv: Driver private data structure
545+
* @ndev: Pointer to net_device structure
546546
* @skb: sk_buff pointer that contains data to be Txed
547547
* @frame_offset: Register offset to write the frame to
548548
*/
549-
static void xcan_write_frame(struct xcan_priv *priv, struct sk_buff *skb,
549+
static void xcan_write_frame(struct net_device *ndev, struct sk_buff *skb,
550550
int frame_offset)
551551
{
552552
u32 id, dlc, data[2] = {0, 0};
553553
struct canfd_frame *cf = (struct canfd_frame *)skb->data;
554554
u32 ramoff, dwindex = 0, i;
555+
struct xcan_priv *priv = netdev_priv(ndev);
555556

556557
/* Watch carefully on the bit sequence */
557558
if (cf->can_id & CAN_EFF_FLAG) {
@@ -587,6 +588,14 @@ static void xcan_write_frame(struct xcan_priv *priv, struct sk_buff *skb,
587588
dlc |= XCAN_DLCR_EDL_MASK;
588589
}
589590

591+
if (!(priv->devtype.flags & XCAN_FLAG_TX_MAILBOXES) &&
592+
(priv->devtype.flags & XCAN_FLAG_TXFEMP))
593+
can_put_echo_skb(skb, ndev, priv->tx_head % priv->tx_max);
594+
else
595+
can_put_echo_skb(skb, ndev, 0);
596+
597+
priv->tx_head++;
598+
590599
priv->write_reg(priv, XCAN_FRAME_ID_OFFSET(frame_offset), id);
591600
/* If the CAN frame is RTR frame this write triggers transmission
592601
* (not on CAN FD)
@@ -638,13 +647,9 @@ static int xcan_start_xmit_fifo(struct sk_buff *skb, struct net_device *ndev)
638647
XCAN_SR_TXFLL_MASK))
639648
return -ENOSPC;
640649

641-
can_put_echo_skb(skb, ndev, priv->tx_head % priv->tx_max);
642-
643650
spin_lock_irqsave(&priv->tx_lock, flags);
644651

645-
priv->tx_head++;
646-
647-
xcan_write_frame(priv, skb, XCAN_TXFIFO_OFFSET);
652+
xcan_write_frame(ndev, skb, XCAN_TXFIFO_OFFSET);
648653

649654
/* Clear TX-FIFO-empty interrupt for xcan_tx_interrupt() */
650655
if (priv->tx_max > 1)
@@ -675,13 +680,9 @@ static int xcan_start_xmit_mailbox(struct sk_buff *skb, struct net_device *ndev)
675680
BIT(XCAN_TX_MAILBOX_IDX)))
676681
return -ENOSPC;
677682

678-
can_put_echo_skb(skb, ndev, 0);
679-
680683
spin_lock_irqsave(&priv->tx_lock, flags);
681684

682-
priv->tx_head++;
683-
684-
xcan_write_frame(priv, skb,
685+
xcan_write_frame(ndev, skb,
685686
XCAN_TXMSG_FRAME_OFFSET(XCAN_TX_MAILBOX_IDX));
686687

687688
/* Mark buffer as ready for transmit */
@@ -1772,7 +1773,8 @@ static int xcan_probe(struct platform_device *pdev)
17721773

17731774
priv->bus_clk = devm_clk_get(&pdev->dev, devtype->bus_clk_name);
17741775
if (IS_ERR(priv->bus_clk)) {
1775-
dev_err(&pdev->dev, "bus clock not found\n");
1776+
if (PTR_ERR(priv->bus_clk) != -EPROBE_DEFER)
1777+
dev_err(&pdev->dev, "bus clock not found\n");
17761778
ret = PTR_ERR(priv->bus_clk);
17771779
goto err_free;
17781780
}

drivers/net/ethernet/cavium/thunder/thunder_bgx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ static int bgx_lmac_enable(struct bgx *bgx, u8 lmacid)
11151115
phy_interface_mode(lmac->lmac_type)))
11161116
return -ENODEV;
11171117

1118-
phy_start_aneg(lmac->phydev);
1118+
phy_start(lmac->phydev);
11191119
return 0;
11201120
}
11211121

drivers/net/ethernet/freescale/enetc/enetc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,7 @@ static int enetc_phy_connect(struct net_device *ndev)
13321332
{
13331333
struct enetc_ndev_priv *priv = netdev_priv(ndev);
13341334
struct phy_device *phydev;
1335+
struct ethtool_eee edata;
13351336

13361337
if (!priv->phy_node)
13371338
return 0; /* phy-less mode */
@@ -1345,6 +1346,10 @@ static int enetc_phy_connect(struct net_device *ndev)
13451346

13461347
phy_attached_info(phydev);
13471348

1349+
/* disable EEE autoneg, until ENETC driver supports it */
1350+
memset(&edata, 0, sizeof(struct ethtool_eee));
1351+
phy_ethtool_set_eee(phydev, &edata);
1352+
13481353
return 0;
13491354
}
13501355

drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,30 +1287,25 @@ static bool hns3_skb_need_linearized(struct sk_buff *skb, unsigned int *bd_size,
12871287
}
12881288

12891289
static int hns3_nic_maybe_stop_tx(struct hns3_enet_ring *ring,
1290-
struct sk_buff **out_skb)
1290+
struct net_device *netdev,
1291+
struct sk_buff *skb)
12911292
{
1293+
struct hns3_nic_priv *priv = netdev_priv(netdev);
12921294
unsigned int bd_size[HNS3_MAX_TSO_BD_NUM + 1U];
1293-
struct sk_buff *skb = *out_skb;
12941295
unsigned int bd_num;
12951296

12961297
bd_num = hns3_tx_bd_num(skb, bd_size);
12971298
if (unlikely(bd_num > HNS3_MAX_NON_TSO_BD_NUM)) {
1298-
struct sk_buff *new_skb;
1299-
13001299
if (bd_num <= HNS3_MAX_TSO_BD_NUM && skb_is_gso(skb) &&
13011300
!hns3_skb_need_linearized(skb, bd_size, bd_num))
13021301
goto out;
13031302

1304-
/* manual split the send packet */
1305-
new_skb = skb_copy(skb, GFP_ATOMIC);
1306-
if (!new_skb)
1303+
if (__skb_linearize(skb))
13071304
return -ENOMEM;
1308-
dev_kfree_skb_any(skb);
1309-
*out_skb = new_skb;
13101305

1311-
bd_num = hns3_tx_bd_count(new_skb->len);
1312-
if ((skb_is_gso(new_skb) && bd_num > HNS3_MAX_TSO_BD_NUM) ||
1313-
(!skb_is_gso(new_skb) &&
1306+
bd_num = hns3_tx_bd_count(skb->len);
1307+
if ((skb_is_gso(skb) && bd_num > HNS3_MAX_TSO_BD_NUM) ||
1308+
(!skb_is_gso(skb) &&
13141309
bd_num > HNS3_MAX_NON_TSO_BD_NUM))
13151310
return -ENOMEM;
13161311

@@ -1320,10 +1315,23 @@ static int hns3_nic_maybe_stop_tx(struct hns3_enet_ring *ring,
13201315
}
13211316

13221317
out:
1323-
if (unlikely(ring_space(ring) < bd_num))
1324-
return -EBUSY;
1318+
if (likely(ring_space(ring) >= bd_num))
1319+
return bd_num;
13251320

1326-
return bd_num;
1321+
netif_stop_subqueue(netdev, ring->queue_index);
1322+
smp_mb(); /* Memory barrier before checking ring_space */
1323+
1324+
/* Start queue in case hns3_clean_tx_ring has just made room
1325+
* available and has not seen the queue stopped state performed
1326+
* by netif_stop_subqueue above.
1327+
*/
1328+
if (ring_space(ring) >= bd_num && netif_carrier_ok(netdev) &&
1329+
!test_bit(HNS3_NIC_STATE_DOWN, &priv->state)) {
1330+
netif_start_subqueue(netdev, ring->queue_index);
1331+
return bd_num;
1332+
}
1333+
1334+
return -EBUSY;
13271335
}
13281336

13291337
static void hns3_clear_desc(struct hns3_enet_ring *ring, int next_to_use_orig)
@@ -1400,13 +1408,13 @@ netdev_tx_t hns3_nic_net_xmit(struct sk_buff *skb, struct net_device *netdev)
14001408
/* Prefetch the data used later */
14011409
prefetch(skb->data);
14021410

1403-
ret = hns3_nic_maybe_stop_tx(ring, &skb);
1411+
ret = hns3_nic_maybe_stop_tx(ring, netdev, skb);
14041412
if (unlikely(ret <= 0)) {
14051413
if (ret == -EBUSY) {
14061414
u64_stats_update_begin(&ring->syncp);
14071415
ring->stats.tx_busy++;
14081416
u64_stats_update_end(&ring->syncp);
1409-
goto out_net_tx_busy;
1417+
return NETDEV_TX_BUSY;
14101418
} else if (ret == -ENOMEM) {
14111419
u64_stats_update_begin(&ring->syncp);
14121420
ring->stats.sw_err_cnt++;
@@ -1457,12 +1465,6 @@ netdev_tx_t hns3_nic_net_xmit(struct sk_buff *skb, struct net_device *netdev)
14571465
out_err_tx_ok:
14581466
dev_kfree_skb_any(skb);
14591467
return NETDEV_TX_OK;
1460-
1461-
out_net_tx_busy:
1462-
netif_stop_subqueue(netdev, ring->queue_index);
1463-
smp_mb(); /* Commit all data before submit */
1464-
1465-
return NETDEV_TX_BUSY;
14661468
}
14671469

14681470
static int hns3_nic_net_set_mac_address(struct net_device *netdev, void *p)
@@ -2519,7 +2521,7 @@ void hns3_clean_tx_ring(struct hns3_enet_ring *ring)
25192521
dev_queue = netdev_get_tx_queue(netdev, ring->tqp->tqp_index);
25202522
netdev_tx_completed_queue(dev_queue, pkts, bytes);
25212523

2522-
if (unlikely(pkts && netif_carrier_ok(netdev) &&
2524+
if (unlikely(netif_carrier_ok(netdev) &&
25232525
ring_space(ring) > HNS3_MAX_TSO_BD_NUM)) {
25242526
/* Make sure that anybody stopping the queue after this
25252527
* sees the new next_to_clean.

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8438,13 +8438,16 @@ static int hclge_set_vf_vlan_filter(struct hnae3_handle *handle, int vfid,
84388438
if (hdev->pdev->revision == 0x20)
84398439
return -EOPNOTSUPP;
84408440

8441+
vport = hclge_get_vf_vport(hdev, vfid);
8442+
if (!vport)
8443+
return -EINVAL;
8444+
84418445
/* qos is a 3 bits value, so can not be bigger than 7 */
8442-
if (vfid >= hdev->num_alloc_vfs || vlan > VLAN_N_VID - 1 || qos > 7)
8446+
if (vlan > VLAN_N_VID - 1 || qos > 7)
84438447
return -EINVAL;
84448448
if (proto != htons(ETH_P_8021Q))
84458449
return -EPROTONOSUPPORT;
84468450

8447-
vport = &hdev->vport[vfid];
84488451
state = hclge_get_port_base_vlan_state(vport,
84498452
vport->port_base_vlan_cfg.state,
84508453
vlan);
@@ -8455,21 +8458,12 @@ static int hclge_set_vf_vlan_filter(struct hnae3_handle *handle, int vfid,
84558458
vlan_info.qos = qos;
84568459
vlan_info.vlan_proto = ntohs(proto);
84578460

8458-
/* update port based VLAN for PF */
8459-
if (!vfid) {
8460-
hclge_notify_client(hdev, HNAE3_DOWN_CLIENT);
8461-
ret = hclge_update_port_base_vlan_cfg(vport, state, &vlan_info);
8462-
hclge_notify_client(hdev, HNAE3_UP_CLIENT);
8463-
8464-
return ret;
8465-
}
8466-
84678461
if (!test_bit(HCLGE_VPORT_STATE_ALIVE, &vport->state)) {
84688462
return hclge_update_port_base_vlan_cfg(vport, state,
84698463
&vlan_info);
84708464
} else {
84718465
ret = hclge_push_vf_port_base_vlan_info(&hdev->vport[0],
8472-
(u8)vfid, state,
8466+
vport->vport_id, state,
84738467
vlan, qos,
84748468
ntohs(proto));
84758469
return ret;

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ struct mlx5e_xsk {
816816
struct mlx5e_priv {
817817
/* priv data path fields - start */
818818
struct mlx5e_txqsq *txq2sq[MLX5E_MAX_NUM_CHANNELS * MLX5E_MAX_NUM_TC];
819-
int channel_tc2txq[MLX5E_MAX_NUM_CHANNELS][MLX5E_MAX_NUM_TC];
819+
int channel_tc2realtxq[MLX5E_MAX_NUM_CHANNELS][MLX5E_MAX_NUM_TC];
820820
#ifdef CONFIG_MLX5_CORE_EN_DCB
821821
struct mlx5e_dcbx_dp dcbx_dp;
822822
#endif

drivers/net/ethernet/mellanox/mlx5/core/en/port.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ static const u32 mlx5e_ext_link_speed[MLX5E_EXT_LINK_MODES_NUMBER] = {
7373
[MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2] = 50000,
7474
[MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR] = 50000,
7575
[MLX5E_CAUI_4_100GBASE_CR4_KR4] = 100000,
76+
[MLX5E_100GAUI_2_100GBASE_CR2_KR2] = 100000,
7677
[MLX5E_200GAUI_4_200GBASE_CR4_KR4] = 200000,
7778
[MLX5E_400GAUI_8] = 400000,
7879
};

drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,11 @@ static int update_xoff_threshold(struct mlx5e_port_buffer *port_buffer,
155155
}
156156

157157
if (port_buffer->buffer[i].size <
158-
(xoff + max_mtu + (1 << MLX5E_BUFFER_CELL_SHIFT)))
158+
(xoff + max_mtu + (1 << MLX5E_BUFFER_CELL_SHIFT))) {
159+
pr_err("buffer_size[%d]=%d is not enough for lossless buffer\n",
160+
i, port_buffer->buffer[i].size);
159161
return -ENOMEM;
162+
}
160163

161164
port_buffer->buffer[i].xoff = port_buffer->buffer[i].size - xoff;
162165
port_buffer->buffer[i].xon =
@@ -232,6 +235,26 @@ static int update_buffer_lossy(unsigned int max_mtu,
232235
return 0;
233236
}
234237

238+
static int fill_pfc_en(struct mlx5_core_dev *mdev, u8 *pfc_en)
239+
{
240+
u32 g_rx_pause, g_tx_pause;
241+
int err;
242+
243+
err = mlx5_query_port_pause(mdev, &g_rx_pause, &g_tx_pause);
244+
if (err)
245+
return err;
246+
247+
/* If global pause enabled, set all active buffers to lossless.
248+
* Otherwise, check PFC setting.
249+
*/
250+
if (g_rx_pause || g_tx_pause)
251+
*pfc_en = 0xff;
252+
else
253+
err = mlx5_query_port_pfc(mdev, pfc_en, NULL);
254+
255+
return err;
256+
}
257+
235258
#define MINIMUM_MAX_MTU 9216
236259
int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv,
237260
u32 change, unsigned int mtu,
@@ -277,7 +300,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv,
277300

278301
if (change & MLX5E_PORT_BUFFER_PRIO2BUFFER) {
279302
update_prio2buffer = true;
280-
err = mlx5_query_port_pfc(priv->mdev, &curr_pfc_en, NULL);
303+
err = fill_pfc_en(priv->mdev, &curr_pfc_en);
281304
if (err)
282305
return err;
283306

0 commit comments

Comments
 (0)