Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'net-5.16-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull networking fixes from Jakub Kicinski:
"Including fixes from.. Santa?

No regressions on our radar at this point. The igc problem fixed here
was the last one I was tracking but it was broken in previous
releases, anyway. Mostly driver fixes and a couple of largish SMC
fixes.

Current release - regressions:

- xsk: initialise xskb free_list_node, fixup for a -rc7 fix

Current release - new code bugs:

- mlx5: handful of minor fixes:

- use first online CPU instead of hard coded CPU

- fix some error handling paths in 'mlx5e_tc_add_fdb_flow()'

- fix skb memory leak when TC classifier action offloads are disabled

- fix memory leak with rules with internal OvS port

Previous releases - regressions:

- igc: do not enable crosstimestamping for i225-V models

Previous releases - always broken:

- udp: use datalen to cap ipv6 udp max gso segments

- fix use-after-free in tw_timer_handler due to early free of stats

- smc: fix kernel panic caused by race of smc_sock

- smc: don't send CDC/LLC message if link not ready, avoid timeouts

- sctp: use call_rcu to free endpoint, avoid UAF in sock diag

- bridge: mcast: add and enforce query interval minimum

- usb: pegasus: do not drop long Ethernet frames

- mlx5e: fix ICOSQ recovery flow for XSK

- nfc: uapi: use kernel size_t to fix user-space builds"

* tag 'net-5.16-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (47 commits)
fsl/fman: Fix missing put_device() call in fman_port_probe
selftests: net: using ping6 for IPv6 in udpgro_fwd.sh
Documentation: fix outdated interpretation of ip_no_pmtu_disc
net/ncsi: check for error return from call to nla_put_u32
net: bridge: mcast: fix br_multicast_ctx_vlan_global_disabled helper
net: fix use-after-free in tw_timer_handler
selftests: net: Fix a typo in udpgro_fwd.sh
selftests/net: udpgso_bench_tx: fix dst ip argument
net: bridge: mcast: add and enforce startup query interval minimum
net: bridge: mcast: add and enforce query interval minimum
ipv6: raw: check passed optlen before reading
xsk: Initialise xskb free_list_node
net/mlx5e: Fix wrong features assignment in case of error
net/mlx5e: TC, Fix memory leak with rules with internal port
ionic: Initialize the 'lif->dbid_inuse' bitmap
igc: Fix TX timestamp support for non-MSI-X platforms
igc: Do not enable crosstimestamping for i225-V models
net/smc: fix kernel panic caused by race of smc_sock
net/smc: don't send CDC/LLC message if link not ready
NFC: st21nfca: Fix memory leak in device probe and remove
...

