aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-13 18:57:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-13 18:57:37 -0400
commitd12109291ccbef7e879cc0d0733f31685cd80854 (patch)
tree8c7e6848b5e7f1f2b5a6707ae277dfcca674aff1
parent1fa91854dcdf7829e2694873b19f96b65947112d (diff)
parent25a09ce79639a8775244808c17282c491cff89cf (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix excessive stack usage in cxgb4, from Arnd Bergmann. 2) Missing skb queue lock init in tipc, from Chris Packham. 3) Fix some regressions in ipv6 flow label handling, from Eric Dumazet. 4) Elide flow dissection of local packets in FIB rules, from Petar Penkov. 5) Fix TLS support build failure in mlx5, from Tariq Toukab. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (36 commits) ppp: mppe: Revert "ppp: mppe: Add softdep to arc4" net: dsa: qca8k: replace legacy gpio include net: hisilicon: Use devm_platform_ioremap_resource cxgb4: reduce kernel stack usage in cudbg_collect_mem_region() tipc: ensure head->lock is initialised tc-tests: updated skbedit tests nfp: flower: ensure ip protocol is specified for L4 matches nfp: flower: fix ethernet check on match fields net/mlx5e: Provide cb_list pointer when setting up tc block on rep net: phy: make exported variables non-static net: sched: Fix NULL-pointer dereference in tc_indr_block_ing_cmd() davinci_cpdma: don't cast dma_addr_t to pointer net: openvswitch: do not update max_headroom if new headroom is equal to old headroom net/mlx5e: Convert single case statement switch statements into if statements net/mlx5: E-Switch, Reduce ingress acl modify metadata stack usage net/mlx5e: Fix unused variable warning when CONFIG_MLX5_ESWITCH is off net/mlx5e: Fix compilation error in TLS code ipv6: fix static key imbalance in fl_create() ipv6: fix potential crash in ip6_datagram_dst_update() ipv6: tcp: fix flowlabels reflection for RST packets ...
-rw-r--r--drivers/net/dsa/qca8k.c2
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c19
-rw-r--r--drivers/net/ethernet/hisilicon/hip04_eth.c7
-rw-r--r--drivers/net/ethernet/hisilicon/hisi_femac.c7
-rw-r--r--drivers/net/ethernet/hisilicon/hix5hd2_gmac.c7
-rw-r--r--drivers/net/ethernet/hisilicon/hns_mdio.c4
-rw-r--r--drivers/net/ethernet/mediatek/mtk_eth_soc.h2
-rw-r--r--drivers/net/ethernet/mediatek/mtk_sgmii.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/accel/tls.h2
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en.h1
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c10
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c34
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_main.c8
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_rep.c5
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_rx.c7
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/eswitch.c5
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c9
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c9
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c23
-rw-r--r--drivers/net/ethernet/netronome/nfp/flower/offload.c28
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/descs.h2
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c4
-rw-r--r--drivers/net/ethernet/ti/davinci_cpdma.c26
-rw-r--r--drivers/net/phy/phy_device.c6
-rw-r--r--drivers/net/ppp/ppp_mppe.c1
-rw-r--r--include/linux/mlx5/mlx5_ifc.h3
-rw-r--r--include/linux/phy.h3
-rw-r--r--include/net/fib_rules.h4
-rw-r--r--include/net/pkt_cls.h10
-rw-r--r--net/hsr/hsr_device.c18
-rw-r--r--net/hsr/hsr_device.h1
-rw-r--r--net/hsr/hsr_netlink.c7
-rw-r--r--net/ipv6/ah6.c4
-rw-r--r--net/ipv6/datagram.c2
-rw-r--r--net/ipv6/exthdrs_core.c2
-rw-r--r--net/ipv6/ip6_flowlabel.c9
-rw-r--r--net/ipv6/ip6_tunnel.c2
-rw-r--r--net/ipv6/netfilter/ip6t_ah.c2
-rw-r--r--net/ipv6/netfilter/ip6t_ipv6header.c2
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c2
-rw-r--r--net/ipv6/netfilter/nf_log_ipv6.c2
-rw-r--r--net/ipv6/tcp_ipv6.c7
-rw-r--r--net/openvswitch/datapath.c39
-rw-r--r--net/rds/connection.c1
-rw-r--r--net/rds/ib.h4
-rw-r--r--net/rds/ib_cm.c9
-rw-r--r--net/rds/ib_frmr.c11
-rw-r--r--net/rds/ib_send.c29
-rw-r--r--net/rds/rdma.c10
-rw-r--r--net/rds/rdma_transport.c11
-rw-r--r--net/rds/rds.h1
-rw-r--r--net/rds/send.c4
-rw-r--r--net/sched/cls_api.c2
-rw-r--r--net/tipc/name_distr.c2
-rw-r--r--tools/testing/selftests/tc-testing/tc-tests/actions/skbedit.json117
55 files changed, 328 insertions, 222 deletions
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index 27709f866c23..232e8cc96f6d 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -14,7 +14,7 @@
14#include <linux/of_platform.h> 14#include <linux/of_platform.h>
15#include <linux/if_bridge.h> 15#include <linux/if_bridge.h>
16#include <linux/mdio.h> 16#include <linux/mdio.h>
17#include <linux/gpio.h> 17#include <linux/gpio/consumer.h>
18#include <linux/etherdevice.h> 18#include <linux/etherdevice.h>
19 19
20#include "qca8k.h" 20#include "qca8k.h"
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
index a76529a7662d..c2e92786608b 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
@@ -1054,14 +1054,12 @@ static void cudbg_t4_fwcache(struct cudbg_init *pdbg_init,
1054 } 1054 }
1055} 1055}
1056 1056
1057static int cudbg_collect_mem_region(struct cudbg_init *pdbg_init, 1057static unsigned long cudbg_mem_region_size(struct cudbg_init *pdbg_init,
1058 struct cudbg_buffer *dbg_buff, 1058 struct cudbg_error *cudbg_err,
1059 struct cudbg_error *cudbg_err, 1059 u8 mem_type)
1060 u8 mem_type)
1061{ 1060{
1062 struct adapter *padap = pdbg_init->adap; 1061 struct adapter *padap = pdbg_init->adap;
1063 struct cudbg_meminfo mem_info; 1062 struct cudbg_meminfo mem_info;
1064 unsigned long size;
1065 u8 mc_idx; 1063 u8 mc_idx;
1066 int rc; 1064 int rc;
1067 1065
@@ -1075,7 +1073,16 @@ static int cudbg_collect_mem_region(struct cudbg_init *pdbg_init,
1075 if (rc) 1073 if (rc)
1076 return rc; 1074 return rc;
1077 1075
1078 size = mem_info.avail[mc_idx].limit - mem_info.avail[mc_idx].base; 1076 return mem_info.avail[mc_idx].limit - mem_info.avail[mc_idx].base;
1077}
1078
1079static int cudbg_collect_mem_region(struct cudbg_init *pdbg_init,
1080 struct cudbg_buffer *dbg_buff,
1081 struct cudbg_error *cudbg_err,
1082 u8 mem_type)
1083{
1084 unsigned long size = cudbg_mem_region_size(pdbg_init, cudbg_err, mem_type);
1085
1079 return cudbg_read_fw_mem(pdbg_init, dbg_buff, mem_type, size, 1086 return cudbg_read_fw_mem(pdbg_init, dbg_buff, mem_type, size,
1080 cudbg_err); 1087 cudbg_err);
1081} 1088}
diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index 625635771b83..d60452845539 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
@@ -899,7 +899,6 @@ static int hip04_mac_probe(struct platform_device *pdev)
899 struct of_phandle_args arg; 899 struct of_phandle_args arg;
900 struct net_device *ndev; 900 struct net_device *ndev;
901 struct hip04_priv *priv; 901 struct hip04_priv *priv;
902 struct resource *res;
903 int irq; 902 int irq;
904 int ret; 903 int ret;
905 904
@@ -912,16 +911,14 @@ static int hip04_mac_probe(struct platform_device *pdev)
912 platform_set_drvdata(pdev, ndev); 911 platform_set_drvdata(pdev, ndev);
913 SET_NETDEV_DEV(ndev, &pdev->dev); 912 SET_NETDEV_DEV(ndev, &pdev->dev);
914 913
915 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 914 priv->base = devm_platform_ioremap_resource(pdev, 0);
916 priv->base = devm_ioremap_resource(d, res);
917 if (IS_ERR(priv->base)) { 915 if (IS_ERR(priv->base)) {
918 ret = PTR_ERR(priv->base); 916 ret = PTR_ERR(priv->base);
919 goto init_fail; 917 goto init_fail;
920 } 918 }
921 919
922#if defined(CONFIG_HI13X1_GMAC) 920#if defined(CONFIG_HI13X1_GMAC)
923 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 921 priv->sysctrl_base = devm_platform_ioremap_resource(pdev, 1);
924 priv->sysctrl_base = devm_ioremap_resource(d, res);
925 if (IS_ERR(priv->sysctrl_base)) { 922 if (IS_ERR(priv->sysctrl_base)) {
926 ret = PTR_ERR(priv->sysctrl_base); 923 ret = PTR_ERR(priv->sysctrl_base);
927 goto init_fail; 924 goto init_fail;
diff --git a/drivers/net/ethernet/hisilicon/hisi_femac.c b/drivers/net/ethernet/hisilicon/hisi_femac.c
index d2e019d89a6f..689f18e3100f 100644
--- a/drivers/net/ethernet/hisilicon/hisi_femac.c
+++ b/drivers/net/ethernet/hisilicon/hisi_femac.c
@@ -781,7 +781,6 @@ static int hisi_femac_drv_probe(struct platform_device *pdev)
781{ 781{
782 struct device *dev = &pdev->dev; 782 struct device *dev = &pdev->dev;
783 struct device_node *node = dev->of_node; 783 struct device_node *node = dev->of_node;
784 struct resource *res;
785 struct net_device *ndev; 784 struct net_device *ndev;
786 struct hisi_femac_priv *priv; 785 struct hisi_femac_priv *priv;
787 struct phy_device *phy; 786 struct phy_device *phy;
@@ -799,15 +798,13 @@ static int hisi_femac_drv_probe(struct platform_device *pdev)
799 priv->dev = dev; 798 priv->dev = dev;
800 priv->ndev = ndev; 799 priv->ndev = ndev;
801 800
802 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 801 priv->port_base = devm_platform_ioremap_resource(pdev, 0);
803 priv->port_base = devm_ioremap_resource(dev, res);
804 if (IS_ERR(priv->port_base)) { 802 if (IS_ERR(priv->port_base)) {
805 ret = PTR_ERR(priv->port_base); 803 ret = PTR_ERR(priv->port_base);
806 goto out_free_netdev; 804 goto out_free_netdev;
807 } 805 }
808 806
809 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 807 priv->glb_base = devm_platform_ioremap_resource(pdev, 1);
810 priv->glb_base = devm_ioremap_resource(dev, res);
811 if (IS_ERR(priv->glb_base)) { 808 if (IS_ERR(priv->glb_base)) {
812 ret = PTR_ERR(priv->glb_base); 809 ret = PTR_ERR(priv->glb_base);
813 goto out_free_netdev; 810 goto out_free_netdev;
diff --git a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
index 89ef764e1c4b..349970557c52 100644
--- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
+++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
@@ -1097,7 +1097,6 @@ static int hix5hd2_dev_probe(struct platform_device *pdev)
1097 const struct of_device_id *of_id = NULL; 1097 const struct of_device_id *of_id = NULL;
1098 struct net_device *ndev; 1098 struct net_device *ndev;
1099 struct hix5hd2_priv *priv; 1099 struct hix5hd2_priv *priv;
1100 struct resource *res;
1101 struct mii_bus *bus; 1100 struct mii_bus *bus;
1102 const char *mac_addr; 1101 const char *mac_addr;
1103 int ret; 1102 int ret;
@@ -1119,15 +1118,13 @@ static int hix5hd2_dev_probe(struct platform_device *pdev)
1119 } 1118 }
1120 priv->hw_cap = (unsigned long)of_id->data; 1119 priv->hw_cap = (unsigned long)of_id->data;
1121 1120
1122 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1121 priv->base = devm_platform_ioremap_resource(pdev, 0);
1123 priv->base = devm_ioremap_resource(dev, res);
1124 if (IS_ERR(priv->base)) { 1122 if (IS_ERR(priv->base)) {
1125 ret = PTR_ERR(priv->base); 1123 ret = PTR_ERR(priv->base);
1126 goto out_free_netdev; 1124 goto out_free_netdev;
1127 } 1125 }
1128 1126
1129 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 1127 priv->ctrl_base = devm_platform_ioremap_resource(pdev, 1);
1130 priv->ctrl_base = devm_ioremap_resource(dev, res);
1131 if (IS_ERR(priv->ctrl_base)) { 1128 if (IS_ERR(priv->ctrl_base)) {
1132 ret = PTR_ERR(priv->ctrl_base); 1129 ret = PTR_ERR(priv->ctrl_base);
1133 goto out_free_netdev; 1130 goto out_free_netdev;
diff --git a/drivers/net/ethernet/hisilicon/hns_mdio.c b/drivers/net/ethernet/hisilicon/hns_mdio.c
index 918cab1c61cd..3e863a71c513 100644
--- a/drivers/net/ethernet/hisilicon/hns_mdio.c
+++ b/drivers/net/ethernet/hisilicon/hns_mdio.c
@@ -417,7 +417,6 @@ static int hns_mdio_probe(struct platform_device *pdev)
417{ 417{
418 struct hns_mdio_device *mdio_dev; 418 struct hns_mdio_device *mdio_dev;
419 struct mii_bus *new_bus; 419 struct mii_bus *new_bus;
420 struct resource *res;
421 int ret = -ENODEV; 420 int ret = -ENODEV;
422 421
423 if (!pdev) { 422 if (!pdev) {
@@ -442,8 +441,7 @@ static int hns_mdio_probe(struct platform_device *pdev)
442 new_bus->priv = mdio_dev; 441 new_bus->priv = mdio_dev;
443 new_bus->parent = &pdev->dev; 442 new_bus->parent = &pdev->dev;
444 443
445 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 444 mdio_dev->vbase = devm_platform_ioremap_resource(pdev, 0);
446 mdio_dev->vbase = devm_ioremap_resource(&pdev->dev, res);
447 if (IS_ERR(mdio_dev->vbase)) { 445 if (IS_ERR(mdio_dev->vbase)) {
448 ret = PTR_ERR(mdio_dev->vbase); 446 ret = PTR_ERR(mdio_dev->vbase);
449 return ret; 447 return ret;
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
index c6be599ed94d..bab94f763e2c 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -723,7 +723,7 @@ struct mtk_soc_data {
723#define MTK_MAX_DEVS 2 723#define MTK_MAX_DEVS 2
724 724
725#define MTK_SGMII_PHYSPEED_AN BIT(31) 725#define MTK_SGMII_PHYSPEED_AN BIT(31)
726#define MTK_SGMII_PHYSPEED_MASK GENMASK(0, 2) 726#define MTK_SGMII_PHYSPEED_MASK GENMASK(2, 0)
727#define MTK_SGMII_PHYSPEED_1000 BIT(0) 727#define MTK_SGMII_PHYSPEED_1000 BIT(0)
728#define MTK_SGMII_PHYSPEED_2500 BIT(1) 728#define MTK_SGMII_PHYSPEED_2500 BIT(1)
729#define MTK_HAS_FLAGS(flags, _x) (((flags) & (_x)) == (_x)) 729#define MTK_HAS_FLAGS(flags, _x) (((flags) & (_x)) == (_x))
diff --git a/drivers/net/ethernet/mediatek/mtk_sgmii.c b/drivers/net/ethernet/mediatek/mtk_sgmii.c
index 136f90ce5a65..ff509d42d818 100644
--- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
+++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
@@ -82,7 +82,7 @@ int mtk_sgmii_setup_mode_force(struct mtk_sgmii *ss, int id)
82 return -EINVAL; 82 return -EINVAL;
83 83
84 regmap_read(ss->regmap[id], ss->ana_rgc3, &val); 84 regmap_read(ss->regmap[id], ss->ana_rgc3, &val);
85 val &= ~GENMASK(2, 3); 85 val &= ~GENMASK(3, 2);
86 mode = ss->flags[id] & MTK_SGMII_PHYSPEED_MASK; 86 mode = ss->flags[id] & MTK_SGMII_PHYSPEED_MASK;
87 val |= (mode == MTK_SGMII_PHYSPEED_1000) ? 0 : BIT(2); 87 val |= (mode == MTK_SGMII_PHYSPEED_1000) ? 0 : BIT(2);
88 regmap_write(ss->regmap[id], ss->ana_rgc3, val); 88 regmap_write(ss->regmap[id], ss->ana_rgc3, val);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/accel/tls.h b/drivers/net/ethernet/mellanox/mlx5/core/accel/tls.h
index 879321b21616..d787bc0a4155 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/accel/tls.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/accel/tls.h
@@ -81,7 +81,6 @@ mlx5e_ktls_type_check(struct mlx5_core_dev *mdev,
81 struct tls_crypto_info *crypto_info) { return false; } 81 struct tls_crypto_info *crypto_info) { return false; }
82#endif 82#endif
83 83
84#ifdef CONFIG_MLX5_FPGA_TLS
85enum { 84enum {
86 MLX5_ACCEL_TLS_TX = BIT(0), 85 MLX5_ACCEL_TLS_TX = BIT(0),
87 MLX5_ACCEL_TLS_RX = BIT(1), 86 MLX5_ACCEL_TLS_RX = BIT(1),
@@ -103,6 +102,7 @@ struct mlx5_ifc_tls_flow_bits {
103 u8 reserved_at_2[0x1e]; 102 u8 reserved_at_2[0x1e];
104}; 103};
105 104
105#ifdef CONFIG_MLX5_FPGA_TLS
106int mlx5_accel_tls_add_flow(struct mlx5_core_dev *mdev, void *flow, 106int mlx5_accel_tls_add_flow(struct mlx5_core_dev *mdev, void *flow,
107 struct tls_crypto_info *crypto_info, 107 struct tls_crypto_info *crypto_info,
108 u32 start_offload_tcp_sn, u32 *p_swid, 108 u32 start_offload_tcp_sn, u32 *p_swid,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index 263558875f20..79d93d6c7d7a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -305,6 +305,7 @@ enum {
305 MLX5E_RQ_STATE_ENABLED, 305 MLX5E_RQ_STATE_ENABLED,
306 MLX5E_RQ_STATE_AM, 306 MLX5E_RQ_STATE_AM,
307 MLX5E_RQ_STATE_NO_CSUM_COMPLETE, 307 MLX5E_RQ_STATE_NO_CSUM_COMPLETE,
308 MLX5E_RQ_STATE_CSUM_FULL, /* cqe_csum_full hw bit is set */
308}; 309};
309 310
310struct mlx5e_cq { 311struct mlx5e_cq {
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
index 476dd97f7f2f..f3d98748b211 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
@@ -142,22 +142,20 @@ static int mlx5e_tx_reporter_timeout_recover(struct mlx5e_txqsq *sq)
142{ 142{
143 struct mlx5_eq_comp *eq = sq->cq.mcq.eq; 143 struct mlx5_eq_comp *eq = sq->cq.mcq.eq;
144 u32 eqe_count; 144 u32 eqe_count;
145 int ret;
146 145
147 netdev_err(sq->channel->netdev, "EQ 0x%x: Cons = 0x%x, irqn = 0x%x\n", 146 netdev_err(sq->channel->netdev, "EQ 0x%x: Cons = 0x%x, irqn = 0x%x\n",
148 eq->core.eqn, eq->core.cons_index, eq->core.irqn); 147 eq->core.eqn, eq->core.cons_index, eq->core.irqn);
149 148
150 eqe_count = mlx5_eq_poll_irq_disabled(eq); 149 eqe_count = mlx5_eq_poll_irq_disabled(eq);
151 ret = eqe_count ? false : true;
152 if (!eqe_count) { 150 if (!eqe_count) {
153 clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state); 151 clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state);
154 return ret; 152 return -EIO;
155 } 153 }
156 154
157 netdev_err(sq->channel->netdev, "Recover %d eqes on EQ 0x%x\n", 155 netdev_err(sq->channel->netdev, "Recover %d eqes on EQ 0x%x\n",
158 eqe_count, eq->core.eqn); 156 eqe_count, eq->core.eqn);
159 sq->channel->stats->eq_rearm++; 157 sq->channel->stats->eq_rearm++;
160 return ret; 158 return 0;
161} 159}
162 160
163int mlx5e_tx_reporter_timeout(struct mlx5e_txqsq *sq) 161int mlx5e_tx_reporter_timeout(struct mlx5e_txqsq *sq)
@@ -264,13 +262,13 @@ static int mlx5e_tx_reporter_diagnose(struct devlink_health_reporter *reporter,
264 262
265 err = mlx5_core_query_sq_state(priv->mdev, sq->sqn, &state); 263 err = mlx5_core_query_sq_state(priv->mdev, sq->sqn, &state);
266 if (err) 264 if (err)
267 break; 265 goto unlock;
268 266
269 err = mlx5e_tx_reporter_build_diagnose_output(fmsg, sq->sqn, 267 err = mlx5e_tx_reporter_build_diagnose_output(fmsg, sq->sqn,
270 state, 268 state,
271 netif_xmit_stopped(sq->txq)); 269 netif_xmit_stopped(sq->txq));
272 if (err) 270 if (err)
273 break; 271 goto unlock;
274 } 272 }
275 err = devlink_fmsg_arr_pair_nest_end(fmsg); 273 err = devlink_fmsg_arr_pair_nest_end(fmsg);
276 if (err) 274 if (err)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
index 5c08891806f0..ea032f54197e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
@@ -25,23 +25,17 @@ static void
25fill_static_params_ctx(void *ctx, struct mlx5e_ktls_offload_context_tx *priv_tx) 25fill_static_params_ctx(void *ctx, struct mlx5e_ktls_offload_context_tx *priv_tx)
26{ 26{
27 struct tls_crypto_info *crypto_info = priv_tx->crypto_info; 27 struct tls_crypto_info *crypto_info = priv_tx->crypto_info;
28 struct tls12_crypto_info_aes_gcm_128 *info;
28 char *initial_rn, *gcm_iv; 29 char *initial_rn, *gcm_iv;
29 u16 salt_sz, rec_seq_sz; 30 u16 salt_sz, rec_seq_sz;
30 char *salt, *rec_seq; 31 char *salt, *rec_seq;
31 u8 tls_version; 32 u8 tls_version;
32 33
33 switch (crypto_info->cipher_type) { 34 if (WARN_ON(crypto_info->cipher_type != TLS_CIPHER_AES_GCM_128))
34 case TLS_CIPHER_AES_GCM_128: {
35 struct tls12_crypto_info_aes_gcm_128 *info =
36 (struct tls12_crypto_info_aes_gcm_128 *)crypto_info;
37
38 EXTRACT_INFO_FIELDS;
39 break;
40 }
41 default:
42 WARN_ON(1);
43 return; 35 return;
44 } 36
37 info = (struct tls12_crypto_info_aes_gcm_128 *)crypto_info;
38 EXTRACT_INFO_FIELDS;
45 39
46 gcm_iv = MLX5_ADDR_OF(tls_static_params, ctx, gcm_iv); 40 gcm_iv = MLX5_ADDR_OF(tls_static_params, ctx, gcm_iv);
47 initial_rn = MLX5_ADDR_OF(tls_static_params, ctx, initial_record_number); 41 initial_rn = MLX5_ADDR_OF(tls_static_params, ctx, initial_record_number);
@@ -234,24 +228,18 @@ tx_post_resync_params(struct mlx5e_txqsq *sq,
234 u64 rcd_sn) 228 u64 rcd_sn)
235{ 229{
236 struct tls_crypto_info *crypto_info = priv_tx->crypto_info; 230 struct tls_crypto_info *crypto_info = priv_tx->crypto_info;
231 struct tls12_crypto_info_aes_gcm_128 *info;
237 __be64 rn_be = cpu_to_be64(rcd_sn); 232 __be64 rn_be = cpu_to_be64(rcd_sn);
238 bool skip_static_post; 233 bool skip_static_post;
239 u16 rec_seq_sz; 234 u16 rec_seq_sz;
240 char *rec_seq; 235 char *rec_seq;
241 236
242 switch (crypto_info->cipher_type) { 237 if (WARN_ON(crypto_info->cipher_type != TLS_CIPHER_AES_GCM_128))
243 case TLS_CIPHER_AES_GCM_128: {
244 struct tls12_crypto_info_aes_gcm_128 *info =
245 (struct tls12_crypto_info_aes_gcm_128 *)crypto_info;
246
247 rec_seq = info->rec_seq;
248 rec_seq_sz = sizeof(info->rec_seq);
249 break;
250 }
251 default:
252 WARN_ON(1);
253 return; 238 return;
254 } 239
240 info = (struct tls12_crypto_info_aes_gcm_128 *)crypto_info;
241 rec_seq = info->rec_seq;
242 rec_seq_sz = sizeof(info->rec_seq);
255 243
256 skip_static_post = !memcmp(rec_seq, &rn_be, rec_seq_sz); 244 skip_static_post = !memcmp(rec_seq, &rn_be, rec_seq_sz);
257 if (!skip_static_post) 245 if (!skip_static_post)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 6d0ae87c8ded..47eea6b3a1c3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -889,6 +889,9 @@ int mlx5e_open_rq(struct mlx5e_channel *c, struct mlx5e_params *params,
889 if (err) 889 if (err)
890 goto err_destroy_rq; 890 goto err_destroy_rq;
891 891
892 if (MLX5_CAP_ETH(c->mdev, cqe_checksum_full))
893 __set_bit(MLX5E_RQ_STATE_CSUM_FULL, &c->rq.state);
894
892 if (params->rx_dim_enabled) 895 if (params->rx_dim_enabled)
893 __set_bit(MLX5E_RQ_STATE_AM, &c->rq.state); 896 __set_bit(MLX5E_RQ_STATE_AM, &c->rq.state);
894 897
@@ -3390,10 +3393,9 @@ static int mlx5e_modify_channels_vsd(struct mlx5e_channels *chs, bool vsd)
3390 return 0; 3393 return 0;
3391} 3394}
3392 3395
3393static int mlx5e_setup_tc_mqprio(struct net_device *netdev, 3396static int mlx5e_setup_tc_mqprio(struct mlx5e_priv *priv,
3394 struct tc_mqprio_qopt *mqprio) 3397 struct tc_mqprio_qopt *mqprio)
3395{ 3398{
3396 struct mlx5e_priv *priv = netdev_priv(netdev);
3397 struct mlx5e_channels new_channels = {}; 3399 struct mlx5e_channels new_channels = {};
3398 u8 tc = mqprio->num_tc; 3400 u8 tc = mqprio->num_tc;
3399 int err = 0; 3401 int err = 0;
@@ -3475,7 +3477,7 @@ static int mlx5e_setup_tc(struct net_device *dev, enum tc_setup_type type,
3475 priv, priv, true); 3477 priv, priv, true);
3476#endif 3478#endif
3477 case TC_SETUP_QDISC_MQPRIO: 3479 case TC_SETUP_QDISC_MQPRIO:
3478 return mlx5e_setup_tc_mqprio(dev, type_data); 3480 return mlx5e_setup_tc_mqprio(priv, type_data);
3479 default: 3481 default:
3480 return -EOPNOTSUPP; 3482 return -EOPNOTSUPP;
3481 } 3483 }
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 10ef90a7bddd..7245d287633d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -1175,6 +1175,8 @@ static int mlx5e_rep_setup_tc_cb(enum tc_setup_type type, void *type_data,
1175 } 1175 }
1176} 1176}
1177 1177
1178static LIST_HEAD(mlx5e_rep_block_cb_list);
1179
1178static int mlx5e_rep_setup_tc(struct net_device *dev, enum tc_setup_type type, 1180static int mlx5e_rep_setup_tc(struct net_device *dev, enum tc_setup_type type,
1179 void *type_data) 1181 void *type_data)
1180{ 1182{
@@ -1182,7 +1184,8 @@ static int mlx5e_rep_setup_tc(struct net_device *dev, enum tc_setup_type type,
1182 1184
1183 switch (type) { 1185 switch (type) {
1184 case TC_SETUP_BLOCK: 1186 case TC_SETUP_BLOCK:
1185 return flow_block_cb_setup_simple(type_data, NULL, 1187 return flow_block_cb_setup_simple(type_data,
1188 &mlx5e_rep_block_cb_list,
1186 mlx5e_rep_setup_tc_cb, 1189 mlx5e_rep_setup_tc_cb,
1187 priv, priv, true); 1190 priv, priv, true);
1188 default: 1191 default:
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index 56a2f4666c47..ac6e586d403d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -923,8 +923,14 @@ static inline void mlx5e_handle_csum(struct net_device *netdev,
923 if (unlikely(get_ip_proto(skb, network_depth, proto) == IPPROTO_SCTP)) 923 if (unlikely(get_ip_proto(skb, network_depth, proto) == IPPROTO_SCTP))
924 goto csum_unnecessary; 924 goto csum_unnecessary;
925 925
926 stats->csum_complete++;
926 skb->ip_summed = CHECKSUM_COMPLETE; 927 skb->ip_summed = CHECKSUM_COMPLETE;
927 skb->csum = csum_unfold((__force __sum16)cqe->check_sum); 928 skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
929
930 if (test_bit(MLX5E_RQ_STATE_CSUM_FULL, &rq->state))
931 return; /* CQE csum covers all received bytes */
932
933 /* csum might need some fixups ...*/
928 if (network_depth > ETH_HLEN) 934 if (network_depth > ETH_HLEN)
929 /* CQE csum is calculated from the IP header and does 935 /* CQE csum is calculated from the IP header and does
930 * not cover VLAN headers (if present). This will add 936 * not cover VLAN headers (if present). This will add
@@ -935,7 +941,6 @@ static inline void mlx5e_handle_csum(struct net_device *netdev,
935 skb->csum); 941 skb->csum);
936 942
937 mlx5e_skb_padding_csum(skb, network_depth, proto, stats); 943 mlx5e_skb_padding_csum(skb, network_depth, proto, stats);
938 stats->csum_complete++;
939 return; 944 return;
940 } 945 }
941 946
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 7281f8d6cba6..3b04d8927fb1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1946,11 +1946,6 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)
1946 esw->enabled_vports = 0; 1946 esw->enabled_vports = 0;
1947 esw->mode = MLX5_ESWITCH_NONE; 1947 esw->mode = MLX5_ESWITCH_NONE;
1948 esw->offloads.inline_mode = MLX5_INLINE_MODE_NONE; 1948 esw->offloads.inline_mode = MLX5_INLINE_MODE_NONE;
1949 if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev, reformat) &&
1950 MLX5_CAP_ESW_FLOWTABLE_FDB(dev, decap))
1951 esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_BASIC;
1952 else
1953 esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_NONE;
1954 1949
1955 dev->priv.eswitch = esw; 1950 dev->priv.eswitch = esw;
1956 return 0; 1951 return 0;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 8ed4497929b9..957d9b09dc3f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -1785,8 +1785,8 @@ static int esw_vport_add_ingress_acl_modify_metadata(struct mlx5_eswitch *esw,
1785 struct mlx5_vport *vport) 1785 struct mlx5_vport *vport)
1786{ 1786{
1787 u8 action[MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto)] = {}; 1787 u8 action[MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto)] = {};
1788 static const struct mlx5_flow_spec spec = {};
1788 struct mlx5_flow_act flow_act = {}; 1789 struct mlx5_flow_act flow_act = {};
1789 struct mlx5_flow_spec spec = {};
1790 int err = 0; 1790 int err = 0;
1791 1791
1792 MLX5_SET(set_action_in, action, action_type, MLX5_ACTION_TYPE_SET); 1792 MLX5_SET(set_action_in, action, action_type, MLX5_ACTION_TYPE_SET);
@@ -2131,6 +2131,12 @@ int esw_offloads_init(struct mlx5_eswitch *esw)
2131{ 2131{
2132 int err; 2132 int err;
2133 2133
2134 if (MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, reformat) &&
2135 MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, decap))
2136 esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_BASIC;
2137 else
2138 esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_NONE;
2139
2134 err = esw_offloads_steering_init(esw); 2140 err = esw_offloads_steering_init(esw);
2135 if (err) 2141 if (err)
2136 return err; 2142 return err;
@@ -2187,6 +2193,7 @@ void esw_offloads_cleanup(struct mlx5_eswitch *esw)
2187 if (mlx5_eswitch_vport_match_metadata_enabled(esw)) 2193 if (mlx5_eswitch_vport_match_metadata_enabled(esw))
2188 mlx5_eswitch_disable_passing_vport_metadata(esw); 2194 mlx5_eswitch_disable_passing_vport_metadata(esw);
2189 esw_offloads_steering_cleanup(esw); 2195 esw_offloads_steering_cleanup(esw);
2196 esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_NONE;
2190} 2197}
2191 2198
2192static int esw_mode_from_devlink(u16 mode, u16 *mlx5_mode) 2199static int esw_mode_from_devlink(u16 mode, u16 *mlx5_mode)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
index faf197d53743..6bfaaab362dc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
@@ -711,7 +711,9 @@ static int mlx5_rdma_setup_rn(struct ib_device *ibdev, u8 port_num,
711 711
712 prof->init(mdev, netdev, prof, ipriv); 712 prof->init(mdev, netdev, prof, ipriv);
713 713
714 mlx5e_attach_netdev(epriv); 714 err = mlx5e_attach_netdev(epriv);
715 if (err)
716 goto detach;
715 netif_carrier_off(netdev); 717 netif_carrier_off(netdev);
716 718
717 /* set rdma_netdev func pointers */ 719 /* set rdma_netdev func pointers */
@@ -727,6 +729,11 @@ static int mlx5_rdma_setup_rn(struct ib_device *ibdev, u8 port_num,
727 729
728 return 0; 730 return 0;
729 731
732detach:
733 prof->cleanup(epriv);
734 if (ipriv->sub_interface)
735 return err;
736 mlx5e_destroy_mdev_resources(mdev);
730destroy_ht: 737destroy_ht:
731 mlx5i_pkey_qpn_ht_cleanup(netdev); 738 mlx5i_pkey_qpn_ht_cleanup(netdev);
732 return err; 739 return err;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c
index be69c1d7941a..48b5c847b642 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c
@@ -98,27 +98,12 @@ static int mlx5_set_entropy(struct mlx5_tun_entropy *tun_entropy,
98 */ 98 */
99 if (entropy_flags.gre_calc_supported && 99 if (entropy_flags.gre_calc_supported &&
100 reformat_type == MLX5_REFORMAT_TYPE_L2_TO_NVGRE) { 100 reformat_type == MLX5_REFORMAT_TYPE_L2_TO_NVGRE) {
101 /* Other applications may change the global FW entropy 101 if (!entropy_flags.force_supported)
102 * calculations settings. Check that the current entropy value 102 return 0;
103 * is the negative of the updated value. 103 err = mlx5_set_port_gre_tun_entropy_calc(tun_entropy->mdev,
104 */ 104 enable, !enable);
105 if (entropy_flags.force_enabled &&
106 enable == entropy_flags.gre_calc_enabled) {
107 mlx5_core_warn(tun_entropy->mdev,
108 "Unexpected GRE entropy calc setting - expected %d",
109 !entropy_flags.gre_calc_enabled);
110 return -EOPNOTSUPP;
111 }
112 err = mlx5_set_port_gre_tun_entropy_calc(tun_entropy->mdev, enable,
113 entropy_flags.force_supported);
114 if (err) 105 if (err)
115 return err; 106 return err;
116 /* if we turn on the entropy we don't need to force it anymore */
117 if (entropy_flags.force_supported && enable) {
118 err = mlx5_set_port_gre_tun_entropy_calc(tun_entropy->mdev, 1, 0);
119 if (err)
120 return err;
121 }
122 } else if (entropy_flags.calc_supported) { 107 } else if (entropy_flags.calc_supported) {
123 /* Other applications may change the global FW entropy 108 /* Other applications may change the global FW entropy
124 * calculations settings. Check that the current entropy value 109 * calculations settings. Check that the current entropy value
diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c
index 7e725fa60347..faa8ba012a37 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/offload.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c
@@ -368,15 +368,12 @@ nfp_flower_calculate_key_layers(struct nfp_app *app,
368 break; 368 break;
369 369
370 default: 370 default:
371 /* Other ethtype - we need check the masks for the 371 NL_SET_ERR_MSG_MOD(extack, "unsupported offload: match on given EtherType is not supported");
372 * remainder of the key to ensure we can offload. 372 return -EOPNOTSUPP;
373 */
374 if (nfp_flower_check_higher_than_mac(flow)) {
375 NL_SET_ERR_MSG_MOD(extack, "unsupported offload: non IPv4/IPv6 offload with L3/L4 matches not supported");
376 return -EOPNOTSUPP;
377 }
378 break;
379 } 373 }
374 } else if (nfp_flower_check_higher_than_mac(flow)) {
375 NL_SET_ERR_MSG_MOD(extack, "unsupported offload: cannot match above L2 without specified EtherType");
376 return -EOPNOTSUPP;
380 } 377 }
381 378
382 if (basic.mask && basic.mask->ip_proto) { 379 if (basic.mask && basic.mask->ip_proto) {
@@ -389,18 +386,15 @@ nfp_flower_calculate_key_layers(struct nfp_app *app,
389 key_layer |= NFP_FLOWER_LAYER_TP; 386 key_layer |= NFP_FLOWER_LAYER_TP;
390 key_size += sizeof(struct nfp_flower_tp_ports); 387 key_size += sizeof(struct nfp_flower_tp_ports);
391 break; 388 break;
392 default:
393 /* Other ip proto - we need check the masks for the
394 * remainder of the key to ensure we can offload.
395 */
396 if (nfp_flower_check_higher_than_l3(flow)) {
397 NL_SET_ERR_MSG_MOD(extack, "unsupported offload: unknown IP protocol with L4 matches not supported");
398 return -EOPNOTSUPP;
399 }
400 break;
401 } 389 }
402 } 390 }
403 391
392 if (!(key_layer & NFP_FLOWER_LAYER_TP) &&
393 nfp_flower_check_higher_than_l3(flow)) {
394 NL_SET_ERR_MSG_MOD(extack, "unsupported offload: cannot match on L4 information without specified IP protocol type");
395 return -EOPNOTSUPP;
396 }
397
404 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_TCP)) { 398 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_TCP)) {
405 struct flow_match_tcp tcp; 399 struct flow_match_tcp tcp;
406 u32 tcp_flags; 400 u32 tcp_flags;
diff --git a/drivers/net/ethernet/stmicro/stmmac/descs.h b/drivers/net/ethernet/stmicro/stmmac/descs.h
index 10429b05f932..9f0b9a9e63b3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/descs.h
+++ b/drivers/net/ethernet/stmicro/stmmac/descs.h
@@ -123,7 +123,7 @@
123#define ETDES1_BUFFER2_SIZE_SHIFT 16 123#define ETDES1_BUFFER2_SIZE_SHIFT 16
124 124
125/* Extended Receive descriptor definitions */ 125/* Extended Receive descriptor definitions */
126#define ERDES4_IP_PAYLOAD_TYPE_MASK GENMASK(2, 6) 126#define ERDES4_IP_PAYLOAD_TYPE_MASK GENMASK(6, 2)
127#define ERDES4_IP_HDR_ERR BIT(3) 127#define ERDES4_IP_HDR_ERR BIT(3)
128#define ERDES4_IP_PAYLOAD_ERR BIT(4) 128#define ERDES4_IP_PAYLOAD_ERR BIT(4)
129#define ERDES4_IP_CSUM_BYPASSED BIT(5) 129#define ERDES4_IP_CSUM_BYPASSED BIT(5)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
index 2856f3fe5266..4083019c547a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
@@ -192,7 +192,7 @@ static const struct emac_variant emac_variant_h6 = {
192 192
193/* Used in RX_CTL1*/ 193/* Used in RX_CTL1*/
194#define EMAC_RX_MD BIT(1) 194#define EMAC_RX_MD BIT(1)
195#define EMAC_RX_TH_MASK GENMASK(4, 5) 195#define EMAC_RX_TH_MASK GENMASK(5, 4)
196#define EMAC_RX_TH_32 0 196#define EMAC_RX_TH_32 0
197#define EMAC_RX_TH_64 (0x1 << 4) 197#define EMAC_RX_TH_64 (0x1 << 4)
198#define EMAC_RX_TH_96 (0x2 << 4) 198#define EMAC_RX_TH_96 (0x2 << 4)
@@ -203,7 +203,7 @@ static const struct emac_variant emac_variant_h6 = {
203/* Used in TX_CTL1*/ 203/* Used in TX_CTL1*/
204#define EMAC_TX_MD BIT(1) 204#define EMAC_TX_MD BIT(1)
205#define EMAC_TX_NEXT_FRM BIT(2) 205#define EMAC_TX_NEXT_FRM BIT(2)
206#define EMAC_TX_TH_MASK GENMASK(8, 10) 206#define EMAC_TX_TH_MASK GENMASK(10, 8)
207#define EMAC_TX_TH_64 0 207#define EMAC_TX_TH_64 0
208#define EMAC_TX_TH_128 (0x1 << 8) 208#define EMAC_TX_TH_128 (0x1 << 8)
209#define EMAC_TX_TH_192 (0x2 << 8) 209#define EMAC_TX_TH_192 (0x2 << 8)
diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c
index 0ca2a1a254de..a65edd2770e6 100644
--- a/drivers/net/ethernet/ti/davinci_cpdma.c
+++ b/drivers/net/ethernet/ti/davinci_cpdma.c
@@ -138,8 +138,8 @@ struct submit_info {
138 struct cpdma_chan *chan; 138 struct cpdma_chan *chan;
139 int directed; 139 int directed;
140 void *token; 140 void *token;
141 void *data; 141 void *data_virt;
142 int flags; 142 dma_addr_t data_dma;
143 int len; 143 int len;
144}; 144};
145 145
@@ -1043,12 +1043,12 @@ static int cpdma_chan_submit_si(struct submit_info *si)
1043 mode = CPDMA_DESC_OWNER | CPDMA_DESC_SOP | CPDMA_DESC_EOP; 1043 mode = CPDMA_DESC_OWNER | CPDMA_DESC_SOP | CPDMA_DESC_EOP;
1044 cpdma_desc_to_port(chan, mode, si->directed); 1044 cpdma_desc_to_port(chan, mode, si->directed);
1045 1045
1046 if (si->flags & CPDMA_DMA_EXT_MAP) { 1046 if (si->data_dma) {
1047 buffer = (dma_addr_t)si->data; 1047 buffer = si->data_dma;
1048 dma_sync_single_for_device(ctlr->dev, buffer, len, chan->dir); 1048 dma_sync_single_for_device(ctlr->dev, buffer, len, chan->dir);
1049 swlen |= CPDMA_DMA_EXT_MAP; 1049 swlen |= CPDMA_DMA_EXT_MAP;
1050 } else { 1050 } else {
1051 buffer = dma_map_single(ctlr->dev, si->data, len, chan->dir); 1051 buffer = dma_map_single(ctlr->dev, si->data_virt, len, chan->dir);
1052 ret = dma_mapping_error(ctlr->dev, buffer); 1052 ret = dma_mapping_error(ctlr->dev, buffer);
1053 if (ret) { 1053 if (ret) {
1054 cpdma_desc_free(ctlr->pool, desc, 1); 1054 cpdma_desc_free(ctlr->pool, desc, 1);
@@ -1086,10 +1086,10 @@ int cpdma_chan_idle_submit(struct cpdma_chan *chan, void *token, void *data,
1086 1086
1087 si.chan = chan; 1087 si.chan = chan;
1088 si.token = token; 1088 si.token = token;
1089 si.data = data; 1089 si.data_virt = data;
1090 si.data_dma = 0;
1090 si.len = len; 1091 si.len = len;
1091 si.directed = directed; 1092 si.directed = directed;
1092 si.flags = 0;
1093 1093
1094 spin_lock_irqsave(&chan->lock, flags); 1094 spin_lock_irqsave(&chan->lock, flags);
1095 if (chan->state == CPDMA_STATE_TEARDOWN) { 1095 if (chan->state == CPDMA_STATE_TEARDOWN) {
@@ -1111,10 +1111,10 @@ int cpdma_chan_idle_submit_mapped(struct cpdma_chan *chan, void *token,
1111 1111
1112 si.chan = chan; 1112 si.chan = chan;
1113 si.token = token; 1113 si.token = token;
1114 si.data = (void *)data; 1114 si.data_virt = NULL;
1115 si.data_dma = data;
1115 si.len = len; 1116 si.len = len;
1116 si.directed = directed; 1117 si.directed = directed;
1117 si.flags = CPDMA_DMA_EXT_MAP;
1118 1118
1119 spin_lock_irqsave(&chan->lock, flags); 1119 spin_lock_irqsave(&chan->lock, flags);
1120 if (chan->state == CPDMA_STATE_TEARDOWN) { 1120 if (chan->state == CPDMA_STATE_TEARDOWN) {
@@ -1136,10 +1136,10 @@ int cpdma_chan_submit(struct cpdma_chan *chan, void *token, void *data,
1136 1136
1137 si.chan = chan; 1137 si.chan = chan;
1138 si.token = token; 1138 si.token = token;
1139 si.data = data; 1139 si.data_virt = data;
1140 si.data_dma = 0;
1140 si.len = len; 1141 si.len = len;
1141 si.directed = directed; 1142 si.directed = directed;
1142 si.flags = 0;
1143 1143
1144 spin_lock_irqsave(&chan->lock, flags); 1144 spin_lock_irqsave(&chan->lock, flags);
1145 if (chan->state != CPDMA_STATE_ACTIVE) { 1145 if (chan->state != CPDMA_STATE_ACTIVE) {
@@ -1161,10 +1161,10 @@ int cpdma_chan_submit_mapped(struct cpdma_chan *chan, void *token,
1161 1161
1162 si.chan = chan; 1162 si.chan = chan;
1163 si.token = token; 1163 si.token = token;
1164 si.data = (void *)data; 1164 si.data_virt = NULL;
1165 si.data_dma = data;
1165 si.len = len; 1166 si.len = len;
1166 si.directed = directed; 1167 si.directed = directed;
1167 si.flags = CPDMA_DMA_EXT_MAP;
1168 1168
1169 spin_lock_irqsave(&chan->lock, flags); 1169 spin_lock_irqsave(&chan->lock, flags);
1170 if (chan->state != CPDMA_STATE_ACTIVE) { 1170 if (chan->state != CPDMA_STATE_ACTIVE) {
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 53878908adf4..6b5cb87f3866 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -56,19 +56,19 @@ EXPORT_SYMBOL_GPL(phy_10gbit_features);
56__ETHTOOL_DECLARE_LINK_MODE_MASK(phy_10gbit_fec_features) __ro_after_init; 56__ETHTOOL_DECLARE_LINK_MODE_MASK(phy_10gbit_fec_features) __ro_after_init;
57EXPORT_SYMBOL_GPL(phy_10gbit_fec_features); 57EXPORT_SYMBOL_GPL(phy_10gbit_fec_features);
58 58
59static const int phy_basic_ports_array[] = { 59const int phy_basic_ports_array[3] = {
60 ETHTOOL_LINK_MODE_Autoneg_BIT, 60 ETHTOOL_LINK_MODE_Autoneg_BIT,
61 ETHTOOL_LINK_MODE_TP_BIT, 61 ETHTOOL_LINK_MODE_TP_BIT,
62 ETHTOOL_LINK_MODE_MII_BIT, 62 ETHTOOL_LINK_MODE_MII_BIT,
63}; 63};
64EXPORT_SYMBOL_GPL(phy_basic_ports_array); 64EXPORT_SYMBOL_GPL(phy_basic_ports_array);
65 65
66static const int phy_fibre_port_array[] = { 66const int phy_fibre_port_array[1] = {
67 ETHTOOL_LINK_MODE_FIBRE_BIT, 67 ETHTOOL_LINK_MODE_FIBRE_BIT,
68}; 68};
69EXPORT_SYMBOL_GPL(phy_fibre_port_array); 69EXPORT_SYMBOL_GPL(phy_fibre_port_array);
70 70
71static const int phy_all_ports_features_array[] = { 71const int phy_all_ports_features_array[7] = {
72 ETHTOOL_LINK_MODE_Autoneg_BIT, 72 ETHTOOL_LINK_MODE_Autoneg_BIT,
73 ETHTOOL_LINK_MODE_TP_BIT, 73 ETHTOOL_LINK_MODE_TP_BIT,
74 ETHTOOL_LINK_MODE_MII_BIT, 74 ETHTOOL_LINK_MODE_MII_BIT,
diff --git a/drivers/net/ppp/ppp_mppe.c b/drivers/net/ppp/ppp_mppe.c
index bd3c80b0bc77..de3b57d09d0c 100644
--- a/drivers/net/ppp/ppp_mppe.c
+++ b/drivers/net/ppp/ppp_mppe.c
@@ -64,7 +64,6 @@ MODULE_AUTHOR("Frank Cusack <fcusack@fcusack.com>");
64MODULE_DESCRIPTION("Point-to-Point Protocol Microsoft Point-to-Point Encryption support"); 64MODULE_DESCRIPTION("Point-to-Point Protocol Microsoft Point-to-Point Encryption support");
65MODULE_LICENSE("Dual BSD/GPL"); 65MODULE_LICENSE("Dual BSD/GPL");
66MODULE_ALIAS("ppp-compress-" __stringify(CI_MPPE)); 66MODULE_ALIAS("ppp-compress-" __stringify(CI_MPPE));
67MODULE_SOFTDEP("pre: arc4");
68MODULE_VERSION("1.0.2"); 67MODULE_VERSION("1.0.2");
69 68
70#define SHA1_PAD_SIZE 40 69#define SHA1_PAD_SIZE 40
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 06881b79167e..515624c66ce1 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -805,7 +805,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_bits {
805 u8 swp[0x1]; 805 u8 swp[0x1];
806 u8 swp_csum[0x1]; 806 u8 swp_csum[0x1];
807 u8 swp_lso[0x1]; 807 u8 swp_lso[0x1];
808 u8 reserved_at_23[0xd]; 808 u8 cqe_checksum_full[0x1];
809 u8 reserved_at_24[0xc];
809 u8 max_vxlan_udp_ports[0x8]; 810 u8 max_vxlan_udp_ports[0x8];
810 u8 reserved_at_38[0x6]; 811 u8 reserved_at_38[0x6];
811 u8 max_geneve_opt_len[0x1]; 812 u8 max_geneve_opt_len[0x1];
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 1739c6dc470e..462b90b73f93 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -55,6 +55,9 @@ extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_10gbit_full_features) __ro_after_ini
55#define PHY_10GBIT_FEC_FEATURES ((unsigned long *)&phy_10gbit_fec_features) 55#define PHY_10GBIT_FEC_FEATURES ((unsigned long *)&phy_10gbit_fec_features)
56#define PHY_10GBIT_FULL_FEATURES ((unsigned long *)&phy_10gbit_full_features) 56#define PHY_10GBIT_FULL_FEATURES ((unsigned long *)&phy_10gbit_full_features)
57 57
58extern const int phy_basic_ports_array[3];
59extern const int phy_fibre_port_array[1];
60extern const int phy_all_ports_features_array[7];
58extern const int phy_10_100_features_array[4]; 61extern const int phy_10_100_features_array[4];
59extern const int phy_basic_t1_features_array[2]; 62extern const int phy_basic_t1_features_array[2];
60extern const int phy_gbit_features_array[2]; 63extern const int phy_gbit_features_array[2];
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index eba8465e1d86..20dcadd8eed9 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -180,9 +180,9 @@ static inline bool fib_rule_port_range_compare(struct fib_rule_port_range *a,
180 180
181static inline bool fib_rule_requires_fldissect(struct fib_rule *rule) 181static inline bool fib_rule_requires_fldissect(struct fib_rule *rule)
182{ 182{
183 return rule->ip_proto || 183 return rule->iifindex != LOOPBACK_IFINDEX && (rule->ip_proto ||
184 fib_rule_port_range_set(&rule->sport_range) || 184 fib_rule_port_range_set(&rule->sport_range) ||
185 fib_rule_port_range_set(&rule->dport_range); 185 fib_rule_port_range_set(&rule->dport_range));
186} 186}
187 187
188struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *, 188struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *,
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index b03d466182db..841faadceb6e 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -60,6 +60,11 @@ static inline bool tcf_block_shared(struct tcf_block *block)
60 return block->index; 60 return block->index;
61} 61}
62 62
63static inline bool tcf_block_non_null_shared(struct tcf_block *block)
64{
65 return block && block->index;
66}
67
63static inline struct Qdisc *tcf_block_q(struct tcf_block *block) 68static inline struct Qdisc *tcf_block_q(struct tcf_block *block)
64{ 69{
65 WARN_ON(tcf_block_shared(block)); 70 WARN_ON(tcf_block_shared(block));
@@ -84,6 +89,11 @@ static inline bool tcf_block_shared(struct tcf_block *block)
84 return false; 89 return false;
85} 90}
86 91
92static inline bool tcf_block_non_null_shared(struct tcf_block *block)
93{
94 return false;
95}
96
87static inline 97static inline
88int tcf_block_get(struct tcf_block **p_block, 98int tcf_block_get(struct tcf_block **p_block,
89 struct tcf_proto __rcu **p_filter_chain, struct Qdisc *q, 99 struct tcf_proto __rcu **p_filter_chain, struct Qdisc *q,
diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
index f0f9b493c47b..f509b495451a 100644
--- a/net/hsr/hsr_device.c
+++ b/net/hsr/hsr_device.c
@@ -227,13 +227,8 @@ static int hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev)
227 struct hsr_port *master; 227 struct hsr_port *master;
228 228
229 master = hsr_port_get_hsr(hsr, HSR_PT_MASTER); 229 master = hsr_port_get_hsr(hsr, HSR_PT_MASTER);
230 if (master) { 230 skb->dev = master->dev;
231 skb->dev = master->dev; 231 hsr_forward_skb(skb, master);
232 hsr_forward_skb(skb, master);
233 } else {
234 atomic_long_inc(&dev->tx_dropped);
235 dev_kfree_skb_any(skb);
236 }
237 return NETDEV_TX_OK; 232 return NETDEV_TX_OK;
238} 233}
239 234
@@ -348,7 +343,11 @@ static void hsr_announce(struct timer_list *t)
348 rcu_read_unlock(); 343 rcu_read_unlock();
349} 344}
350 345
351void hsr_dev_destroy(struct net_device *hsr_dev) 346/* This has to be called after all the readers are gone.
347 * Otherwise we would have to check the return value of
348 * hsr_port_get_hsr().
349 */
350static void hsr_dev_destroy(struct net_device *hsr_dev)
352{ 351{
353 struct hsr_priv *hsr; 352 struct hsr_priv *hsr;
354 struct hsr_port *port; 353 struct hsr_port *port;
@@ -364,8 +363,6 @@ void hsr_dev_destroy(struct net_device *hsr_dev)
364 del_timer_sync(&hsr->prune_timer); 363 del_timer_sync(&hsr->prune_timer);
365 del_timer_sync(&hsr->announce_timer); 364 del_timer_sync(&hsr->announce_timer);
366 365
367 synchronize_rcu();
368
369 hsr_del_self_node(&hsr->self_node_db); 366 hsr_del_self_node(&hsr->self_node_db);
370 hsr_del_nodes(&hsr->node_db); 367 hsr_del_nodes(&hsr->node_db);
371} 368}
@@ -376,6 +373,7 @@ static const struct net_device_ops hsr_device_ops = {
376 .ndo_stop = hsr_dev_close, 373 .ndo_stop = hsr_dev_close,
377 .ndo_start_xmit = hsr_dev_xmit, 374 .ndo_start_xmit = hsr_dev_xmit,
378 .ndo_fix_features = hsr_fix_features, 375 .ndo_fix_features = hsr_fix_features,
376 .ndo_uninit = hsr_dev_destroy,
379}; 377};
380 378
381static struct device_type hsr_type = { 379static struct device_type hsr_type = {
diff --git a/net/hsr/hsr_device.h b/net/hsr/hsr_device.h
index d0fa6b0696d2..6d7759c4f5f9 100644
--- a/net/hsr/hsr_device.h
+++ b/net/hsr/hsr_device.h
@@ -14,7 +14,6 @@
14void hsr_dev_setup(struct net_device *dev); 14void hsr_dev_setup(struct net_device *dev);
15int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], 15int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],
16 unsigned char multicast_spec, u8 protocol_version); 16 unsigned char multicast_spec, u8 protocol_version);
17void hsr_dev_destroy(struct net_device *hsr_dev);
18void hsr_check_carrier_and_operstate(struct hsr_priv *hsr); 17void hsr_check_carrier_and_operstate(struct hsr_priv *hsr);
19bool is_hsr_master(struct net_device *dev); 18bool is_hsr_master(struct net_device *dev);
20int hsr_get_max_mtu(struct hsr_priv *hsr); 19int hsr_get_max_mtu(struct hsr_priv *hsr);
diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c
index 160edd24de4e..8f8337f893ba 100644
--- a/net/hsr/hsr_netlink.c
+++ b/net/hsr/hsr_netlink.c
@@ -69,12 +69,6 @@ static int hsr_newlink(struct net *src_net, struct net_device *dev,
69 return hsr_dev_finalize(dev, link, multicast_spec, hsr_version); 69 return hsr_dev_finalize(dev, link, multicast_spec, hsr_version);
70} 70}
71 71
72static void hsr_dellink(struct net_device *hsr_dev, struct list_head *head)
73{
74 hsr_dev_destroy(hsr_dev);
75 unregister_netdevice_queue(hsr_dev, head);
76}
77
78static int hsr_fill_info(struct sk_buff *skb, const struct net_device *dev) 72static int hsr_fill_info(struct sk_buff *skb, const struct net_device *dev)
79{ 73{
80 struct hsr_priv *hsr; 74 struct hsr_priv *hsr;
@@ -119,7 +113,6 @@ static struct rtnl_link_ops hsr_link_ops __read_mostly = {
119 .priv_size = sizeof(struct hsr_priv), 113 .priv_size = sizeof(struct hsr_priv),
120 .setup = hsr_dev_setup, 114 .setup = hsr_dev_setup,
121 .newlink = hsr_newlink, 115 .newlink = hsr_newlink,
122 .dellink = hsr_dellink,
123 .fill_info = hsr_fill_info, 116 .fill_info = hsr_fill_info,
124}; 117};
125 118
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 25e1172fd1c3..95835e8d99aa 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -464,7 +464,7 @@ static void ah6_input_done(struct crypto_async_request *base, int err)
464 struct ah_data *ahp = x->data; 464 struct ah_data *ahp = x->data;
465 struct ip_auth_hdr *ah = ip_auth_hdr(skb); 465 struct ip_auth_hdr *ah = ip_auth_hdr(skb);
466 int hdr_len = skb_network_header_len(skb); 466 int hdr_len = skb_network_header_len(skb);
467 int ah_hlen = (ah->hdrlen + 2) << 2; 467 int ah_hlen = ipv6_authlen(ah);
468 468
469 if (err) 469 if (err)
470 goto out; 470 goto out;
@@ -546,7 +546,7 @@ static int ah6_input(struct xfrm_state *x, struct sk_buff *skb)
546 ahash = ahp->ahash; 546 ahash = ahp->ahash;
547 547
548 nexthdr = ah->nexthdr; 548 nexthdr = ah->nexthdr;
549 ah_hlen = (ah->hdrlen + 2) << 2; 549 ah_hlen = ipv6_authlen(ah);
550 550
551 if (ah_hlen != XFRM_ALIGN8(sizeof(*ah) + ahp->icv_full_len) && 551 if (ah_hlen != XFRM_ALIGN8(sizeof(*ah) + ahp->icv_full_len) &&
552 ah_hlen != XFRM_ALIGN8(sizeof(*ah) + ahp->icv_trunc_len)) 552 ah_hlen != XFRM_ALIGN8(sizeof(*ah) + ahp->icv_trunc_len))
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 9d78c907b918..9ab897ded4df 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -74,7 +74,7 @@ int ip6_datagram_dst_update(struct sock *sk, bool fix_sk_saddr)
74 74
75 if (np->sndflow && (np->flow_label & IPV6_FLOWLABEL_MASK)) { 75 if (np->sndflow && (np->flow_label & IPV6_FLOWLABEL_MASK)) {
76 flowlabel = fl6_sock_lookup(sk, np->flow_label); 76 flowlabel = fl6_sock_lookup(sk, np->flow_label);
77 if (!flowlabel) 77 if (IS_ERR(flowlabel))
78 return -EINVAL; 78 return -EINVAL;
79 } 79 }
80 ip6_datagram_flow_key_init(&fl6, sk); 80 ip6_datagram_flow_key_init(&fl6, sk);
diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c
index 11a43ee4dd45..b358f1a4dd08 100644
--- a/net/ipv6/exthdrs_core.c
+++ b/net/ipv6/exthdrs_core.c
@@ -266,7 +266,7 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
266 } else if (nexthdr == NEXTHDR_AUTH) { 266 } else if (nexthdr == NEXTHDR_AUTH) {
267 if (flags && (*flags & IP6_FH_F_AUTH) && (target < 0)) 267 if (flags && (*flags & IP6_FH_F_AUTH) && (target < 0))
268 break; 268 break;
269 hdrlen = (hp->hdrlen + 2) << 2; 269 hdrlen = ipv6_authlen(hp);
270 } else 270 } else
271 hdrlen = ipv6_optlen(hp); 271 hdrlen = ipv6_optlen(hp);
272 272
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index ad284b1fd308..d64b83e85642 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -435,8 +435,6 @@ fl_create(struct net *net, struct sock *sk, struct in6_flowlabel_req *freq,
435 } 435 }
436 fl->dst = freq->flr_dst; 436 fl->dst = freq->flr_dst;
437 atomic_set(&fl->users, 1); 437 atomic_set(&fl->users, 1);
438 if (fl_shared_exclusive(fl) || fl->opt)
439 static_branch_deferred_inc(&ipv6_flowlabel_exclusive);
440 switch (fl->share) { 438 switch (fl->share) {
441 case IPV6_FL_S_EXCL: 439 case IPV6_FL_S_EXCL:
442 case IPV6_FL_S_ANY: 440 case IPV6_FL_S_ANY:
@@ -451,10 +449,15 @@ fl_create(struct net *net, struct sock *sk, struct in6_flowlabel_req *freq,
451 err = -EINVAL; 449 err = -EINVAL;
452 goto done; 450 goto done;
453 } 451 }
452 if (fl_shared_exclusive(fl) || fl->opt)
453 static_branch_deferred_inc(&ipv6_flowlabel_exclusive);
454 return fl; 454 return fl;
455 455
456done: 456done:
457 fl_free(fl); 457 if (fl) {
458 kfree(fl->opt);
459 kfree(fl);
460 }
458 *err_p = err; 461 *err_p = err;
459 return NULL; 462 return NULL;
460} 463}
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index b80fde1bc005..3134fbb65d7f 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -416,7 +416,7 @@ __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw)
416 break; 416 break;
417 optlen = 8; 417 optlen = 8;
418 } else if (nexthdr == NEXTHDR_AUTH) { 418 } else if (nexthdr == NEXTHDR_AUTH) {
419 optlen = (hdr->hdrlen + 2) << 2; 419 optlen = ipv6_authlen(hdr);
420 } else { 420 } else {
421 optlen = ipv6_optlen(hdr); 421 optlen = ipv6_optlen(hdr);
422 } 422 }
diff --git a/net/ipv6/netfilter/ip6t_ah.c b/net/ipv6/netfilter/ip6t_ah.c
index 0228ff3636bb..4e15a14435e4 100644
--- a/net/ipv6/netfilter/ip6t_ah.c
+++ b/net/ipv6/netfilter/ip6t_ah.c
@@ -55,7 +55,7 @@ static bool ah_mt6(const struct sk_buff *skb, struct xt_action_param *par)
55 return false; 55 return false;
56 } 56 }
57 57
58 hdrlen = (ah->hdrlen + 2) << 2; 58 hdrlen = ipv6_authlen(ah);
59 59
60 pr_debug("IPv6 AH LEN %u %u ", hdrlen, ah->hdrlen); 60 pr_debug("IPv6 AH LEN %u %u ", hdrlen, ah->hdrlen);
61 pr_debug("RES %04X ", ah->reserved); 61 pr_debug("RES %04X ", ah->reserved);
diff --git a/net/ipv6/netfilter/ip6t_ipv6header.c b/net/ipv6/netfilter/ip6t_ipv6header.c
index fd439f88377f..0fc6326ef499 100644
--- a/net/ipv6/netfilter/ip6t_ipv6header.c
+++ b/net/ipv6/netfilter/ip6t_ipv6header.c
@@ -71,7 +71,7 @@ ipv6header_mt6(const struct sk_buff *skb, struct xt_action_param *par)
71 if (nexthdr == NEXTHDR_FRAGMENT) 71 if (nexthdr == NEXTHDR_FRAGMENT)
72 hdrlen = 8; 72 hdrlen = 8;
73 else if (nexthdr == NEXTHDR_AUTH) 73 else if (nexthdr == NEXTHDR_AUTH)
74 hdrlen = (hp->hdrlen + 2) << 2; 74 hdrlen = ipv6_authlen(hp);
75 else 75 else
76 hdrlen = ipv6_optlen(hp); 76 hdrlen = ipv6_optlen(hp);
77 77
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 398e1df41406..0f82c150543b 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -414,7 +414,7 @@ find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff)
414 if (skb_copy_bits(skb, start, &hdr, sizeof(hdr))) 414 if (skb_copy_bits(skb, start, &hdr, sizeof(hdr)))
415 BUG(); 415 BUG();
416 if (nexthdr == NEXTHDR_AUTH) 416 if (nexthdr == NEXTHDR_AUTH)
417 hdrlen = (hdr.hdrlen+2)<<2; 417 hdrlen = ipv6_authlen(&hdr);
418 else 418 else
419 hdrlen = ipv6_optlen(&hdr); 419 hdrlen = ipv6_optlen(&hdr);
420 420
diff --git a/net/ipv6/netfilter/nf_log_ipv6.c b/net/ipv6/netfilter/nf_log_ipv6.c
index 549c51156d5d..f53bd8f01219 100644
--- a/net/ipv6/netfilter/nf_log_ipv6.c
+++ b/net/ipv6/netfilter/nf_log_ipv6.c
@@ -155,7 +155,7 @@ static void dump_ipv6_packet(struct net *net, struct nf_log_buf *m,
155 155
156 } 156 }
157 157
158 hdrlen = (hp->hdrlen+2)<<2; 158 hdrlen = ipv6_authlen(hp);
159 break; 159 break;
160 case IPPROTO_ESP: 160 case IPPROTO_ESP:
161 if (logflags & NF_LOG_IPOPT) { 161 if (logflags & NF_LOG_IPOPT) {
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index d56a9019a0fe..5da069e91cac 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -984,8 +984,13 @@ static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb)
984 984
985 if (sk) { 985 if (sk) {
986 oif = sk->sk_bound_dev_if; 986 oif = sk->sk_bound_dev_if;
987 if (sk_fullsock(sk)) 987 if (sk_fullsock(sk)) {
988 const struct ipv6_pinfo *np = tcp_inet6_sk(sk);
989
988 trace_tcp_send_reset(sk, skb); 990 trace_tcp_send_reset(sk, skb);
991 if (np->repflow)
992 label = ip6_flowlabel(ipv6h);
993 }
989 if (sk->sk_state == TCP_TIME_WAIT) 994 if (sk->sk_state == TCP_TIME_WAIT)
990 label = cpu_to_be32(inet_twsk(sk)->tw_flowlabel); 995 label = cpu_to_be32(inet_twsk(sk)->tw_flowlabel);
991 } else { 996 } else {
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 33b388103741..892287d06c17 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -1958,10 +1958,9 @@ static struct vport *lookup_vport(struct net *net,
1958 1958
1959} 1959}
1960 1960
1961/* Called with ovs_mutex */ 1961static unsigned int ovs_get_max_headroom(struct datapath *dp)
1962static void update_headroom(struct datapath *dp)
1963{ 1962{
1964 unsigned dev_headroom, max_headroom = 0; 1963 unsigned int dev_headroom, max_headroom = 0;
1965 struct net_device *dev; 1964 struct net_device *dev;
1966 struct vport *vport; 1965 struct vport *vport;
1967 int i; 1966 int i;
@@ -1975,10 +1974,19 @@ static void update_headroom(struct datapath *dp)
1975 } 1974 }
1976 } 1975 }
1977 1976
1978 dp->max_headroom = max_headroom; 1977 return max_headroom;
1978}
1979
1980/* Called with ovs_mutex */
1981static void ovs_update_headroom(struct datapath *dp, unsigned int new_headroom)
1982{
1983 struct vport *vport;
1984 int i;
1985
1986 dp->max_headroom = new_headroom;
1979 for (i = 0; i < DP_VPORT_HASH_BUCKETS; i++) 1987 for (i = 0; i < DP_VPORT_HASH_BUCKETS; i++)
1980 hlist_for_each_entry_rcu(vport, &dp->ports[i], dp_hash_node) 1988 hlist_for_each_entry_rcu(vport, &dp->ports[i], dp_hash_node)
1981 netdev_set_rx_headroom(vport->dev, max_headroom); 1989 netdev_set_rx_headroom(vport->dev, new_headroom);
1982} 1990}
1983 1991
1984static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info) 1992static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info)
@@ -1989,6 +1997,7 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info)
1989 struct sk_buff *reply; 1997 struct sk_buff *reply;
1990 struct vport *vport; 1998 struct vport *vport;
1991 struct datapath *dp; 1999 struct datapath *dp;
2000 unsigned int new_headroom;
1992 u32 port_no; 2001 u32 port_no;
1993 int err; 2002 int err;
1994 2003
@@ -2050,8 +2059,10 @@ restart:
2050 info->snd_portid, info->snd_seq, 0, 2059 info->snd_portid, info->snd_seq, 0,
2051 OVS_VPORT_CMD_NEW); 2060 OVS_VPORT_CMD_NEW);
2052 2061
2053 if (netdev_get_fwd_headroom(vport->dev) > dp->max_headroom) 2062 new_headroom = netdev_get_fwd_headroom(vport->dev);
2054 update_headroom(dp); 2063
2064 if (new_headroom > dp->max_headroom)
2065 ovs_update_headroom(dp, new_headroom);
2055 else 2066 else
2056 netdev_set_rx_headroom(vport->dev, dp->max_headroom); 2067 netdev_set_rx_headroom(vport->dev, dp->max_headroom);
2057 2068
@@ -2122,11 +2133,12 @@ exit_unlock_free:
2122 2133
2123static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info) 2134static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info)
2124{ 2135{
2125 bool must_update_headroom = false; 2136 bool update_headroom = false;
2126 struct nlattr **a = info->attrs; 2137 struct nlattr **a = info->attrs;
2127 struct sk_buff *reply; 2138 struct sk_buff *reply;
2128 struct datapath *dp; 2139 struct datapath *dp;
2129 struct vport *vport; 2140 struct vport *vport;
2141 unsigned int new_headroom;
2130 int err; 2142 int err;
2131 2143
2132 reply = ovs_vport_cmd_alloc_info(); 2144 reply = ovs_vport_cmd_alloc_info();
@@ -2152,12 +2164,17 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info)
2152 /* the vport deletion may trigger dp headroom update */ 2164 /* the vport deletion may trigger dp headroom update */
2153 dp = vport->dp; 2165 dp = vport->dp;
2154 if (netdev_get_fwd_headroom(vport->dev) == dp->max_headroom) 2166 if (netdev_get_fwd_headroom(vport->dev) == dp->max_headroom)
2155 must_update_headroom = true; 2167 update_headroom = true;
2168
2156 netdev_reset_rx_headroom(vport->dev); 2169 netdev_reset_rx_headroom(vport->dev);
2157 ovs_dp_detach_port(vport); 2170 ovs_dp_detach_port(vport);
2158 2171
2159 if (must_update_headroom) 2172 if (update_headroom) {
2160 update_headroom(dp); 2173 new_headroom = ovs_get_max_headroom(dp);
2174
2175 if (new_headroom < dp->max_headroom)
2176 ovs_update_headroom(dp, new_headroom);
2177 }
2161 ovs_unlock(); 2178 ovs_unlock();
2162 2179
2163 ovs_notify(&dp_vport_genl_family, reply, info); 2180 ovs_notify(&dp_vport_genl_family, reply, info);
diff --git a/net/rds/connection.c b/net/rds/connection.c
index 7ea134f9a825..ed7f2133acc2 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -736,6 +736,7 @@ static int rds_conn_info_visitor(struct rds_conn_path *cp, void *buffer)
736 cinfo->next_rx_seq = cp->cp_next_rx_seq; 736 cinfo->next_rx_seq = cp->cp_next_rx_seq;
737 cinfo->laddr = conn->c_laddr.s6_addr32[3]; 737 cinfo->laddr = conn->c_laddr.s6_addr32[3];
738 cinfo->faddr = conn->c_faddr.s6_addr32[3]; 738 cinfo->faddr = conn->c_faddr.s6_addr32[3];
739 cinfo->tos = conn->c_tos;
739 strncpy(cinfo->transport, conn->c_trans->t_name, 740 strncpy(cinfo->transport, conn->c_trans->t_name,
740 sizeof(cinfo->transport)); 741 sizeof(cinfo->transport));
741 cinfo->flags = 0; 742 cinfo->flags = 0;
diff --git a/net/rds/ib.h b/net/rds/ib.h
index 67a715b076ca..66c03c7665b2 100644
--- a/net/rds/ib.h
+++ b/net/rds/ib.h
@@ -15,8 +15,7 @@
15 15
16#define RDS_IB_DEFAULT_RECV_WR 1024 16#define RDS_IB_DEFAULT_RECV_WR 1024
17#define RDS_IB_DEFAULT_SEND_WR 256 17#define RDS_IB_DEFAULT_SEND_WR 256
18#define RDS_IB_DEFAULT_FR_WR 256 18#define RDS_IB_DEFAULT_FR_WR 512
19#define RDS_IB_DEFAULT_FR_INV_WR 256
20 19
21#define RDS_IB_DEFAULT_RETRY_COUNT 1 20#define RDS_IB_DEFAULT_RETRY_COUNT 1
22 21
@@ -157,7 +156,6 @@ struct rds_ib_connection {
157 156
158 /* To control the number of wrs from fastreg */ 157 /* To control the number of wrs from fastreg */
159 atomic_t i_fastreg_wrs; 158 atomic_t i_fastreg_wrs;
160 atomic_t i_fastunreg_wrs;
161 159
162 /* interrupt handling */ 160 /* interrupt handling */
163 struct tasklet_struct i_send_tasklet; 161 struct tasklet_struct i_send_tasklet;
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
index 66c6eb56072b..8891822eba4f 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
@@ -460,10 +460,7 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
460 * completion queue and send queue. This extra space is used for FRMR 460 * completion queue and send queue. This extra space is used for FRMR
461 * registration and invalidation work requests 461 * registration and invalidation work requests
462 */ 462 */
463 fr_queue_space = rds_ibdev->use_fastreg ? 463 fr_queue_space = (rds_ibdev->use_fastreg ? RDS_IB_DEFAULT_FR_WR : 0);
464 (RDS_IB_DEFAULT_FR_WR + 1) +
465 (RDS_IB_DEFAULT_FR_INV_WR + 1)
466 : 0;
467 464
468 /* add the conn now so that connection establishment has the dev */ 465 /* add the conn now so that connection establishment has the dev */
469 rds_ib_add_conn(rds_ibdev, conn); 466 rds_ib_add_conn(rds_ibdev, conn);
@@ -530,7 +527,6 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
530 attr.send_cq = ic->i_send_cq; 527 attr.send_cq = ic->i_send_cq;
531 attr.recv_cq = ic->i_recv_cq; 528 attr.recv_cq = ic->i_recv_cq;
532 atomic_set(&ic->i_fastreg_wrs, RDS_IB_DEFAULT_FR_WR); 529 atomic_set(&ic->i_fastreg_wrs, RDS_IB_DEFAULT_FR_WR);
533 atomic_set(&ic->i_fastunreg_wrs, RDS_IB_DEFAULT_FR_INV_WR);
534 530
535 /* 531 /*
536 * XXX this can fail if max_*_wr is too large? Are we supposed 532 * XXX this can fail if max_*_wr is too large? Are we supposed
@@ -1009,8 +1005,7 @@ void rds_ib_conn_path_shutdown(struct rds_conn_path *cp)
1009 wait_event(rds_ib_ring_empty_wait, 1005 wait_event(rds_ib_ring_empty_wait,
1010 rds_ib_ring_empty(&ic->i_recv_ring) && 1006 rds_ib_ring_empty(&ic->i_recv_ring) &&
1011 (atomic_read(&ic->i_signaled_sends) == 0) && 1007 (atomic_read(&ic->i_signaled_sends) == 0) &&
1012 (atomic_read(&ic->i_fastreg_wrs) == RDS_IB_DEFAULT_FR_WR) && 1008 (atomic_read(&ic->i_fastreg_wrs) == RDS_IB_DEFAULT_FR_WR));
1013 (atomic_read(&ic->i_fastunreg_wrs) == RDS_IB_DEFAULT_FR_INV_WR));
1014 tasklet_kill(&ic->i_send_tasklet); 1009 tasklet_kill(&ic->i_send_tasklet);
1015 tasklet_kill(&ic->i_recv_tasklet); 1010 tasklet_kill(&ic->i_recv_tasklet);
1016 1011
diff --git a/net/rds/ib_frmr.c b/net/rds/ib_frmr.c
index 688dcd68d4ea..32ae26ed58a0 100644
--- a/net/rds/ib_frmr.c
+++ b/net/rds/ib_frmr.c
@@ -239,8 +239,8 @@ static int rds_ib_post_inv(struct rds_ib_mr *ibmr)
239 if (frmr->fr_state != FRMR_IS_INUSE) 239 if (frmr->fr_state != FRMR_IS_INUSE)
240 goto out; 240 goto out;
241 241
242 while (atomic_dec_return(&ibmr->ic->i_fastunreg_wrs) <= 0) { 242 while (atomic_dec_return(&ibmr->ic->i_fastreg_wrs) <= 0) {
243 atomic_inc(&ibmr->ic->i_fastunreg_wrs); 243 atomic_inc(&ibmr->ic->i_fastreg_wrs);
244 cpu_relax(); 244 cpu_relax();
245 } 245 }
246 246
@@ -257,7 +257,7 @@ static int rds_ib_post_inv(struct rds_ib_mr *ibmr)
257 if (unlikely(ret)) { 257 if (unlikely(ret)) {
258 frmr->fr_state = FRMR_IS_STALE; 258 frmr->fr_state = FRMR_IS_STALE;
259 frmr->fr_inv = false; 259 frmr->fr_inv = false;
260 atomic_inc(&ibmr->ic->i_fastunreg_wrs); 260 atomic_inc(&ibmr->ic->i_fastreg_wrs);
261 pr_err("RDS/IB: %s returned error(%d)\n", __func__, ret); 261 pr_err("RDS/IB: %s returned error(%d)\n", __func__, ret);
262 goto out; 262 goto out;
263 } 263 }
@@ -285,10 +285,9 @@ void rds_ib_mr_cqe_handler(struct rds_ib_connection *ic, struct ib_wc *wc)
285 if (frmr->fr_inv) { 285 if (frmr->fr_inv) {
286 frmr->fr_state = FRMR_IS_FREE; 286 frmr->fr_state = FRMR_IS_FREE;
287 frmr->fr_inv = false; 287 frmr->fr_inv = false;
288 atomic_inc(&ic->i_fastreg_wrs);
289 } else {
290 atomic_inc(&ic->i_fastunreg_wrs);
291 } 288 }
289
290 atomic_inc(&ic->i_fastreg_wrs);
292} 291}
293 292
294void rds_ib_unreg_frmr(struct list_head *list, unsigned int *nfreed, 293void rds_ib_unreg_frmr(struct list_head *list, unsigned int *nfreed,
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c
index 18f2341202f8..dfe6237dafe2 100644
--- a/net/rds/ib_send.c
+++ b/net/rds/ib_send.c
@@ -69,6 +69,16 @@ static void rds_ib_send_complete(struct rds_message *rm,
69 complete(rm, notify_status); 69 complete(rm, notify_status);
70} 70}
71 71
72static void rds_ib_send_unmap_data(struct rds_ib_connection *ic,
73 struct rm_data_op *op,
74 int wc_status)
75{
76 if (op->op_nents)
77 ib_dma_unmap_sg(ic->i_cm_id->device,
78 op->op_sg, op->op_nents,
79 DMA_TO_DEVICE);
80}
81
72static void rds_ib_send_unmap_rdma(struct rds_ib_connection *ic, 82static void rds_ib_send_unmap_rdma(struct rds_ib_connection *ic,
73 struct rm_rdma_op *op, 83 struct rm_rdma_op *op,
74 int wc_status) 84 int wc_status)
@@ -129,21 +139,6 @@ static void rds_ib_send_unmap_atomic(struct rds_ib_connection *ic,
129 rds_ib_stats_inc(s_ib_atomic_fadd); 139 rds_ib_stats_inc(s_ib_atomic_fadd);
130} 140}
131 141
132static void rds_ib_send_unmap_data(struct rds_ib_connection *ic,
133 struct rm_data_op *op,
134 int wc_status)
135{
136 struct rds_message *rm = container_of(op, struct rds_message, data);
137
138 if (op->op_nents)
139 ib_dma_unmap_sg(ic->i_cm_id->device,
140 op->op_sg, op->op_nents,
141 DMA_TO_DEVICE);
142
143 if (rm->rdma.op_active && rm->data.op_notify)
144 rds_ib_send_unmap_rdma(ic, &rm->rdma, wc_status);
145}
146
147/* 142/*
148 * Unmap the resources associated with a struct send_work. 143 * Unmap the resources associated with a struct send_work.
149 * 144 *
@@ -902,7 +897,9 @@ int rds_ib_xmit_rdma(struct rds_connection *conn, struct rm_rdma_op *op)
902 send->s_queued = jiffies; 897 send->s_queued = jiffies;
903 send->s_op = NULL; 898 send->s_op = NULL;
904 899
905 nr_sig += rds_ib_set_wr_signal_state(ic, send, op->op_notify); 900 if (!op->op_notify)
901 nr_sig += rds_ib_set_wr_signal_state(ic, send,
902 op->op_notify);
906 903
907 send->s_wr.opcode = op->op_write ? IB_WR_RDMA_WRITE : IB_WR_RDMA_READ; 904 send->s_wr.opcode = op->op_write ? IB_WR_RDMA_WRITE : IB_WR_RDMA_READ;
908 send->s_rdma_wr.remote_addr = remote_addr; 905 send->s_rdma_wr.remote_addr = remote_addr;
diff --git a/net/rds/rdma.c b/net/rds/rdma.c
index b340ed4fc43a..916f5ec373d8 100644
--- a/net/rds/rdma.c
+++ b/net/rds/rdma.c
@@ -641,16 +641,6 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
641 } 641 }
642 op->op_notifier->n_user_token = args->user_token; 642 op->op_notifier->n_user_token = args->user_token;
643 op->op_notifier->n_status = RDS_RDMA_SUCCESS; 643 op->op_notifier->n_status = RDS_RDMA_SUCCESS;
644
645 /* Enable rmda notification on data operation for composite
646 * rds messages and make sure notification is enabled only
647 * for the data operation which follows it so that application
648 * gets notified only after full message gets delivered.
649 */
650 if (rm->data.op_sg) {
651 rm->rdma.op_notify = 0;
652 rm->data.op_notify = !!(args->flags & RDS_RDMA_NOTIFY_ME);
653 }
654 } 644 }
655 645
656 /* The cookie contains the R_Key of the remote memory region, and 646 /* The cookie contains the R_Key of the remote memory region, and
diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c
index 46bce8389066..ff74c4bbb9fc 100644
--- a/net/rds/rdma_transport.c
+++ b/net/rds/rdma_transport.c
@@ -112,17 +112,20 @@ static int rds_rdma_cm_event_handler_cmn(struct rdma_cm_id *cm_id,
112 if (!conn) 112 if (!conn)
113 break; 113 break;
114 err = (int *)rdma_consumer_reject_data(cm_id, event, &len); 114 err = (int *)rdma_consumer_reject_data(cm_id, event, &len);
115 if (!err || (err && ((*err) == RDS_RDMA_REJ_INCOMPAT))) { 115 if (!err ||
116 (err && len >= sizeof(*err) &&
117 ((*err) <= RDS_RDMA_REJ_INCOMPAT))) {
116 pr_warn("RDS/RDMA: conn <%pI6c, %pI6c> rejected, dropping connection\n", 118 pr_warn("RDS/RDMA: conn <%pI6c, %pI6c> rejected, dropping connection\n",
117 &conn->c_laddr, &conn->c_faddr); 119 &conn->c_laddr, &conn->c_faddr);
118 conn->c_proposed_version = RDS_PROTOCOL_COMPAT_VERSION; 120
119 conn->c_tos = 0; 121 if (!conn->c_tos)
122 conn->c_proposed_version = RDS_PROTOCOL_COMPAT_VERSION;
123
120 rds_conn_drop(conn); 124 rds_conn_drop(conn);
121 } 125 }
122 rdsdebug("Connection rejected: %s\n", 126 rdsdebug("Connection rejected: %s\n",
123 rdma_reject_msg(cm_id, event->status)); 127 rdma_reject_msg(cm_id, event->status));
124 break; 128 break;
125 /* FALLTHROUGH */
126 case RDMA_CM_EVENT_ADDR_ERROR: 129 case RDMA_CM_EVENT_ADDR_ERROR:
127 case RDMA_CM_EVENT_ROUTE_ERROR: 130 case RDMA_CM_EVENT_ROUTE_ERROR:
128 case RDMA_CM_EVENT_CONNECT_ERROR: 131 case RDMA_CM_EVENT_CONNECT_ERROR:
diff --git a/net/rds/rds.h b/net/rds/rds.h
index 0d8f67cadd74..f0066d168499 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -476,7 +476,6 @@ struct rds_message {
476 } rdma; 476 } rdma;
477 struct rm_data_op { 477 struct rm_data_op {
478 unsigned int op_active:1; 478 unsigned int op_active:1;
479 unsigned int op_notify:1;
480 unsigned int op_nents; 479 unsigned int op_nents;
481 unsigned int op_count; 480 unsigned int op_count;
482 unsigned int op_dmasg; 481 unsigned int op_dmasg;
diff --git a/net/rds/send.c b/net/rds/send.c
index 166dd578c1cc..031b1e97a466 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -491,14 +491,12 @@ void rds_rdma_send_complete(struct rds_message *rm, int status)
491 struct rm_rdma_op *ro; 491 struct rm_rdma_op *ro;
492 struct rds_notifier *notifier; 492 struct rds_notifier *notifier;
493 unsigned long flags; 493 unsigned long flags;
494 unsigned int notify = 0;
495 494
496 spin_lock_irqsave(&rm->m_rs_lock, flags); 495 spin_lock_irqsave(&rm->m_rs_lock, flags);
497 496
498 notify = rm->rdma.op_notify | rm->data.op_notify;
499 ro = &rm->rdma; 497 ro = &rm->rdma;
500 if (test_bit(RDS_MSG_ON_SOCK, &rm->m_flags) && 498 if (test_bit(RDS_MSG_ON_SOCK, &rm->m_flags) &&
501 ro->op_active && notify && ro->op_notifier) { 499 ro->op_active && ro->op_notify && ro->op_notifier) {
502 notifier = ro->op_notifier; 500 notifier = ro->op_notifier;
503 rs = rm->m_rs; 501 rs = rm->m_rs;
504 sock_hold(rds_rs_to_sk(rs)); 502 sock_hold(rds_rs_to_sk(rs));
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 638c1bc1ea1b..278014e26aec 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -684,7 +684,7 @@ static void tc_indr_block_ing_cmd(struct tc_indr_block_dev *indr_dev,
684 .command = command, 684 .command = command,
685 .binder_type = FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS, 685 .binder_type = FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS,
686 .net = dev_net(indr_dev->dev), 686 .net = dev_net(indr_dev->dev),
687 .block_shared = tcf_block_shared(indr_dev->block), 687 .block_shared = tcf_block_non_null_shared(indr_dev->block),
688 }; 688 };
689 INIT_LIST_HEAD(&bo.cb_list); 689 INIT_LIST_HEAD(&bo.cb_list);
690 690
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 61219f0b9677..44abc8e9c990 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -190,7 +190,7 @@ void tipc_named_node_up(struct net *net, u32 dnode)
190 struct name_table *nt = tipc_name_table(net); 190 struct name_table *nt = tipc_name_table(net);
191 struct sk_buff_head head; 191 struct sk_buff_head head;
192 192
193 __skb_queue_head_init(&head); 193 skb_queue_head_init(&head);
194 194
195 read_lock_bh(&nt->cluster_scope_lock); 195 read_lock_bh(&nt->cluster_scope_lock);
196 named_distribute(net, &head, dnode, &nt->cluster_scope); 196 named_distribute(net, &head, dnode, &nt->cluster_scope);
diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/skbedit.json b/tools/testing/selftests/tc-testing/tc-tests/actions/skbedit.json
index 45e7e89928a5..bf5ebf59c2d4 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/actions/skbedit.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/actions/skbedit.json
@@ -70,6 +70,123 @@
70 "teardown": [] 70 "teardown": []
71 }, 71 },
72 { 72 {
73 "id": "d4cd",
74 "name": "Add skbedit action with valid mark and mask",
75 "category": [
76 "actions",
77 "skbedit"
78 ],
79 "setup": [
80 [
81 "$TC actions flush action skbedit",
82 0,
83 1,
84 255
85 ]
86 ],
87 "cmdUnderTest": "$TC actions add action skbedit mark 1/0xaabb",
88 "expExitCode": "0",
89 "verifyCmd": "$TC actions list action skbedit",
90 "matchPattern": "action order [0-9]*: skbedit mark 1/0xaabb",
91 "matchCount": "1",
92 "teardown": [
93 "$TC actions flush action skbedit"
94 ]
95 },
96 {
97 "id": "baa7",
98 "name": "Add skbedit action with valid mark and 32-bit maximum mask",
99 "category": [
100 "actions",
101 "skbedit"
102 ],
103 "setup": [
104 [
105 "$TC actions flush action skbedit",
106 0,
107 1,
108 255
109 ]
110 ],
111 "cmdUnderTest": "$TC actions add action skbedit mark 1/0xffffffff",
112 "expExitCode": "0",
113 "verifyCmd": "$TC actions list action skbedit",
114 "matchPattern": "action order [0-9]*: skbedit mark 1/0xffffffff",
115 "matchCount": "1",
116 "teardown": [
117 "$TC actions flush action skbedit"
118 ]
119 },
120 {
121 "id": "62a5",
122 "name": "Add skbedit action with valid mark and mask exceeding 32-bit maximum",
123 "category": [
124 "actions",
125 "skbedit"
126 ],
127 "setup": [
128 [
129 "$TC actions flush action skbedit",
130 0,
131 1,
132 255
133 ]
134 ],
135 "cmdUnderTest": "$TC actions add action skbedit mark 1/0xaabbccddeeff112233",
136 "expExitCode": "255",
137 "verifyCmd": "$TC actions list action skbedit",
138 "matchPattern": "action order [0-9]*: skbedit mark 1/0xaabbccddeeff112233",
139 "matchCount": "0",
140 "teardown": []
141 },
142 {
143 "id": "bc15",
144 "name": "Add skbedit action with valid mark and mask with invalid format",
145 "category": [
146 "actions",
147 "skbedit"
148 ],
149 "setup": [
150 [
151 "$TC actions flush action skbedit",
152 0,
153 1,
154 255
155 ]
156 ],
157 "cmdUnderTest": "$TC actions add action skbedit mark 1/-1234",
158 "expExitCode": "255",
159 "verifyCmd": "$TC actions list action skbedit",
160 "matchPattern": "action order [0-9]*: skbedit mark 1/-1234",
161 "matchCount": "0",
162 "teardown": []
163 },
164 {
165 "id": "57c2",
166 "name": "Replace skbedit action with new mask",
167 "category": [
168 "actions",
169 "skbedit"
170 ],
171 "setup": [
172 [
173 "$TC actions flush action skbedit",
174 0,
175 1,
176 255
177 ],
178 "$TC actions add action skbedit mark 1/0x11223344 index 1"
179 ],
180 "cmdUnderTest": "$TC actions replace action skbedit mark 1/0xaabb index 1",
181 "expExitCode": "0",
182 "verifyCmd": "$TC actions list action skbedit",
183 "matchPattern": "action order [0-9]*: skbedit mark 1/0xaabb",
184 "matchCount": "1",
185 "teardown": [
186 "$TC actions flush action skbedit"
187 ]
188 },
189 {
73 "id": "081d", 190 "id": "081d",
74 "name": "Add skbedit action with priority", 191 "name": "Add skbedit action with priority",
75 "category": [ 192 "category": [