Skip to content

Commit 9ed13a1

Browse files
committed
Merge tag 'net-5.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Networking fixes for 5.13-rc7, including fixes from wireless, bpf, bluetooth, netfilter and can. Current release - regressions: - mlxsw: spectrum_qdisc: Pass handle, not band number to find_class() to fix modifying offloaded qdiscs - lantiq: net: fix duplicated skb in rx descriptor ring - rtnetlink: fix regression in bridge VLAN configuration, empty info is not an error, bot-generated "fix" was not needed - libbpf: s/rx/tx/ typo on umem->rx_ring_setup_done to fix umem creation Current release - new code bugs: - ethtool: fix NULL pointer dereference during module EEPROM dump via the new netlink API - mlx5e: don't update netdev RQs with PTP-RQ, the special purpose queue should not be visible to the stack - mlx5e: select special PTP queue only for SKBTX_HW_TSTAMP skbs - mlx5e: verify dev is present in get devlink port ndo, avoid a panic Previous releases - regressions: - neighbour: allow NUD_NOARP entries to be force GCed - further fixes for fallout from reorg of WiFi locking (staging: rtl8723bs, mac80211, cfg80211) - skbuff: fix incorrect msg_zerocopy copy notifications - mac80211: fix NULL ptr deref for injected rate info - Revert "net/mlx5: Arm only EQs with EQEs" it may cause missed IRQs Previous releases - always broken: - bpf: more speculative execution fixes - netfilter: nft_fib_ipv6: skip ipv6 packets from any to link-local - udp: fix race between close() and udp_abort() resulting in a panic - fix out of bounds when parsing TCP options before packets are validated (in netfilter: synproxy, tc: sch_cake and mptcp) - mptcp: improve operation under memory pressure, add missing wake-ups - mptcp: fix double-lock/soft lookup in subflow_error_report() - bridge: fix races (null pointer deref and UAF) in vlan tunnel egress - ena: fix DMA mapping function issues in XDP - rds: fix memory leak in rds_recvmsg Misc: - vrf: allow larger MTUs - icmp: don't send out ICMP messages with a source address of 0.0.0.0 - cdc_ncm: switch to eth%d interface naming" * tag 'net-5.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (139 commits) net: ethernet: fix potential use-after-free in ec_bhf_remove selftests/net: Add icmp.sh for testing ICMP dummy address responses icmp: don't send out ICMP messages with a source address of 0.0.0.0 net: ll_temac: Avoid ndo_start_xmit returning NETDEV_TX_BUSY net: ll_temac: Fix TX BD buffer overwrite net: ll_temac: Add memory-barriers for TX BD access net: ll_temac: Make sure to free skb when it is completely used MAINTAINERS: add Guvenc as SMC maintainer bnxt_en: Call bnxt_ethtool_free() in bnxt_init_one() error path bnxt_en: Fix TQM fastpath ring backing store computation bnxt_en: Rediscover PHY capabilities after firmware reset cxgb4: fix wrong shift. mac80211: handle various extensible elements correctly mac80211: reset profile_periodicity/ema_ap cfg80211: avoid double free of PMSR request cfg80211: make certificate generation more robust mac80211: minstrel_ht: fix sample time check net: qed: Fix memcpy() overflow of qed_dcbx_params() net: cdc_eem: fix tx fixup skb leak net: hamradio: fix memory leak in mkiss_close ...
2 parents 6fab154 + 9cca0c2 commit 9ed13a1

File tree

145 files changed

+1513
-589
lines changed

Some content is hidden

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

145 files changed

+1513
-589
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16560,6 +16560,7 @@ F: drivers/misc/sgi-xp/
1656016560

1656116561
SHARED MEMORY COMMUNICATIONS (SMC) SOCKETS
1656216562
M: Karsten Graul <[email protected]>
16563+
M: Guvenc Gulce <[email protected]>
1656316564
1656416565
S: Supported
1656516566
W: http://www.ibm.com/developerworks/linux/linux390/

