History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

David S. Miller committed 5 years ago

Commit d489ded2 parents 86dd986 3af409c56 files · +724 −336Browse files

Unified · Split

56 files
  1. Documentation/networking/ip-sysctl.rst +3 −4
  2. Documentation/networking/netdev-FAQ.rst +16 −0
  3. drivers/atm/idt77252.c +1 −10
  4. drivers/atm/idt77252.h +1 −1
  5. drivers/net/ethernet/amd/xgbe/xgbe-common.h +14 −0
  6. drivers/net/ethernet/amd/xgbe/xgbe-drv.c +1 −0
  7. drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +1 −2
  8. drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +38 −1
  9. drivers/net/ethernet/aquantia/atlantic/aq_main.c +3 −1
  10. drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 −1
  11. drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +2 −2
  12. drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h +3 −0
  13. drivers/net/ethernet/chelsio/cxgb4/sge.c +8 −3
  14. drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.h +0 −3
  15. drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +12 −2
  16. drivers/net/ethernet/freescale/enetc/Kconfig +1 −1
  17. drivers/net/ethernet/freescale/enetc/enetc_pf.c +3 −2
  18. drivers/net/ethernet/ibm/ibmvnic.c +32 −12
  19. drivers/net/ethernet/ibm/ibmvnic.h +3 −1
  20. drivers/net/ethernet/mellanox/mlx5/core/devlink.c +9 −0
  21. drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +192 −67
  22. drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h +1 −1
  23. drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c +1 −1
  24. drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h +1 −1
  25. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c +31 −35
  26. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +26 −13
  27. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +16 −9
  28. drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +2 −2
  29. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +1 −1
  30. drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c +1 −1
  31. drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.h +2 −0
  32. drivers/net/ethernet/mellanox/mlx5/core/health.c +14 −8
  33. drivers/net/ethernet/mellanox/mlx5/core/main.c +2 −1
  34. drivers/net/ethernet/realtek/r8169_main.c +25 −0
  35. drivers/net/ethernet/xilinx/xilinx_axienet_main.c +12 −14
  36. drivers/net/ipa/ipa_main.c +2 −2
  37. drivers/net/phy/phy_device.c +17 −36
  38. drivers/net/wan/lmc/lmc_main.c +3 −1
  39. drivers/net/wireless/broadcom/b43/phy_n.c +1 −1
  40. drivers/target/iscsi/cxgbit/cxgbit_target.c +1 −2
  41. include/linux/atmdev.h +1 −1
  42. include/net/act_api.h +1 −0
  43. include/uapi/linux/pkt_cls.h +1 −0
  44. kernel/bpf/verifier.c +6 −4
  45. net/appletalk/ddp.c +21 −12
  46. net/caif/chnl_net.c +1 −4
  47. net/core/flow_dissector.c +3 −3
  48. net/mptcp/options.c +5 −5
  49. net/mptcp/protocol.c +36 −19
  50. net/mptcp/protocol.h +7 −11
  51. net/mptcp/subflow.c +59 −24
  52. net/sched/act_api.c +1 −1
  53. net/sched/cls_api.c +1 −0
  54. net/sched/cls_flower.c +37 −2
  55. tools/testing/selftests/bpf/test_xdp_redirect.sh +3 −7
  56. tools/testing/selftests/net/forwarding/tc_flower.sh +37 −1