+405 -237
+4 -2
Documentation/networking/ip-sysctl.rst
··· 25 25 ip_no_pmtu_disc - INTEGER 26 26 Disable Path MTU Discovery. If enabled in mode 1 and a 27 27 fragmentation-required ICMP is received, the PMTU to this 28 - destination will be set to min_pmtu (see below). You will need 28 + destination will be set to the smallest of the old MTU to 29 + this destination and min_pmtu (see below). You will need 29 30 to raise min_pmtu to the smallest interface MTU on your system 30 31 manually if you want to avoid locally generated fragments. 31 32 ··· 50 49 Default: FALSE 51 50 52 51 min_pmtu - INTEGER 53 - default 552 - minimum discovered Path MTU 52 + default 552 - minimum Path MTU. Unless this is changed mannually, 53 + each cached pmtu will never be lower than this setting. 54 54 55 55 ip_forward_use_pmtu - BOOLEAN 56 56 By default we don't trust protocol path MTUs while forwarding
+3 -3
drivers/isdn/mISDN/core.c
··· 381 381 err = mISDN_inittimer(&debug); 382 382 if (err) 383 383 goto error2; 384 - err = l1_init(&debug); 384 + err = Isdnl1_Init(&debug); 385 385 if (err) 386 386 goto error3; 387 387 err = Isdnl2_Init(&debug); ··· 395 395 error5: 396 396 Isdnl2_cleanup(); 397 397 error4: 398 - l1_cleanup(); 398 + Isdnl1_cleanup(); 399 399 error3: 400 400 mISDN_timer_cleanup(); 401 401 error2: ··· 408 408 { 409 409 misdn_sock_cleanup(); 410 410 Isdnl2_cleanup(); 411 - l1_cleanup(); 411 + Isdnl1_cleanup(); 412 412 mISDN_timer_cleanup(); 413 413 class_unregister(&mISDN_class); 414 414
+2 -2
drivers/isdn/mISDN/core.h
··· 60 60 extern int mISDN_inittimer(u_int *); 61 61 extern void mISDN_timer_cleanup(void); 62 62 63 - extern int l1_init(u_int *); 64 - extern void l1_cleanup(void); 63 + extern int Isdnl1_Init(u_int *); 64 + extern void Isdnl1_cleanup(void); 65 65 extern int Isdnl2_Init(u_int *); 66 66 extern void Isdnl2_cleanup(void); 67 67
+2 -2
drivers/isdn/mISDN/layer1.c
··· 398 398 EXPORT_SYMBOL(create_l1); 399 399 400 400 int 401 - l1_init(u_int *deb) 401 + Isdnl1_Init(u_int *deb) 402 402 { 403 403 debug = deb; 404 404 l1fsm_s.state_count = L1S_STATE_COUNT; ··· 409 409 } 410 410 411 411 void 412 - l1_cleanup(void) 412 + Isdnl1_cleanup(void) 413 413 { 414 414 mISDN_FsmFree(&l1fsm_s); 415 415 }
+8
drivers/net/ethernet/aquantia/atlantic/aq_ring.c
··· 366 366 if (!buff->is_eop) { 367 367 buff_ = buff; 368 368 do { 369 + if (buff_->next >= self->size) { 370 + err = -EIO; 371 + goto err_exit; 372 + } 369 373 next_ = buff_->next, 370 374 buff_ = &self->buff_ring[next_]; 371 375 is_rsc_completed = ··· 393 389 (buff->is_lro && buff->is_cso_err)) { 394 390 buff_ = buff; 395 391 do { 392 + if (buff_->next >= self->size) { 393 + err = -EIO; 394 + goto err_exit; 395 + } 396 396 next_ = buff_->next, 397 397 buff_ = &self->buff_ring[next_]; 398 398
+8 -15
drivers/net/ethernet/atheros/ag71xx.c
··· 1913 1913 ag->mac_reset = devm_reset_control_get(&pdev->dev, "mac"); 1914 1914 if (IS_ERR(ag->mac_reset)) { 1915 1915 netif_err(ag, probe, ndev, "missing mac reset\n"); 1916 - err = PTR_ERR(ag->mac_reset); 1917 - goto err_free; 1916 + return PTR_ERR(ag->mac_reset); 1918 1917 } 1919 1918 1920 1919 ag->mac_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); 1921 - if (!ag->mac_base) { 1922 - err = -ENOMEM; 1923 - goto err_free; 1924 - } 1920 + if (!ag->mac_base) 1921 + return -ENOMEM; 1925 1922 1926 1923 ndev->irq = platform_get_irq(pdev, 0); 1927 1924 err = devm_request_irq(&pdev->dev, ndev->irq, ag71xx_interrupt, ··· 1926 1929 if (err) { 1927 1930 netif_err(ag, probe, ndev, "unable to request IRQ %d\n", 1928 1931 ndev->irq); 1929 - goto err_free; 1932 + return err; 1930 1933 } 1931 1934 1932 1935 ndev->netdev_ops = &ag71xx_netdev_ops; ··· 1954 1957 ag->stop_desc = dmam_alloc_coherent(&pdev->dev, 1955 1958 sizeof(struct ag71xx_desc), 1956 1959 &ag->stop_desc_dma, GFP_KERNEL); 1957 - if (!ag->stop_desc) { 1958 - err = -ENOMEM; 1959 - goto err_free; 1960 - } 1960 + if (!ag->stop_desc) 1961 + return -ENOMEM; 1961 1962 1962 1963 ag->stop_desc->data = 0; 1963 1964 ag->stop_desc->ctrl = 0; ··· 1970 1975 err = of_get_phy_mode(np, &ag->phy_if_mode); 1971 1976 if (err) { 1972 1977 netif_err(ag, probe, ndev, "missing phy-mode property in DT\n"); 1973 - goto err_free; 1978 + return err; 1974 1979 } 1975 1980 1976 1981 netif_napi_add(ndev, &ag->napi, ag71xx_poll, AG71XX_NAPI_WEIGHT); ··· 1978 1983 err = clk_prepare_enable(ag->clk_eth); 1979 1984 if (err) { 1980 1985 netif_err(ag, probe, ndev, "Failed to enable eth clk.\n"); 1981 - goto err_free; 1986 + return err; 1982 1987 } 1983 1988 1984 1989 ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, 0); ··· 2014 2019 ag71xx_mdio_remove(ag); 2015 2020 err_put_clk: 2016 2021 clk_disable_unprepare(ag->clk_eth); 2017 - err_free: 2018 - free_netdev(ndev); 2019 2022 return err; 2020 2023 } 2021 2024
+7 -5
drivers/net/ethernet/freescale/fman/fman_port.c
··· 1805 1805 fman = dev_get_drvdata(&fm_pdev->dev); 1806 1806 if (!fman) { 1807 1807 err = -EINVAL; 1808 - goto return_err; 1808 + goto put_device; 1809 1809 } 1810 1810 1811 1811 err = of_property_read_u32(port_node, "cell-index", &val); ··· 1813 1813 dev_err(port->dev, "%s: reading cell-index for %pOF failed\n", 1814 1814 __func__, port_node); 1815 1815 err = -EINVAL; 1816 - goto return_err; 1816 + goto put_device; 1817 1817 } 1818 1818 port_id = (u8)val; 1819 1819 port->dts_params.id = port_id; ··· 1847 1847 } else { 1848 1848 dev_err(port->dev, "%s: Illegal port type\n", __func__); 1849 1849 err = -EINVAL; 1850 - goto return_err; 1850 + goto put_device; 1851 1851 } 1852 1852 1853 1853 port->dts_params.type = port_type; ··· 1861 1861 dev_err(port->dev, "%s: incorrect qman-channel-id\n", 1862 1862 __func__); 1863 1863 err = -EINVAL; 1864 - goto return_err; 1864 + goto put_device; 1865 1865 } 1866 1866 port->dts_params.qman_channel_id = qman_channel_id; 1867 1867 } ··· 1871 1871 dev_err(port->dev, "%s: of_address_to_resource() failed\n", 1872 1872 __func__); 1873 1873 err = -ENOMEM; 1874 - goto return_err; 1874 + goto put_device; 1875 1875 } 1876 1876 1877 1877 port->dts_params.fman = fman; ··· 1896 1896 1897 1897 return 0; 1898 1898 1899 + put_device: 1900 + put_device(&fm_pdev->dev); 1899 1901 return_err: 1900 1902 of_node_put(port_node); 1901 1903 free_port:
+6
drivers/net/ethernet/intel/igc/igc_main.c
··· 5467 5467 mod_timer(&adapter->watchdog_timer, jiffies + 1); 5468 5468 } 5469 5469 5470 + if (icr & IGC_ICR_TS) 5471 + igc_tsync_interrupt(adapter); 5472 + 5470 5473 napi_schedule(&q_vector->napi); 5471 5474 5472 5475 return IRQ_HANDLED; ··· 5512 5509 if (!test_bit(__IGC_DOWN, &adapter->state)) 5513 5510 mod_timer(&adapter->watchdog_timer, jiffies + 1); 5514 5511 } 5512 + 5513 + if (icr & IGC_ICR_TS) 5514 + igc_tsync_interrupt(adapter); 5515 5515 5516 5516 napi_schedule(&q_vector->napi); 5517 5517
+14 -1
drivers/net/ethernet/intel/igc/igc_ptp.c
··· 768 768 */ 769 769 static bool igc_is_crosststamp_supported(struct igc_adapter *adapter) 770 770 { 771 - return IS_ENABLED(CONFIG_X86_TSC) ? pcie_ptm_enabled(adapter->pdev) : false; 771 + if (!IS_ENABLED(CONFIG_X86_TSC)) 772 + return false; 773 + 774 + /* FIXME: it was noticed that enabling support for PCIe PTM in 775 + * some i225-V models could cause lockups when bringing the 776 + * interface up/down. There should be no downsides to 777 + * disabling crosstimestamping support for i225-V, as it 778 + * doesn't have any PTP support. That way we gain some time 779 + * while root causing the issue. 780 + */ 781 + if (adapter->pdev->device == IGC_DEV_ID_I225_V) 782 + return false; 783 + 784 + return pcie_ptm_enabled(adapter->pdev); 772 785 } 773 786 774 787 static struct system_counterval_t igc_device_tstamp_to_system(u64 tstamp)
+1 -1
drivers/net/ethernet/lantiq_xrx200.c
··· 224 224 skb->protocol = eth_type_trans(skb, net_dev); 225 225 netif_receive_skb(skb); 226 226 net_dev->stats.rx_packets++; 227 - net_dev->stats.rx_bytes += len - ETH_FCS_LEN; 227 + net_dev->stats.rx_bytes += len; 228 228 229 229 return 0; 230 230 }
+2 -3
drivers/net/ethernet/mellanox/mlx5/core/en.h
··· 783 783 DECLARE_BITMAP(state, MLX5E_CHANNEL_NUM_STATES); 784 784 int ix; 785 785 int cpu; 786 + /* Sync between icosq recovery and XSK enable/disable. */ 787 + struct mutex icosq_recovery_lock; 786 788 }; 787 789 788 790 struct mlx5e_ptp; ··· 1016 1014 void mlx5e_destroy_rq(struct mlx5e_rq *rq); 1017 1015 1018 1016 struct mlx5e_sq_param; 1019 - int mlx5e_open_icosq(struct mlx5e_channel *c, struct mlx5e_params *params, 1020 - struct mlx5e_sq_param *param, struct mlx5e_icosq *sq); 1021 - void mlx5e_close_icosq(struct mlx5e_icosq *sq); 1022 1017 int mlx5e_open_xdpsq(struct mlx5e_channel *c, struct mlx5e_params *params, 1023 1018 struct mlx5e_sq_param *param, struct xsk_buff_pool *xsk_pool, 1024 1019 struct mlx5e_xdpsq *sq, bool is_redirect);
+2
drivers/net/ethernet/mellanox/mlx5/core/en/health.h
··· 30 30 void mlx5e_reporter_icosq_cqe_err(struct mlx5e_icosq *icosq); 31 31 void mlx5e_reporter_rq_cqe_err(struct mlx5e_rq *rq); 32 32 void mlx5e_reporter_rx_timeout(struct mlx5e_rq *rq); 33 + void mlx5e_reporter_icosq_suspend_recovery(struct mlx5e_channel *c); 34 + void mlx5e_reporter_icosq_resume_recovery(struct mlx5e_channel *c); 33 35 34 36 #define MLX5E_REPORTER_PER_Q_MAX_LEN 256 35 37
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.h
··· 66 66 67 67 static inline void 68 68 mlx5e_rep_tc_receive(struct mlx5_cqe64 *cqe, struct mlx5e_rq *rq, 69 - struct sk_buff *skb) {} 69 + struct sk_buff *skb) { napi_gro_receive(rq->cq.napi, skb); } 70 70 71 71 #endif /* CONFIG_MLX5_CLS_ACT */ 72 72
+34 -1
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
··· 62 62 63 63 static int mlx5e_rx_reporter_err_icosq_cqe_recover(void *ctx) 64 64 { 65 + struct mlx5e_rq *xskrq = NULL; 65 66 struct mlx5_core_dev *mdev; 66 67 struct mlx5e_icosq *icosq; 67 68 struct net_device *dev; ··· 71 70 int err; 72 71 73 72 icosq = ctx; 73 + 74 + mutex_lock(&icosq->channel->icosq_recovery_lock); 75 + 76 + /* mlx5e_close_rq cancels this work before RQ and ICOSQ are killed. */ 74 77 rq = &icosq->channel->rq; 78 + if (test_bit(MLX5E_RQ_STATE_ENABLED, &icosq->channel->xskrq.state)) 79 + xskrq = &icosq->channel->xskrq; 75 80 mdev = icosq->channel->mdev; 76 81 dev = icosq->channel->netdev; 77 82 err = mlx5_core_query_sq_state(mdev, icosq->sqn, &state); ··· 91 84 goto out; 92 85 93 86 mlx5e_deactivate_rq(rq); 87 + if (xskrq) 88 + mlx5e_deactivate_rq(xskrq); 89 + 94 90 err = mlx5e_wait_for_icosq_flush(icosq); 95 91 if (err) 96 92 goto out; ··· 107 97 goto out; 108 98 109 99 mlx5e_reset_icosq_cc_pc(icosq); 100 + 110 101 mlx5e_free_rx_in_progress_descs(rq); 102 + if (xskrq) 103 + mlx5e_free_rx_in_progress_descs(xskrq); 104 + 111 105 clear_bit(MLX5E_SQ_STATE_RECOVERING, &icosq->state); 112 106 mlx5e_activate_icosq(icosq); 113 - mlx5e_activate_rq(rq); 114 107 108 + mlx5e_activate_rq(rq); 115 109 rq->stats->recover++; 110 + 111 + if (xskrq) { 112 + mlx5e_activate_rq(xskrq); 113 + xskrq->stats->recover++; 114 + } 115 + 116 + mutex_unlock(&icosq->channel->icosq_recovery_lock); 117 + 116 118 return 0; 117 119 out: 118 120 clear_bit(MLX5E_SQ_STATE_RECOVERING, &icosq->state); 121 + mutex_unlock(&icosq->channel->icosq_recovery_lock); 119 122 return err; 120 123 } 121 124 ··· 727 704 snprintf(err_str, sizeof(err_str), "ERR CQE on ICOSQ: 0x%x", icosq->sqn); 728 705 729 706 mlx5e_health_report(priv, priv->rx_reporter, err_str, &err_ctx); 707 + } 708 + 709 + void mlx5e_reporter_icosq_suspend_recovery(struct mlx5e_channel *c) 710 + { 711 + mutex_lock(&c->icosq_recovery_lock); 712 + } 713 + 714 + void mlx5e_reporter_icosq_resume_recovery(struct mlx5e_channel *c) 715 + { 716 + mutex_unlock(&c->icosq_recovery_lock); 730 717 } 731 718 732 719 static const struct devlink_health_reporter_ops mlx5_rx_reporter_ops = {
+9 -1
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
··· 466 466 return mlx5e_health_fmsg_named_obj_nest_end(fmsg); 467 467 } 468 468 469 + static int mlx5e_tx_reporter_timeout_dump(struct mlx5e_priv *priv, struct devlink_fmsg *fmsg, 470 + void *ctx) 471 + { 472 + struct mlx5e_tx_timeout_ctx *to_ctx = ctx; 473 + 474 + return mlx5e_tx_reporter_dump_sq(priv, fmsg, to_ctx->sq); 475 + } 476 + 469 477 static int mlx5e_tx_reporter_dump_all_sqs(struct mlx5e_priv *priv, 470 478 struct devlink_fmsg *fmsg) 471 479 { ··· 569 561 to_ctx.sq = sq; 570 562 err_ctx.ctx = &to_ctx; 571 563 err_ctx.recover = mlx5e_tx_reporter_timeout_recover; 572 - err_ctx.dump = mlx5e_tx_reporter_dump_sq; 564 + err_ctx.dump = mlx5e_tx_reporter_timeout_dump; 573 565 snprintf(err_str, sizeof(err_str), 574 566 "TX timeout on queue: %d, SQ: 0x%x, CQ: 0x%x, SQ Cons: 0x%x SQ Prod: 0x%x, usecs since last trans: %u", 575 567 sq->ch_ix, sq->sqn, sq->cq.mcq.cqn, sq->cc, sq->pc,
+15 -1
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c
··· 4 4 #include "setup.h" 5 5 #include "en/params.h" 6 6 #include "en/txrx.h" 7 + #include "en/health.h" 7 8 8 9 /* It matches XDP_UMEM_MIN_CHUNK_SIZE, but as this constant is private and may 9 10 * change unexpectedly, and mlx5e has a minimum valid stride size for striding ··· 171 170 172 171 void mlx5e_activate_xsk(struct mlx5e_channel *c) 173 172 { 173 + /* ICOSQ recovery deactivates RQs. Suspend the recovery to avoid 174 + * activating XSKRQ in the middle of recovery. 175 + */ 176 + mlx5e_reporter_icosq_suspend_recovery(c); 174 177 set_bit(MLX5E_RQ_STATE_ENABLED, &c->xskrq.state); 178 + mlx5e_reporter_icosq_resume_recovery(c); 179 + 175 180 /* TX queue is created active. */ 176 181 177 182 spin_lock_bh(&c->async_icosq_lock); ··· 187 180 188 181 void mlx5e_deactivate_xsk(struct mlx5e_channel *c) 189 182 { 190 - mlx5e_deactivate_rq(&c->xskrq); 183 + /* ICOSQ recovery may reactivate XSKRQ if clear_bit is called in the 184 + * middle of recovery. Suspend the recovery to avoid it. 185 + */ 186 + mlx5e_reporter_icosq_suspend_recovery(c); 187 + clear_bit(MLX5E_RQ_STATE_ENABLED, &c->xskrq.state); 188 + mlx5e_reporter_icosq_resume_recovery(c); 189 + synchronize_net(); /* Sync with NAPI to prevent mlx5e_post_rx_wqes. */ 190 + 191 191 /* TX queue is disabled on close. */ 192 192 }
+32 -16
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 1087 1087 void mlx5e_close_rq(struct mlx5e_rq *rq) 1088 1088 { 1089 1089 cancel_work_sync(&rq->dim.work); 1090 - if (rq->icosq) 1091 - cancel_work_sync(&rq->icosq->recover_work); 1092 1090 cancel_work_sync(&rq->recover_work); 1093 1091 mlx5e_destroy_rq(rq); 1094 1092 mlx5e_free_rx_descs(rq); ··· 1214 1216 mlx5e_reporter_icosq_cqe_err(sq); 1215 1217 } 1216 1218 1219 + static void mlx5e_async_icosq_err_cqe_work(struct work_struct *recover_work) 1220 + { 1221 + struct mlx5e_icosq *sq = container_of(recover_work, struct mlx5e_icosq, 1222 + recover_work); 1223 + 1224 + /* Not implemented yet. */ 1225 + 1226 + netdev_warn(sq->channel->netdev, "async_icosq recovery is not implemented\n"); 1227 + } 1228 + 1217 1229 static int mlx5e_alloc_icosq(struct mlx5e_channel *c, 1218 1230 struct mlx5e_sq_param *param, 1219 - struct mlx5e_icosq *sq) 1231 + struct mlx5e_icosq *sq, 1232 + work_func_t recover_work_func) 1220 1233 { 1221 1234 void *sqc_wq = MLX5_ADDR_OF(sqc, param->sqc, wq); 1222 1235 struct mlx5_core_dev *mdev = c->mdev; ··· 1248 1239 if (err) 1249 1240 goto err_sq_wq_destroy; 1250 1241 1251 - INIT_WORK(&sq->recover_work, mlx5e_icosq_err_cqe_work); 1242 + INIT_WORK(&sq->recover_work, recover_work_func); 1252 1243 1253 1244 return 0; 1254 1245 ··· 1584 1575 mlx5e_reporter_tx_err_cqe(sq); 1585 1576 } 1586 1577 1587 - int mlx5e_open_icosq(struct mlx5e_channel *c, struct mlx5e_params *params, 1588 - struct mlx5e_sq_param *param, struct mlx5e_icosq *sq) 1578 + static int mlx5e_open_icosq(struct mlx5e_channel *c, struct mlx5e_params *params, 1579 + struct mlx5e_sq_param *param, struct mlx5e_icosq *sq, 1580 + work_func_t recover_work_func) 1589 1581 { 1590 1582 struct mlx5e_create_sq_param csp = {}; 1591 1583 int err; 1592 1584 1593 - err = mlx5e_alloc_icosq(c, param, sq); 1585 + err = mlx5e_alloc_icosq(c, param, sq, recover_work_func); 1594 1586 if (err) 1595 1587 return err; 1596 1588 ··· 1630 1620 synchronize_net(); /* Sync with NAPI. */ 1631 1621 } 1632 1622 1633 - void mlx5e_close_icosq(struct mlx5e_icosq *sq) 1623 + static void mlx5e_close_icosq(struct mlx5e_icosq *sq) 1634 1624 { 1635 1625 struct mlx5e_channel *c = sq->channel; 1636 1626 ··· 2094 2084 2095 2085 spin_lock_init(&c->async_icosq_lock); 2096 2086 2097 - err = mlx5e_open_icosq(c, params, &cparam->async_icosq, &c->async_icosq); 2087 + err = mlx5e_open_icosq(c, params, &cparam->async_icosq, &c->async_icosq, 2088 + mlx5e_async_icosq_err_cqe_work); 2098 2089 if (err) 2099 2090 goto err_close_xdpsq_cq; 2100 2091 2101 - err = mlx5e_open_icosq(c, params, &cparam->icosq, &c->icosq); 2092 + mutex_init(&c->icosq_recovery_lock); 2093 + 2094 + err = mlx5e_open_icosq(c, params, &cparam->icosq, &c->icosq, 2095 + mlx5e_icosq_err_cqe_work); 2102 2096 if (err) 2103 2097 goto err_close_async_icosq; 2104 2098 ··· 2170 2156 mlx5e_close_xdpsq(&c->xdpsq); 2171 2157 if (c->xdp) 2172 2158 mlx5e_close_xdpsq(&c->rq_xdpsq); 2159 + /* The same ICOSQ is used for UMRs for both RQ and XSKRQ. */ 2160 + cancel_work_sync(&c->icosq.recover_work); 2173 2161 mlx5e_close_rq(&c->rq); 2174 2162 mlx5e_close_sqs(c); 2175 2163 mlx5e_close_icosq(&c->icosq); 2164 + mutex_destroy(&c->icosq_recovery_lock); 2176 2165 mlx5e_close_icosq(&c->async_icosq); 2177 2166 if (c->xdp) 2178 2167 mlx5e_close_cq(&c->rq_xdpsq.cq); ··· 3741 3724 3742 3725 static int mlx5e_handle_feature(struct net_device *netdev, 3743 3726 netdev_features_t *features, 3744 - netdev_features_t wanted_features, 3745 3727 netdev_features_t feature, 3746 3728 mlx5e_feature_handler feature_handler) 3747 3729 { 3748 - netdev_features_t changes = wanted_features ^ netdev->features; 3749 - bool enable = !!(wanted_features & feature); 3730 + netdev_features_t changes = *features ^ netdev->features; 3731 + bool enable = !!(*features & feature); 3750 3732 int err; 3751 3733 3752 3734 if (!(changes & feature)) ··· 3753 3737 3754 3738 err = feature_handler(netdev, enable); 3755 3739 if (err) { 3740 + MLX5E_SET_FEATURE(features, feature, !enable); 3756 3741 netdev_err(netdev, "%s feature %pNF failed, err %d\n", 3757 3742 enable ? "Enable" : "Disable", &feature, err); 3758 3743 return err; 3759 3744 } 3760 3745 3761 - MLX5E_SET_FEATURE(features, feature, enable); 3762 3746 return 0; 3763 3747 } 3764 3748 3765 3749 int mlx5e_set_features(struct net_device *netdev, netdev_features_t features) 3766 3750 { 3767 - netdev_features_t oper_features = netdev->features; 3751 + netdev_features_t oper_features = features; 3768 3752 int err = 0; 3769 3753 3770 3754 #define MLX5E_HANDLE_FEATURE(feature, handler) \ 3771 - mlx5e_handle_feature(netdev, &oper_features, features, feature, handler) 3755 + mlx5e_handle_feature(netdev, &oper_features, feature, handler) 3772 3756 3773 3757 err |= MLX5E_HANDLE_FEATURE(NETIF_F_LRO, set_feature_lro); 3774 3758 err |= MLX5E_HANDLE_FEATURE(NETIF_F_GRO_HW, set_feature_hw_gro);
+17 -16
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
··· 1196 1196 if (attr->flags & MLX5_ESW_ATTR_FLAG_SLOW_PATH) 1197 1197 goto offload_rule_0; 1198 1198 1199 - if (flow_flag_test(flow, CT)) { 1200 - mlx5_tc_ct_delete_flow(get_ct_priv(flow->priv), flow, attr); 1201 - return; 1202 - } 1203 - 1204 - if (flow_flag_test(flow, SAMPLE)) { 1205 - mlx5e_tc_sample_unoffload(get_sample_priv(flow->priv), flow->rule[0], attr); 1206 - return; 1207 - } 1208 - 1209 1199 if (attr->esw_attr->split_count) 1210 1200 mlx5_eswitch_del_fwd_rule(esw, flow->rule[1], attr); 1211 1201 1202 + if (flow_flag_test(flow, CT)) 1203 + mlx5_tc_ct_delete_flow(get_ct_priv(flow->priv), flow, attr); 1204 + else if (flow_flag_test(flow, SAMPLE)) 1205 + mlx5e_tc_sample_unoffload(get_sample_priv(flow->priv), flow->rule[0], attr); 1206 + else 1212 1207 offload_rule_0: 1213 - mlx5_eswitch_del_offloaded_rule(esw, flow->rule[0], attr); 1208 + mlx5_eswitch_del_offloaded_rule(esw, flow->rule[0], attr); 1214 1209 } 1215 1210 1216 1211 struct mlx5_flow_handle * ··· 1440 1445 MLX5_FLOW_NAMESPACE_FDB, VPORT_TO_REG, 1441 1446 metadata); 1442 1447 if (err) 1443 - return err; 1448 + goto err_out; 1449 + 1450 + attr->action |= MLX5_FLOW_CONTEXT_ACTION_MOD_HDR; 1444 1451 } 1445 1452 } 1446 1453 ··· 1458 1461 if (attr->chain) { 1459 1462 NL_SET_ERR_MSG_MOD(extack, 1460 1463 "Internal port rule is only supported on chain 0"); 1461 - return -EOPNOTSUPP; 1464 + err = -EOPNOTSUPP; 1465 + goto err_out; 1462 1466 } 1463 1467 1464 1468 if (attr->dest_chain) { 1465 1469 NL_SET_ERR_MSG_MOD(extack, 1466 1470 "Internal port rule offload doesn't support goto action"); 1467 - return -EOPNOTSUPP; 1471 + err = -EOPNOTSUPP; 1472 + goto err_out; 1468 1473 } 1469 1474 1470 1475 int_port = mlx5e_tc_int_port_get(mlx5e_get_int_port_priv(priv), ··· 1474 1475 flow_flag_test(flow, EGRESS) ? 1475 1476 MLX5E_TC_INT_PORT_EGRESS : 1476 1477 MLX5E_TC_INT_PORT_INGRESS); 1477 - if (IS_ERR(int_port)) 1478 - return PTR_ERR(int_port); 1478 + if (IS_ERR(int_port)) { 1479 + err = PTR_ERR(int_port); 1480 + goto err_out; 1481 + } 1479 1482 1480 1483 esw_attr->int_port = int_port; 1481 1484 }
+3
drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c
··· 121 121 122 122 u32 mlx5_chains_get_prio_range(struct mlx5_fs_chains *chains) 123 123 { 124 + if (!mlx5_chains_prios_supported(chains)) 125 + return 1; 126 + 124 127 if (mlx5_chains_ignore_flow_level_supported(chains)) 125 128 return UINT_MAX; 126 129
+6 -5
drivers/net/ethernet/mellanox/mlx5/core/main.c
··· 1809 1809 1810 1810 int mlx5_recover_device(struct mlx5_core_dev *dev) 1811 1811 { 1812 - int ret = -EIO; 1812 + if (!mlx5_core_is_sf(dev)) { 1813 + mlx5_pci_disable_device(dev); 1814 + if (mlx5_pci_slot_reset(dev->pdev) != PCI_ERS_RESULT_RECOVERED) 1815 + return -EIO; 1816 + } 1813 1817 1814 - mlx5_pci_disable_device(dev); 1815 - if (mlx5_pci_slot_reset(dev->pdev) == PCI_ERS_RESULT_RECOVERED) 1816 - ret = mlx5_load_one(dev); 1817 - return ret; 1818 + return mlx5_load_one(dev); 1818 1819 } 1819 1820 1820 1821 static struct pci_driver mlx5_core_driver = {
+3 -3
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
··· 356 356 new_irq = irq_pool_create_irq(pool, affinity); 357 357 if (IS_ERR(new_irq)) { 358 358 if (!least_loaded_irq) { 359 - mlx5_core_err(pool->dev, "Didn't find IRQ for cpu = %u\n", 360 - cpumask_first(affinity)); 359 + mlx5_core_err(pool->dev, "Didn't find a matching IRQ. err = %ld\n", 360 + PTR_ERR(new_irq)); 361 361 mutex_unlock(&pool->lock); 362 362 return new_irq; 363 363 } ··· 398 398 cpumask_copy(irq->mask, affinity); 399 399 if (!irq_pool_is_sf_pool(pool) && !pool->xa_num_irqs.max && 400 400 cpumask_empty(irq->mask)) 401 - cpumask_set_cpu(0, irq->mask); 401 + cpumask_set_cpu(cpumask_first(cpu_online_mask), irq->mask); 402 402 irq_set_affinity_hint(irq->irqn, irq->mask); 403 403 unlock: 404 404 mutex_unlock(&pool->lock);
+4 -5
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c
··· 2 2 /* Copyright (c) 2019 Mellanox Technologies. */ 3 3 4 4 #include <linux/mlx5/eswitch.h> 5 + #include <linux/err.h> 5 6 #include "dr_types.h" 6 7 7 8 #define DR_DOMAIN_SW_STEERING_SUPPORTED(dmn, dmn_type) \ ··· 73 72 } 74 73 75 74 dmn->uar = mlx5_get_uars_page(dmn->mdev); 76 - if (!dmn->uar) { 75 + if (IS_ERR(dmn->uar)) { 77 76 mlx5dr_err(dmn, "Couldn't allocate UAR\n"); 78 - ret = -ENOMEM; 77 + ret = PTR_ERR(dmn->uar); 79 78 goto clean_pd; 80 79 } 81 80 ··· 164 163 165 164 static int dr_domain_query_esw_mngr(struct mlx5dr_domain *dmn) 166 165 { 167 - return dr_domain_query_vport(dmn, 168 - dmn->info.caps.is_ecpf ? MLX5_VPORT_ECPF : 0, 169 - false, 166 + return dr_domain_query_vport(dmn, 0, false, 170 167 &dmn->info.caps.vports.esw_manager_caps); 171 168 } 172 169
+1 -1
drivers/net/ethernet/pensando/ionic/ionic_lif.c
··· 3135 3135 return -EINVAL; 3136 3136 } 3137 3137 3138 - lif->dbid_inuse = bitmap_alloc(lif->dbid_count, GFP_KERNEL); 3138 + lif->dbid_inuse = bitmap_zalloc(lif->dbid_count, GFP_KERNEL); 3139 3139 if (!lif->dbid_inuse) { 3140 3140 dev_err(dev, "Failed alloc doorbell id bitmap, aborting\n"); 3141 3141 return -ENOMEM;
+2 -2
drivers/net/phy/fixed_phy.c
··· 239 239 /* Check if we have a GPIO associated with this fixed phy */ 240 240 if (!gpiod) { 241 241 gpiod = fixed_phy_get_gpiod(np); 242 - if (IS_ERR(gpiod)) 243 - return ERR_CAST(gpiod); 242 + if (!gpiod) 243 + return ERR_PTR(-EINVAL); 244 244 } 245 245 246 246 /* Get the next available PHY address, up to PHY_MAX_ADDR */
+2 -2
drivers/net/usb/pegasus.c
··· 493 493 goto goon; 494 494 495 495 rx_status = buf[count - 2]; 496 - if (rx_status & 0x1e) { 496 + if (rx_status & 0x1c) { 497 497 netif_dbg(pegasus, rx_err, net, 498 498 "RX packet error %x\n", rx_status); 499 499 net->stats.rx_errors++; 500 - if (rx_status & 0x06) /* long or runt */ 500 + if (rx_status & 0x04) /* runt */ 501 501 net->stats.rx_length_errors++; 502 502 if (rx_status & 0x08) 503 503 net->stats.rx_crc_errors++;
+20 -9
drivers/nfc/st21nfca/i2c.c
··· 524 524 phy->gpiod_ena = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); 525 525 if (IS_ERR(phy->gpiod_ena)) { 526 526 nfc_err(dev, "Unable to get ENABLE GPIO\n"); 527 - return PTR_ERR(phy->gpiod_ena); 527 + r = PTR_ERR(phy->gpiod_ena); 528 + goto out_free; 528 529 } 529 530 530 531 phy->se_status.is_ese_present = ··· 536 535 r = st21nfca_hci_platform_init(phy); 537 536 if (r < 0) { 538 537 nfc_err(&client->dev, "Unable to reboot st21nfca\n"); 539 - return r; 538 + goto out_free; 540 539 } 541 540 542 541 r = devm_request_threaded_irq(&client->dev, client->irq, NULL, ··· 545 544 ST21NFCA_HCI_DRIVER_NAME, phy); 546 545 if (r < 0) { 547 546 nfc_err(&client->dev, "Unable to register IRQ handler\n"); 548 - return r; 547 + goto out_free; 549 548 } 550 549 551 - return st21nfca_hci_probe(phy, &i2c_phy_ops, LLC_SHDLC_NAME, 552 - ST21NFCA_FRAME_HEADROOM, 553 - ST21NFCA_FRAME_TAILROOM, 554 - ST21NFCA_HCI_LLC_MAX_PAYLOAD, 555 - &phy->hdev, 556 - &phy->se_status); 550 + r = st21nfca_hci_probe(phy, &i2c_phy_ops, LLC_SHDLC_NAME, 551 + ST21NFCA_FRAME_HEADROOM, 552 + ST21NFCA_FRAME_TAILROOM, 553 + ST21NFCA_HCI_LLC_MAX_PAYLOAD, 554 + &phy->hdev, 555 + &phy->se_status); 556 + if (r) 557 + goto out_free; 558 + 559 + return 0; 560 + 561 + out_free: 562 + kfree_skb(phy->pending_skb); 563 + return r; 557 564 } 558 565 559 566 static int st21nfca_hci_i2c_remove(struct i2c_client *client) ··· 572 563 573 564 if (phy->powered) 574 565 st21nfca_hci_i2c_disable(phy); 566 + if (phy->pending_skb) 567 + kfree_skb(phy->pending_skb); 575 568 576 569 return 0; 577 570 }
+3 -3
include/net/sctp/sctp.h
··· 105 105 int sctp_asconf_mgmt(struct sctp_sock *, struct sctp_sockaddr_entry *); 106 106 struct sk_buff *sctp_skb_recv_datagram(struct sock *, int, int, int *); 107 107 108 + typedef int (*sctp_callback_t)(struct sctp_endpoint *, struct sctp_transport *, void *); 108 109 void sctp_transport_walk_start(struct rhashtable_iter *iter); 109 110 void sctp_transport_walk_stop(struct rhashtable_iter *iter); 110 111 struct sctp_transport *sctp_transport_get_next(struct net *net, ··· 116 115 struct net *net, 117 116 const union sctp_addr *laddr, 118 117 const union sctp_addr *paddr, void *p); 119 - int sctp_for_each_transport(int (*cb)(struct sctp_transport *, void *), 120 - int (*cb_done)(struct sctp_transport *, void *), 121 - struct net *net, int *pos, void *p); 118 + int sctp_transport_traverse_process(sctp_callback_t cb, sctp_callback_t cb_done, 119 + struct net *net, int *pos, void *p); 122 120 int sctp_for_each_endpoint(int (*cb)(struct sctp_endpoint *, void *), void *p); 123 121 int sctp_get_sctp_info(struct sock *sk, struct sctp_association *asoc, 124 122 struct sctp_info *info);
+2 -1
include/net/sctp/structs.h
··· 1355 1355 reconf_enable:1; 1356 1356 1357 1357 __u8 strreset_enable; 1358 + struct rcu_head rcu; 1358 1359 }; 1359 1360 1360 1361 /* Recover the outter endpoint structure. */ ··· 1371 1370 struct sctp_endpoint *sctp_endpoint_new(struct sock *, gfp_t); 1372 1371 void sctp_endpoint_free(struct sctp_endpoint *); 1373 1372 void sctp_endpoint_put(struct sctp_endpoint *); 1374 - void sctp_endpoint_hold(struct sctp_endpoint *); 1373 + int sctp_endpoint_hold(struct sctp_endpoint *ep); 1375 1374 void sctp_endpoint_add_asoc(struct sctp_endpoint *, struct sctp_association *); 1376 1375 struct sctp_association *sctp_endpoint_lookup_assoc( 1377 1376 const struct sctp_endpoint *ep,
+3 -3
include/uapi/linux/nfc.h
··· 263 263 #define NFC_SE_ENABLED 0x1 264 264 265 265 struct sockaddr_nfc { 266 - sa_family_t sa_family; 266 + __kernel_sa_family_t sa_family; 267 267 __u32 dev_idx; 268 268 __u32 target_idx; 269 269 __u32 nfc_protocol; ··· 271 271 272 272 #define NFC_LLCP_MAX_SERVICE_NAME 63 273 273 struct sockaddr_nfc_llcp { 274 - sa_family_t sa_family; 274 + __kernel_sa_family_t sa_family; 275 275 __u32 dev_idx; 276 276 __u32 target_idx; 277 277 __u32 nfc_protocol; 278 278 __u8 dsap; /* Destination SAP, if known */ 279 279 __u8 ssap; /* Source SAP to be bound to */ 280 280 char service_name[NFC_LLCP_MAX_SERVICE_NAME]; /* Service name URI */; 281 - size_t service_name_len; 281 + __kernel_size_t service_name_len; 282 282 }; 283 283 284 284 /* NFC socket protocols */
+32
net/bridge/br_multicast.c
··· 4522 4522 } 4523 4523 #endif 4524 4524 4525 + void br_multicast_set_query_intvl(struct net_bridge_mcast *brmctx, 4526 + unsigned long val) 4527 + { 4528 + unsigned long intvl_jiffies = clock_t_to_jiffies(val); 4529 + 4530 + if (intvl_jiffies < BR_MULTICAST_QUERY_INTVL_MIN) { 4531 + br_info(brmctx->br, 4532 + "trying to set multicast query interval below minimum, setting to %lu (%ums)\n", 4533 + jiffies_to_clock_t(BR_MULTICAST_QUERY_INTVL_MIN), 4534 + jiffies_to_msecs(BR_MULTICAST_QUERY_INTVL_MIN)); 4535 + intvl_jiffies = BR_MULTICAST_QUERY_INTVL_MIN; 4536 + } 4537 + 4538 + brmctx->multicast_query_interval = intvl_jiffies; 4539 + } 4540 + 4541 + void br_multicast_set_startup_query_intvl(struct net_bridge_mcast *brmctx, 4542 + unsigned long val) 4543 + { 4544 + unsigned long intvl_jiffies = clock_t_to_jiffies(val); 4545 + 4546 + if (intvl_jiffies < BR_MULTICAST_STARTUP_QUERY_INTVL_MIN) { 4547 + br_info(brmctx->br, 4548 + "trying to set multicast startup query interval below minimum, setting to %lu (%ums)\n", 4549 + jiffies_to_clock_t(BR_MULTICAST_STARTUP_QUERY_INTVL_MIN), 4550 + jiffies_to_msecs(BR_MULTICAST_STARTUP_QUERY_INTVL_MIN)); 4551 + intvl_jiffies = BR_MULTICAST_STARTUP_QUERY_INTVL_MIN; 4552 + } 4553 + 4554 + brmctx->multicast_startup_query_interval = intvl_jiffies; 4555 + } 4556 + 4525 4557 /** 4526 4558 * br_multicast_list_adjacent - Returns snooped multicast addresses 4527 4559 * @dev: The bridge port adjacent to which to retrieve addresses
+2 -2
net/bridge/br_netlink.c
··· 1357 1357 if (data[IFLA_BR_MCAST_QUERY_INTVL]) { 1358 1358 u64 val = nla_get_u64(data[IFLA_BR_MCAST_QUERY_INTVL]); 1359 1359 1360 - br->multicast_ctx.multicast_query_interval = clock_t_to_jiffies(val); 1360 + br_multicast_set_query_intvl(&br->multicast_ctx, val); 1361 1361 } 1362 1362 1363 1363 if (data[IFLA_BR_MCAST_QUERY_RESPONSE_INTVL]) { ··· 1369 1369 if (data[IFLA_BR_MCAST_STARTUP_QUERY_INTVL]) { 1370 1370 u64 val = nla_get_u64(data[IFLA_BR_MCAST_STARTUP_QUERY_INTVL]); 1371 1371 1372 - br->multicast_ctx.multicast_startup_query_interval = clock_t_to_jiffies(val); 1372 + br_multicast_set_startup_query_intvl(&br->multicast_ctx, val); 1373 1373 } 1374 1374 1375 1375 if (data[IFLA_BR_MCAST_STATS_ENABLED]) {
+9 -3
net/bridge/br_private.h
··· 28 28 #define BR_MAX_PORTS (1<<BR_PORT_BITS) 29 29 30 30 #define BR_MULTICAST_DEFAULT_HASH_MAX 4096 31 + #define BR_MULTICAST_QUERY_INTVL_MIN msecs_to_jiffies(1000) 32 + #define BR_MULTICAST_STARTUP_QUERY_INTVL_MIN BR_MULTICAST_QUERY_INTVL_MIN 31 33 32 34 #define BR_HWDOM_MAX BITS_PER_LONG 33 35 ··· 965 963 int nest_attr); 966 964 size_t br_multicast_querier_state_size(void); 967 965 size_t br_rports_size(const struct net_bridge_mcast *brmctx); 966 + void br_multicast_set_query_intvl(struct net_bridge_mcast *brmctx, 967 + unsigned long val); 968 + void br_multicast_set_startup_query_intvl(struct net_bridge_mcast *brmctx, 969 + unsigned long val); 968 970 969 971 static inline bool br_group_is_l2(const struct br_ip *group) 970 972 { ··· 1153 1147 static inline bool 1154 1148 br_multicast_ctx_vlan_global_disabled(const struct net_bridge_mcast *brmctx) 1155 1149 { 1156 - return br_opt_get(brmctx->br, BROPT_MCAST_VLAN_SNOOPING_ENABLED) && 1157 - br_multicast_ctx_is_vlan(brmctx) && 1158 - !(brmctx->vlan->priv_flags & BR_VLFLAG_GLOBAL_MCAST_ENABLED); 1150 + return br_multicast_ctx_is_vlan(brmctx) && 1151 + (!br_opt_get(brmctx->br, BROPT_MCAST_VLAN_SNOOPING_ENABLED) || 1152 + !(brmctx->vlan->priv_flags & BR_VLFLAG_GLOBAL_MCAST_ENABLED)); 1159 1153 } 1160 1154 1161 1155 static inline bool
+2 -2
net/bridge/br_sysfs_br.c
··· 658 658 static int set_query_interval(struct net_bridge *br, unsigned long val, 659 659 struct netlink_ext_ack *extack) 660 660 { 661 - br->multicast_ctx.multicast_query_interval = clock_t_to_jiffies(val); 661 + br_multicast_set_query_intvl(&br->multicast_ctx, val); 662 662 return 0; 663 663 } 664 664 ··· 706 706 static int set_startup_query_interval(struct net_bridge *br, unsigned long val, 707 707 struct netlink_ext_ack *extack) 708 708 { 709 - br->multicast_ctx.multicast_startup_query_interval = clock_t_to_jiffies(val); 709 + br_multicast_set_startup_query_intvl(&br->multicast_ctx, val); 710 710 return 0; 711 711 } 712 712
+2 -2
net/bridge/br_vlan_options.c
··· 521 521 u64 val; 522 522 523 523 val = nla_get_u64(tb[BRIDGE_VLANDB_GOPTS_MCAST_QUERY_INTVL]); 524 - v->br_mcast_ctx.multicast_query_interval = clock_t_to_jiffies(val); 524 + br_multicast_set_query_intvl(&v->br_mcast_ctx, val); 525 525 *changed = true; 526 526 } 527 527 if (tb[BRIDGE_VLANDB_GOPTS_MCAST_QUERY_RESPONSE_INTVL]) { ··· 535 535 u64 val; 536 536 537 537 val = nla_get_u64(tb[BRIDGE_VLANDB_GOPTS_MCAST_STARTUP_QUERY_INTVL]); 538 - v->br_mcast_ctx.multicast_startup_query_interval = clock_t_to_jiffies(val); 538 + br_multicast_set_startup_query_intvl(&v->br_mcast_ctx, val); 539 539 *changed = true; 540 540 } 541 541 if (tb[BRIDGE_VLANDB_GOPTS_MCAST_QUERIER]) {
+4 -6
net/ipv4/af_inet.c
··· 1994 1994 1995 1995 ip_init(); 1996 1996 1997 + /* Initialise per-cpu ipv4 mibs */ 1998 + if (init_ipv4_mibs()) 1999 + panic("%s: Cannot init ipv4 mibs\n", __func__); 2000 + 1997 2001 /* Setup TCP slab cache for open requests. */ 1998 2002 tcp_init(); 1999 2003 ··· 2028 2024 2029 2025 if (init_inet_pernet_ops()) 2030 2026 pr_crit("%s: Cannot init ipv4 inet pernet ops\n", __func__); 2031 - /* 2032 - * Initialise per-cpu ipv4 mibs 2033 - */ 2034 - 2035 - if (init_ipv4_mibs()) 2036 - pr_crit("%s: Cannot init ipv4 mibs\n", __func__); 2037 2027 2038 2028 ipv4_proc_init(); 2039 2029
+1 -1
net/ipv4/udp.c
··· 3075 3075 { 3076 3076 seq_setwidth(seq, 127); 3077 3077 if (v == SEQ_START_TOKEN) 3078 - seq_puts(seq, " sl local_address rem_address st tx_queue " 3078 + seq_puts(seq, " sl local_address rem_address st tx_queue " 3079 3079 "rx_queue tr tm->when retrnsmt uid timeout " 3080 3080 "inode ref pointer drops"); 3081 3081 else {
+2
net/ipv6/ip6_vti.c
··· 808 808 struct net *net = dev_net(dev); 809 809 struct vti6_net *ip6n = net_generic(net, vti6_net_id); 810 810 811 + memset(&p1, 0, sizeof(p1)); 812 + 811 813 switch (cmd) { 812 814 case SIOCGETTUNNEL: 813 815 if (dev == ip6n->fb_tnl_dev) {
+3
net/ipv6/raw.c
··· 1020 1020 struct raw6_sock *rp = raw6_sk(sk); 1021 1021 int val; 1022 1022 1023 + if (optlen < sizeof(val)) 1024 + return -EINVAL; 1025 + 1023 1026 if (copy_from_sockptr(&val, optval, sizeof(val))) 1024 1027 return -EFAULT; 1025 1028
+1 -1
net/ipv6/udp.c
··· 1204 1204 kfree_skb(skb); 1205 1205 return -EINVAL; 1206 1206 } 1207 - if (skb->len > cork->gso_size * UDP_MAX_SEGMENTS) { 1207 + if (datalen > cork->gso_size * UDP_MAX_SEGMENTS) { 1208 1208 kfree_skb(skb); 1209 1209 return -EINVAL; 1210 1210 }
+5 -1
net/ncsi/ncsi-netlink.c
··· 112 112 pnest = nla_nest_start_noflag(skb, NCSI_PKG_ATTR); 113 113 if (!pnest) 114 114 return -ENOMEM; 115 - nla_put_u32(skb, NCSI_PKG_ATTR_ID, np->id); 115 + rc = nla_put_u32(skb, NCSI_PKG_ATTR_ID, np->id); 116 + if (rc) { 117 + nla_nest_cancel(skb, pnest); 118 + return rc; 119 + } 116 120 if ((0x1 << np->id) == ndp->package_whitelist) 117 121 nla_put_flag(skb, NCSI_PKG_ATTR_FORCED); 118 122 cnest = nla_nest_start_noflag(skb, NCSI_PKG_ATTR_CHANNEL_LIST);
+6 -6
net/sctp/diag.c
··· 290 290 return err; 291 291 } 292 292 293 - static int sctp_sock_dump(struct sctp_transport *tsp, void *p) 293 + static int sctp_sock_dump(struct sctp_endpoint *ep, struct sctp_transport *tsp, void *p) 294 294 { 295 - struct sctp_endpoint *ep = tsp->asoc->ep; 296 295 struct sctp_comm_param *commp = p; 297 296 struct sock *sk = ep->base.sk; 298 297 struct sk_buff *skb = commp->skb; ··· 301 302 int err = 0; 302 303 303 304 lock_sock(sk); 305 + if (ep != tsp->asoc->ep) 306 + goto release; 304 307 list_for_each_entry(assoc, &ep->asocs, asocs) { 305 308 if (cb->args[4] < cb->args[1]) 306 309 goto next; ··· 345 344 return err; 346 345 } 347 346 348 - static int sctp_sock_filter(struct sctp_transport *tsp, void *p) 347 + static int sctp_sock_filter(struct sctp_endpoint *ep, struct sctp_transport *tsp, void *p) 349 348 { 350 - struct sctp_endpoint *ep = tsp->asoc->ep; 351 349 struct sctp_comm_param *commp = p; 352 350 struct sock *sk = ep->base.sk; 353 351 const struct inet_diag_req_v2 *r = commp->r; ··· 505 505 if (!(idiag_states & ~(TCPF_LISTEN | TCPF_CLOSE))) 506 506 goto done; 507 507 508 - sctp_for_each_transport(sctp_sock_filter, sctp_sock_dump, 509 - net, &pos, &commp); 508 + sctp_transport_traverse_process(sctp_sock_filter, sctp_sock_dump, 509 + net, &pos, &commp); 510 510 cb->args[2] = pos; 511 511 512 512 done:
+15 -8
net/sctp/endpointola.c
··· 184 184 } 185 185 186 186 /* Final destructor for endpoint. */ 187 + static void sctp_endpoint_destroy_rcu(struct rcu_head *head) 188 + { 189 + struct sctp_endpoint *ep = container_of(head, struct sctp_endpoint, rcu); 190 + struct sock *sk = ep->base.sk; 191 + 192 + sctp_sk(sk)->ep = NULL; 193 + sock_put(sk); 194 + 195 + kfree(ep); 196 + SCTP_DBG_OBJCNT_DEC(ep); 197 + } 198 + 187 199 static void sctp_endpoint_destroy(struct sctp_endpoint *ep) 188 200 { 189 201 struct sock *sk; ··· 225 213 if (sctp_sk(sk)->bind_hash) 226 214 sctp_put_port(sk); 227 215 228 - sctp_sk(sk)->ep = NULL; 229 - /* Give up our hold on the sock */ 230 - sock_put(sk); 231 - 232 - kfree(ep); 233 - SCTP_DBG_OBJCNT_DEC(ep); 216 + call_rcu(&ep->rcu, sctp_endpoint_destroy_rcu); 234 217 } 235 218 236 219 /* Hold a reference to an endpoint. */ 237 - void sctp_endpoint_hold(struct sctp_endpoint *ep) 220 + int sctp_endpoint_hold(struct sctp_endpoint *ep) 238 221 { 239 - refcount_inc(&ep->base.refcnt); 222 + return refcount_inc_not_zero(&ep->base.refcnt); 240 223 } 241 224 242 225 /* Release a reference to an endpoint and clean up if there are
+15 -8
net/sctp/socket.c
··· 5338 5338 } 5339 5339 EXPORT_SYMBOL_GPL(sctp_transport_lookup_process); 5340 5340 5341 - int sctp_for_each_transport(int (*cb)(struct sctp_transport *, void *), 5342 - int (*cb_done)(struct sctp_transport *, void *), 5343 - struct net *net, int *pos, void *p) { 5341 + int sctp_transport_traverse_process(sctp_callback_t cb, sctp_callback_t cb_done, 5342 + struct net *net, int *pos, void *p) 5343 + { 5344 5344 struct rhashtable_iter hti; 5345 5345 struct sctp_transport *tsp; 5346 + struct sctp_endpoint *ep; 5346 5347 int ret; 5347 5348 5348 5349 again: ··· 5352 5351 5353 5352 tsp = sctp_transport_get_idx(net, &hti, *pos + 1); 5354 5353 for (; !IS_ERR_OR_NULL(tsp); tsp = sctp_transport_get_next(net, &hti)) { 5355 - ret = cb(tsp, p); 5356 - if (ret) 5357 - break; 5354 + ep = tsp->asoc->ep; 5355 + if (sctp_endpoint_hold(ep)) { /* asoc can be peeled off */ 5356 + ret = cb(ep, tsp, p); 5357 + if (ret) 5358 + break; 5359 + sctp_endpoint_put(ep); 5360 + } 5358 5361 (*pos)++; 5359 5362 sctp_transport_put(tsp); 5360 5363 } 5361 5364 sctp_transport_walk_stop(&hti); 5362 5365 5363 5366 if (ret) { 5364 - if (cb_done && !cb_done(tsp, p)) { 5367 + if (cb_done && !cb_done(ep, tsp, p)) { 5365 5368 (*pos)++; 5369 + sctp_endpoint_put(ep); 5366 5370 sctp_transport_put(tsp); 5367 5371 goto again; 5368 5372 } 5373 + sctp_endpoint_put(ep); 5369 5374 sctp_transport_put(tsp); 5370 5375 } 5371 5376 5372 5377 return ret; 5373 5378 } 5374 - EXPORT_SYMBOL_GPL(sctp_for_each_transport); 5379 + EXPORT_SYMBOL_GPL(sctp_transport_traverse_process); 5375 5380 5376 5381 /* 7.2.1 Association Status (SCTP_STATUS) 5377 5382
+5
net/smc/smc.h
··· 180 180 u16 tx_cdc_seq; /* sequence # for CDC send */ 181 181 u16 tx_cdc_seq_fin; /* sequence # - tx completed */ 182 182 spinlock_t send_lock; /* protect wr_sends */ 183 + atomic_t cdc_pend_tx_wr; /* number of pending tx CDC wqe 184 + * - inc when post wqe, 185 + * - dec on polled tx cqe 186 + */ 187 + wait_queue_head_t cdc_pend_tx_wq; /* wakeup on no cdc_pend_tx_wr*/ 183 188 struct delayed_work tx_work; /* retry of smc_cdc_msg_send */ 184 189 u32 tx_off; /* base offset in peer rmb */ 185 190
+24 -28
net/smc/smc_cdc.c
··· 31 31 struct smc_sock *smc; 32 32 int diff; 33 33 34 - if (!conn) 35 - /* already dismissed */ 36 - return; 37 - 38 34 smc = container_of(conn, struct smc_sock, conn); 39 35 bh_lock_sock(&smc->sk); 40 36 if (!wc_status) { ··· 47 51 conn); 48 52 conn->tx_cdc_seq_fin = cdcpend->ctrl_seq; 49 53 } 54 + 55 + if (atomic_dec_and_test(&conn->cdc_pend_tx_wr) && 56 + unlikely(wq_has_sleeper(&conn->cdc_pend_tx_wq))) 57 + wake_up(&conn->cdc_pend_tx_wq); 58 + WARN_ON(atomic_read(&conn->cdc_pend_tx_wr) < 0); 59 + 50 60 smc_tx_sndbuf_nonfull(smc); 51 61 bh_unlock_sock(&smc->sk); 52 62 } ··· 109 107 conn->tx_cdc_seq++; 110 108 conn->local_tx_ctrl.seqno = conn->tx_cdc_seq; 111 109 smc_host_msg_to_cdc((struct smc_cdc_msg *)wr_buf, conn, &cfed); 110 + 111 + atomic_inc(&conn->cdc_pend_tx_wr); 112 + smp_mb__after_atomic(); /* Make sure cdc_pend_tx_wr added before post */ 113 + 112 114 rc = smc_wr_tx_send(link, (struct smc_wr_tx_pend_priv *)pend); 113 115 if (!rc) { 114 116 smc_curs_copy(&conn->rx_curs_confirmed, &cfed, conn); ··· 120 114 } else { 121 115 conn->tx_cdc_seq--; 122 116 conn->local_tx_ctrl.seqno = conn->tx_cdc_seq; 117 + atomic_dec(&conn->cdc_pend_tx_wr); 123 118 } 124 119 125 120 return rc; ··· 143 136 peer->token = htonl(local->token); 144 137 peer->prod_flags.failover_validation = 1; 145 138 139 + /* We need to set pend->conn here to make sure smc_cdc_tx_handler() 140 + * can handle properly 141 + */ 142 + smc_cdc_add_pending_send(conn, pend); 143 + 144 + atomic_inc(&conn->cdc_pend_tx_wr); 145 + smp_mb__after_atomic(); /* Make sure cdc_pend_tx_wr added before post */ 146 + 146 147 rc = smc_wr_tx_send(link, (struct smc_wr_tx_pend_priv *)pend); 148 + if (unlikely(rc)) 149 + atomic_dec(&conn->cdc_pend_tx_wr); 150 + 147 151 return rc; 148 152 } 149 153 ··· 211 193 return rc; 212 194 } 213 195 214 - static bool smc_cdc_tx_filter(struct smc_wr_tx_pend_priv *tx_pend, 215 - unsigned long data) 196 + void smc_cdc_wait_pend_tx_wr(struct smc_connection *conn) 216 197 { 217 - struct smc_connection *conn = (struct smc_connection *)data; 218 - struct smc_cdc_tx_pend *cdc_pend = 219 - (struct smc_cdc_tx_pend *)tx_pend; 220 - 221 - return cdc_pend->conn == conn; 222 - } 223 - 224 - static void smc_cdc_tx_dismisser(struct smc_wr_tx_pend_priv *tx_pend) 225 - { 226 - struct smc_cdc_tx_pend *cdc_pend = 227 - (struct smc_cdc_tx_pend *)tx_pend; 228 - 229 - cdc_pend->conn = NULL; 230 - } 231 - 232 - void smc_cdc_tx_dismiss_slots(struct smc_connection *conn) 233 - { 234 - struct smc_link *link = conn->lnk; 235 - 236 - smc_wr_tx_dismiss_slots(link, SMC_CDC_MSG_TYPE, 237 - smc_cdc_tx_filter, smc_cdc_tx_dismisser, 238 - (unsigned long)conn); 198 + wait_event(conn->cdc_pend_tx_wq, !atomic_read(&conn->cdc_pend_tx_wr)); 239 199 } 240 200 241 201 /* Send a SMC-D CDC header.
+1 -1
net/smc/smc_cdc.h
··· 291 291 struct smc_wr_buf **wr_buf, 292 292 struct smc_rdma_wr **wr_rdma_buf, 293 293 struct smc_cdc_tx_pend **pend); 294 - void smc_cdc_tx_dismiss_slots(struct smc_connection *conn); 294 + void smc_cdc_wait_pend_tx_wr(struct smc_connection *conn); 295 295 int smc_cdc_msg_send(struct smc_connection *conn, struct smc_wr_buf *wr_buf, 296 296 struct smc_cdc_tx_pend *pend); 297 297 int smc_cdc_get_slot_and_msg_send(struct smc_connection *conn);
+21 -6
net/smc/smc_core.c
··· 647 647 for (i = 0; i < SMC_LINKS_PER_LGR_MAX; i++) { 648 648 struct smc_link *lnk = &lgr->lnk[i]; 649 649 650 - if (smc_link_usable(lnk)) 650 + if (smc_link_sendable(lnk)) 651 651 lnk->state = SMC_LNK_INACTIVE; 652 652 } 653 653 wake_up_all(&lgr->llc_msg_waiter); ··· 1127 1127 smc_ism_unset_conn(conn); 1128 1128 tasklet_kill(&conn->rx_tsklet); 1129 1129 } else { 1130 - smc_cdc_tx_dismiss_slots(conn); 1130 + smc_cdc_wait_pend_tx_wr(conn); 1131 1131 if (current_work() != &conn->abort_work) 1132 1132 cancel_work_sync(&conn->abort_work); 1133 1133 } ··· 1204 1204 smc_llc_link_clear(lnk, log); 1205 1205 smcr_buf_unmap_lgr(lnk); 1206 1206 smcr_rtoken_clear_link(lnk); 1207 - smc_ib_modify_qp_reset(lnk); 1207 + smc_ib_modify_qp_error(lnk); 1208 1208 smc_wr_free_link(lnk); 1209 1209 smc_ib_destroy_queue_pair(lnk); 1210 1210 smc_ib_dealloc_protection_domain(lnk); ··· 1336 1336 else 1337 1337 tasklet_unlock_wait(&conn->rx_tsklet); 1338 1338 } else { 1339 - smc_cdc_tx_dismiss_slots(conn); 1339 + smc_cdc_wait_pend_tx_wr(conn); 1340 1340 } 1341 1341 smc_lgr_unregister_conn(conn); 1342 1342 smc_close_active_abort(smc); ··· 1459 1459 /* Called when an SMCR device is removed or the smc module is unloaded. 1460 1460 * If smcibdev is given, all SMCR link groups using this device are terminated. 1461 1461 * If smcibdev is NULL, all SMCR link groups are terminated. 1462 + * 1463 + * We must wait here for QPs been destroyed before we destroy the CQs, 1464 + * or we won't received any CQEs and cdc_pend_tx_wr cannot reach 0 thus 1465 + * smc_sock cannot be released. 1462 1466 */ 1463 1467 void smc_smcr_terminate_all(struct smc_ib_device *smcibdev) 1464 1468 { 1465 1469 struct smc_link_group *lgr, *lg; 1466 1470 LIST_HEAD(lgr_free_list); 1471 + LIST_HEAD(lgr_linkdown_list); 1467 1472 int i; 1468 1473 1469 1474 spin_lock_bh(&smc_lgr_list.lock); ··· 1480 1475 list_for_each_entry_safe(lgr, lg, &smc_lgr_list.list, list) { 1481 1476 for (i = 0; i < SMC_LINKS_PER_LGR_MAX; i++) { 1482 1477 if (lgr->lnk[i].smcibdev == smcibdev) 1483 - smcr_link_down_cond_sched(&lgr->lnk[i]); 1478 + list_move_tail(&lgr->list, &lgr_linkdown_list); 1484 1479 } 1485 1480 } 1486 1481 } ··· 1490 1485 list_del_init(&lgr->list); 1491 1486 smc_llc_set_termination_rsn(lgr, SMC_LLC_DEL_OP_INIT_TERM); 1492 1487 __smc_lgr_terminate(lgr, false); 1488 + } 1489 + 1490 + list_for_each_entry_safe(lgr, lg, &lgr_linkdown_list, list) { 1491 + for (i = 0; i < SMC_LINKS_PER_LGR_MAX; i++) { 1492 + if (lgr->lnk[i].smcibdev == smcibdev) { 1493 + mutex_lock(&lgr->llc_conf_mutex); 1494 + smcr_link_down_cond(&lgr->lnk[i]); 1495 + mutex_unlock(&lgr->llc_conf_mutex); 1496 + } 1497 + } 1493 1498 } 1494 1499 1495 1500 if (smcibdev) { ··· 1601 1586 if (!lgr || lnk->state == SMC_LNK_UNUSED || list_empty(&lgr->list)) 1602 1587 return; 1603 1588 1604 - smc_ib_modify_qp_reset(lnk); 1605 1589 to_lnk = smc_switch_conns(lgr, lnk, true); 1606 1590 if (!to_lnk) { /* no backup link available */ 1607 1591 smcr_link_clear(lnk, true); ··· 1838 1824 conn->local_tx_ctrl.common.type = SMC_CDC_MSG_TYPE; 1839 1825 conn->local_tx_ctrl.len = SMC_WR_TX_SIZE; 1840 1826 conn->urg_state = SMC_URG_READ; 1827 + init_waitqueue_head(&conn->cdc_pend_tx_wq); 1841 1828 INIT_WORK(&smc->conn.abort_work, smc_conn_abort_work); 1842 1829 if (ini->is_smcd) { 1843 1830 conn->rx_off = sizeof(struct smcd_cdc_msg);
+6
net/smc/smc_core.h
··· 415 415 return true; 416 416 } 417 417 418 + static inline bool smc_link_sendable(struct smc_link *lnk) 419 + { 420 + return smc_link_usable(lnk) && 421 + lnk->qp_attr.cur_qp_state == IB_QPS_RTS; 422 + } 423 + 418 424 static inline bool smc_link_active(struct smc_link *lnk) 419 425 { 420 426 return lnk->state == SMC_LNK_ACTIVE;
+2 -2
net/smc/smc_ib.c
··· 109 109 IB_QP_MAX_QP_RD_ATOMIC); 110 110 } 111 111 112 - int smc_ib_modify_qp_reset(struct smc_link *lnk) 112 + int smc_ib_modify_qp_error(struct smc_link *lnk) 113 113 { 114 114 struct ib_qp_attr qp_attr; 115 115 116 116 memset(&qp_attr, 0, sizeof(qp_attr)); 117 - qp_attr.qp_state = IB_QPS_RESET; 117 + qp_attr.qp_state = IB_QPS_ERR; 118 118 return ib_modify_qp(lnk->roce_qp, &qp_attr, IB_QP_STATE); 119 119 } 120 120
+1
net/smc/smc_ib.h
··· 90 90 int smc_ib_ready_link(struct smc_link *lnk); 91 91 int smc_ib_modify_qp_rts(struct smc_link *lnk); 92 92 int smc_ib_modify_qp_reset(struct smc_link *lnk); 93 + int smc_ib_modify_qp_error(struct smc_link *lnk); 93 94 long smc_ib_setup_per_ibdev(struct smc_ib_device *smcibdev); 94 95 int smc_ib_get_memory_region(struct ib_pd *pd, int access_flags, 95 96 struct smc_buf_desc *buf_slot, u8 link_idx);
+1 -1
net/smc/smc_llc.c
··· 1630 1630 delllc.reason = htonl(rsn); 1631 1631 1632 1632 for (i = 0; i < SMC_LINKS_PER_LGR_MAX; i++) { 1633 - if (!smc_link_usable(&lgr->lnk[i])) 1633 + if (!smc_link_sendable(&lgr->lnk[i])) 1634 1634 continue; 1635 1635 if (!smc_llc_send_message_wait(&lgr->lnk[i], &delllc)) 1636 1636 break;
+9 -42
net/smc/smc_wr.c
··· 62 62 } 63 63 64 64 /* wait till all pending tx work requests on the given link are completed */ 65 - int smc_wr_tx_wait_no_pending_sends(struct smc_link *link) 65 + void smc_wr_tx_wait_no_pending_sends(struct smc_link *link) 66 66 { 67 - if (wait_event_timeout(link->wr_tx_wait, !smc_wr_is_tx_pend(link), 68 - SMC_WR_TX_WAIT_PENDING_TIME)) 69 - return 0; 70 - else /* timeout */ 71 - return -EPIPE; 67 + wait_event(link->wr_tx_wait, !smc_wr_is_tx_pend(link)); 72 68 } 73 69 74 70 static inline int smc_wr_tx_find_pending_index(struct smc_link *link, u64 wr_id) ··· 83 87 struct smc_wr_tx_pend pnd_snd; 84 88 struct smc_link *link; 85 89 u32 pnd_snd_idx; 86 - int i; 87 90 88 91 link = wc->qp->qp_context; 89 92 ··· 123 128 } 124 129 125 130 if (wc->status) { 126 - for_each_set_bit(i, link->wr_tx_mask, link->wr_tx_cnt) { 127 - /* clear full struct smc_wr_tx_pend including .priv */ 128 - memset(&link->wr_tx_pends[i], 0, 129 - sizeof(link->wr_tx_pends[i])); 130 - memset(&link->wr_tx_bufs[i], 0, 131 - sizeof(link->wr_tx_bufs[i])); 132 - clear_bit(i, link->wr_tx_mask); 133 - } 134 131 if (link->lgr->smc_version == SMC_V2) { 135 132 memset(link->wr_tx_v2_pend, 0, 136 133 sizeof(*link->wr_tx_v2_pend)); ··· 175 188 static inline int smc_wr_tx_get_free_slot_index(struct smc_link *link, u32 *idx) 176 189 { 177 190 *idx = link->wr_tx_cnt; 178 - if (!smc_link_usable(link)) 191 + if (!smc_link_sendable(link)) 179 192 return -ENOLINK; 180 193 for_each_clear_bit(*idx, link->wr_tx_mask, link->wr_tx_cnt) { 181 194 if (!test_and_set_bit(*idx, link->wr_tx_mask)) ··· 218 231 } else { 219 232 rc = wait_event_interruptible_timeout( 220 233 link->wr_tx_wait, 221 - !smc_link_usable(link) || 234 + !smc_link_sendable(link) || 222 235 lgr->terminating || 223 236 (smc_wr_tx_get_free_slot_index(link, &idx) != -EBUSY), 224 237 SMC_WR_TX_WAIT_FREE_SLOT_TIME); ··· 345 358 unsigned long timeout) 346 359 { 347 360 struct smc_wr_tx_pend *pend; 361 + u32 pnd_idx; 348 362 int rc; 349 363 350 364 pend = container_of(priv, struct smc_wr_tx_pend, priv); 351 365 pend->compl_requested = 1; 352 - init_completion(&link->wr_tx_compl[pend->idx]); 366 + pnd_idx = pend->idx; 367 + init_completion(&link->wr_tx_compl[pnd_idx]); 353 368 354 369 rc = smc_wr_tx_send(link, priv); 355 370 if (rc) 356 371 return rc; 357 372 /* wait for completion by smc_wr_tx_process_cqe() */ 358 373 rc = wait_for_completion_interruptible_timeout( 359 - &link->wr_tx_compl[pend->idx], timeout); 374 + &link->wr_tx_compl[pnd_idx], timeout); 360 375 if (rc <= 0) 361 376 rc = -ENODATA; 362 377 if (rc > 0) ··· 406 417 break; 407 418 } 408 419 return rc; 409 - } 410 - 411 - void smc_wr_tx_dismiss_slots(struct smc_link *link, u8 wr_tx_hdr_type, 412 - smc_wr_tx_filter filter, 413 - smc_wr_tx_dismisser dismisser, 414 - unsigned long data) 415 - { 416 - struct smc_wr_tx_pend_priv *tx_pend; 417 - struct smc_wr_rx_hdr *wr_tx; 418 - int i; 419 - 420 - for_each_set_bit(i, link->wr_tx_mask, link->wr_tx_cnt) { 421 - wr_tx = (struct smc_wr_rx_hdr *)&link->wr_tx_bufs[i]; 422 - if (wr_tx->type != wr_tx_hdr_type) 423 - continue; 424 - tx_pend = &link->wr_tx_pends[i].priv; 425 - if (filter(tx_pend, data)) 426 - dismisser(tx_pend); 427 - } 428 420 } 429 421 430 422 /****************************** receive queue ********************************/ ··· 643 673 smc_wr_wakeup_reg_wait(lnk); 644 674 smc_wr_wakeup_tx_wait(lnk); 645 675 646 - if (smc_wr_tx_wait_no_pending_sends(lnk)) 647 - memset(lnk->wr_tx_mask, 0, 648 - BITS_TO_LONGS(SMC_WR_BUF_CNT) * 649 - sizeof(*lnk->wr_tx_mask)); 676 + smc_wr_tx_wait_no_pending_sends(lnk); 650 677 wait_event(lnk->wr_reg_wait, (!atomic_read(&lnk->wr_reg_refcnt))); 651 678 wait_event(lnk->wr_tx_wait, (!atomic_read(&lnk->wr_tx_refcnt))); 652 679
+2 -3
net/smc/smc_wr.h
··· 22 22 #define SMC_WR_BUF_CNT 16 /* # of ctrl buffers per link */ 23 23 24 24 #define SMC_WR_TX_WAIT_FREE_SLOT_TIME (10 * HZ) 25 - #define SMC_WR_TX_WAIT_PENDING_TIME (5 * HZ) 26 25 27 26 #define SMC_WR_TX_SIZE 44 /* actual size of wr_send data (<=SMC_WR_BUF_SIZE) */ 28 27 ··· 61 62 62 63 static inline bool smc_wr_tx_link_hold(struct smc_link *link) 63 64 { 64 - if (!smc_link_usable(link)) 65 + if (!smc_link_sendable(link)) 65 66 return false; 66 67 atomic_inc(&link->wr_tx_refcnt); 67 68 return true; ··· 129 130 smc_wr_tx_filter filter, 130 131 smc_wr_tx_dismisser dismisser, 131 132 unsigned long data); 132 - int smc_wr_tx_wait_no_pending_sends(struct smc_link *link); 133 + void smc_wr_tx_wait_no_pending_sends(struct smc_link *link); 133 134 134 135 int smc_wr_rx_register_handler(struct smc_wr_rx_handler *handler); 135 136 int smc_wr_rx_post_init(struct smc_link *link);
+1
net/xdp/xsk_buff_pool.c
··· 83 83 xskb = &pool->heads[i]; 84 84 xskb->pool = pool; 85 85 xskb->xdp.frame_sz = umem->chunk_size - umem->headroom; 86 + INIT_LIST_HEAD(&xskb->free_list_node); 86 87 if (pool->unaligned) 87 88 pool->free_heads[i] = xskb; 88 89 else
-1
tools/testing/selftests/net/mptcp/config
··· 9 9 CONFIG_NETFILTER_ADVANCED=y 10 10 CONFIG_NETFILTER_NETLINK=m 11 11 CONFIG_NF_TABLES=m 12 - CONFIG_NFT_COUNTER=m 13 12 CONFIG_NFT_COMPAT=m 14 13 CONFIG_NETFILTER_XTABLES=m 15 14 CONFIG_NETFILTER_XT_MATCH_BPF=m
+4 -2
tools/testing/selftests/net/udpgro_fwd.sh
··· 132 132 local rcv=`ip netns exec $NS_DST $ipt"-save" -c | grep 'dport 8000' | \ 133 133 sed -e 's/\[//' -e 's/:.*//'` 134 134 if [ $rcv != $pkts ]; then 135 - echo " fail - received $rvs packets, expected $pkts" 135 + echo " fail - received $rcv packets, expected $pkts" 136 136 ret=1 137 137 return 138 138 fi ··· 185 185 IPT=iptables 186 186 SUFFIX=24 187 187 VXDEV=vxlan 188 + PING=ping 188 189 189 190 if [ $family = 6 ]; then 190 191 BM_NET=$BM_NET_V6 ··· 193 192 SUFFIX="64 nodad" 194 193 VXDEV=vxlan6 195 194 IPT=ip6tables 195 + PING="ping6" 196 196 fi 197 197 198 198 echo "IPv$family" ··· 239 237 240 238 # load arp cache before running the test to reduce the amount of 241 239 # stray traffic on top of the UDP tunnel 242 - ip netns exec $NS_SRC ping -q -c 1 $OL_NET$DST_NAT >/dev/null 240 + ip netns exec $NS_SRC $PING -q -c 1 $OL_NET$DST_NAT >/dev/null 243 241 run_test "GRO fwd over UDP tunnel" $OL_NET$DST_NAT 1 1 $OL_NET$DST 244 242 cleanup 245 243
+6 -6
tools/testing/selftests/net/udpgso.c
··· 156 156 }, 157 157 { 158 158 /* send max number of min sized segments */ 159 - .tlen = UDP_MAX_SEGMENTS - CONST_HDRLEN_V4, 159 + .tlen = UDP_MAX_SEGMENTS, 160 160 .gso_len = 1, 161 - .r_num_mss = UDP_MAX_SEGMENTS - CONST_HDRLEN_V4, 161 + .r_num_mss = UDP_MAX_SEGMENTS, 162 162 }, 163 163 { 164 164 /* send max number + 1 of min sized segments: fail */ 165 - .tlen = UDP_MAX_SEGMENTS - CONST_HDRLEN_V4 + 1, 165 + .tlen = UDP_MAX_SEGMENTS + 1, 166 166 .gso_len = 1, 167 167 .tfail = true, 168 168 }, ··· 259 259 }, 260 260 { 261 261 /* send max number of min sized segments */ 262 - .tlen = UDP_MAX_SEGMENTS - CONST_HDRLEN_V6, 262 + .tlen = UDP_MAX_SEGMENTS, 263 263 .gso_len = 1, 264 - .r_num_mss = UDP_MAX_SEGMENTS - CONST_HDRLEN_V6, 264 + .r_num_mss = UDP_MAX_SEGMENTS, 265 265 }, 266 266 { 267 267 /* send max number + 1 of min sized segments: fail */ 268 - .tlen = UDP_MAX_SEGMENTS - CONST_HDRLEN_V6 + 1, 268 + .tlen = UDP_MAX_SEGMENTS + 1, 269 269 .gso_len = 1, 270 270 .tfail = true, 271 271 },
+7 -1
tools/testing/selftests/net/udpgso_bench_tx.c
··· 419 419 420 420 static void parse_opts(int argc, char **argv) 421 421 { 422 + const char *bind_addr = NULL; 422 423 int max_len, hdrlen; 423 424 int c; 424 425 ··· 447 446 cfg_cpu = strtol(optarg, NULL, 0); 448 447 break; 449 448 case 'D': 450 - setup_sockaddr(cfg_family, optarg, &cfg_dst_addr); 449 + bind_addr = optarg; 451 450 break; 452 451 case 'l': 453 452 cfg_runtime_ms = strtoul(optarg, NULL, 10) * 1000; ··· 492 491 break; 493 492 } 494 493 } 494 + 495 + if (!bind_addr) 496 + bind_addr = cfg_family == PF_INET6 ? "::" : "0.0.0.0"; 497 + 498 + setup_sockaddr(cfg_family, bind_addr, &cfg_dst_addr); 495 499 496 500 if (optind != argc) 497 501 usage(argv[0]);