drivers/net/caif/caif_serial.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ static int ldisc_open(struct tty_struct *tty)
350350
rtnl_lock();
351351
result = register_netdevice(dev);
352352
if (result) {
353+
tty_kref_put(tty);
353354
rtnl_unlock();
354355
free_netdev(dev);
355356
return -ENODEV;

drivers/net/can/usb/mcba_usb.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ struct mcba_priv {
8282
bool can_ka_first_pass;
8383
bool can_speed_check;
8484
atomic_t free_ctx_cnt;
85+
void *rxbuf[MCBA_MAX_RX_URBS];
86+
dma_addr_t rxbuf_dma[MCBA_MAX_RX_URBS];
8587
};
8688

8789
/* CAN frame */
@@ -633,6 +635,7 @@ static int mcba_usb_start(struct mcba_priv *priv)
633635
for (i = 0; i < MCBA_MAX_RX_URBS; i++) {
634636
struct urb *urb = NULL;
635637
u8 *buf;
638+
dma_addr_t buf_dma;
636639

637640
/* create a URB, and a buffer for it */
638641
urb = usb_alloc_urb(0, GFP_KERNEL);
@@ -642,7 +645,7 @@ static int mcba_usb_start(struct mcba_priv *priv)
642645
}
643646

644647
buf = usb_alloc_coherent(priv->udev, MCBA_USB_RX_BUFF_SIZE,
645-
GFP_KERNEL, &urb->transfer_dma);
648+
GFP_KERNEL, &buf_dma);
646649
if (!buf) {
647650
netdev_err(netdev, "No memory left for USB buffer\n");
648651
usb_free_urb(urb);
@@ -661,11 +664,14 @@ static int mcba_usb_start(struct mcba_priv *priv)
661664
if (err) {
662665
usb_unanchor_urb(urb);
663666
usb_free_coherent(priv->udev, MCBA_USB_RX_BUFF_SIZE,
664-
buf, urb->transfer_dma);
667+
buf, buf_dma);
665668
usb_free_urb(urb);
666669
break;
667670
}
668671

672+
priv->rxbuf[i] = buf;
673+
priv->rxbuf_dma[i] = buf_dma;
674+
669675
/* Drop reference, USB core will take care of freeing it */
670676
usb_free_urb(urb);
671677
}
@@ -708,7 +714,14 @@ static int mcba_usb_open(struct net_device *netdev)
708714

709715
static void mcba_urb_unlink(struct mcba_priv *priv)
710716
{
717+
int i;
718+
711719
usb_kill_anchored_urbs(&priv->rx_submitted);
720+
721+
for (i = 0; i < MCBA_MAX_RX_URBS; ++i)
722+
usb_free_coherent(priv->udev, MCBA_USB_RX_BUFF_SIZE,
723+
priv->rxbuf[i], priv->rxbuf_dma[i]);
724+
712725
usb_kill_anchored_urbs(&priv->tx_submitted);
713726
}
714727

drivers/net/ethernet/amazon/ena/ena_netdev.c

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -236,36 +236,48 @@ static int ena_xdp_io_poll(struct napi_struct *napi, int budget)
236236
static int ena_xdp_tx_map_frame(struct ena_ring *xdp_ring,
237237
struct ena_tx_buffer *tx_info,
238238
struct xdp_frame *xdpf,
239-
void **push_hdr,
240-
u32 *push_len)
239+
struct ena_com_tx_ctx *ena_tx_ctx)
241240
{
242241
struct ena_adapter *adapter = xdp_ring->adapter;
243242
struct ena_com_buf *ena_buf;
244-
dma_addr_t dma = 0;
243+
int push_len = 0;
244+
dma_addr_t dma;
245+
void *data;
245246
u32 size;
246247

247248
tx_info->xdpf = xdpf;
249+
data = tx_info->xdpf->data;
248250
size = tx_info->xdpf->len;
249-
ena_buf = tx_info->bufs;
250251

251-
/* llq push buffer */
252-
*push_len = min_t(u32, size, xdp_ring->tx_max_header_size);
253-
*push_hdr = tx_info->xdpf->data;
252+
if (xdp_ring->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) {
253+
/* Designate part of the packet for LLQ */
254+
push_len = min_t(u32, size, xdp_ring->tx_max_header_size);
255+
256+
ena_tx_ctx->push_header = data;
257+
258+
size -= push_len;
259+
data += push_len;
260+
}
261+
262+
ena_tx_ctx->header_len = push_len;
254263

255-
if (size - *push_len > 0) {
264+
if (size > 0) {
256265
dma = dma_map_single(xdp_ring->dev,
257-
*push_hdr + *push_len,
258-
size - *push_len,
266+
data,
267+
size,
259268
DMA_TO_DEVICE);
260269
if (unlikely(dma_mapping_error(xdp_ring->dev, dma)))
261270
goto error_report_dma_error;
262271

263-
tx_info->map_linear_data = 1;
264-
tx_info->num_of_bufs = 1;
265-
}
272+
tx_info->map_linear_data = 0;
266273

267-
ena_buf->paddr = dma;
268-
ena_buf->len = size;
274+
ena_buf = tx_info->bufs;
275+
ena_buf->paddr = dma;
276+
ena_buf->len = size;
277+
278+
ena_tx_ctx->ena_bufs = ena_buf;
279+
ena_tx_ctx->num_bufs = tx_info->num_of_bufs = 1;
280+
}
269281

270282
return 0;
271283

@@ -274,10 +286,6 @@ static int ena_xdp_tx_map_frame(struct ena_ring *xdp_ring,
274286
&xdp_ring->syncp);
275287
netif_warn(adapter, tx_queued, adapter->netdev, "Failed to map xdp buff\n");
276288

277-
xdp_return_frame_rx_napi(tx_info->xdpf);
278-
tx_info->xdpf = NULL;
279-
tx_info->num_of_bufs = 0;
280-
281289
return -EINVAL;
282290
}
283291