Documentation/networking/ip-sysctl.rst+3−4
@@ -651,16 +651,15 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max · 650 unmodified lines
651651
652652 default: initial size of receive buffer used by TCP sockets.
653653 This value overrides net.core.rmem_default used by other protocols.
654− Default: 87380 bytes. This value results in window of 65535 with
655− default setting of tcp_adv_win_scale and tcp_app_win:0 and a bit
656− less for default tcp_app_win. See below about these variables.
654+ Default: 131072 bytes.
655+ This value results in initial window of 65535.
657656
658657 max: maximal size of receive buffer allowed for automatically
659658 selected receiver buffers for TCP socket. This value does not override
660659 net.core.rmem_max. Calling setsockopt() with SO_RCVBUF disables
661660 automatic tuning of that socket's receive buffer size, in which
662661 case this value is ignored.
663− Default: between 87380B and 6MB, depending on RAM size.
662+ Default: between 131072 and 6MB, depending on RAM size.
664663
665664 tcp_sack - BOOLEAN
666665 Enable select acknowledgments (SACKS).
Documentation/networking/netdev-FAQ.rst+16−0
@@ -272,6 +272,22 @@ to the mailing list, e.g.:: · 271 unmodified lines
272272 Posting as one thread is discouraged because it confuses patchwork
273273 (as of patchwork 2.2.2).
274274
275+Can I reproduce the checks from patchwork on my local machine?
276+--------------------------------------------------------------
277+
278+Checks in patchwork are mostly simple wrappers around existing kernel
279+scripts, the sources are available at:
280+
281+https://github.com/kuba-moo/nipa/tree/master/tests
282+
283+Running all the builds and checks locally is a pain, can I post my patches and have the patchwork bot validate them?
284+--------------------------------------------------------------------------------------------------------------------
285+
286+No, you must ensure that your patches are ready by testing them locally
287+before posting to the mailing list. The patchwork build bot instance
288+gets overloaded very easily and netdev@vger really doesn't need more
289+traffic if we can help it.
290+
275291 Any other tips to help ensure my net/net-next patch gets OK'd?
276292 --------------------------------------------------------------
277293 Attention to detail. Re-read your own work as if you were the
drivers/atm/idt77252.c+1−10
@@ -3743,16 +3743,7 @@ static int __init idt77252_init(void) · 3742 unmodified lines
37433743 struct sk_buff *skb;
37443744
37453745 printk("%s: at %p\n", __func__, idt77252_init);
3746−
3747− if (sizeof(skb->cb) < sizeof(struct atm_skb_data) +
3748− sizeof(struct idt77252_skb_prv)) {
3749− printk(KERN_ERR "%s: skb->cb is too small (%lu < %lu)\n",
3750− __func__, (unsigned long) sizeof(skb->cb),
3751− (unsigned long) sizeof(struct atm_skb_data) +
3752− sizeof(struct idt77252_skb_prv));
3753− return -EIO;
3754− }
3755−
3746+ BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct idt77252_skb_prv) + sizeof(struct atm_skb_data));
37563747 return pci_register_driver(&idt77252_driver);
37573748 }
37583749
drivers/atm/idt77252.h+1−1
@@ -789,7 +789,7 @@ struct idt77252_skb_prv { · 788 unmodified lines
789789 struct scqe tbd; /* Transmit Buffer Descriptor */
790790 dma_addr_t paddr; /* DMA handle */
791791 u32 pool; /* sb_pool handle */
792−};
792+} __packed;
793793
794794 #define IDT77252_PRV_TBD(skb) \
795795 (((struct idt77252_skb_prv *)(ATM_SKB(skb)+1))->tbd)
drivers/net/ethernet/amd/xgbe/xgbe-common.h+14−0
@@ -1279,10 +1279,18 @@ · 1278 unmodified lines
12791279 #define MDIO_PMA_10GBR_FECCTRL 0x00ab
12801280 #endif
12811281
1282+#ifndef MDIO_PMA_RX_CTRL1
1283+#define MDIO_PMA_RX_CTRL1 0x8051
1284+#endif
1285+
12821286 #ifndef MDIO_PCS_DIG_CTRL
12831287 #define MDIO_PCS_DIG_CTRL 0x8000
12841288 #endif
12851289
1290+#ifndef MDIO_PCS_DIGITAL_STAT
1291+#define MDIO_PCS_DIGITAL_STAT 0x8010
1292+#endif
1293+
12861294 #ifndef MDIO_AN_XNP
12871295 #define MDIO_AN_XNP 0x0016
12881296 #endif
@@ -1358,6 +1366,8 @@ · 69 unmodified lines
13581366 #define XGBE_KR_TRAINING_ENABLE BIT(1)
13591367
13601368 #define XGBE_PCS_CL37_BP BIT(12)
1369+#define XGBE_PCS_PSEQ_STATE_MASK 0x1c
1370+#define XGBE_PCS_PSEQ_STATE_POWER_GOOD 0x10
13611371
13621372 #define XGBE_AN_CL37_INT_CMPLT BIT(0)
13631373 #define XGBE_AN_CL37_INT_MASK 0x01
@@ -1375,6 +1385,10 @@ · 11 unmodified lines
13751385 #define XGBE_PMA_CDR_TRACK_EN_OFF 0x00
13761386 #define XGBE_PMA_CDR_TRACK_EN_ON 0x01
13771387
1388+#define XGBE_PMA_RX_RST_0_MASK BIT(4)
1389+#define XGBE_PMA_RX_RST_0_RESET_ON 0x10
1390+#define XGBE_PMA_RX_RST_0_RESET_OFF 0x00
1391+
13781392 /* Bit setting and getting macros
13791393 * The get macro will extract the current bit field value from within
13801394 * the variable
drivers/net/ethernet/amd/xgbe/xgbe-drv.c+1−0
@@ -1368,6 +1368,7 @@ static void xgbe_stop(struct xgbe_prv_data *pdata) · 1367 unmodified lines
13681368 return;
13691369
13701370 netif_tx_stop_all_queues(netdev);
1371+ netif_carrier_off(pdata->netdev);
13711372
13721373 xgbe_stop_timers(pdata);
13731374 flush_workqueue(pdata->dev_workqueue);
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c+1−2
@@ -1345,7 +1345,7 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata) · 1344 unmodified lines
13451345 &an_restart);
13461346 if (an_restart) {
13471347 xgbe_phy_config_aneg(pdata);
1348− return;
1348+ goto adjust_link;
13491349 }
13501350
13511351 if (pdata->phy.link) {
@@ -1396,7 +1396,6 @@ static void xgbe_phy_stop(struct xgbe_prv_data *pdata) · 44 unmodified lines
13961396 pdata->phy_if.phy_impl.stop(pdata);
13971397
13981398 pdata->phy.link = 0;
1399− netif_carrier_off(pdata->netdev);
14001399
14011400 xgbe_phy_adjust_link(pdata);
14021401 }
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c+38−1
@@ -922,6 +922,9 @@ static bool xgbe_phy_belfuse_phy_quirks(struct xgbe_prv_data *pdata) · 921 unmodified lines
922922 if ((phy_id & 0xfffffff0) != 0x03625d10)
923923 return false;
924924
925+ /* Reset PHY - wait for self-clearing reset bit to clear */
926+ genphy_soft_reset(phy_data->phydev);
927+
925928 /* Disable RGMII mode */
926929 phy_write(phy_data->phydev, 0x18, 0x7007);
927930 reg = phy_read(phy_data->phydev, 0x18);
@@ -1953,6 +1956,27 @@ static void xgbe_phy_set_redrv_mode(struct xgbe_prv_data *pdata) · 1025 unmodified lines
19531956 xgbe_phy_put_comm_ownership(pdata);
19541957 }
19551958
1959+static void xgbe_phy_rx_reset(struct xgbe_prv_data *pdata)
1960+{
1961+ int reg;
1962+
1963+ reg = XMDIO_READ_BITS(pdata, MDIO_MMD_PCS, MDIO_PCS_DIGITAL_STAT,
1964+ XGBE_PCS_PSEQ_STATE_MASK);
1965+ if (reg == XGBE_PCS_PSEQ_STATE_POWER_GOOD) {
1966+ /* Mailbox command timed out, reset of RX block is required.
1967+ * This can be done by asseting the reset bit and wait for
1968+ * its compeletion.
1969+ */
1970+ XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_PMA_RX_CTRL1,
1971+ XGBE_PMA_RX_RST_0_MASK, XGBE_PMA_RX_RST_0_RESET_ON);
1972+ ndelay(20);
1973+ XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_PMA_RX_CTRL1,
1974+ XGBE_PMA_RX_RST_0_MASK, XGBE_PMA_RX_RST_0_RESET_OFF);
1975+ usleep_range(40, 50);
1976+ netif_err(pdata, link, pdata->netdev, "firmware mailbox reset performed\n");
1977+ }
1978+}
1979+
19561980 static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
19571981 unsigned int cmd, unsigned int sub_cmd)
19581982 {
@@ -1960,9 +1984,11 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, · 1 unmodified line
19601984 unsigned int wait;
19611985
19621986 /* Log if a previous command did not complete */
1963− if (XP_IOREAD_BITS(pdata, XP_DRIVER_INT_RO, STATUS))
1987+ if (XP_IOREAD_BITS(pdata, XP_DRIVER_INT_RO, STATUS)) {
19641988 netif_dbg(pdata, link, pdata->netdev,
19651989 "firmware mailbox not ready for command\n");
1990+ xgbe_phy_rx_reset(pdata);
1991+ }
19661992
19671993 /* Construct the command */
19681994 XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, COMMAND, cmd);
@@ -1984,6 +2010,9 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, · 15 unmodified lines
19842010
19852011 netif_dbg(pdata, link, pdata->netdev,
19862012 "firmware mailbox command did not complete\n");
2013+
2014+ /* Reset on error */
2015+ xgbe_phy_rx_reset(pdata);
19872016 }
19882017
19892018 static void xgbe_phy_rrc(struct xgbe_prv_data *pdata)
@@ -2584,6 +2613,14 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart) · 594 unmodified lines
25842613 if (reg & MDIO_STAT1_LSTATUS)
25852614 return 1;
25862615
2616+ if (pdata->phy.autoneg == AUTONEG_ENABLE &&
2617+ phy_data->port_mode == XGBE_PORT_MODE_BACKPLANE) {
2618+ if (!test_bit(XGBE_LINK_INIT, &pdata->dev_state)) {
2619+ netif_carrier_off(pdata->netdev);
2620+ *an_restart = 1;
2621+ }
2622+ }
2623+
25872624 /* No link, attempt a receiver reset cycle */
25882625 if (phy_data->rrc_count++ > XGBE_RRC_FREQUENCY) {
25892626 phy_data->rrc_count = 0;
drivers/net/ethernet/aquantia/atlantic/aq_main.c+3−1
@@ -71,8 +71,10 @@ static int aq_ndev_open(struct net_device *ndev) · 70 unmodified lines
7171 goto err_exit;
7272
7373 err = aq_nic_start(aq_nic);
74− if (err < 0)
74+ if (err < 0) {
75+ aq_nic_stop(aq_nic);
7576 goto err_exit;
77+ }
7678
7779 err_exit:
7880 if (err < 0)
drivers/net/ethernet/broadcom/bnxt/bnxt.c+2−1
@@ -8984,9 +8984,10 @@ void bnxt_tx_disable(struct bnxt *bp) · 8983 unmodified lines
89848984 txr->dev_state = BNXT_DEV_STATE_CLOSING;
89858985 }
89868986 }
8987+ /* Drop carrier first to prevent TX timeout */
8988+ netif_carrier_off(bp->dev);
89878989 /* Stop all TX queues */
89888990 netif_tx_disable(bp->dev);
8989− netif_carrier_off(bp->dev);
89908991 }
89918992
89928993 void bnxt_tx_enable(struct bnxt *bp)
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c+2−2
@@ -471,8 +471,8 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req, · 470 unmodified lines
471471 if (BNXT_PF(bp) && !bnxt_hwrm_get_nvm_cfg_ver(bp, &nvm_cfg_ver)) {
472472 u32 ver = nvm_cfg_ver.vu32;
473473
474− sprintf(buf, "%X.%X.%X", (ver >> 16) & 0xF, (ver >> 8) & 0xF,
475− ver & 0xF);
474+ sprintf(buf, "%d.%d.%d", (ver >> 16) & 0xf, (ver >> 8) & 0xf,
475+ ver & 0xf);
476476 rc = bnxt_dl_info_put(bp, req, BNXT_VERSION_STORED,
477477 DEVLINK_INFO_VERSION_GENERIC_FW_PSID,
478478 buf);
drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h+3−0
@@ -46,6 +46,9 @@ · 45 unmodified lines
4646 #define MAX_ULD_QSETS 16
4747 #define MAX_ULD_NPORTS 4
4848
49+/* ulp_mem_io + ulptx_idata + payload + padding */
50+#define MAX_IMM_ULPTX_WR_LEN (32 + 8 + 256 + 8)
51+
4952 /* CPL message priority levels */
5053 enum {
5154 CPL_PRIORITY_DATA = 0, /* data messages */
drivers/net/ethernet/chelsio/cxgb4/sge.c+8−3
@@ -2846,17 +2846,22 @@ int t4_mgmt_tx(struct adapter *adap, struct sk_buff *skb) · 2845 unmodified lines
28462846 * @skb: the packet
28472847 *
28482848 * Returns true if a packet can be sent as an offload WR with immediate
2849− * data. We currently use the same limit as for Ethernet packets.
2849+ * data.
2850+ * FW_OFLD_TX_DATA_WR limits the payload to 255 bytes due to 8-bit field.
2851+ * However, FW_ULPTX_WR commands have a 256 byte immediate only
2852+ * payload limit.
28502853 */
28512854 static inline int is_ofld_imm(const struct sk_buff *skb)
28522855 {
28532856 struct work_request_hdr *req = (struct work_request_hdr *)skb->data;
28542857 unsigned long opcode = FW_WR_OP_G(ntohl(req->wr_hi));
28552858
2856− if (opcode == FW_CRYPTO_LOOKASIDE_WR)
2859+ if (unlikely(opcode == FW_ULPTX_WR))
2860+ return skb->len <= MAX_IMM_ULPTX_WR_LEN;
2861+ else if (opcode == FW_CRYPTO_LOOKASIDE_WR)
28572862 return skb->len <= SGE_MAX_WR_LEN;
28582863 else
2859− return skb->len <= MAX_IMM_TX_PKT_LEN;
2864+ return skb->len <= MAX_IMM_OFLD_TX_DATA_WR_LEN;
28602865 }
28612866
28622867 /**
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.h+0−3
@@ -50,9 +50,6 @@ · 49 unmodified lines
5050 #define MIN_RCV_WND (24 * 1024U)
5151 #define LOOPBACK(x) (((x) & htonl(0xff000000)) == htonl(0x7f000000))
5252
53−/* ulp_mem_io + ulptx_idata + payload + padding */
54−#define MAX_IMM_ULPTX_WR_LEN (32 + 8 + 256 + 8)
55−
5653 /* for TX: a skb must have a headroom of at least TX_HEADER_LEN bytes */
5754 #define TX_HEADER_LEN \
5855 (sizeof(struct fw_ofld_tx_data_wr) + sizeof(struct sge_opaque_hdr))
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c+12−2
@@ -395,10 +395,20 @@ static u32 dpaa2_eth_run_xdp(struct dpaa2_eth_priv *priv, · 394 unmodified lines
395395 xdp.frame_sz = DPAA2_ETH_RX_BUF_RAW_SIZE;
396396
397397 err = xdp_do_redirect(priv->net_dev, &xdp, xdp_prog);
398− if (unlikely(err))
398+ if (unlikely(err)) {
399+ addr = dma_map_page(priv->net_dev->dev.parent,
400+ virt_to_page(vaddr), 0,
401+ priv->rx_buf_size, DMA_BIDIRECTIONAL);
402+ if (unlikely(dma_mapping_error(priv->net_dev->dev.parent, addr))) {
403+ free_pages((unsigned long)vaddr, 0);
404+ } else {
405+ ch->buf_count++;
406+ dpaa2_eth_xdp_release_buf(priv, ch, addr);
407+ }
399408 ch->stats.xdp_drop++;
400− else
409+ } else {
401410 ch->stats.xdp_redirect++;
411+ }
402412 break;
403413 }
404414
drivers/net/ethernet/freescale/enetc/Kconfig+1−1
@@ -27,7 +27,7 @@ config FSL_ENETC_VF · 26 unmodified lines
2727
2828 config FSL_ENETC_MDIO
2929 tristate "ENETC MDIO driver"
30− depends on PCI
30+ depends on PCI && MDIO_DEVRES && MDIO_BUS
3131 help
3232 This driver supports NXP ENETC Central MDIO controller as a PCIe
3333 physical function (PF) device.
drivers/net/ethernet/freescale/enetc/enetc_pf.c+3−2
@@ -1157,14 +1157,15 @@ static void enetc_pf_remove(struct pci_dev *pdev) · 1156 unmodified lines
11571157 struct enetc_ndev_priv *priv;
11581158
11591159 priv = netdev_priv(si->ndev);
1160− enetc_phylink_destroy(priv);
1161− enetc_mdiobus_destroy(pf);
11621160
11631161 if (pf->num_vfs)
11641162 enetc_sriov_configure(pdev, 0);
11651163
11661164 unregister_netdev(si->ndev);
11671165
1166+ enetc_phylink_destroy(priv);
1167+ enetc_mdiobus_destroy(pf);
1168+
11681169 enetc_free_msix(priv);
11691170
11701171 enetc_free_si_resources(priv);
drivers/net/ethernet/ibm/ibmvnic.c+32−12
@@ -247,8 +247,13 @@ static void free_long_term_buff(struct ibmvnic_adapter *adapter, · 246 unmodified lines
247247 if (!ltb->buff)
248248 return;
249249
250+ /* VIOS automatically unmaps the long term buffer at remote
251+ * end for the following resets:
252+ * FAILOVER, MOBILITY, TIMEOUT.
253+ */
250254 if (adapter->reset_reason != VNIC_RESET_FAILOVER &&
251− adapter->reset_reason != VNIC_RESET_MOBILITY)
255+ adapter->reset_reason != VNIC_RESET_MOBILITY &&
256+ adapter->reset_reason != VNIC_RESET_TIMEOUT)
252257 send_request_unmap(adapter, ltb->map_id);
253258 dma_free_coherent(dev, ltb->size, ltb->buff, ltb->addr);
254259 }
@@ -1322,10 +1327,8 @@ static int __ibmvnic_close(struct net_device *netdev) · 1067 unmodified lines
13221327
13231328 adapter->state = VNIC_CLOSING;
13241329 rc = set_link_state(adapter, IBMVNIC_LOGICAL_LNK_DN);
1325− if (rc)
1326− return rc;
13271330 adapter->state = VNIC_CLOSED;
1328− return 0;
1331+ return rc;
13291332 }
13301333
13311334 static int ibmvnic_close(struct net_device *netdev)
@@ -1670,6 +1673,9 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) · 338 unmodified lines
16701673 skb_copy_from_linear_data(skb, dst, skb->len);
16711674 }
16721675
1676+ /* post changes to long_term_buff *dst before VIOS accessing it */
1677+ dma_wmb();
1678+
16731679 tx_pool->consumer_index =
16741680 (tx_pool->consumer_index + 1) % tx_pool->num_buffers;
16751681
@@ -2288,7 +2294,8 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, · 612 unmodified lines
22882294 unsigned long flags;
22892295 int ret;
22902296
2291− /* If failover is pending don't schedule any other reset.
2297+ /*
2298+ * If failover is pending don't schedule any other reset.
22922299 * Instead let the failover complete. If there is already a
22932300 * a failover reset scheduled, we will detect and drop the
22942301 * duplicate reset when walking the ->rwi_list below.
@@ -2308,14 +2315,11 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, · 13 unmodified lines
23082315 goto err;
23092316 }
23102317
2311− spin_lock_irqsave(&adapter->rwi_lock, flags);
2312−
23132318 list_for_each(entry, &adapter->rwi_list) {
23142319 tmp = list_entry(entry, struct ibmvnic_rwi, list);
23152320 if (tmp->reset_reason == reason) {
23162321 netdev_dbg(netdev, "Skipping matching reset, reason=%d\n",
23172322 reason);
2318− spin_unlock_irqrestore(&adapter->rwi_lock, flags);
23192323 ret = EBUSY;
23202324 goto err;
23212325 }
@@ -2323,8 +2327,6 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, · 1 unmodified line
23232327
23242328 rwi = kzalloc(sizeof(*rwi), GFP_ATOMIC);
23252329 if (!rwi) {
2326− spin_unlock_irqrestore(&adapter->rwi_lock, flags);
2327− ibmvnic_close(netdev);
23282330 ret = ENOMEM;
23292331 goto err;
23302332 }
@@ -2337,12 +2339,17 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, · 6 unmodified lines
23372339 }
23382340 rwi->reset_reason = reason;
23392341 list_add_tail(&rwi->list, &adapter->rwi_list);
2340− spin_unlock_irqrestore(&adapter->rwi_lock, flags);
23412342 netdev_dbg(adapter->netdev, "Scheduling reset (reason %d)\n", reason);
23422343 schedule_work(&adapter->ibmvnic_reset);
23432344
2344− return 0;
2345+ ret = 0;
23452346 err:
2347+ /* ibmvnic_close() below can block, so drop the lock first */
2348+ spin_unlock_irqrestore(&adapter->rwi_lock, flags);
2349+
2350+ if (ret == ENOMEM)
2351+ ibmvnic_close(netdev);
2352+
23462353 return -ret;
23472354 }
23482355
@@ -2433,6 +2440,8 @@ restart_poll: · 84 unmodified lines
24332440 offset = be16_to_cpu(next->rx_comp.off_frame_data);
24342441 flags = next->rx_comp.flags;
24352442 skb = rx_buff->skb;
2443+ /* load long_term_buff before copying to skb */
2444+ dma_rmb();
24362445 skb_copy_to_linear_data(skb, rx_buff->data + offset,
24372446 length);
24382447
@@ -5346,7 +5355,18 @@ static int ibmvnic_remove(struct vio_dev *dev) · 2907 unmodified lines
53465355 unsigned long flags;
53475356
53485357 spin_lock_irqsave(&adapter->state_lock, flags);
5358+
5359+ /* If ibmvnic_reset() is scheduling a reset, wait for it to
5360+ * finish. Then, set the state to REMOVING to prevent it from
5361+ * scheduling any more work and to have reset functions ignore
5362+ * any resets that have already been scheduled. Drop the lock
5363+ * after setting state, so __ibmvnic_reset() which is called
5364+ * from the flush_work() below, can make progress.
5365+ */
5366+ spin_lock_irqsave(&adapter->rwi_lock, flags);
53495367 adapter->state = VNIC_REMOVING;
5368+ spin_unlock_irqrestore(&adapter->rwi_lock, flags);
5369+
53505370 spin_unlock_irqrestore(&adapter->state_lock, flags);
53515371
53525372 flush_work(&adapter->ibmvnic_reset);
drivers/net/ethernet/ibm/ibmvnic.h+3−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #define IBMVNIC_BUFFS_PER_POOL 100
3232 #define IBMVNIC_MAX_QUEUES 16
3333 #define IBMVNIC_MAX_QUEUE_SZ 4096
34−#define IBMVNIC_MAX_IND_DESCS 128
34+#define IBMVNIC_MAX_IND_DESCS 16
3535 #define IBMVNIC_IND_ARR_SZ (IBMVNIC_MAX_IND_DESCS * 32)
3636
3737 #define IBMVNIC_TSO_BUF_SZ 65536
@@ -1084,6 +1084,8 @@ struct ibmvnic_adapter { · 1046 unmodified lines
10841084 /* Used for serializatin of state field */
10851085 spinlock_t state_lock;
10861086 enum ibmvnic_reset_reason reset_reason;
1087+ /* when taking both state and rwi locks, take state lock first */
1088+ spinlock_t rwi_lock;
10871089 struct list_head rwi_list;
10881090 /* Used for serialization of rwi_list */
10891091 spinlock_t rwi_lock;
drivers/net/ethernet/mellanox/mlx5/core/devlink.c+9−0
@@ -141,6 +141,11 @@ static int mlx5_devlink_reload_down(struct devlink *devlink, bool netns_change, · 140 unmodified lines
141141 return -EOPNOTSUPP;
142142 }
143143
144+ if (mlx5_lag_is_active(dev)) {
145+ NL_SET_ERR_MSG_MOD(extack, "reload is unsupported in Lag mode\n");
146+ return -EOPNOTSUPP;
147+ }
148+
144149 switch (action) {
145150 case DEVLINK_RELOAD_ACTION_DRIVER_REINIT:
146151 mlx5_unload_one(dev, false);
@@ -428,6 +433,10 @@ static int mlx5_devlink_enable_roce_validate(struct devlink *devlink, u32 id, · 281 unmodified lines
428433 NL_SET_ERR_MSG_MOD(extack, "Device doesn't support RoCE");
429434 return -EOPNOTSUPP;
430435 }
436+ if (mlx5_core_is_mp_slave(dev) || mlx5_lag_is_active(dev)) {
437+ NL_SET_ERR_MSG_MOD(extack, "Multi port slave/Lag device can't configure RoCE");
438+ return -EOPNOTSUPP;
439+ }
431440
432441 return 0;
433442 }
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c+192−67
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <net/flow_offload.h>
1313 #include <net/netfilter/nf_flow_table.h>
1414 #include <linux/workqueue.h>
15+#include <linux/refcount.h>
1516 #include <linux/xarray.h>
1617
1718 #include "lib/fs_chains.h"
@@ -52,11 +53,11 @@ struct mlx5_tc_ct_priv { · 34 unmodified lines
5253 struct mlx5_flow_table *ct_nat;
5354 struct mlx5_flow_table *post_ct;
5455 struct mutex control_lock; /* guards parallel adds/dels */
55− struct mutex shared_counter_lock;
5656 struct mapping_ctx *zone_mapping;
5757 struct mapping_ctx *labels_mapping;
5858 enum mlx5_flow_namespace_type ns_type;
5959 struct mlx5_fs_chains *chains;
60+ spinlock_t ht_lock; /* protects ft entries */
6061 };
6162
6263 struct mlx5_ct_flow {
@@ -125,6 +126,10 @@ struct mlx5_ct_counter { · 62 unmodified lines
125126 bool is_shared;
126127 };
127128
129+enum {
130+ MLX5_CT_ENTRY_FLAG_VALID,
131+};
132+
128133 struct mlx5_ct_entry {
129134 struct rhash_head node;
130135 struct rhash_head tuple_node;
@@ -135,6 +140,12 @@ struct mlx5_ct_entry { · 4 unmodified lines
135140 struct mlx5_ct_tuple tuple;
136141 struct mlx5_ct_tuple tuple_nat;
137142 struct mlx5_ct_zone_rule zone_rules[2];
143+
144+ struct mlx5_tc_ct_priv *ct_priv;
145+ struct work_struct work;
146+
147+ refcount_t refcnt;
148+ unsigned long flags;
138149 };
139150
140151 static const struct rhashtable_params cts_ht_params = {
@@ -742,6 +753,87 @@ err_attr: · 601 unmodified lines
742753 return err;
743754 }
744755
756+static bool
757+mlx5_tc_ct_entry_valid(struct mlx5_ct_entry *entry)
758+{
759+ return test_bit(MLX5_CT_ENTRY_FLAG_VALID, &entry->flags);
760+}
761+
762+static struct mlx5_ct_entry *
763+mlx5_tc_ct_entry_get(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_tuple *tuple)
764+{
765+ struct mlx5_ct_entry *entry;
766+
767+ entry = rhashtable_lookup_fast(&ct_priv->ct_tuples_ht, tuple,
768+ tuples_ht_params);
769+ if (entry && mlx5_tc_ct_entry_valid(entry) &&
770+ refcount_inc_not_zero(&entry->refcnt)) {
771+ return entry;
772+ } else if (!entry) {
773+ entry = rhashtable_lookup_fast(&ct_priv->ct_tuples_nat_ht,
774+ tuple, tuples_nat_ht_params);
775+ if (entry && mlx5_tc_ct_entry_valid(entry) &&
776+ refcount_inc_not_zero(&entry->refcnt))
777+ return entry;
778+ }
779+
780+ return entry ? ERR_PTR(-EINVAL) : NULL;
781+}
782+
783+static void mlx5_tc_ct_entry_remove_from_tuples(struct mlx5_ct_entry *entry)
784+{
785+ struct mlx5_tc_ct_priv *ct_priv = entry->ct_priv;
786+
787+ rhashtable_remove_fast(&ct_priv->ct_tuples_nat_ht,
788+ &entry->tuple_nat_node,
789+ tuples_nat_ht_params);
790+ rhashtable_remove_fast(&ct_priv->ct_tuples_ht, &entry->tuple_node,
791+ tuples_ht_params);
792+}
793+
794+static void mlx5_tc_ct_entry_del(struct mlx5_ct_entry *entry)
795+{
796+ struct mlx5_tc_ct_priv *ct_priv = entry->ct_priv;
797+
798+ mlx5_tc_ct_entry_del_rules(ct_priv, entry);
799+
800+ spin_lock_bh(&ct_priv->ht_lock);
801+ mlx5_tc_ct_entry_remove_from_tuples(entry);
802+ spin_unlock_bh(&ct_priv->ht_lock);
803+
804+ mlx5_tc_ct_counter_put(ct_priv, entry);
805+ kfree(entry);
806+}
807+
808+static void
809+mlx5_tc_ct_entry_put(struct mlx5_ct_entry *entry)
810+{
811+ if (!refcount_dec_and_test(&entry->refcnt))
812+ return;
813+
814+ mlx5_tc_ct_entry_del(entry);
815+}
816+
817+static void mlx5_tc_ct_entry_del_work(struct work_struct *work)
818+{
819+ struct mlx5_ct_entry *entry = container_of(work, struct mlx5_ct_entry, work);
820+
821+ mlx5_tc_ct_entry_del(entry);
822+}
823+
824+static void
825+__mlx5_tc_ct_entry_put(struct mlx5_ct_entry *entry)
826+{
827+ struct mlx5e_priv *priv;
828+
829+ if (!refcount_dec_and_test(&entry->refcnt))
830+ return;
831+
832+ priv = netdev_priv(entry->ct_priv->netdev);
833+ INIT_WORK(&entry->work, mlx5_tc_ct_entry_del_work);
834+ queue_work(priv->wq, &entry->work);
835+}
836+
745837 static struct mlx5_ct_counter *
746838 mlx5_tc_ct_counter_create(struct mlx5_tc_ct_priv *ct_priv)
747839 {
@@ -793,16 +885,26 @@ mlx5_tc_ct_shared_counter_get(struct mlx5_tc_ct_priv *ct_priv, · 45 unmodified lines
793885 }
794886
795887 /* Use the same counter as the reverse direction */
796− mutex_lock(&ct_priv->shared_counter_lock);
797− rev_entry = rhashtable_lookup_fast(&ct_priv->ct_tuples_ht, &rev_tuple,
798− tuples_ht_params);
799− if (rev_entry) {
800− if (refcount_inc_not_zero(&rev_entry->counter->refcount)) {
801− mutex_unlock(&ct_priv->shared_counter_lock);
802− return rev_entry->counter;
803− }
888+ spin_lock_bh(&ct_priv->ht_lock);
889+ rev_entry = mlx5_tc_ct_entry_get(ct_priv, &rev_tuple);
890+
891+ if (IS_ERR(rev_entry)) {
892+ spin_unlock_bh(&ct_priv->ht_lock);
893+ goto create_counter;
804894 }
805− mutex_unlock(&ct_priv->shared_counter_lock);
895+
896+ if (rev_entry && refcount_inc_not_zero(&rev_entry->counter->refcount)) {
897+ ct_dbg("Using shared counter entry=0x%p rev=0x%p\n", entry, rev_entry);
898+ shared_counter = rev_entry->counter;
899+ spin_unlock_bh(&ct_priv->ht_lock);
900+
901+ mlx5_tc_ct_entry_put(rev_entry);
902+ return shared_counter;
903+ }
904+
905+ spin_unlock_bh(&ct_priv->ht_lock);
906+
907+create_counter:
806908
807909 shared_counter = mlx5_tc_ct_counter_create(ct_priv);
808910 if (IS_ERR(shared_counter))
@@ -865,10 +967,14 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft, · 56 unmodified lines
865967 if (!meta_action)
866968 return -EOPNOTSUPP;
867969
868− entry = rhashtable_lookup_fast(&ft->ct_entries_ht, &cookie,
869− cts_ht_params);
870− if (entry)
871− return 0;
970+ spin_lock_bh(&ct_priv->ht_lock);
971+ entry = rhashtable_lookup_fast(&ft->ct_entries_ht, &cookie, cts_ht_params);
972+ if (entry && refcount_inc_not_zero(&entry->refcnt)) {
973+ spin_unlock_bh(&ct_priv->ht_lock);
974+ mlx5_tc_ct_entry_put(entry);
975+ return -EEXIST;
976+ }
977+ spin_unlock_bh(&ct_priv->ht_lock);
872978
873979 entry = kzalloc(sizeof(*entry), GFP_KERNEL);
874980 if (!entry)
@@ -877,6 +983,8 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft, · 2 unmodified lines
877983 entry->tuple.zone = ft->zone;
878984 entry->cookie = flow->cookie;
879985 entry->restore_cookie = meta_action->ct_metadata.cookie;
986+ refcount_set(&entry->refcnt, 2);
987+ entry->ct_priv = ct_priv;
880988
881989 err = mlx5_tc_ct_rule_to_tuple(&entry->tuple, flow_rule);
882990 if (err)
@@ -887,35 +995,40 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft, · 4 unmodified lines
887995 if (err)
888996 goto err_set;
889997
890− err = rhashtable_insert_fast(&ct_priv->ct_tuples_ht,
891− &entry->tuple_node,
892− tuples_ht_params);
998+ spin_lock_bh(&ct_priv->ht_lock);
999+
1000+ err = rhashtable_lookup_insert_fast(&ft->ct_entries_ht, &entry->node,
1001+ cts_ht_params);
1002+ if (err)
1003+ goto err_entries;
1004+
1005+ err = rhashtable_lookup_insert_fast(&ct_priv->ct_tuples_ht,
1006+ &entry->tuple_node,
1007+ tuples_ht_params);
8931008 if (err)
8941009 goto err_tuple;
8951010
8961011 if (memcmp(&entry->tuple, &entry->tuple_nat, sizeof(entry->tuple))) {
897− err = rhashtable_insert_fast(&ct_priv->ct_tuples_nat_ht,
898− &entry->tuple_nat_node,
899− tuples_nat_ht_params);
1012+ err = rhashtable_lookup_insert_fast(&ct_priv->ct_tuples_nat_ht,
1013+ &entry->tuple_nat_node,
1014+ tuples_nat_ht_params);
9001015 if (err)
9011016 goto err_tuple_nat;
9021017 }
1018+ spin_unlock_bh(&ct_priv->ht_lock);
9031019
9041020 err = mlx5_tc_ct_entry_add_rules(ct_priv, flow_rule, entry,
9051021 ft->zone_restore_id);
9061022 if (err)
9071023 goto err_rules;
9081024
909− err = rhashtable_insert_fast(&ft->ct_entries_ht, &entry->node,
910− cts_ht_params);
911− if (err)
912− goto err_insert;
1025+ set_bit(MLX5_CT_ENTRY_FLAG_VALID, &entry->flags);
1026+ mlx5_tc_ct_entry_put(entry); /* this function reference */
9131027
9141028 return 0;
9151029
916−err_insert:
917− mlx5_tc_ct_entry_del_rules(ct_priv, entry);
9181030 err_rules:
1031+ spin_lock_bh(&ct_priv->ht_lock);
9191032 if (mlx5_tc_ct_entry_has_nat(entry))
9201033 rhashtable_remove_fast(&ct_priv->ct_tuples_nat_ht,
9211034 &entry->tuple_nat_node, tuples_nat_ht_params);
@@ -924,47 +1037,43 @@ err_tuple_nat: · 2 unmodified lines
9241037 &entry->tuple_node,
9251038 tuples_ht_params);
9261039 err_tuple:
1040+ rhashtable_remove_fast(&ft->ct_entries_ht,
1041+ &entry->node,
1042+ cts_ht_params);
1043+err_entries:
1044+ spin_unlock_bh(&ct_priv->ht_lock);
9271045 err_set:
9281046 kfree(entry);
929− netdev_warn(ct_priv->netdev,
930− "Failed to offload ct entry, err: %d\n", err);
1047+ if (err != -EEXIST)
1048+ netdev_warn(ct_priv->netdev, "Failed to offload ct entry, err: %d\n", err);
9311049 return err;
9321050 }
9331051
934−static void
935−mlx5_tc_ct_del_ft_entry(struct mlx5_tc_ct_priv *ct_priv,
936− struct mlx5_ct_entry *entry)
937−{
938− mlx5_tc_ct_entry_del_rules(ct_priv, entry);
939− mutex_lock(&ct_priv->shared_counter_lock);
940− if (mlx5_tc_ct_entry_has_nat(entry))
941− rhashtable_remove_fast(&ct_priv->ct_tuples_nat_ht,
942− &entry->tuple_nat_node,
943− tuples_nat_ht_params);
944− rhashtable_remove_fast(&ct_priv->ct_tuples_ht, &entry->tuple_node,
945− tuples_ht_params);
946− mutex_unlock(&ct_priv->shared_counter_lock);
947− mlx5_tc_ct_counter_put(ct_priv, entry);
948−
949−}
950−
9511052 static int
9521053 mlx5_tc_ct_block_flow_offload_del(struct mlx5_ct_ft *ft,
9531054 struct flow_cls_offload *flow)
9541055 {
1056+ struct mlx5_tc_ct_priv *ct_priv = ft->ct_priv;
9551057 unsigned long cookie = flow->cookie;
9561058 struct mlx5_ct_entry *entry;
9571059
958− entry = rhashtable_lookup_fast(&ft->ct_entries_ht, &cookie,
959− cts_ht_params);
960− if (!entry)
1060+ spin_lock_bh(&ct_priv->ht_lock);
1061+ entry = rhashtable_lookup_fast(&ft->ct_entries_ht, &cookie, cts_ht_params);
1062+ if (!entry) {
1063+ spin_unlock_bh(&ct_priv->ht_lock);
9611064 return -ENOENT;
1065+ }
9621066
963− mlx5_tc_ct_del_ft_entry(ft->ct_priv, entry);
964− WARN_ON(rhashtable_remove_fast(&ft->ct_entries_ht,
965− &entry->node,
966− cts_ht_params));
967− kfree(entry);
1067+ if (!mlx5_tc_ct_entry_valid(entry)) {
1068+ spin_unlock_bh(&ct_priv->ht_lock);
1069+ return -EINVAL;
1070+ }
1071+
1072+ rhashtable_remove_fast(&ft->ct_entries_ht, &entry->node, cts_ht_params);
1073+ mlx5_tc_ct_entry_remove_from_tuples(entry);
1074+ spin_unlock_bh(&ct_priv->ht_lock);
1075+
1076+ mlx5_tc_ct_entry_put(entry);
9681077
9691078 return 0;
9701079 }
@@ -973,19 +1082,30 @@ static int · 2 unmodified lines
9731082 mlx5_tc_ct_block_flow_offload_stats(struct mlx5_ct_ft *ft,
9741083 struct flow_cls_offload *f)
9751084 {
1085+ struct mlx5_tc_ct_priv *ct_priv = ft->ct_priv;
9761086 unsigned long cookie = f->cookie;
9771087 struct mlx5_ct_entry *entry;
9781088 u64 lastuse, packets, bytes;
9791089
980− entry = rhashtable_lookup_fast(&ft->ct_entries_ht, &cookie,
981− cts_ht_params);
982− if (!entry)
1090+ spin_lock_bh(&ct_priv->ht_lock);
1091+ entry = rhashtable_lookup_fast(&ft->ct_entries_ht, &cookie, cts_ht_params);
1092+ if (!entry) {
1093+ spin_unlock_bh(&ct_priv->ht_lock);
9831094 return -ENOENT;
1095+ }
1096+
1097+ if (!mlx5_tc_ct_entry_valid(entry) || !refcount_inc_not_zero(&entry->refcnt)) {
1098+ spin_unlock_bh(&ct_priv->ht_lock);
1099+ return -EINVAL;
1100+ }
1101+
1102+ spin_unlock_bh(&ct_priv->ht_lock);
9841103
9851104 mlx5_fc_query_cached(entry->counter->counter, &bytes, &packets, &lastuse);
9861105 flow_stats_update(&f->stats, bytes, packets, 0, lastuse,
9871106 FLOW_ACTION_HW_STATS_DELAYED);
9881107
1108+ mlx5_tc_ct_entry_put(entry);
9891109 return 0;
9901110 }
9911111
@@ -1481,11 +1601,9 @@ err_mapping: · 489 unmodified lines
14811601 static void
14821602 mlx5_tc_ct_flush_ft_entry(void *ptr, void *arg)
14831603 {
1484− struct mlx5_tc_ct_priv *ct_priv = arg;
14851604 struct mlx5_ct_entry *entry = ptr;
14861605
1487− mlx5_tc_ct_del_ft_entry(ct_priv, entry);
1488− kfree(entry);
1606+ mlx5_tc_ct_entry_put(entry);
14891607 }
14901608
14911609 static void
@@ -1962,6 +2080,7 @@ mlx5_tc_ct_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains, · 470 unmodified lines
19622080 goto err_mapping_labels;
19632081 }
19642082
2083+ spin_lock_init(&ct_priv->ht_lock);
19652084 ct_priv->ns_type = ns_type;
19662085 ct_priv->chains = chains;
19672086 ct_priv->netdev = priv->netdev;
@@ -1996,7 +2115,6 @@ mlx5_tc_ct_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains, · 28 unmodified lines
19962115
19972116 idr_init(&ct_priv->fte_ids);
19982117 mutex_init(&ct_priv->control_lock);
1999− mutex_init(&ct_priv->shared_counter_lock);
20002118 rhashtable_init(&ct_priv->zone_ht, &zone_params);
20012119 rhashtable_init(&ct_priv->ct_tuples_ht, &tuples_ht_params);
20022120 rhashtable_init(&ct_priv->ct_tuples_nat_ht, &tuples_nat_ht_params);
@@ -2039,7 +2157,6 @@ mlx5_tc_ct_clean(struct mlx5_tc_ct_priv *ct_priv) · 36 unmodified lines
20392157 rhashtable_destroy(&ct_priv->ct_tuples_nat_ht);
20402158 rhashtable_destroy(&ct_priv->zone_ht);
20412159 mutex_destroy(&ct_priv->control_lock);
2042− mutex_destroy(&ct_priv->shared_counter_lock);
20432160 idr_destroy(&ct_priv->fte_ids);
20442161 kfree(ct_priv);
20452162 }
@@ -2061,14 +2178,22 @@ mlx5e_tc_ct_restore_flow(struct mlx5_tc_ct_priv *ct_priv, · 15 unmodified lines
20612178 if (!mlx5_tc_ct_skb_to_tuple(skb, &tuple, zone))
20622179 return false;
20632180
2064− entry = rhashtable_lookup_fast(&ct_priv->ct_tuples_ht, &tuple,
2065− tuples_ht_params);
2066− if (!entry)
2067− entry = rhashtable_lookup_fast(&ct_priv->ct_tuples_nat_ht,
2068− &tuple, tuples_nat_ht_params);
2069− if (!entry)
2181+ spin_lock(&ct_priv->ht_lock);
2182+
2183+ entry = mlx5_tc_ct_entry_get(ct_priv, &tuple);
2184+ if (!entry) {
2185+ spin_unlock(&ct_priv->ht_lock);
2186+ return false;
2187+ }
2188+
2189+ if (IS_ERR(entry)) {
2190+ spin_unlock(&ct_priv->ht_lock);
20702191 return false;
2192+ }
2193+ spin_unlock(&ct_priv->ht_lock);
20712194
20722195 tcf_ct_flow_table_restore_skb(skb, entry->restore_cookie);
2196+ __mlx5_tc_ct_entry_put(entry);
2197+
20732198 return true;
20742199 }
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h+1−1
@@ -83,7 +83,7 @@ static inline void mlx5e_xdp_tx_disable(struct mlx5e_priv *priv) · 82 unmodified lines
8383
8484 clear_bit(MLX5E_STATE_XDP_TX_ENABLED, &priv->state);
8585 /* Let other device's napi(s) and XSK wakeups see our new state. */
86− synchronize_rcu();
86+ synchronize_net();
8787 }
8888
8989 static inline bool mlx5e_xdp_tx_is_enabled(struct mlx5e_priv *priv)
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c+1−1
@@ -111,7 +111,7 @@ err_free_cparam: · 110 unmodified lines
111111 void mlx5e_close_xsk(struct mlx5e_channel *c)
112112 {
113113 clear_bit(MLX5E_CHANNEL_STATE_XSK, c->state);
114− synchronize_rcu(); /* Sync with the XSK wakeup and with NAPI. */
114+ synchronize_net(); /* Sync with the XSK wakeup and with NAPI. */
115115
116116 mlx5e_close_rq(&c->xskrq);
117117 mlx5e_close_cq(&c->xskrq.cq);
drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h+1−1
@@ -173,7 +173,7 @@ static inline bool mlx5e_accel_tx_eseg(struct mlx5e_priv *priv, · 172 unmodified lines
173173 #endif
174174
175175 #if IS_ENABLED(CONFIG_GENEVE)
176− if (skb->encapsulation)
176+ if (skb->encapsulation && skb->ip_summed == CHECKSUM_PARTIAL)
177177 mlx5e_tx_tunnel_accel(skb, eseg, ihs);
178178 #endif
179179
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c+31−35
@@ -57,6 +57,20 @@ struct mlx5e_ktls_offload_context_rx { · 56 unmodified lines
5757 struct mlx5e_ktls_rx_resync_ctx resync;
5858 };
5959
60+static bool mlx5e_ktls_priv_rx_put(struct mlx5e_ktls_offload_context_rx *priv_rx)
61+{
62+ if (!refcount_dec_and_test(&priv_rx->resync.refcnt))
63+ return false;
64+
65+ kfree(priv_rx);
66+ return true;
67+}
68+
69+static void mlx5e_ktls_priv_rx_get(struct mlx5e_ktls_offload_context_rx *priv_rx)
70+{
71+ refcount_inc(&priv_rx->resync.refcnt);
72+}
73+
6074 static int mlx5e_ktls_create_tir(struct mlx5_core_dev *mdev, u32 *tirn, u32 rqtn)
6175 {
6276 int err, inlen;
@@ -326,7 +340,7 @@ static void resync_handle_work(struct work_struct *work) · 263 unmodified lines
326340 priv_rx = container_of(resync, struct mlx5e_ktls_offload_context_rx, resync);
327341
328342 if (unlikely(test_bit(MLX5E_PRIV_RX_FLAG_DELETING, priv_rx->flags))) {
329− refcount_dec(&resync->refcnt);
343+ mlx5e_ktls_priv_rx_put(priv_rx);
330344 return;
331345 }
332346
@@ -334,7 +348,7 @@ static void resync_handle_work(struct work_struct *work) · 1 unmodified line
334348 sq = &c->async_icosq;
335349
336350 if (resync_post_get_progress_params(sq, priv_rx))
337− refcount_dec(&resync->refcnt);
351+ mlx5e_ktls_priv_rx_put(priv_rx);
338352 }
339353
340354 static void resync_init(struct mlx5e_ktls_rx_resync_ctx *resync,
@@ -377,7 +391,11 @@ unlock: · 36 unmodified lines
377391 return err;
378392 }
379393
380−/* Function is called with elevated refcount, it decreases it. */
394+/* Function can be called with the refcount being either elevated or not.
395+ * It decreases the refcount and may free the kTLS priv context.
396+ * Refcount is not elevated only if tls_dev_del has been called, but GET_PSV was
397+ * already in flight.
398+ */
381399 void mlx5e_ktls_handle_get_psv_completion(struct mlx5e_icosq_wqe_info *wi,
382400 struct mlx5e_icosq *sq)
383401 {
@@ -410,7 +428,7 @@ void mlx5e_ktls_handle_get_psv_completion(struct mlx5e_icosq_wqe_info *wi, · 26 unmodified lines
410428 tls_offload_rx_resync_async_request_end(priv_rx->sk, cpu_to_be32(hw_seq));
411429 priv_rx->stats->tls_resync_req_end++;
412430 out:
413− refcount_dec(&resync->refcnt);
431+ mlx5e_ktls_priv_rx_put(priv_rx);
414432 dma_unmap_single(dev, buf->dma_addr, PROGRESS_PARAMS_PADDED_SIZE, DMA_FROM_DEVICE);
415433 kfree(buf);
416434 }
@@ -431,9 +449,9 @@ static bool resync_queue_get_psv(struct sock *sk) · 14 unmodified lines
431449 return false;
432450
433451 resync = &priv_rx->resync;
434− refcount_inc(&resync->refcnt);
452+ mlx5e_ktls_priv_rx_get(priv_rx);
435453 if (unlikely(!queue_work(resync->priv->tls->rx_wq, &resync->work)))
436− refcount_dec(&resync->refcnt);
454+ mlx5e_ktls_priv_rx_put(priv_rx);
437455
438456 return true;
439457 }
@@ -625,31 +643,6 @@ err_create_key: · 185 unmodified lines
625643 return err;
626644 }
627645
628−/* Elevated refcount on the resync object means there are
629− * outstanding operations (uncompleted GET_PSV WQEs) that
630− * will read the resync / priv_rx objects once completed.
631− * Wait for them to avoid use-after-free.
632− */
633−static void wait_for_resync(struct net_device *netdev,
634− struct mlx5e_ktls_rx_resync_ctx *resync)
635−{
636−#define MLX5E_KTLS_RX_RESYNC_TIMEOUT 20000 /* msecs */
637− unsigned long exp_time = jiffies + msecs_to_jiffies(MLX5E_KTLS_RX_RESYNC_TIMEOUT);
638− unsigned int refcnt;
639−
640− do {
641− refcnt = refcount_read(&resync->refcnt);
642− if (refcnt == 1)
643− return;
644−
645− msleep(20);
646− } while (time_before(jiffies, exp_time));
647−
648− netdev_warn(netdev,
649− "Failed waiting for kTLS RX resync refcnt to be released (%u).\n",
650− refcnt);
651−}
652−
653646 void mlx5e_ktls_del_rx(struct net_device *netdev, struct tls_context *tls_ctx)
654647 {
655648 struct mlx5e_ktls_offload_context_rx *priv_rx;
@@ -663,7 +656,7 @@ void mlx5e_ktls_del_rx(struct net_device *netdev, struct tls_context *tls_ctx) · 7 unmodified lines
663656 priv_rx = mlx5e_get_ktls_rx_priv_ctx(tls_ctx);
664657 set_bit(MLX5E_PRIV_RX_FLAG_DELETING, priv_rx->flags);
665658 mlx5e_set_ktls_rx_priv_ctx(tls_ctx, NULL);
666− synchronize_rcu(); /* Sync with NAPI */
659+ synchronize_net(); /* Sync with NAPI */
667660 if (!cancel_work_sync(&priv_rx->rule.work))
668661 /* completion is needed, as the priv_rx in the add flow
669662 * is maintained on the wqe info (wi), not on the socket.
@@ -671,8 +664,7 @@ void mlx5e_ktls_del_rx(struct net_device *netdev, struct tls_context *tls_ctx) · 1 unmodified line
671664 wait_for_completion(&priv_rx->add_ctx);
672665 resync = &priv_rx->resync;
673666 if (cancel_work_sync(&resync->work))
674− refcount_dec(&resync->refcnt);
675− wait_for_resync(netdev, resync);
667+ mlx5e_ktls_priv_rx_put(priv_rx);
676668
677669 priv_rx->stats->tls_del++;
678670 if (priv_rx->rule.rule)
@@ -680,5 +672,9 @@ void mlx5e_ktls_del_rx(struct net_device *netdev, struct tls_context *tls_ctx) · 1 unmodified line
680672
681673 mlx5_core_destroy_tir(mdev, priv_rx->tirn);
682674 mlx5_ktls_destroy_key(mdev, priv_rx->key_id);
683− kfree(priv_rx);
675+ /* priv_rx should normally be freed here, but if there is an outstanding
676+ * GET_PSV, deallocation will be delayed until the CQE for GET_PSV is
677+ * processed.
678+ */
679+ mlx5e_ktls_priv_rx_put(priv_rx);
684680 }
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+26−13
@@ -536,7 +536,7 @@ static int mlx5e_get_coalesce(struct net_device *netdev, · 535 unmodified lines
536536 #define MLX5E_MAX_COAL_FRAMES MLX5_MAX_CQ_COUNT
537537
538538 static void
539−mlx5e_set_priv_channels_coalesce(struct mlx5e_priv *priv, struct ethtool_coalesce *coal)
539+mlx5e_set_priv_channels_tx_coalesce(struct mlx5e_priv *priv, struct ethtool_coalesce *coal)
540540 {
541541 struct mlx5_core_dev *mdev = priv->mdev;
542542 int tc;
@@ -551,6 +551,17 @@ mlx5e_set_priv_channels_coalesce(struct mlx5e_priv *priv, struct ethtool_coalesc · 8 unmodified lines
551551 coal->tx_coalesce_usecs,
552552 coal->tx_max_coalesced_frames);
553553 }
554+ }
555+}
556+
557+static void
558+mlx5e_set_priv_channels_rx_coalesce(struct mlx5e_priv *priv, struct ethtool_coalesce *coal)
559+{
560+ struct mlx5_core_dev *mdev = priv->mdev;
561+ int i;
562+
563+ for (i = 0; i < priv->channels.num; ++i) {
564+ struct mlx5e_channel *c = priv->channels.c[i];
554565
555566 mlx5_core_modify_cq_moderation(mdev, &c->rq.cq.mcq,
556567 coal->rx_coalesce_usecs,
@@ -597,21 +608,9 @@ int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv, · 40 unmodified lines
597608 tx_moder->pkts = coal->tx_max_coalesced_frames;
598609 new_channels.params.tx_dim_enabled = !!coal->use_adaptive_tx_coalesce;
599610
600− if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
601− priv->channels.params = new_channels.params;
602− goto out;
603− }
604− /* we are opened */
605−
606611 reset_rx = !!coal->use_adaptive_rx_coalesce != priv->channels.params.rx_dim_enabled;
607612 reset_tx = !!coal->use_adaptive_tx_coalesce != priv->channels.params.tx_dim_enabled;
608613
609− if (!reset_rx && !reset_tx) {
610− mlx5e_set_priv_channels_coalesce(priv, coal);
611− priv->channels.params = new_channels.params;
612− goto out;
613− }
614−
615614 if (reset_rx) {
616615 u8 mode = MLX5E_GET_PFLAG(&new_channels.params,
617616 MLX5E_PFLAG_RX_CQE_BASED_MODER);
@@ -625,6 +624,20 @@ int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv, · 7 unmodified lines
625624 mlx5e_reset_tx_moderation(&new_channels.params, mode);
626625 }
627626
627+ if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
628+ priv->channels.params = new_channels.params;
629+ goto out;
630+ }
631+
632+ if (!reset_rx && !reset_tx) {
633+ if (!coal->use_adaptive_rx_coalesce)
634+ mlx5e_set_priv_channels_rx_coalesce(priv, coal);
635+ if (!coal->use_adaptive_tx_coalesce)
636+ mlx5e_set_priv_channels_tx_coalesce(priv, coal);
637+ priv->channels.params = new_channels.params;
638+ goto out;
639+ }
640+
628641 err = mlx5e_safe_switch_channels(priv, &new_channels, NULL, NULL);
629642
630643 out:
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+16−9
@@ -67,6 +67,7 @@ · 66 unmodified lines
6767 #include "en/ptp.h"
6868 #include "qos.h"
6969 #include "en/trap.h"
70+#include "fpga/ipsec.h"
7071
7172 bool mlx5e_check_fragmented_striding_rq_cap(struct mlx5_core_dev *mdev)
7273 {
@@ -108,7 +109,7 @@ bool mlx5e_striding_rq_possible(struct mlx5_core_dev *mdev, · 35 unmodified lines
108109 if (!mlx5e_check_fragmented_striding_rq_cap(mdev))
109110 return false;
110111
111− if (MLX5_IPSEC_DEV(mdev))
112+ if (mlx5_fpga_is_ipsec_device(mdev))
112113 return false;
113114
114115 if (params->xdp_prog) {
@@ -947,7 +948,7 @@ void mlx5e_activate_rq(struct mlx5e_rq *rq) · 832 unmodified lines
947948 void mlx5e_deactivate_rq(struct mlx5e_rq *rq)
948949 {
949950 clear_bit(MLX5E_RQ_STATE_ENABLED, &rq->state);
950− synchronize_rcu(); /* Sync with NAPI to prevent mlx5e_post_rx_wqes. */
951+ synchronize_net(); /* Sync with NAPI to prevent mlx5e_post_rx_wqes. */
951952 }
952953
953954 void mlx5e_close_rq(struct mlx5e_rq *rq)
@@ -1401,7 +1402,7 @@ void mlx5e_deactivate_txqsq(struct mlx5e_txqsq *sq) · 447 unmodified lines
14011402 struct mlx5_wq_cyc *wq = &sq->wq;
14021403
14031404 clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state);
1404− synchronize_rcu(); /* Sync with NAPI to prevent netif_tx_wake_queue. */
1405+ synchronize_net(); /* Sync with NAPI to prevent netif_tx_wake_queue. */
14051406
14061407 mlx5e_tx_disable_queue(sq->txq);
14071408
@@ -1476,7 +1477,7 @@ void mlx5e_activate_icosq(struct mlx5e_icosq *icosq) · 68 unmodified lines
14761477 void mlx5e_deactivate_icosq(struct mlx5e_icosq *icosq)
14771478 {
14781479 clear_bit(MLX5E_SQ_STATE_ENABLED, &icosq->state);
1479− synchronize_rcu(); /* Sync with NAPI. */
1480+ synchronize_net(); /* Sync with NAPI. */
14801481 }
14811482
14821483 void mlx5e_close_icosq(struct mlx5e_icosq *sq)
@@ -1555,7 +1556,7 @@ void mlx5e_close_xdpsq(struct mlx5e_xdpsq *sq) · 72 unmodified lines
15551556 struct mlx5e_channel *c = sq->channel;
15561557
15571558 clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state);
1558− synchronize_rcu(); /* Sync with NAPI. */
1559+ synchronize_net(); /* Sync with NAPI. */
15591560
15601561 mlx5e_destroy_sq(c->mdev, sq->sqn);
15611562 mlx5e_free_xdpsq_descs(sq);
@@ -1879,12 +1880,12 @@ static int mlx5e_open_queues(struct mlx5e_channel *c, · 317 unmodified lines
18791880
18801881 mlx5e_build_create_cq_param(&ccp, c);
18811882
1882− err = mlx5e_open_cq(c->priv, icocq_moder, &cparam->icosq.cqp, &ccp,
1883+ err = mlx5e_open_cq(c->priv, icocq_moder, &cparam->async_icosq.cqp, &ccp,
18831884 &c->async_icosq.cq);
18841885 if (err)
18851886 return err;
18861887
1887− err = mlx5e_open_cq(c->priv, icocq_moder, &cparam->async_icosq.cqp, &ccp,
1888+ err = mlx5e_open_cq(c->priv, icocq_moder, &cparam->icosq.cqp, &ccp,
18881889 &c->icosq.cq);
18891890 if (err)
18901891 goto err_close_async_icosq_cq;
@@ -2122,7 +2123,12 @@ static void mlx5e_build_rq_frags_info(struct mlx5_core_dev *mdev, · 231 unmodified lines
21222123 u32 buf_size = 0;
21232124 int i;
21242125
2126+<<<<<<< HEAD
21252127 if (MLX5_IPSEC_DEV(mdev))
2128+=======
2129+#ifdef CONFIG_MLX5_EN_IPSEC
2130+ if (mlx5_fpga_is_ipsec_device(mdev))
2131+>>>>>>> 3af409ca278d4a8d50e91f9f7c4c33b175645cf3
21262132 byte_count += MLX5E_METADATA_ETHER_LEN;
21272133
21282134 if (mlx5e_rx_is_linear_skb(params, xsk)) {
@@ -4590,8 +4596,9 @@ static int mlx5e_xdp_allowed(struct mlx5e_priv *priv, struct bpf_prog *prog) · 2461 unmodified lines
45904596 return -EINVAL;
45914597 }
45924598
4593− if (MLX5_IPSEC_DEV(priv->mdev)) {
4594− netdev_warn(netdev, "can't set XDP with IPSec offload\n");
4599+ if (mlx5_fpga_is_ipsec_device(priv->mdev)) {
4600+ netdev_warn(netdev,
4601+ "XDP is not available on Innova cards with IPsec support\n");
45954602 return -EINVAL;
45964603 }
45974604
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c+2−2
@@ -1783,8 +1783,8 @@ int mlx5e_rq_set_handlers(struct mlx5e_rq *rq, struct mlx5e_params *params, bool · 1782 unmodified lines
17831783 rq->dealloc_wqe = mlx5e_dealloc_rx_mpwqe;
17841784
17851785 rq->handle_rx_cqe = priv->profile->rx_handlers->handle_rx_cqe_mpwqe;
1786− if (MLX5_IPSEC_DEV(mdev)) {
1787− netdev_err(netdev, "MPWQE RQ with IPSec offload not supported\n");
1786+ if (mlx5_fpga_is_ipsec_device(mdev)) {
1787+ netdev_err(netdev, "MPWQE RQ with Innova IPSec offload not supported\n");
17881788 return -EINVAL;
17891789 }
17901790 if (!rq->handle_rx_cqe) {
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+1−1
@@ -4445,7 +4445,7 @@ static int apply_police_params(struct mlx5e_priv *priv, u64 rate, · 4444 unmodified lines
44454445 */
44464446 if (rate) {
44474447 rate = (rate * BITS_PER_BYTE) + 500000;
4448− rate_mbps = max_t(u32, do_div(rate, 1000000), 1);
4448+ rate_mbps = max_t(u64, do_div(rate, 1000000), 1);
44494449 }
44504450
44514451 err = mlx5_esw_modify_vport_rate(esw, vport_num, rate_mbps);
drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c+1−1
@@ -124,7 +124,7 @@ struct mlx5_fpga_ipsec { · 123 unmodified lines
124124 struct ida halloc;
125125 };
126126
127−static bool mlx5_fpga_is_ipsec_device(struct mlx5_core_dev *mdev)
127+bool mlx5_fpga_is_ipsec_device(struct mlx5_core_dev *mdev)
128128 {
129129 if (!mdev->fpga || !MLX5_CAP_GEN(mdev, fpga))
130130 return false;
drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.h+2−0
@@ -43,6 +43,7 @@ u32 mlx5_fpga_ipsec_device_caps(struct mlx5_core_dev *mdev); · 42 unmodified lines
4343 const struct mlx5_flow_cmds *
4444 mlx5_fs_cmd_get_default_ipsec_fpga_cmds(enum fs_flow_table_type type);
4545 void mlx5_fpga_ipsec_build_fs_cmds(void);
46+bool mlx5_fpga_is_ipsec_device(struct mlx5_core_dev *mdev);
4647 #else
4748 static inline
4849 const struct mlx5_accel_ipsec_ops *mlx5_fpga_ipsec_ops(struct mlx5_core_dev *mdev)
@@ -55,6 +56,7 @@ mlx5_fs_cmd_get_default_ipsec_fpga_cmds(enum fs_flow_table_type type) · 6 unmodified lines
5556 }
5657
5758 static inline void mlx5_fpga_ipsec_build_fs_cmds(void) {};
59+static inline bool mlx5_fpga_is_ipsec_device(struct mlx5_core_dev *mdev) { return false; }
5860
5961 #endif /* CONFIG_MLX5_FPGA_IPSEC */
6062 #endif /* __MLX5_FPGA_IPSEC_H__ */
drivers/net/ethernet/mellanox/mlx5/core/health.c+14−8
@@ -190,6 +190,16 @@ static bool reset_fw_if_needed(struct mlx5_core_dev *dev) · 189 unmodified lines
190190 return true;
191191 }
192192
193+static void enter_error_state(struct mlx5_core_dev *dev, bool force)
194+{
195+ if (mlx5_health_check_fatal_sensors(dev) || force) { /* protected state setting */
196+ dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR;
197+ mlx5_cmd_flush(dev);
198+ }
199+
200+ mlx5_notifier_call_chain(dev->priv.events, MLX5_DEV_EVENT_SYS_ERROR, (void *)1);
201+}
202+
193203 void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force)
194204 {
195205 bool err_detected = false;
@@ -208,12 +218,7 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force) · 12 unmodified lines
208218 goto unlock;
209219 }
210220
211− if (mlx5_health_check_fatal_sensors(dev) || force) { /* protected state setting */
212− dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR;
213− mlx5_cmd_flush(dev);
214− }
215−
216− mlx5_notifier_call_chain(dev->priv.events, MLX5_DEV_EVENT_SYS_ERROR, (void *)1);
221+ enter_error_state(dev, force);
217222 unlock:
218223 mutex_unlock(&dev->intf_state_mutex);
219224 }
@@ -613,7 +618,7 @@ static void mlx5_fw_fatal_reporter_err_work(struct work_struct *work) · 393 unmodified lines
613618 priv = container_of(health, struct mlx5_priv, health);
614619 dev = container_of(priv, struct mlx5_core_dev, priv);
615620
616− mlx5_enter_error_state(dev, false);
621+ enter_error_state(dev, false);
617622 if (IS_ERR_OR_NULL(health->fw_fatal_reporter)) {
618623 if (mlx5_health_try_recover(dev))
619624 mlx5_core_err(dev, "health recovery failed\n");
@@ -707,8 +712,9 @@ static void poll_health(struct timer_list *t) · 87 unmodified lines
707712 mlx5_core_err(dev, "Fatal error %u detected\n", fatal_error);
708713 dev->priv.health.fatal_error = fatal_error;
709714 print_health_info(dev);
715+ dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR;
710716 mlx5_trigger_health_work(dev);
711− goto out;
717+ return;
712718 }
713719
714720 count = ioread32be(health->health_counter);
drivers/net/ethernet/mellanox/mlx5/core/main.c+2−1
@@ -1445,7 +1445,8 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *id) · 1444 unmodified lines
14451445 dev_err(&pdev->dev, "mlx5_crdump_enable failed with error code %d\n", err);
14461446
14471447 pci_save_state(pdev);
1448− devlink_reload_enable(devlink);
1448+ if (!mlx5_core_is_mp_slave(dev))
1449+ devlink_reload_enable(devlink);
14491450 return 0;
14501451
14511452 err_load_one:
drivers/net/ethernet/realtek/r8169_main.c+25−0
@@ -2230,6 +2230,31 @@ static void rtl_prepare_power_down(struct rtl8169_private *tp) · 2229 unmodified lines
22302230 phy_speed_down(tp->phydev, false);
22312231 rtl_wol_enable_rx(tp);
22322232 }
2233+
2234+ switch (tp->mac_version) {
2235+ case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26:
2236+ case RTL_GIGA_MAC_VER_29 ... RTL_GIGA_MAC_VER_30:
2237+ case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_33:
2238+ case RTL_GIGA_MAC_VER_37:
2239+ case RTL_GIGA_MAC_VER_39:
2240+ case RTL_GIGA_MAC_VER_43:
2241+ case RTL_GIGA_MAC_VER_44:
2242+ case RTL_GIGA_MAC_VER_45:
2243+ case RTL_GIGA_MAC_VER_46:
2244+ case RTL_GIGA_MAC_VER_47:
2245+ case RTL_GIGA_MAC_VER_48:
2246+ case RTL_GIGA_MAC_VER_50 ... RTL_GIGA_MAC_VER_63:
2247+ RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) & ~0x80);
2248+ break;
2249+ case RTL_GIGA_MAC_VER_40:
2250+ case RTL_GIGA_MAC_VER_41:
2251+ case RTL_GIGA_MAC_VER_49:
2252+ rtl_eri_clear_bits(tp, 0x1a8, 0xfc000000);
2253+ RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) & ~0x80);
2254+ break;
2255+ default:
2256+ break;
2257+ }
22332258 }
22342259
22352260 static void rtl_init_rxcfg(struct rtl8169_private *tp)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c+12−14
@@ -1862,6 +1862,18 @@ static int axienet_probe(struct platform_device *pdev) · 1861 unmodified lines
18621862 lp->options = XAE_OPTION_DEFAULTS;
18631863 lp->rx_bd_num = RX_BD_NUM_DEFAULT;
18641864 lp->tx_bd_num = TX_BD_NUM_DEFAULT;
1865+
1866+ lp->clk = devm_clk_get_optional(&pdev->dev, NULL);
1867+ if (IS_ERR(lp->clk)) {
1868+ ret = PTR_ERR(lp->clk);
1869+ goto free_netdev;
1870+ }
1871+ ret = clk_prepare_enable(lp->clk);
1872+ if (ret) {
1873+ dev_err(&pdev->dev, "Unable to enable clock: %d\n", ret);
1874+ goto free_netdev;
1875+ }
1876+
18651877 /* Map device registers */
18661878 ethres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
18671879 lp->regs = devm_ioremap_resource(&pdev->dev, ethres);
@@ -2046,20 +2058,6 @@ static int axienet_probe(struct platform_device *pdev) · 178 unmodified lines
20462058
20472059 lp->phy_node = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0);
20482060 if (lp->phy_node) {
2049− lp->clk = devm_clk_get(&pdev->dev, NULL);
2050− if (IS_ERR(lp->clk)) {
2051− dev_warn(&pdev->dev, "Failed to get clock: %ld\n",
2052− PTR_ERR(lp->clk));
2053− lp->clk = NULL;
2054− } else {
2055− ret = clk_prepare_enable(lp->clk);
2056− if (ret) {
2057− dev_err(&pdev->dev, "Unable to enable clock: %d\n",
2058− ret);
2059− goto free_netdev;
2060− }
2061− }
2062−
20632061 ret = axienet_mdio_setup(lp);
20642062 if (ret)
20652063 dev_warn(&pdev->dev,
drivers/net/ipa/ipa_main.c+2−2
@@ -580,10 +580,10 @@ ipa_resource_config(struct ipa *ipa, const struct ipa_resource_data *data) · 579 unmodified lines
580580 return -EINVAL;
581581
582582 for (i = 0; i < data->resource_src_count; i++)
583− ipa_resource_config_src(ipa, data->resource_src);
583+ ipa_resource_config_src(ipa, &data->resource_src[i]);
584584
585585 for (i = 0; i < data->resource_dst_count; i++)
586− ipa_resource_config_dst(ipa, data->resource_dst);
586+ ipa_resource_config_dst(ipa, &data->resource_dst[i]);
587587
588588 return 0;
589589 }
drivers/net/phy/phy_device.c+17−36
@@ -300,50 +300,22 @@ static int mdio_bus_phy_resume(struct device *dev) · 299 unmodified lines
300300
301301 phydev->suspended_by_mdio_bus = 0;
302302
303− ret = phy_resume(phydev);
303+ ret = phy_init_hw(phydev);
304304 if (ret < 0)
305305 return ret;
306306
307−no_resume:
308− if (phydev->attached_dev && phydev->adjust_link)
309− phy_start_machine(phydev);
310−
311− return 0;
312−}
313−
314−static int mdio_bus_phy_restore(struct device *dev)
315−{
316− struct phy_device *phydev = to_phy_device(dev);
317− struct net_device *netdev = phydev->attached_dev;
318− int ret;
319−
320− if (!netdev)
321− return 0;
322−
323− ret = phy_init_hw(phydev);
307+ ret = phy_resume(phydev);
324308 if (ret < 0)
325309 return ret;
326−
310+no_resume:
327311 if (phydev->attached_dev && phydev->adjust_link)
328312 phy_start_machine(phydev);
329313
330314 return 0;
331315 }
332316
333−static const struct dev_pm_ops mdio_bus_phy_pm_ops = {
334− .suspend = mdio_bus_phy_suspend,
335− .resume = mdio_bus_phy_resume,
336− .freeze = mdio_bus_phy_suspend,
337− .thaw = mdio_bus_phy_resume,
338− .restore = mdio_bus_phy_restore,
339−};
340−
341−#define MDIO_BUS_PHY_PM_OPS (&mdio_bus_phy_pm_ops)
342−
343−#else
344−
345−#define MDIO_BUS_PHY_PM_OPS NULL
346−
317+static SIMPLE_DEV_PM_OPS(mdio_bus_phy_pm_ops, mdio_bus_phy_suspend,
318+ mdio_bus_phy_resume);
347319 #endif /* CONFIG_PM */
348320
349321 /**
@@ -554,7 +526,7 @@ static const struct device_type mdio_bus_phy_type = { · 204 unmodified lines
554526 .name = "PHY",
555527 .groups = phy_dev_groups,
556528 .release = phy_device_release,
557− .pm = MDIO_BUS_PHY_PM_OPS,
529+ .pm = pm_ptr(&mdio_bus_phy_pm_ops),
558530 };
559531
560532 static int phy_request_driver_module(struct phy_device *dev, u32 phy_id)
@@ -1144,10 +1116,19 @@ int phy_init_hw(struct phy_device *phydev) · 583 unmodified lines
11441116 if (ret < 0)
11451117 return ret;
11461118
1147− if (phydev->drv->config_init)
1119+ if (phydev->drv->config_init) {
11481120 ret = phydev->drv->config_init(phydev);
1121+ if (ret < 0)
1122+ return ret;
1123+ }
11491124
1150− return ret;
1125+ if (phydev->drv->config_intr) {
1126+ ret = phydev->drv->config_intr(phydev);
1127+ if (ret < 0)
1128+ return ret;
1129+ }
1130+
1131+ return 0;
11511132 }
11521133 EXPORT_SYMBOL(phy_init_hw);
11531134
drivers/net/wan/lmc/lmc_main.c+3−1
@@ -854,7 +854,7 @@ static int lmc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 853 unmodified lines
854854 spin_lock_init(&sc->lmc_lock);
855855 pci_set_master(pdev);
856856
857− printk(KERN_INFO "%s: detected at %lx, irq %d\n", dev->name,
857+ printk(KERN_INFO "hdlc: detected at %lx, irq %d\n",
858858 dev->base_addr, dev->irq);
859859
860860 err = register_hdlc_device(dev);
@@ -899,6 +899,8 @@ static int lmc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 38 unmodified lines
899899 break;
900900 default:
901901 printk(KERN_WARNING "%s: LMC UNKNOWN CARD!\n", dev->name);
902+ unregister_hdlc_device(dev);
903+ return -EIO;
902904 break;
903905 }
904906
drivers/net/wireless/broadcom/b43/phy_n.c+1−1
@@ -5311,7 +5311,7 @@ static void b43_nphy_restore_cal(struct b43_wldev *dev) · 5310 unmodified lines
53115311
53125312 for (i = 0; i < 4; i++) {
53135313 if (dev->phy.rev >= 3)
5314− table[i] = coef[i];
5314+ coef[i] = table[i];
53155315 else
53165316 coef[i] = 0;
53175317 }
drivers/target/iscsi/cxgbit/cxgbit_target.c+1−2
@@ -86,8 +86,7 @@ static int cxgbit_is_ofld_imm(const struct sk_buff *skb) · 85 unmodified lines
8686 if (likely(cxgbit_skcb_flags(skb) & SKCBF_TX_ISO))
8787 length += sizeof(struct cpl_tx_data_iso);
8888
89−#define MAX_IMM_TX_PKT_LEN 256
90− return length <= MAX_IMM_TX_PKT_LEN;
89+ return length <= MAX_IMM_OFLD_TX_DATA_WR_LEN;
9190 }
9291
9392 /*
include/linux/atmdev.h+1−1
@@ -207,7 +207,7 @@ struct atm_skb_data { · 206 unmodified lines
207207 struct atm_vcc *vcc; /* ATM VCC */
208208 unsigned long atm_options; /* ATM layer options */
209209 unsigned int acct_truesize; /* truesize accounted to vcc */
210−};
210+} __packed;
211211
212212 #define VCC_HTABLE_SIZE 32
213213
include/net/act_api.h+1−0
@@ -166,6 +166,7 @@ int tcf_idr_create_from_flags(struct tc_action_net *tn, u32 index, · 165 unmodified lines
166166 struct nlattr *est, struct tc_action **a,
167167 const struct tc_action_ops *ops, int bind,
168168 u32 flags);
169+void tcf_idr_insert_many(struct tc_action *actions[]);
169170 void tcf_idr_cleanup(struct tc_action_net *tn, u32 index);
170171 int tcf_idr_check_alloc(struct tc_action_net *tn, u32 *index,
171172 struct tc_action **a, int bind);
include/uapi/linux/pkt_cls.h+1−0
@@ -593,6 +593,7 @@ enum { · 592 unmodified lines
593593 TCA_FLOWER_KEY_CT_FLAGS_TRACKED = 1 << 3, /* Conntrack has occurred. */
594594 TCA_FLOWER_KEY_CT_FLAGS_INVALID = 1 << 4, /* Conntrack is invalid. */
595595 TCA_FLOWER_KEY_CT_FLAGS_REPLY = 1 << 5, /* Packet is in the reply direction. */
596+ __TCA_FLOWER_KEY_CT_FLAGS_MAX,
596597 };
597598
598599 enum {
kernel/bpf/verifier.c+6−4
@@ -11563,7 +11563,7 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env) · 11562 unmodified lines
1156311563 bool isdiv = BPF_OP(insn->code) == BPF_DIV;
1156411564 struct bpf_insn *patchlet;
1156511565 struct bpf_insn chk_and_div[] = {
11566− /* Rx div 0 -> 0 */
11566+ /* [R,W]x div 0 -> 0 */
1156711567 BPF_RAW_INSN((is64 ? BPF_JMP : BPF_JMP32) |
1156811568 BPF_JNE | BPF_K, insn->src_reg,
1156911569 0, 2, 0),
@@ -11572,16 +11572,18 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env) · 2 unmodified lines
1157211572 *insn,
1157311573 };
1157411574 struct bpf_insn chk_and_mod[] = {
11575− /* Rx mod 0 -> Rx */
11575+ /* [R,W]x mod 0 -> [R,W]x */
1157611576 BPF_RAW_INSN((is64 ? BPF_JMP : BPF_JMP32) |
1157711577 BPF_JEQ | BPF_K, insn->src_reg,
11578− 0, 1, 0),
11578+ 0, 1 + (is64 ? 0 : 1), 0),
1157911579 *insn,
11580+ BPF_JMP_IMM(BPF_JA, 0, 0, 1),
11581+ BPF_MOV32_REG(insn->dst_reg, insn->dst_reg),
1158011582 };
1158111583
1158211584 patchlet = isdiv ? chk_and_div : chk_and_mod;
1158311585 cnt = isdiv ? ARRAY_SIZE(chk_and_div) :
11584− ARRAY_SIZE(chk_and_mod);
11586+ ARRAY_SIZE(chk_and_mod) - (is64 ? 2 : 0);
1158511587
1158611588 new_prog = bpf_patch_insn_data(env, i + delta, patchlet, cnt);
1158711589 if (!new_prog)
net/appletalk/ddp.c+21−12
@@ -1577,8 +1577,8 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) · 1576 unmodified lines
15771577 struct sk_buff *skb;
15781578 struct net_device *dev;
15791579 struct ddpehdr *ddp;
1580− int size;
1581− struct atalk_route *rt;
1580+ int size, hard_header_len;
1581+ struct atalk_route *rt, *rt_lo = NULL;
15821582 int err;
15831583
15841584 if (flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT))
@@ -1641,7 +1641,22 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) · 56 unmodified lines
16411641 SOCK_DEBUG(sk, "SK %p: Size needed %d, device %s\n",
16421642 sk, size, dev->name);
16431643
1644− size += dev->hard_header_len;
1644+ hard_header_len = dev->hard_header_len;
1645+ /* Leave room for loopback hardware header if necessary */
1646+ if (usat->sat_addr.s_node == ATADDR_BCAST &&
1647+ (dev->flags & IFF_LOOPBACK || !(rt->flags & RTF_GATEWAY))) {
1648+ struct atalk_addr at_lo;
1649+
1650+ at_lo.s_node = 0;
1651+ at_lo.s_net = 0;
1652+
1653+ rt_lo = atrtr_find(&at_lo);
1654+
1655+ if (rt_lo && rt_lo->dev->hard_header_len > hard_header_len)
1656+ hard_header_len = rt_lo->dev->hard_header_len;
1657+ }
1658+
1659+ size += hard_header_len;
16451660 release_sock(sk);
16461661 skb = sock_alloc_send_skb(sk, size, (flags & MSG_DONTWAIT), &err);
16471662 lock_sock(sk);
@@ -1649,7 +1664,7 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) · 1 unmodified line
16491664 goto out;
16501665
16511666 skb_reserve(skb, ddp_dl->header_length);
1652− skb_reserve(skb, dev->hard_header_len);
1667+ skb_reserve(skb, hard_header_len);
16531668 skb->dev = dev;
16541669
16551670 SOCK_DEBUG(sk, "SK %p: Begin build.\n", sk);
@@ -1700,18 +1715,12 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) · 44 unmodified lines
17001715 /* loop back */
17011716 skb_orphan(skb);
17021717 if (ddp->deh_dnode == ATADDR_BCAST) {
1703− struct atalk_addr at_lo;
1704−
1705− at_lo.s_node = 0;
1706− at_lo.s_net = 0;
1707−
1708− rt = atrtr_find(&at_lo);
1709− if (!rt) {
1718+ if (!rt_lo) {
17101719 kfree_skb(skb);
17111720 err = -ENETUNREACH;
17121721 goto out;
17131722 }
1714− dev = rt->dev;
1723+ dev = rt_lo->dev;
17151724 skb->dev = dev;
17161725 }
17171726 ddp_dl->request(ddp_dl, skb, dev->dev_addr);
net/caif/chnl_net.c+1−4
@@ -115,10 +115,7 @@ static int chnl_recv_cb(struct cflayer *layr, struct cfpkt *pkt) · 114 unmodified lines
115115 else
116116 skb->ip_summed = CHECKSUM_NONE;
117117
118− if (in_interrupt())
119− netif_rx(skb);
120− else
121− netif_rx_ni(skb);
118+ netif_rx_any_context(skb);
122119
123120 /* Update statistics. */
124121 priv->netdev->stats.rx_packets++;
net/core/flow_dissector.c+3−3
@@ -1056,6 +1056,9 @@ proto_again: · 1055 unmodified lines
10561056 key_control->addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
10571057 }
10581058
1059+ __skb_flow_dissect_ipv4(skb, flow_dissector,
1060+ target_container, data, iph);
1061+
10591062 if (ip_is_fragment(iph)) {
10601063 key_control->flags |= FLOW_DIS_IS_FRAGMENT;
10611064
@@ -1072,9 +1075,6 @@ proto_again: · 10 unmodified lines
10721075 }
10731076 }
10741077
1075− __skb_flow_dissect_ipv4(skb, flow_dissector,
1076− target_container, data, iph);
1077−
10781078 break;
10791079 }
10801080 case htons(ETH_P_IPV6): {
net/mptcp/options.c+5−5
@@ -508,8 +508,8 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb, · 507 unmodified lines
508508 {
509509 struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
510510 struct mptcp_sock *msk = mptcp_sk(subflow->conn);
511+ u64 snd_data_fin_enable, ack_seq;
511512 unsigned int dss_size = 0;
512− u64 snd_data_fin_enable;
513513 struct mptcp_ext *mpext;
514514 unsigned int ack_size;
515515 bool ret = false;
@@ -541,13 +541,14 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb, · 25 unmodified lines
541541 return ret;
542542 }
543543
544+ ack_seq = READ_ONCE(msk->ack_seq);
544545 if (READ_ONCE(msk->use_64bit_ack)) {
545546 ack_size = TCPOLEN_MPTCP_DSS_ACK64;
546− opts->ext_copy.data_ack = READ_ONCE(msk->ack_seq);
547+ opts->ext_copy.data_ack = ack_seq;
547548 opts->ext_copy.ack64 = 1;
548549 } else {
549550 ack_size = TCPOLEN_MPTCP_DSS_ACK32;
550− opts->ext_copy.data_ack32 = (uint32_t)READ_ONCE(msk->ack_seq);
551+ opts->ext_copy.data_ack32 = (uint32_t)ack_seq;
551552 opts->ext_copy.ack64 = 0;
552553 }
553554 opts->ext_copy.use_ack = 1;
@@ -918,8 +919,7 @@ static void ack_update_msk(struct mptcp_sock *msk, · 364 unmodified lines
918919 msk->wnd_end = new_wnd_end;
919920
920921 /* this assumes mptcp_incoming_options() is invoked after tcp_ack() */
921− if (after64(msk->wnd_end, READ_ONCE(msk->snd_nxt)) &&
922− sk_stream_memory_free(ssk))
922+ if (after64(msk->wnd_end, READ_ONCE(msk->snd_nxt)))
923923 __mptcp_check_push(sk, ssk);
924924
925925 if (after64(new_snd_una, old_snd_una)) {
net/mptcp/protocol.c+36−19
@@ -363,8 +363,6 @@ static void mptcp_check_data_fin_ack(struct sock *sk) · 362 unmodified lines
363363
364364 /* Look for an acknowledged DATA_FIN */
365365 if (mptcp_pending_data_fin_ack(sk)) {
366− mptcp_stop_timer(sk);
367−
368366 WRITE_ONCE(msk->snd_data_fin_enable, 0);
369367
370368 switch (sk->sk_state) {
@@ -458,7 +456,18 @@ static bool mptcp_subflow_cleanup_rbuf(struct sock *ssk) · 87 unmodified lines
458456 static void mptcp_cleanup_rbuf(struct mptcp_sock *msk)
459457 {
460458 struct sock *ack_hint = READ_ONCE(msk->ack_hint);
459+ int old_space = READ_ONCE(msk->old_wspace);
461460 struct mptcp_subflow_context *subflow;
461+ struct sock *sk = (struct sock *)msk;
462+ bool cleanup;
463+
464+ /* this is a simple superset of what tcp_cleanup_rbuf() implements
465+ * so that we don't have to acquire the ssk socket lock most of the time
466+ * to do actually nothing
467+ */
468+ cleanup = __mptcp_space(sk) - old_space >= max(0, old_space);
469+ if (!cleanup)
470+ return;
462471
463472 /* if the hinted ssk is still active, try to use it */
464473 if (likely(ack_hint)) {
@@ -1565,6 +1574,9 @@ out: · 1100 unmodified lines
15651574 mptcp_set_timeout(sk, ssk);
15661575 tcp_push(ssk, 0, info.mss_now, tcp_sk(ssk)->nonagle,
15671576 info.size_goal);
1577+ if (!mptcp_timer_pending(sk))
1578+ mptcp_reset_timer(sk);
1579+
15681580 if (msk->snd_data_fin_enable &&
15691581 msk->snd_nxt + 1 == msk->write_seq)
15701582 mptcp_schedule_work(sk);
@@ -1868,7 +1880,7 @@ static void __mptcp_splice_receive_queue(struct sock *sk) · 297 unmodified lines
18681880 skb_queue_splice_tail_init(&sk->sk_receive_queue, &msk->receive_queue);
18691881 }
18701882
1871−static bool __mptcp_move_skbs(struct mptcp_sock *msk, unsigned int rcv)
1883+static bool __mptcp_move_skbs(struct mptcp_sock *msk)
18721884 {
18731885 struct sock *sk = (struct sock *)msk;
18741886 unsigned int moved = 0;
@@ -1888,13 +1900,10 @@ static bool __mptcp_move_skbs(struct mptcp_sock *msk, unsigned int rcv) · 13 unmodified lines
18881900
18891901 slowpath = lock_sock_fast(ssk);
18901902 mptcp_data_lock(sk);
1903+ __mptcp_update_rmem(sk);
18911904 done = __mptcp_move_skbs_from_subflow(msk, ssk, &moved);
18921905 mptcp_data_unlock(sk);
1893− if (moved && rcv) {
1894− WRITE_ONCE(msk->rmem_pending, min(rcv, moved));
1895− tcp_cleanup_rbuf(ssk, 1);
1896− WRITE_ONCE(msk->rmem_pending, 0);
1897− }
1906+ tcp_cleanup_rbuf(ssk, moved);
18981907 unlock_sock_fast(ssk, slowpath);
18991908 } while (!done);
19001909
@@ -1907,6 +1916,7 @@ static bool __mptcp_move_skbs(struct mptcp_sock *msk, unsigned int rcv) · 6 unmodified lines
19071916 ret |= __mptcp_ofo_queue(msk);
19081917 __mptcp_splice_receive_queue(sk);
19091918 mptcp_data_unlock(sk);
1919+ mptcp_cleanup_rbuf(msk);
19101920 }
19111921 if (ret)
19121922 mptcp_check_data_fin((struct sock *)msk);
@@ -1936,7 +1946,7 @@ static int mptcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, · 23 unmodified lines
19361946 target = sock_rcvlowat(sk, flags & MSG_WAITALL, len);
19371947
19381948 while (copied < len) {
1939− int bytes_read, old_space;
1949+ int bytes_read;
19401950
19411951 bytes_read = __mptcp_recvmsg_mskq(msk, msg, len - copied);
19421952 if (unlikely(bytes_read < 0)) {
@@ -1947,14 +1957,11 @@ static int mptcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, · 4 unmodified lines
19471957
19481958 copied += bytes_read;
19491959
1950− if (skb_queue_empty(&msk->receive_queue) &&
1951− __mptcp_move_skbs(msk, len - copied))
1952− continue;
1953−
19541960 /* be sure to advertise window change */
1955− old_space = READ_ONCE(msk->old_wspace);
1956− if ((tcp_space(sk) - old_space) >= old_space)
1957− mptcp_cleanup_rbuf(msk);
1961+ mptcp_cleanup_rbuf(msk);
1962+
1963+ if (skb_queue_empty(&msk->receive_queue) && __mptcp_move_skbs(msk))
1964+ continue;
19581965
19591966 /* only the master socket status is relevant here. The exit
19601967 * conditions mirror closely tcp_recvmsg()
@@ -1982,7 +1989,7 @@ static int mptcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, · 21 unmodified lines
19821989 /* race breaker: the shutdown could be after the
19831990 * previous receive queue check
19841991 */
1985− if (__mptcp_move_skbs(msk, len - copied))
1992+ if (__mptcp_move_skbs(msk))
19861993 continue;
19871994 break;
19881995 }
@@ -2015,7 +2022,7 @@ static int mptcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, · 26 unmodified lines
20152022 /* .. race-breaker: ssk might have gotten new data
20162023 * after last __mptcp_move_skbs() returned false.
20172024 */
2018− if (unlikely(__mptcp_move_skbs(msk, 0)))
2025+ if (unlikely(__mptcp_move_skbs(msk)))
20192026 set_bit(MPTCP_DATA_READY, &msk->flags);
20202027 } else if (unlikely(!test_bit(MPTCP_DATA_READY, &msk->flags))) {
20212028 /* data to read but mptcp_wait_data() cleared DATA_READY */
@@ -2275,6 +2282,7 @@ static void mptcp_worker(struct work_struct *work) · 253 unmodified lines
22752282 if (!test_and_clear_bit(MPTCP_WORK_RTX, &msk->flags))
22762283 goto unlock;
22772284
2285+ __mptcp_clean_una(sk);
22782286 dfrag = mptcp_rtx_head(sk);
22792287 if (!dfrag)
22802288 goto unlock;
@@ -2943,6 +2951,8 @@ static void mptcp_release_cb(struct sock *sk) · 662 unmodified lines
29432951 mptcp_push_pending(sk, 0);
29442952 spin_lock_bh(&sk->sk_lock.slock);
29452953 }
2954+ if (test_and_clear_bit(MPTCP_ERROR_REPORT, &mptcp_sk(sk)->flags))
2955+ __mptcp_error_report(sk);
29462956
29472957 /* clear any wmem reservation and errors */
29482958 __mptcp_update_wmem(sk);
@@ -3319,7 +3329,7 @@ static __poll_t mptcp_check_writeable(struct mptcp_sock *msk) · 370 unmodified lines
33193329 struct sock *sk = (struct sock *)msk;
33203330
33213331 if (unlikely(sk->sk_shutdown & SEND_SHUTDOWN))
3322− return 0;
3332+ return EPOLLOUT | EPOLLWRNORM;
33233333
33243334 if (sk_stream_is_writeable(sk))
33253335 return EPOLLOUT | EPOLLWRNORM;
@@ -3352,9 +3362,16 @@ static __poll_t mptcp_poll(struct file *file, struct socket *sock, · 26 unmodified lines
33523362 mask |= mptcp_check_readable(msk);
33533363 mask |= mptcp_check_writeable(msk);
33543364 }
3365+ if (sk->sk_shutdown == SHUTDOWN_MASK || state == TCP_CLOSE)
3366+ mask |= EPOLLHUP;
33553367 if (sk->sk_shutdown & RCV_SHUTDOWN)
33563368 mask |= EPOLLIN | EPOLLRDNORM | EPOLLRDHUP;
33573369
3370+ /* This barrier is coupled with smp_wmb() in tcp_reset() */
3371+ smp_rmb();
3372+ if (sk->sk_err)
3373+ mask |= EPOLLERR;
3374+
33583375 return mask;
33593376 }
33603377
net/mptcp/protocol.h+7−11
@@ -102,6 +102,7 @@ · 101 unmodified lines
102102 #define MPTCP_WORK_CLOSE_SUBFLOW 5
103103 #define MPTCP_PUSH_PENDING 6
104104 #define MPTCP_CLEAN_UNA 7
105+#define MPTCP_ERROR_REPORT 8
105106
106107 static inline bool before64(__u64 seq1, __u64 seq2)
107108 {
@@ -237,7 +238,6 @@ struct mptcp_sock { · 129 unmodified lines
237238 u64 wnd_end;
238239 unsigned long timer_ival;
239240 u32 token;
240− int rmem_pending;
241241 int rmem_released;
242242 unsigned long flags;
243243 bool can_ack;
@@ -301,7 +301,7 @@ static inline struct mptcp_sock *mptcp_sk(const struct sock *sk) · 57 unmodified lines
301301
302302 static inline int __mptcp_space(const struct sock *sk)
303303 {
304− return tcp_space(sk) + READ_ONCE(mptcp_sk(sk)->rmem_pending);
304+ return tcp_space(sk) + READ_ONCE(mptcp_sk(sk)->rmem_released);
305305 }
306306
307307 static inline struct mptcp_data_frag *mptcp_send_head(const struct sock *sk)
@@ -334,20 +334,13 @@ static inline struct mptcp_data_frag *mptcp_pending_tail(const struct sock *sk) · 26 unmodified lines
334334 return list_last_entry(&msk->rtx_queue, struct mptcp_data_frag, list);
335335 }
336336
337−static inline struct mptcp_data_frag *mptcp_rtx_tail(const struct sock *sk)
337+static inline struct mptcp_data_frag *mptcp_rtx_head(const struct sock *sk)
338338 {
339339 struct mptcp_sock *msk = mptcp_sk(sk);
340340
341− if (!before64(msk->snd_nxt, READ_ONCE(msk->snd_una)))
341+ if (msk->snd_una == READ_ONCE(msk->snd_nxt))
342342 return NULL;
343343
344− return list_last_entry(&msk->rtx_queue, struct mptcp_data_frag, list);
345−}
346−
347−static inline struct mptcp_data_frag *mptcp_rtx_head(const struct sock *sk)
348−{
349− struct mptcp_sock *msk = mptcp_sk(sk);
350−
351344 return list_first_entry_or_null(&msk->rtx_queue, struct mptcp_data_frag, list);
352345 }
353346
@@ -436,6 +429,7 @@ struct mptcp_subflow_context { · 82 unmodified lines
436429 void (*tcp_data_ready)(struct sock *sk);
437430 void (*tcp_state_change)(struct sock *sk);
438431 void (*tcp_write_space)(struct sock *sk);
432+ void (*tcp_error_report)(struct sock *sk);
439433
440434 struct rcu_head rcu;
441435 };
@@ -560,6 +554,7 @@ static inline void mptcp_subflow_tcp_fallback(struct sock *sk, · 118 unmodified lines
560554 sk->sk_data_ready = ctx->tcp_data_ready;
561555 sk->sk_state_change = ctx->tcp_state_change;
562556 sk->sk_write_space = ctx->tcp_write_space;
557+ sk->sk_error_report = ctx->tcp_error_report;
563558
564559 inet_csk(sk)->icsk_af_ops = ctx->icsk_af_ops;
565560 }
@@ -587,6 +582,7 @@ bool mptcp_finish_join(struct sock *sk); · 21 unmodified lines
587582 bool mptcp_schedule_work(struct sock *sk);
588583 void __mptcp_check_push(struct sock *sk, struct sock *ssk);
589584 void __mptcp_data_acked(struct sock *sk);
585+void __mptcp_error_report(struct sock *sk);
590586 void mptcp_subflow_eof(struct sock *sk);
591587 bool mptcp_update_rcv_data_fin(struct mptcp_sock *msk, u64 data_fin_seq, bool use_64bit);
592588 void __mptcp_flush_join_list(struct mptcp_sock *msk);
net/mptcp/subflow.c+59−24
@@ -100,7 +100,7 @@ static struct mptcp_sock *subflow_token_join_request(struct request_sock *req) · 99 unmodified lines
100100 return msk;
101101 }
102102
103−static int __subflow_init_req(struct request_sock *req, const struct sock *sk_listener)
103+static void subflow_init_req(struct request_sock *req, const struct sock *sk_listener)
104104 {
105105 struct mptcp_subflow_request_sock *subflow_req = mptcp_subflow_rsk(req);
106106
@@ -108,16 +108,6 @@ static int __subflow_init_req(struct request_sock *req, const struct sock *sk_li · 1 unmodified line
108108 subflow_req->mp_join = 0;
109109 subflow_req->msk = NULL;
110110 mptcp_token_init_request(req);
111−
112−#ifdef CONFIG_TCP_MD5SIG
113− /* no MPTCP if MD5SIG is enabled on this socket or we may run out of
114− * TCP option space.
115− */
116− if (rcu_access_pointer(tcp_sk(sk_listener)->md5sig_info))
117− return -EINVAL;
118−#endif
119−
120− return 0;
121111 }
122112
123113 static bool subflow_use_different_sport(struct mptcp_sock *msk, const struct sock *sk)
@@ -130,20 +120,23 @@ static bool subflow_use_different_sport(struct mptcp_sock *msk, const struct soc · 6 unmodified lines
130120 * Returns an error code if a JOIN has failed and a TCP reset
131121 * should be sent.
132122 */
133−static int subflow_init_req(struct request_sock *req,
134− const struct sock *sk_listener,
135− struct sk_buff *skb)
123+static int subflow_check_req(struct request_sock *req,
124+ const struct sock *sk_listener,
125+ struct sk_buff *skb)
136126 {
137127 struct mptcp_subflow_context *listener = mptcp_subflow_ctx(sk_listener);
138128 struct mptcp_subflow_request_sock *subflow_req = mptcp_subflow_rsk(req);
139129 struct mptcp_options_received mp_opt;
140− int ret;
141130
142131 pr_debug("subflow_req=%p, listener=%p", subflow_req, listener);
143132
144− ret = __subflow_init_req(req, sk_listener);
145− if (ret)
146− return 0;
133+#ifdef CONFIG_TCP_MD5SIG
134+ /* no MPTCP if MD5SIG is enabled on this socket or we may run out of
135+ * TCP option space.
136+ */
137+ if (rcu_access_pointer(tcp_sk(sk_listener)->md5sig_info))
138+ return -EINVAL;
139+#endif
147140
148141 mptcp_get_options(skb, &mp_opt);
149142
@@ -236,10 +229,7 @@ int mptcp_subflow_init_cookie_req(struct request_sock *req, · 86 unmodified lines
236229 struct mptcp_options_received mp_opt;
237230 int err;
238231
239− err = __subflow_init_req(req, sk_listener);
240− if (err)
241− return err;
242−
232+ subflow_init_req(req, sk_listener);
243233 mptcp_get_options(skb, &mp_opt);
244234
245235 if (mp_opt.mp_capable && mp_opt.mp_join)
@@ -279,12 +269,13 @@ static struct dst_entry *subflow_v4_route_req(const struct sock *sk, · 33 unmodified lines
279269 int err;
280270
281271 tcp_rsk(req)->is_mptcp = 1;
272+ subflow_init_req(req, sk);
282273
283274 dst = tcp_request_sock_ipv4_ops.route_req(sk, skb, fl, req);
284275 if (!dst)
285276 return NULL;
286277
287− err = subflow_init_req(req, sk, skb);
278+ err = subflow_check_req(req, sk, skb);
288279 if (err == 0)
289280 return dst;
290281
@@ -304,12 +295,13 @@ static struct dst_entry *subflow_v6_route_req(const struct sock *sk, · 13 unmodified lines
304295 int err;
305296
306297 tcp_rsk(req)->is_mptcp = 1;
298+ subflow_init_req(req, sk);
307299
308300 dst = tcp_request_sock_ipv6_ops.route_req(sk, skb, fl, req);
309301 if (!dst)
310302 return NULL;
311303
312− err = subflow_init_req(req, sk, skb);
304+ err = subflow_check_req(req, sk, skb);
313305 if (err == 0)
314306 return dst;
315307
@@ -1124,6 +1116,46 @@ static void subflow_write_space(struct sock *ssk) · 808 unmodified lines
11241116 mptcp_write_space(sk);
11251117 }
11261118
1119+void __mptcp_error_report(struct sock *sk)
1120+{
1121+ struct mptcp_subflow_context *subflow;
1122+ struct mptcp_sock *msk = mptcp_sk(sk);
1123+
1124+ mptcp_for_each_subflow(msk, subflow) {
1125+ struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
1126+ int err = sock_error(ssk);
1127+
1128+ if (!err)
1129+ continue;
1130+
1131+ /* only propagate errors on fallen-back sockets or
1132+ * on MPC connect
1133+ */
1134+ if (sk->sk_state != TCP_SYN_SENT && !__mptcp_check_fallback(msk))
1135+ continue;
1136+
1137+ inet_sk_state_store(sk, inet_sk_state_load(ssk));
1138+ sk->sk_err = -err;
1139+
1140+ /* This barrier is coupled with smp_rmb() in mptcp_poll() */
1141+ smp_wmb();
1142+ sk->sk_error_report(sk);
1143+ break;
1144+ }
1145+}
1146+
1147+static void subflow_error_report(struct sock *ssk)
1148+{
1149+ struct sock *sk = mptcp_subflow_ctx(ssk)->conn;
1150+
1151+ mptcp_data_lock(sk);
1152+ if (!sock_owned_by_user(sk))
1153+ __mptcp_error_report(sk);
1154+ else
1155+ set_bit(MPTCP_ERROR_REPORT, &mptcp_sk(sk)->flags);
1156+ mptcp_data_unlock(sk);
1157+}
1158+
11271159 static struct inet_connection_sock_af_ops *
11281160 subflow_default_af_ops(struct sock *sk)
11291161 {
@@ -1470,9 +1502,11 @@ static int subflow_ulp_init(struct sock *sk) · 340 unmodified lines
14701502 ctx->tcp_data_ready = sk->sk_data_ready;
14711503 ctx->tcp_state_change = sk->sk_state_change;
14721504 ctx->tcp_write_space = sk->sk_write_space;
1505+ ctx->tcp_error_report = sk->sk_error_report;
14731506 sk->sk_data_ready = subflow_data_ready;
14741507 sk->sk_write_space = subflow_write_space;
14751508 sk->sk_state_change = subflow_state_change;
1509+ sk->sk_error_report = subflow_error_report;
14761510 out:
14771511 return err;
14781512 }
@@ -1526,6 +1560,7 @@ static void subflow_ulp_clone(const struct request_sock *req, · 47 unmodified lines
15261560 new_ctx->tcp_data_ready = old_ctx->tcp_data_ready;
15271561 new_ctx->tcp_state_change = old_ctx->tcp_state_change;
15281562 new_ctx->tcp_write_space = old_ctx->tcp_write_space;
1563+ new_ctx->tcp_error_report = old_ctx->tcp_error_report;
15291564 new_ctx->rel_write_seq = 1;
15301565 new_ctx->tcp_sock = newsk;
15311566
net/sched/act_api.c+1−1
@@ -908,7 +908,7 @@ static const struct nla_policy tcf_action_policy[TCA_ACT_MAX + 1] = { · 907 unmodified lines
908908 [TCA_ACT_HW_STATS] = NLA_POLICY_BITFIELD32(TCA_ACT_HW_STATS_ANY),
909909 };
910910
911−static void tcf_idr_insert_many(struct tc_action *actions[])
911+void tcf_idr_insert_many(struct tc_action *actions[])
912912 {
913913 int i;
914914
net/sched/cls_api.c+1−0
@@ -3060,6 +3060,7 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb, · 3059 unmodified lines
30603060 act->type = exts->type = TCA_OLD_COMPAT;
30613061 exts->actions[0] = act;
30623062 exts->nr_actions = 1;
3063+ tcf_idr_insert_many(exts->actions);
30633064 } else if (exts->action && tb[exts->action]) {
30643065 int err;
30653066
net/sched/cls_flower.c+37−2
@@ -30,6 +30,11 @@ · 29 unmodified lines
3030
3131 #include <uapi/linux/netfilter/nf_conntrack_common.h>
3232
33+#define TCA_FLOWER_KEY_CT_FLAGS_MAX \
34+ ((__TCA_FLOWER_KEY_CT_FLAGS_MAX - 1) << 1)
35+#define TCA_FLOWER_KEY_CT_FLAGS_MASK \
36+ (TCA_FLOWER_KEY_CT_FLAGS_MAX - 1)
37+
3338 struct fl_flow_key {
3439 struct flow_dissector_key_meta meta;
3540 struct flow_dissector_key_control control;
@@ -690,8 +695,10 @@ static const struct nla_policy fl_policy[TCA_FLOWER_MAX + 1] = { · 654 unmodified lines
690695 [TCA_FLOWER_KEY_ENC_IP_TTL_MASK] = { .type = NLA_U8 },
691696 [TCA_FLOWER_KEY_ENC_OPTS] = { .type = NLA_NESTED },
692697 [TCA_FLOWER_KEY_ENC_OPTS_MASK] = { .type = NLA_NESTED },
693− [TCA_FLOWER_KEY_CT_STATE] = { .type = NLA_U16 },
694− [TCA_FLOWER_KEY_CT_STATE_MASK] = { .type = NLA_U16 },
698+ [TCA_FLOWER_KEY_CT_STATE] =
699+ NLA_POLICY_MASK(NLA_U16, TCA_FLOWER_KEY_CT_FLAGS_MASK),
700+ [TCA_FLOWER_KEY_CT_STATE_MASK] =
701+ NLA_POLICY_MASK(NLA_U16, TCA_FLOWER_KEY_CT_FLAGS_MASK),
695702 [TCA_FLOWER_KEY_CT_ZONE] = { .type = NLA_U16 },
696703 [TCA_FLOWER_KEY_CT_ZONE_MASK] = { .type = NLA_U16 },
697704 [TCA_FLOWER_KEY_CT_MARK] = { .type = NLA_U32 },
@@ -1394,12 +1401,33 @@ static int fl_set_enc_opt(struct nlattr **tb, struct fl_flow_key *key, · 696 unmodified lines
13941401 return 0;
13951402 }
13961403
1404+static int fl_validate_ct_state(u16 state, struct nlattr *tb,
1405+ struct netlink_ext_ack *extack)
1406+{
1407+ if (state && !(state & TCA_FLOWER_KEY_CT_FLAGS_TRACKED)) {
1408+ NL_SET_ERR_MSG_ATTR(extack, tb,
1409+ "no trk, so no other flag can be set");
1410+ return -EINVAL;
1411+ }
1412+
1413+ if (state & TCA_FLOWER_KEY_CT_FLAGS_NEW &&
1414+ state & TCA_FLOWER_KEY_CT_FLAGS_ESTABLISHED) {
1415+ NL_SET_ERR_MSG_ATTR(extack, tb,
1416+ "new and est are mutually exclusive");
1417+ return -EINVAL;
1418+ }
1419+
1420+ return 0;
1421+}
1422+
13971423 static int fl_set_key_ct(struct nlattr **tb,
13981424 struct flow_dissector_key_ct *key,
13991425 struct flow_dissector_key_ct *mask,
14001426 struct netlink_ext_ack *extack)
14011427 {
14021428 if (tb[TCA_FLOWER_KEY_CT_STATE]) {
1429+ int err;
1430+
14031431 if (!IS_ENABLED(CONFIG_NF_CONNTRACK)) {
14041432 NL_SET_ERR_MSG(extack, "Conntrack isn't enabled");
14051433 return -EOPNOTSUPP;
@@ -1407,6 +1435,13 @@ static int fl_set_key_ct(struct nlattr **tb, · 1 unmodified line
14071435 fl_set_key_val(tb, &key->ct_state, TCA_FLOWER_KEY_CT_STATE,
14081436 &mask->ct_state, TCA_FLOWER_KEY_CT_STATE_MASK,
14091437 sizeof(key->ct_state));
1438+
1439+ err = fl_validate_ct_state(mask->ct_state,
1440+ tb[TCA_FLOWER_KEY_CT_STATE_MASK],
1441+ extack);
1442+ if (err)
1443+ return err;
1444+
14101445 }
14111446 if (tb[TCA_FLOWER_KEY_CT_ZONE]) {
14121447 if (!IS_ENABLED(CONFIG_NF_CONNTRACK_ZONES)) {
tools/testing/selftests/bpf/test_xdp_redirect.sh+3−7
@@ -1,4 +1,4 @@
1−#!/bin/sh
1+#!/bin/bash
22 # Create 2 namespaces with two veth peers, and
33 # forward packets in-between using generic XDP
44 #
@@ -57,12 +57,8 @@ test_xdp_redirect() · 52 unmodified lines
5757 ip link set dev veth1 $xdpmode obj test_xdp_redirect.o sec redirect_to_222 &> /dev/null
5858 ip link set dev veth2 $xdpmode obj test_xdp_redirect.o sec redirect_to_111 &> /dev/null
5959
60− ip netns exec ns1 ping -c 1 10.1.1.22 &> /dev/null
61− local ret1=$?
62− ip netns exec ns2 ping -c 1 10.1.1.11 &> /dev/null
63− local ret2=$?
64−
65− if [ $ret1 -eq 0 -a $ret2 -eq 0 ]; then
60+ if ip netns exec ns1 ping -c 1 10.1.1.22 &> /dev/null &&
61+ ip netns exec ns2 ping -c 1 10.1.1.11 &> /dev/null; then
6662 echo "selftests: test_xdp_redirect $xdpmode [PASS]";
6763 else
6864 ret=1
tools/testing/selftests/net/forwarding/tc_flower.sh+37−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33
44 ALL_TESTS="match_dst_mac_test match_src_mac_test match_dst_ip_test \
55 match_src_ip_test match_ip_flags_test match_pcp_test match_vlan_test \
6− match_ip_tos_test match_indev_test match_mpls_label_test \
6+ match_ip_tos_test match_indev_testmatch_ip_ttl_test match_mpls_label_test \
77 match_mpls_tc_test match_mpls_bos_test match_mpls_ttl_test \
88 match_mpls_lse_test"
99 NUM_NETIFS=2
@@ -312,6 +312,42 @@ match_ip_tos_test() · 302 unmodified lines
312312 log_test "ip_tos match ($tcflags)"
313313 }
314314
315+match_ip_ttl_test()
316+{
317+ RET=0
318+
319+ tc filter add dev $h2 ingress protocol ip pref 1 handle 101 flower \
320+ $tcflags dst_ip 192.0.2.2 ip_ttl 63 action drop
321+ tc filter add dev $h2 ingress protocol ip pref 2 handle 102 flower \
322+ $tcflags dst_ip 192.0.2.2 action drop
323+
324+ $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
325+ -t ip "ttl=63" -q
326+
327+ $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
328+ -t ip "ttl=63,mf,frag=256" -q
329+
330+ tc_check_packets "dev $h2 ingress" 102 1
331+ check_fail $? "Matched on the wrong filter (no check on ttl)"
332+
333+ tc_check_packets "dev $h2 ingress" 101 2
334+ check_err $? "Did not match on correct filter (ttl=63)"
335+
336+ $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
337+ -t ip "ttl=255" -q
338+
339+ tc_check_packets "dev $h2 ingress" 101 3
340+ check_fail $? "Matched on a wrong filter (ttl=63)"
341+
342+ tc_check_packets "dev $h2 ingress" 102 1
343+ check_err $? "Did not match on correct filter (no check on ttl)"
344+
345+ tc filter del dev $h2 ingress protocol ip pref 2 handle 102 flower
346+ tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower
347+
348+ log_test "ip_ttl match ($tcflags)"
349+}
350+
315351 match_indev_test()
316352 {
317353 RET=0