@@ -289,24 +297,18 @@ static int ena_xdp_xmit_frame(struct ena_ring *xdp_ring,
289297
struct ena_com_tx_ctx ena_tx_ctx = {};
290298
struct ena_tx_buffer *tx_info;
291299
u16 next_to_use, req_id;
292-
void *push_hdr;
293-
u32 push_len;
294300
int rc;
295301

296302
next_to_use = xdp_ring->next_to_use;
297303
req_id = xdp_ring->free_ids[next_to_use];
298304
tx_info = &xdp_ring->tx_buffer_info[req_id];
299305
tx_info->num_of_bufs = 0;
300306

301-
rc = ena_xdp_tx_map_frame(xdp_ring, tx_info, xdpf, &push_hdr, &push_len);
307+
rc = ena_xdp_tx_map_frame(xdp_ring, tx_info, xdpf, &ena_tx_ctx);
302308
if (unlikely(rc))
303309
return rc;
304310

305-
ena_tx_ctx.ena_bufs = tx_info->bufs;
306-
ena_tx_ctx.push_header = push_hdr;
307-
ena_tx_ctx.num_bufs = tx_info->num_of_bufs;
308311
ena_tx_ctx.req_id = req_id;
309-
ena_tx_ctx.header_len = push_len;
310312

311313
rc = ena_xmit_common(dev,
312314
xdp_ring,

drivers/net/ethernet/atheros/alx/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,6 +1849,7 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
18491849
free_netdev(netdev);
18501850
out_pci_release:
18511851
pci_release_mem_regions(pdev);
1852+
pci_disable_pcie_error_reporting(pdev);
18521853
out_pci_disable:
18531854
pci_disable_device(pdev);
18541855
return err;

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7308,7 +7308,7 @@ static int bnxt_alloc_ctx_mem(struct bnxt *bp)
73087308
entries_sp = ctx->vnic_max_vnic_entries + ctx->qp_max_l2_entries +
73097309
2 * (extra_qps + ctx->qp_min_qp1_entries) + min;
73107310
entries_sp = roundup(entries_sp, ctx->tqm_entries_multiple);
7311-
entries = ctx->qp_max_l2_entries + extra_qps + ctx->qp_min_qp1_entries;
7311+
entries = ctx->qp_max_l2_entries + 2 * (extra_qps + ctx->qp_min_qp1_entries);
73127312
entries = roundup(entries, ctx->tqm_entries_multiple);
73137313
entries = clamp_t(u32, entries, min, ctx->tqm_max_entries_per_ring);
73147314
for (i = 0; i < ctx->tqm_fp_rings_count + 1; i++) {
@@ -11750,6 +11750,8 @@ static void bnxt_fw_init_one_p3(struct bnxt *bp)
1175011750
bnxt_hwrm_coal_params_qcaps(bp);
1175111751
}
1175211752

11753+
static int bnxt_probe_phy(struct bnxt *bp, bool fw_dflt);
11754+
1175311755
static int bnxt_fw_init_one(struct bnxt *bp)
1175411756
{
1175511757
int rc;
@@ -11764,6 +11766,9 @@ static int bnxt_fw_init_one(struct bnxt *bp)
1176411766
netdev_err(bp->dev, "Firmware init phase 2 failed\n");
1176511767
return rc;
1176611768
}
11769+
rc = bnxt_probe_phy(bp, false);
11770+
if (rc)
11771+
return rc;
1176711772
rc = bnxt_approve_mac(bp, bp->dev->dev_addr, false);
1176811773
if (rc)
1176911774
return rc;
@@ -13155,6 +13160,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1315513160
bnxt_hwrm_func_drv_unrgtr(bp);
1315613161
bnxt_free_hwrm_short_cmd_req(bp);
1315713162
bnxt_free_hwrm_resources(bp);
13163+
bnxt_ethtool_free(bp);
1315813164
kfree(bp->fw_health);
1315913165
bp->fw_health = NULL;
1316013166
bnxt_cleanup_pci(bp);

drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,13 +1337,27 @@ static int cxgb4_ethtool_flash_phy(struct net_device *netdev,
13371337
return ret;
13381338
}
13391339

1340-
spin_lock_bh(&adap->win0_lock);
1340+
/* We have to RESET the chip/firmware because we need the
1341+
* chip in uninitialized state for loading new PHY image.
1342+
* Otherwise, the running firmware will only store the PHY
1343+
* image in local RAM which will be lost after next reset.
1344+
*/
1345+
ret = t4_fw_reset(adap, adap->mbox, PIORSTMODE_F | PIORST_F);
1346+
if (ret < 0) {
1347+
dev_err(adap->pdev_dev,
1348+
"Set FW to RESET for flashing PHY FW failed. ret: %d\n",
1349+
ret);
1350+
return ret;
1351+
}
1352+
13411353
ret = t4_load_phy_fw(adap, MEMWIN_NIC, NULL, data, size);
1342-
spin_unlock_bh(&adap->win0_lock);
1343-
if (ret)
1344-
dev_err(adap->pdev_dev, "Failed to load PHY FW\n");
1354+
if (ret < 0) {
1355+
dev_err(adap->pdev_dev, "Failed to load PHY FW. ret: %d\n",
1356+
ret);
1357+
return ret;
1358+
}
13451359

1346-
return ret;
1360+
return 0;
13471361
}
13481362

13491363
static int cxgb4_ethtool_flash_fw(struct net_device *netdev,
@@ -1610,16 +1624,14 @@ static struct filter_entry *cxgb4_get_filter_entry(struct adapter *adap,
16101624
u32 ftid)
16111625
{
16121626
struct tid_info *t = &adap->tids;
1613-
struct filter_entry *f;
16141627

1615-
if (ftid < t->nhpftids)
1616-
f = &adap->tids.hpftid_tab[ftid];
1617-
else if (ftid < t->nftids)
1618-
f = &adap->tids.ftid_tab[ftid - t->nhpftids];
1619-
else
1620-
f = lookup_tid(&adap->tids, ftid);
1628+
if (ftid >= t->hpftid_base && ftid < t->hpftid_base + t->nhpftids)
1629+
return &t->hpftid_tab[ftid - t->hpftid_base];
16211630

1622-
return f;
1631+
if (ftid >= t->ftid_base && ftid < t->ftid_base + t->nftids)
1632+
return &t->ftid_tab[ftid - t->ftid_base];
1633+
1634+
return lookup_tid(t, ftid);
16231635
}
16241636

16251637
static void cxgb4_fill_filter_rule(struct ethtool_rx_flow_spec *fs,
@@ -1826,6 +1838,11 @@ static int cxgb4_ntuple_del_filter(struct net_device *dev,
18261838
filter_id = filter_info->loc_array[cmd->fs.location];
18271839
f = cxgb4_get_filter_entry(adapter, filter_id);
18281840

1841+
if (f->fs.prio)
1842+
filter_id -= adapter->tids.hpftid_base;
1843+
else if (!f->fs.hash)
1844+
filter_id -= (adapter->tids.ftid_base - adapter->tids.nhpftids);
1845+
18291846
ret = cxgb4_flow_rule_destroy(dev, f->fs.tc_prio, &f->fs, filter_id);
18301847
if (ret)
18311848
goto err;
@@ -1885,6 +1902,11 @@ static int cxgb4_ntuple_set_filter(struct net_device *netdev,
18851902

18861903
filter_info = &adapter->ethtool_filters->port[pi->port_id];
18871904

1905+
if (fs.prio)
1906+
tid += adapter->tids.hpftid_base;
1907+
else if (!fs.hash)
1908+
tid += (adapter->tids.ftid_base - adapter->tids.nhpftids);
1909+
18881910
filter_info->loc_array[cmd->fs.location] = tid;
18891911
set_bit(cmd->fs.location, filter_info->bmap);
18901912
filter_info->in_use++;

drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static void set_nat_params(struct adapter *adap, struct filter_entry *f,
198198
WORD_MASK, f->fs.nat_lip[3] |
199199
f->fs.nat_lip[2] << 8 |
200200
f->fs.nat_lip[1] << 16 |
201-
(u64)f->fs.nat_lip[0] << 25, 1);
201+
(u64)f->fs.nat_lip[0] << 24, 1);
202202
}
203203
}
204204

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4424,10 +4424,8 @@ static int adap_init0_phy(struct adapter *adap)
44244424

44254425
/* Load PHY Firmware onto adapter.
44264426
*/
4427-
spin_lock_bh(&adap->win0_lock);
44284427
ret = t4_load_phy_fw(adap, MEMWIN_NIC, phy_info->phy_fw_version,
44294428
(u8 *)phyf->data, phyf->size);
4430-
spin_unlock_bh(&adap->win0_lock);
44314429
if (ret < 0)
44324430
dev_err(adap->pdev_dev, "PHY Firmware transfer error %d\n",
44334431
-ret);

0 commit comments

Comments
 (0)