]> Git Repo - linux.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
authorLinus Torvalds <[email protected]>
Fri, 4 Sep 2020 01:50:48 +0000 (18:50 -0700)
committerLinus Torvalds <[email protected]>
Fri, 4 Sep 2020 01:50:48 +0000 (18:50 -0700)
Pull networking fixes from David Miller:

 1) Use netif_rx_ni() when necessary in batman-adv stack, from Jussi
    Kivilinna.

 2) Fix loss of RTT samples in rxrpc, from David Howells.

 3) Memory leak in hns_nic_dev_probe(), from Dignhao Liu.

 4) ravb module cannot be unloaded, fix from Yuusuke Ashizuka.

 5) We disable BH for too lokng in sctp_get_port_local(), add a
    cond_resched() here as well, from Xin Long.

 6) Fix memory leak in st95hf_in_send_cmd, from Dinghao Liu.

 7) Out of bound access in bpf_raw_tp_link_fill_link_info(), from
    Yonghong Song.

 8) Missing of_node_put() in mt7530 DSA driver, from Sumera
    Priyadarsini.

 9) Fix crash in bnxt_fw_reset_task(), from Michael Chan.

10) Fix geneve tunnel checksumming bug in hns3, from Yi Li.

11) Memory leak in rxkad_verify_response, from Dinghao Liu.

12) In tipc, don't use smp_processor_id() in preemptible context. From
    Tuong Lien.

13) Fix signedness issue in mlx4 memory allocation, from Shung-Hsi Yu.

14) Missing clk_disable_prepare() in gemini driver, from Dan Carpenter.

15) Fix ABI mismatch between driver and firmware in nfp, from Louis
    Peens.

* git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (110 commits)
  net/smc: fix sock refcounting in case of termination
  net/smc: reset sndbuf_desc if freed
  net/smc: set rx_off for SMCR explicitly
  net/smc: fix toleration of fake add_link messages
  tg3: Fix soft lockup when tg3_reset_task() fails.
  doc: net: dsa: Fix typo in config code sample
  net: dp83867: Fix WoL SecureOn password
  nfp: flower: fix ABI mismatch between driver and firmware
  tipc: fix shutdown() of connectionless socket
  ipv6: Fix sysctl max for fib_multipath_hash_policy
  drivers/net/wan/hdlc: Change the default of hard_header_len to 0
  net: gemini: Fix another missing clk_disable_unprepare() in probe
  net: bcmgenet: fix mask check in bcmgenet_validate_flow()
  amd-xgbe: Add support for new port mode
  net: usb: dm9601: Add USB ID of Keenetic Plus DSL
  vhost: fix typo in error message
  net: ethernet: mlx4: Fix memory allocation in mlx4_buddy_init()
  pktgen: fix error message with wrong function name
  net: ethernet: ti: am65-cpsw: fix rmii 100Mbit link mode
  cxgb4: fix thermal zone device registration
  ...

21 files changed:
1  2 
MAINTAINERS
drivers/atm/firestream.c
drivers/net/dsa/mt7530.c
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
drivers/net/ethernet/broadcom/genet/bcmgenet.c
drivers/net/ethernet/broadcom/tg3.c
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
drivers/net/wan/lapbether.c
include/linux/skbuff.h
kernel/bpf/syscall.c
net/core/dev.c
net/core/pktgen.c
net/core/sock.c
net/mptcp/protocol.c
net/rxrpc/input.c
net/smc/smc_close.c
net/tipc/socket.c
net/wireless/chan.c
net/wireless/nl80211.c
net/wireless/util.c

diff --combined MAINTAINERS
index 592467ba3f4d0a05efce391c30c57e2541012e5c,f8b2991b45eeb0241743058166e9404aecee90f8..dca9bfd8c88804ab85948328b95d65149848a567
@@@ -3205,7 -3205,6 +3205,7 @@@ S:      Maintaine
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
  F:    block/
  F:    drivers/block/
 +F:    include/linux/blk*
  F:    kernel/trace/blktrace.c
  F:    lib/sbitmap.c
  
@@@ -3389,6 -3388,7 +3389,7 @@@ M:      Florian Fainelli <[email protected]
  L:    [email protected]
  L:    [email protected] (subscribers-only)
  S:    Supported
+ F:    Documentation/devicetree/bindings/net/dsa/b53.txt
  F:    drivers/net/dsa/b53/*
  F:    include/linux/platform_data/b53.h
  
  S:    Maintained
  F:    drivers/phy/broadcom/phy-brcm-usb*
  
+ BROADCOM ETHERNET PHY DRIVERS
+ M:    Florian Fainelli <[email protected]>
+ L:    [email protected]
+ L:    [email protected]
+ S:    Supported
+ F:    Documentation/devicetree/bindings/net/broadcom-bcm87xx.txt
+ F:    drivers/net/phy/bcm*.[ch]
+ F:    drivers/net/phy/broadcom.c
+ F:    include/linux/brcmphy.h
  BROADCOM GENET ETHERNET DRIVER
  M:    Doug Berger <[email protected]>
  M:    Florian Fainelli <[email protected]>
  L:    [email protected]
  L:    [email protected]
  S:    Supported
+ F:    Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
+ F:    Documentation/devicetree/bindings/net/brcm,unimac-mdio.txt
  F:    drivers/net/ethernet/broadcom/genet/
+ F:    drivers/net/mdio/mdio-bcm-unimac.c
+ F:    include/linux/platform_data/bcmgenet.h
+ F:    include/linux/platform_data/mdio-bcm-unimac.h
  
  BROADCOM IPROC ARM ARCHITECTURE
  M:    Ray Jui <[email protected]>
@@@ -5240,7 -5255,6 +5256,7 @@@ DOCUMENTATIO
  M:    Jonathan Corbet <[email protected]>
  L:    [email protected]
  S:    Maintained
 +P:    Documentation/doc-guide/maintainer-profile.rst
  T:    git git://git.lwn.net/linux.git docs-next
  F:    Documentation/
  F:    scripts/documentation-file-ref-check
@@@ -6496,7 -6510,6 +6512,6 @@@ F:      net/bridge
  
  ETHERNET PHY LIBRARY
  M:    Andrew Lunn <[email protected]>
- M:    Florian Fainelli <[email protected]>
  M:    Heiner Kallweit <[email protected]>
  R:    Russell King <[email protected]>
  L:    [email protected]
@@@ -13571,18 -13584,12 +13586,18 @@@ F:        kernel/events/
  F:    tools/lib/perf/
  F:    tools/perf/
  
 -PERFORMANCE EVENTS SUBSYSTEM ARM64 PMU EVENTS
 +PERFORMANCE EVENTS TOOLING ARM64
  R:    John Garry <[email protected]>
  R:    Will Deacon <[email protected]>
 +R:    Mathieu Poirier <[email protected]>
 +R:    Leo Yan <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Supported
 +F:    tools/build/feature/test-libopencsd.c
 +F:    tools/perf/arch/arm*/
  F:    tools/perf/pmu-events/arch/arm64/
 +F:    tools/perf/util/arm-spe*
 +F:    tools/perf/util/cs-etm*
  
  PERSONALITY HANDLING
  M:    Christoph Hellwig <[email protected]>
@@@ -17124,8 -17131,8 +17139,8 @@@ S:   Maintaine
  F:    Documentation/devicetree/bindings/arm/keystone/ti,k3-sci-common.yaml
  F:    Documentation/devicetree/bindings/arm/keystone/ti,sci.txt
  F:    Documentation/devicetree/bindings/clock/ti,sci-clk.txt
 -F:    Documentation/devicetree/bindings/interrupt-controller/ti,sci-inta.txt
 -F:    Documentation/devicetree/bindings/interrupt-controller/ti,sci-intr.txt
 +F:    Documentation/devicetree/bindings/interrupt-controller/ti,sci-inta.yaml
 +F:    Documentation/devicetree/bindings/interrupt-controller/ti,sci-intr.yaml
  F:    Documentation/devicetree/bindings/reset/ti,sci-reset.txt
  F:    Documentation/devicetree/bindings/soc/ti/sci-pm-domain.txt
  F:    drivers/clk/keystone/sci-clk.c
@@@ -18882,15 -18889,6 +18897,15 @@@ S: Maintaine
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core
  F:    arch/x86/platform
  
 +X86 PLATFORM UV HPE SUPERDOME FLEX
 +M:    Steve Wahl <[email protected]>
 +R:    Dimitri Sivanich <[email protected]>
 +R:    Russ Anderson <[email protected]>
 +S:    Supported
 +F:    arch/x86/include/asm/uv/
 +F:    arch/x86/kernel/apic/x2apic_uv_x.c
 +F:    arch/x86/platform/uv/
 +
  X86 VDSO
  M:    Andy Lutomirski <[email protected]>
  L:    [email protected]
diff --combined drivers/atm/firestream.c
index c798856e74a4b411da92388530596d405b16f522,510250cf5c876650b49ba6996d50db35b19abd69..0ddd611b427766f4f4d01eb17334a1e7ff13124b
@@@ -711,7 -711,7 +711,7 @@@ static void process_txdone_queue (struc
  
                switch (STATUS_CODE (qe)) {
                case 0x01: /* This is for AAL0 where we put the chip in streaming mode */
 -                      /* Fall through */
 +                      fallthrough;
                case 0x02:
                        /* Process a real txdone entry. */
                        tmp = qe->p0;
@@@ -998,6 -998,7 +998,7 @@@ static int fs_open(struct atm_vcc *atm_
                                error = make_rate (pcr, r, &tmc0, NULL);
                                if (error) {
                                        kfree(tc);
+                                       kfree(vcc);
                                        return error;
                                }
                        }
diff --combined drivers/net/dsa/mt7530.c
index 0c37ddb58c1e24077bea86a4bb09c2e799b118a8,e044d9e8d0165cdd59ff96a4d6e25b971cca1293..1aaf47a0da2b35523a8af8b886c532de20d236db
@@@ -566,7 -566,7 +566,7 @@@ static void mt7530_setup_port5(struct d
        case P5_INTF_SEL_PHY_P0:
                /* MT7530_P5_MODE_GPHY_P0: 2nd GMAC -> P5 -> P0 */
                val |= MHWTRAP_PHY0_SEL;
 -              /* fall through */
 +              fallthrough;
        case P5_INTF_SEL_PHY_P4:
                /* MT7530_P5_MODE_GPHY_P4: 2nd GMAC -> P5 -> P4 */
                val &= ~MHWTRAP_P5_MAC_SEL & ~MHWTRAP_P5_DIS;
@@@ -1326,14 -1326,17 +1326,17 @@@ mt7530_setup(struct dsa_switch *ds
  
                        if (phy_node->parent == priv->dev->of_node->parent) {
                                ret = of_get_phy_mode(mac_np, &interface);
-                               if (ret && ret != -ENODEV)
+                               if (ret && ret != -ENODEV) {
+                                       of_node_put(mac_np);
                                        return ret;
+                               }
                                id = of_mdio_parse_addr(ds->dev, phy_node);
                                if (id == 0)
                                        priv->p5_intf_sel = P5_INTF_SEL_PHY_P0;
                                if (id == 4)
                                        priv->p5_intf_sel = P5_INTF_SEL_PHY_P4;
                        }
+                       of_node_put(mac_np);
                        of_node_put(phy_node);
                        break;
                }
@@@ -1501,7 -1504,7 +1504,7 @@@ unsupported
                phylink_set(mask, 100baseT_Full);
  
                if (state->interface != PHY_INTERFACE_MODE_MII) {
-                       phylink_set(mask, 1000baseT_Half);
+                       /* This switch only supports 1G full-duplex. */
                        phylink_set(mask, 1000baseT_Full);
                        if (port == 5)
                                phylink_set(mask, 1000baseX_Full);
index f92fd8863f48f7329e8d496ccdedd61bfef490f8,57d0e195cddf6376fc96a4cf8c714258f12a15b4..b167066af45040c523bb19cc74695c9dca8ae717
@@@ -1141,6 -1141,9 +1141,9 @@@ static int bnxt_discard_rx(struct bnxt 
  
  static void bnxt_queue_fw_reset_work(struct bnxt *bp, unsigned long delay)
  {
+       if (!(test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)))
+               return;
        if (BNXT_PF(bp))
                queue_delayed_work(bnxt_pf_wq, &bp->fw_reset_task, delay);
        else
@@@ -1157,10 -1160,12 +1160,12 @@@ static void bnxt_queue_sp_work(struct b
  
  static void bnxt_cancel_sp_work(struct bnxt *bp)
  {
-       if (BNXT_PF(bp))
+       if (BNXT_PF(bp)) {
                flush_workqueue(bnxt_pf_wq);
-       else
+       } else {
                cancel_work_sync(&bp->sp_task);
+               cancel_delayed_work_sync(&bp->fw_reset_task);
+       }
  }
  
  static void bnxt_sched_reset(struct bnxt *bp, struct bnxt_rx_ring_info *rxr)
@@@ -1923,7 -1928,7 +1928,7 @@@ u32 bnxt_fw_health_readl(struct bnxt *b
                break;
        case BNXT_FW_HEALTH_REG_TYPE_GRC:
                reg_off = fw_health->mapped_regs[reg_idx];
 -              /* fall through */
 +              fallthrough;
        case BNXT_FW_HEALTH_REG_TYPE_BAR0:
                val = readl(bp->bar0 + reg_off);
                break;
@@@ -1966,11 -1971,11 +1971,11 @@@ static int bnxt_async_event_process(str
                }
                set_bit(BNXT_LINK_SPEED_CHNG_SP_EVENT, &bp->sp_event);
        }
 -      /* fall through */
 +              fallthrough;
        case ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE:
        case ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE:
                set_bit(BNXT_LINK_CFG_CHANGE_SP_EVENT, &bp->sp_event);
 -              /* fall through */
 +              fallthrough;
        case ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE:
                set_bit(BNXT_LINK_CHNG_SP_EVENT, &bp->sp_event);
                break;
@@@ -6102,6 -6107,21 +6107,21 @@@ static int bnxt_get_func_stat_ctxs(stru
        return cp + ulp_stat;
  }
  
+ /* Check if a default RSS map needs to be setup.  This function is only
+  * used on older firmware that does not require reserving RX rings.
+  */
+ static void bnxt_check_rss_tbl_no_rmgr(struct bnxt *bp)
+ {
+       struct bnxt_hw_resc *hw_resc = &bp->hw_resc;
+       /* The RSS map is valid for RX rings set to resv_rx_rings */
+       if (hw_resc->resv_rx_rings != bp->rx_nr_rings) {
+               hw_resc->resv_rx_rings = bp->rx_nr_rings;
+               if (!netif_is_rxfh_configured(bp->dev))
+                       bnxt_set_dflt_rss_indir_tbl(bp);
+       }
+ }
  static bool bnxt_need_reserve_rings(struct bnxt *bp)
  {
        struct bnxt_hw_resc *hw_resc = &bp->hw_resc;
        int rx = bp->rx_nr_rings, stat;
        int vnic = 1, grp = rx;
  
-       if (bp->hwrm_spec_code < 0x10601)
-               return false;
-       if (hw_resc->resv_tx_rings != bp->tx_nr_rings)
+       if (hw_resc->resv_tx_rings != bp->tx_nr_rings &&
+           bp->hwrm_spec_code >= 0x10601)
                return true;
  
+       /* Old firmware does not need RX ring reservations but we still
+        * need to setup a default RSS map when needed.  With new firmware
+        * we go through RX ring reservations first and then set up the
+        * RSS map for the successfully reserved RX rings when needed.
+        */
+       if (!BNXT_NEW_RM(bp)) {
+               bnxt_check_rss_tbl_no_rmgr(bp);
+               return false;
+       }
        if ((bp->flags & BNXT_FLAG_RFS) && !(bp->flags & BNXT_FLAG_CHIP_P5))
                vnic = rx + 1;
        if (bp->flags & BNXT_FLAG_AGG_RINGS)
                rx <<= 1;
        stat = bnxt_get_func_stat_ctxs(bp);
-       if (BNXT_NEW_RM(bp) &&
-           (hw_resc->resv_rx_rings != rx || hw_resc->resv_cp_rings != cp ||
-            hw_resc->resv_vnics != vnic || hw_resc->resv_stat_ctxs != stat ||
-            (hw_resc->resv_hw_ring_grps != grp &&
-             !(bp->flags & BNXT_FLAG_CHIP_P5))))
+       if (hw_resc->resv_rx_rings != rx || hw_resc->resv_cp_rings != cp ||
+           hw_resc->resv_vnics != vnic || hw_resc->resv_stat_ctxs != stat ||
+           (hw_resc->resv_hw_ring_grps != grp &&
+            !(bp->flags & BNXT_FLAG_CHIP_P5)))
                return true;
        if ((bp->flags & BNXT_FLAG_CHIP_P5) && BNXT_PF(bp) &&
            hw_resc->resv_irqs != nq)
@@@ -6214,6 -6240,9 +6240,9 @@@ static int __bnxt_reserve_rings(struct 
        if (!tx || !rx || !cp || !grp || !vnic || !stat)
                return -ENOMEM;
  
+       if (!netif_is_rxfh_configured(bp->dev))
+               bnxt_set_dflt_rss_indir_tbl(bp);
        return rc;
  }
  
@@@ -8495,9 -8524,6 +8524,6 @@@ int bnxt_reserve_rings(struct bnxt *bp
                        rc = bnxt_init_int_mode(bp);
                bnxt_ulp_irq_restart(bp, rc);
        }
-       if (!netif_is_rxfh_configured(bp->dev))
-               bnxt_set_dflt_rss_indir_tbl(bp);
        if (rc) {
                netdev_err(bp->dev, "ring reservation/IRQ init failure rc: %d\n", rc);
                return rc;
@@@ -9284,16 -9310,19 +9310,19 @@@ static ssize_t bnxt_show_temp(struct de
        struct hwrm_temp_monitor_query_input req = {0};
        struct hwrm_temp_monitor_query_output *resp;
        struct bnxt *bp = dev_get_drvdata(dev);
-       u32 temp = 0;
+       u32 len = 0;
  
        resp = bp->hwrm_cmd_resp_addr;
        bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_TEMP_MONITOR_QUERY, -1, -1);
        mutex_lock(&bp->hwrm_cmd_lock);
-       if (!_hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT))
-               temp = resp->temp * 1000; /* display millidegree */
+       if (!_hwrm_send_message_silent(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT))
+               len = sprintf(buf, "%u\n", resp->temp * 1000); /* display millidegree */
        mutex_unlock(&bp->hwrm_cmd_lock);
  
-       return sprintf(buf, "%u\n", temp);
+       if (len)
+               return len;
+       return sprintf(buf, "unknown\n");
  }
  static SENSOR_DEVICE_ATTR(temp1_input, 0444, bnxt_show_temp, NULL, 0);
  
@@@ -9475,15 -9504,15 +9504,15 @@@ static int __bnxt_open_nic(struct bnxt 
                }
        }
  
-       bnxt_enable_napi(bp);
-       bnxt_debug_dev_init(bp);
        rc = bnxt_init_nic(bp, irq_re_init);
        if (rc) {
                netdev_err(bp->dev, "bnxt_init_nic err: %x\n", rc);
-               goto open_err;
+               goto open_err_irq;
        }
  
+       bnxt_enable_napi(bp);
+       bnxt_debug_dev_init(bp);
        if (link_re_init) {
                mutex_lock(&bp->link_lock);
                rc = bnxt_update_phy_setting(bp);
                bnxt_vf_reps_open(bp);
        return 0;
  
- open_err:
-       bnxt_debug_dev_exit(bp);
-       bnxt_disable_napi(bp);
  open_err_irq:
        bnxt_del_napi(bp);
  
@@@ -9765,7 -9790,7 +9790,7 @@@ static int bnxt_ioctl(struct net_devic
        case SIOCGMIIPHY:
                mdio->phy_id = bp->link_info.phy_addr;
  
 -              /* fallthru */
 +              fallthrough;
        case SIOCGMIIREG: {
                u16 mii_regval = 0;
  
@@@ -11022,7 -11047,7 +11047,7 @@@ static void bnxt_fw_reset_writel(struc
                writel(reg_off & BNXT_GRC_BASE_MASK,
                       bp->bar0 + BNXT_GRCPF_REG_WINDOW_BASE_OUT + 4);
                reg_off = (reg_off & BNXT_GRC_OFFSET_MASK) + 0x2000;
 -              /* fall through */
 +              fallthrough;
        case BNXT_FW_HEALTH_REG_TYPE_BAR0:
                writel(val, bp->bar0 + reg_off);
                break;
@@@ -11135,7 -11160,7 +11160,7 @@@ static void bnxt_fw_reset_task(struct w
                }
                bp->fw_reset_state = BNXT_FW_RESET_STATE_RESET_FW;
        }
 -      /* fall through */
 +              fallthrough;
        case BNXT_FW_RESET_STATE_RESET_FW:
                bnxt_reset_all(bp);
                bp->fw_reset_state = BNXT_FW_RESET_STATE_ENABLE_DEV;
                }
                pci_set_master(bp->pdev);
                bp->fw_reset_state = BNXT_FW_RESET_STATE_POLL_FW;
 -              /* fall through */
 +              fallthrough;
        case BNXT_FW_RESET_STATE_POLL_FW:
                bp->hwrm_cmd_timeout = SHORT_HWRM_CMD_TIMEOUT;
                rc = __bnxt_hwrm_ver_get(bp, true);
                }
                bp->hwrm_cmd_timeout = DFLT_HWRM_CMD_TIMEOUT;
                bp->fw_reset_state = BNXT_FW_RESET_STATE_OPENING;
 -              /* fall through */
 +              fallthrough;
        case BNXT_FW_RESET_STATE_OPENING:
                while (!rtnl_trylock()) {
                        bnxt_queue_fw_reset_work(bp, HZ / 10);
@@@ -11761,6 -11786,7 +11786,7 @@@ static void bnxt_remove_one(struct pci_
        unregister_netdev(dev);
        bnxt_dl_unregister(bp);
        bnxt_shutdown_tc(bp);
+       clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
        bnxt_cancel_sp_work(bp);
        bp->sp_event = 0;
  
@@@ -12200,6 -12226,10 +12226,10 @@@ static int bnxt_init_one(struct pci_de
        if (BNXT_CHIP_P5(bp))
                bp->flags |= BNXT_FLAG_CHIP_P5;
  
+       rc = bnxt_alloc_rss_indir_tbl(bp);
+       if (rc)
+               goto init_err_pci_clean;
        rc = bnxt_fw_init_one_p2(bp);
        if (rc)
                goto init_err_pci_clean;
         */
        bp->tx_nr_rings_per_tc = bp->tx_nr_rings;
  
-       rc = bnxt_alloc_rss_indir_tbl(bp);
-       if (rc)
-               goto init_err_pci_clean;
-       bnxt_set_dflt_rss_indir_tbl(bp);
        if (BNXT_PF(bp)) {
                if (!bnxt_pf_wq) {
                        bnxt_pf_wq =
                    (long)pci_resource_start(pdev, 0), dev->dev_addr);
        pcie_print_link_status(pdev);
  
+       pci_save_state(pdev);
        return 0;
  
  init_err_cleanup:
@@@ -12536,6 -12562,8 +12562,8 @@@ static pci_ers_result_t bnxt_io_slot_re
                        "Cannot re-enable PCI device after reset.\n");
        } else {
                pci_set_master(pdev);
+               pci_restore_state(pdev);
+               pci_save_state(pdev);
  
                err = bnxt_hwrm_func_reset(bp);
                if (!err) {
index 17934cd87a4aa8dc4a9844f299a3904467dc402f,1bc5130458bf3a0484422dd3aa7a68235906af40..d0928334bdc85906289f940ee6042db46d719e71
@@@ -472,20 -472,13 +472,13 @@@ static int bnxt_get_num_tpa_ring_stats(
  static int bnxt_get_num_ring_stats(struct bnxt *bp)
  {
        int rx, tx, cmn;
-       bool sh = false;
-       if (bp->flags & BNXT_FLAG_SHARED_RINGS)
-               sh = true;
  
        rx = NUM_RING_RX_HW_STATS + NUM_RING_RX_SW_STATS +
             bnxt_get_num_tpa_ring_stats(bp);
        tx = NUM_RING_TX_HW_STATS;
        cmn = NUM_RING_CMN_SW_STATS;
-       if (sh)
-               return (rx + tx + cmn) * bp->cp_nr_rings;
-       else
-               return rx * bp->rx_nr_rings + tx * bp->tx_nr_rings +
-                      cmn * bp->cp_nr_rings;
+       return rx * bp->rx_nr_rings + tx * bp->tx_nr_rings +
+              cmn * bp->cp_nr_rings;
  }
  
  static int bnxt_get_num_stats(struct bnxt *bp)
@@@ -806,7 -799,7 +799,7 @@@ static void bnxt_get_channels(struct ne
        int max_tx_sch_inputs;
  
        /* Get the most up-to-date max_tx_sch_inputs. */
-       if (BNXT_NEW_RM(bp))
+       if (netif_running(dev) && BNXT_NEW_RM(bp))
                bnxt_hwrm_func_resc_qcaps(bp, false);
        max_tx_sch_inputs = hw_resc->max_tx_sch_inputs;
  
@@@ -1073,7 -1066,7 +1066,7 @@@ static int bnxt_grxfh(struct bnxt *bp, 
                if (bp->rss_hash_cfg & VNIC_RSS_CFG_REQ_HASH_TYPE_UDP_IPV4)
                        cmd->data |= RXH_IP_SRC | RXH_IP_DST |
                                     RXH_L4_B_0_1 | RXH_L4_B_2_3;
 -              /* fall through */
 +              fallthrough;
        case SCTP_V4_FLOW:
        case AH_ESP_V4_FLOW:
        case AH_V4_FLOW:
                if (bp->rss_hash_cfg & VNIC_RSS_CFG_REQ_HASH_TYPE_UDP_IPV6)
                        cmd->data |= RXH_IP_SRC | RXH_IP_DST |
                                     RXH_L4_B_0_1 | RXH_L4_B_2_3;
 -              /* fall through */
 +              fallthrough;
        case SCTP_V6_FLOW:
        case AH_ESP_V6_FLOW:
        case AH_V6_FLOW:
@@@ -2323,6 -2316,9 +2316,9 @@@ static int bnxt_get_nvram_directory(str
        if (rc != 0)
                return rc;
  
+       if (!dir_entries || !entry_length)
+               return -EIO;
        /* Insert 2 bytes of directory info (count and size of entries) */
        if (len < 2)
                return -EINVAL;
index 0ca8436d2e9d8534b2b856d2112803c586d7aa55,d95f46ef804037a2acbff7732e836dcc50a9c037..be85dad2e3bc4d0667b7ecd2071a9bfd369634ca
@@@ -1185,10 -1185,10 +1185,10 @@@ static void bcmgenet_update_mib_counter
                        continue;
                case BCMGENET_STAT_RUNT:
                        offset += BCMGENET_STAT_OFFSET;
 -                      /* fall through */
 +                      fallthrough;
                case BCMGENET_STAT_MIB_TX:
                        offset += BCMGENET_STAT_OFFSET;
 -                      /* fall through */
 +                      fallthrough;
                case BCMGENET_STAT_MIB_RX:
                        val = bcmgenet_umac_readl(priv,
                                                  UMAC_MIB_START + j + offset);
@@@ -1364,7 -1364,7 +1364,7 @@@ static int bcmgenet_validate_flow(struc
        case ETHER_FLOW:
                eth_mask = &cmd->fs.m_u.ether_spec;
                /* don't allow mask which isn't valid */
-               if (VALIDATE_MASK(eth_mask->h_source) ||
+               if (VALIDATE_MASK(eth_mask->h_dest) ||
                    VALIDATE_MASK(eth_mask->h_source) ||
                    VALIDATE_MASK(eth_mask->h_proto)) {
                        netdev_err(dev, "rxnfc: Unsupported mask\n");
index 9894594d957dee8d481835e3d3e62ac7ce869e6f,4515804d1ce4c3cca24c2dc18228c09be97f748b..5143cdd0eecada87c5827c2de74913a6cc15ce5e
@@@ -715,7 -715,7 +715,7 @@@ static int tg3_ape_lock(struct tg3 *tp
        case TG3_APE_LOCK_GPIO:
                if (tg3_asic_rev(tp) == ASIC_REV_5761)
                        return 0;
 -              /* fall through */
 +              fallthrough;
        case TG3_APE_LOCK_GRC:
        case TG3_APE_LOCK_MEM:
                if (!tp->pci_fn)
@@@ -776,7 -776,7 +776,7 @@@ static void tg3_ape_unlock(struct tg3 *
        case TG3_APE_LOCK_GPIO:
                if (tg3_asic_rev(tp) == ASIC_REV_5761)
                        return;
 -              /* fall through */
 +              fallthrough;
        case TG3_APE_LOCK_GRC:
        case TG3_APE_LOCK_MEM:
                if (!tp->pci_fn)
@@@ -1586,7 -1586,7 +1586,7 @@@ static int tg3_mdio_init(struct tg3 *tp
                        phydev->dev_flags |= PHY_BRCM_EXT_IBND_RX_ENABLE;
                if (tg3_flag(tp, RGMII_EXT_IBND_TX_EN))
                        phydev->dev_flags |= PHY_BRCM_EXT_IBND_TX_ENABLE;
 -              /* fall through */
 +              fallthrough;
        case PHY_ID_RTL8211C:
                phydev->interface = PHY_INTERFACE_MODE_RGMII;
                break;
@@@ -2114,7 -2114,7 +2114,7 @@@ static int tg3_phy_init(struct tg3 *tp
                        phy_support_asym_pause(phydev);
                        break;
                }
 -              /* fall through */
 +              fallthrough;
        case PHY_INTERFACE_MODE_MII:
                phy_set_max_speed(phydev, SPEED_100);
                phy_support_asym_pause(phydev);
@@@ -4390,7 -4390,7 +4390,7 @@@ static int tg3_phy_autoneg_cfg(struct t
                                      MII_TG3_DSP_TAP26_RMRXSTO |
                                      MII_TG3_DSP_TAP26_OPCSINPT;
                        tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, val);
 -                      /* Fall through */
 +                      fallthrough;
                case ASIC_REV_5720:
                case ASIC_REV_5762:
                        if (!tg3_phydsp_read(tp, MII_TG3_DSP_CH34TP2, &val))
@@@ -4538,7 -4538,7 +4538,7 @@@ static int tg3_phy_pull_config(struct t
                                tp->link_config.speed = SPEED_1000;
                                break;
                        }
 -                      /* Fall through */
 +                      fallthrough;
                default:
                        goto done;
                }
@@@ -5209,7 -5209,7 +5209,7 @@@ static int tg3_fiber_aneg_smachine(stru
                if (ap->flags & (MR_AN_ENABLE | MR_RESTART_AN))
                        ap->state = ANEG_STATE_AN_ENABLE;
  
 -              /* fall through */
 +              fallthrough;
        case ANEG_STATE_AN_ENABLE:
                ap->flags &= ~(MR_AN_COMPLETE | MR_PAGE_RX);
                if (ap->flags & MR_AN_ENABLE) {
                ret = ANEG_TIMER_ENAB;
                ap->state = ANEG_STATE_RESTART;
  
 -              /* fall through */
 +              fallthrough;
        case ANEG_STATE_RESTART:
                delta = ap->cur_time - ap->link_time;
                if (delta > ANEG_STATE_SETTLE_TIME)
  
                ap->state = ANEG_STATE_ACK_DETECT;
  
 -              /* fall through */
 +              fallthrough;
        case ANEG_STATE_ACK_DETECT:
                if (ap->ack_match != 0) {
                        if ((ap->rxconfig & ~ANEG_CFG_ACK) ==
@@@ -7221,8 -7221,8 +7221,8 @@@ static inline void tg3_reset_task_sched
  
  static inline void tg3_reset_task_cancel(struct tg3 *tp)
  {
-       cancel_work_sync(&tp->reset_task);
-       tg3_flag_clear(tp, RESET_TASK_PENDING);
+       if (test_and_clear_bit(TG3_FLAG_RESET_TASK_PENDING, tp->tg3_flags))
+               cancel_work_sync(&tp->reset_task);
        tg3_flag_clear(tp, TX_RECOVERY_PENDING);
  }
  
@@@ -10720,40 -10720,40 +10720,40 @@@ static int tg3_reset_hw(struct tg3 *tp
        switch (limit) {
        case 16:
                tw32(MAC_RCV_RULE_15,  0); tw32(MAC_RCV_VALUE_15,  0);
 -              /* fall through */
 +              fallthrough;
        case 15:
                tw32(MAC_RCV_RULE_14,  0); tw32(MAC_RCV_VALUE_14,  0);
 -              /* fall through */
 +              fallthrough;
        case 14:
                tw32(MAC_RCV_RULE_13,  0); tw32(MAC_RCV_VALUE_13,  0);
 -              /* fall through */
 +              fallthrough;
        case 13:
                tw32(MAC_RCV_RULE_12,  0); tw32(MAC_RCV_VALUE_12,  0);
 -              /* fall through */
 +              fallthrough;
        case 12:
                tw32(MAC_RCV_RULE_11,  0); tw32(MAC_RCV_VALUE_11,  0);
 -              /* fall through */
 +              fallthrough;
        case 11:
                tw32(MAC_RCV_RULE_10,  0); tw32(MAC_RCV_VALUE_10,  0);
 -              /* fall through */
 +              fallthrough;
        case 10:
                tw32(MAC_RCV_RULE_9,  0); tw32(MAC_RCV_VALUE_9,  0);
 -              /* fall through */
 +              fallthrough;
        case 9:
                tw32(MAC_RCV_RULE_8,  0); tw32(MAC_RCV_VALUE_8,  0);
 -              /* fall through */
 +              fallthrough;
        case 8:
                tw32(MAC_RCV_RULE_7,  0); tw32(MAC_RCV_VALUE_7,  0);
 -              /* fall through */
 +              fallthrough;
        case 7:
                tw32(MAC_RCV_RULE_6,  0); tw32(MAC_RCV_VALUE_6,  0);
 -              /* fall through */
 +              fallthrough;
        case 6:
                tw32(MAC_RCV_RULE_5,  0); tw32(MAC_RCV_VALUE_5,  0);
 -              /* fall through */
 +              fallthrough;
        case 5:
                tw32(MAC_RCV_RULE_4,  0); tw32(MAC_RCV_VALUE_4,  0);
 -              /* fall through */
 +              fallthrough;
        case 4:
                /* tw32(MAC_RCV_RULE_3,  0); tw32(MAC_RCV_VALUE_3,  0); */
        case 3:
@@@ -11209,18 -11209,27 +11209,27 @@@ static void tg3_reset_task(struct work_
  
        tg3_halt(tp, RESET_KIND_SHUTDOWN, 0);
        err = tg3_init_hw(tp, true);
-       if (err)
+       if (err) {
+               tg3_full_unlock(tp);
+               tp->irq_sync = 0;
+               tg3_napi_enable(tp);
+               /* Clear this flag so that tg3_reset_task_cancel() will not
+                * call cancel_work_sync() and wait forever.
+                */
+               tg3_flag_clear(tp, RESET_TASK_PENDING);
+               dev_close(tp->dev);
                goto out;
+       }
  
        tg3_netif_start(tp);
  
- out:
        tg3_full_unlock(tp);
  
        if (!err)
                tg3_phy_start(tp);
  
        tg3_flag_clear(tp, RESET_TASK_PENDING);
+ out:
        rtnl_unlock();
  }
  
@@@ -13998,7 -14007,7 +14007,7 @@@ static int tg3_ioctl(struct net_device 
        case SIOCGMIIPHY:
                data->phy_id = tp->phy_addr;
  
 -              /* fall through */
 +              fallthrough;
        case SIOCGMIIREG: {
                u32 mii_regval;
  
@@@ -17136,7 -17145,7 +17145,7 @@@ static u32 tg3_calc_dma_bndry(struct tg
                                val |= DMA_RWCTRL_WRITE_BNDRY_64_PCIE;
                                break;
                        }
 -                      /* fallthrough */
 +                      fallthrough;
                case 128:
                default:
                        val &= ~DMA_RWCTRL_WRITE_BNDRY_DISAB_PCIE;
                                        DMA_RWCTRL_WRITE_BNDRY_16);
                                break;
                        }
 -                      /* fallthrough */
 +                      fallthrough;
                case 32:
                        if (goal == BOUNDARY_SINGLE_CACHELINE) {
                                val |= (DMA_RWCTRL_READ_BNDRY_32 |
                                        DMA_RWCTRL_WRITE_BNDRY_32);
                                break;
                        }
 -                      /* fallthrough */
 +                      fallthrough;
                case 64:
                        if (goal == BOUNDARY_SINGLE_CACHELINE) {
                                val |= (DMA_RWCTRL_READ_BNDRY_64 |
                                        DMA_RWCTRL_WRITE_BNDRY_64);
                                break;
                        }
 -                      /* fallthrough */
 +                      fallthrough;
                case 128:
                        if (goal == BOUNDARY_SINGLE_CACHELINE) {
                                val |= (DMA_RWCTRL_READ_BNDRY_128 |
                                        DMA_RWCTRL_WRITE_BNDRY_128);
                                break;
                        }
 -                      /* fallthrough */
 +                      fallthrough;
                case 256:
                        val |= (DMA_RWCTRL_READ_BNDRY_256 |
                                DMA_RWCTRL_WRITE_BNDRY_256);
index c2ea0348b2f7ecfee17b763ec209bb6c3d1c3de0,7d83c45369c22e20514d4f81cd4938fe7d94144f..a4f1d515e5e09b6ce151295f255af25d0048c1f8
@@@ -21,6 -21,7 +21,7 @@@
  #include <net/pkt_cls.h>
  #include <net/tcp.h>
  #include <net/vxlan.h>
+ #include <net/geneve.h>
  
  #include "hnae3.h"
  #include "hns3_enet.h"
@@@ -780,7 -781,7 +781,7 @@@ static int hns3_get_l4_protocol(struct 
   * and it is udp packet, which has a dest port as the IANA assigned.
   * the hardware is expected to do the checksum offload, but the
   * hardware will not do the checksum offload when udp dest port is
-  * 4789.
+  * 4789 or 6081.
   */
  static bool hns3_tunnel_csum_bug(struct sk_buff *skb)
  {
        l4.hdr = skb_transport_header(skb);
  
        if (!(!skb->encapsulation &&
-             l4.udp->dest == htons(IANA_VXLAN_UDP_PORT)))
+             (l4.udp->dest == htons(IANA_VXLAN_UDP_PORT) ||
+             l4.udp->dest == htons(GENEVE_UDP_PORT))))
                return false;
  
        skb_checksum_help(skb);
@@@ -2746,7 -2748,7 +2748,7 @@@ static void hns3_rx_checksum(struct hns
        case HNS3_OL4_TYPE_MAC_IN_UDP:
        case HNS3_OL4_TYPE_NVGRE:
                skb->csum_level = 1;
 -              /* fall through */
 +              fallthrough;
        case HNS3_OL4_TYPE_NO_TUN:
                l3_type = hnae3_get_field(l234info, HNS3_RXD_L3ID_M,
                                          HNS3_RXD_L3ID_S);
index 8ccd086e06cb172c505b4ba21d9622e55694d2b3,e61616b0b91c7473568e492b533ec69278f490d1..732a6c1851f56ce50cf9e6c1d9059212e49982cd
@@@ -173,7 -173,7 +173,7 @@@ static netdev_tx_t lapbeth_xmit(struct 
        case X25_IFACE_DISCONNECT:
                if ((err = lapb_disconnect_request(dev)) != LAPB_OK)
                        pr_err("lapb_disconnect_request err: %d\n", err);
 -              /* Fall thru */
 +              fallthrough;
        default:
                goto drop;
        }
@@@ -210,6 -210,8 +210,8 @@@ static void lapbeth_data_transmit(struc
  
        skb->dev = dev = lapbeth->ethdev;
  
+       skb_reset_network_header(skb);
        dev_hard_header(skb, dev, ETH_P_DEC, bcast_addr, NULL, 0);
  
        dev_queue_xmit(skb);
@@@ -340,6 -342,7 +342,7 @@@ static int lapbeth_new_device(struct ne
         */
        ndev->needed_headroom = -1 + 3 + 2 + dev->hard_header_len
                                           + dev->needed_headroom;
+       ndev->needed_tailroom = dev->needed_tailroom;
  
        lapbeth = netdev_priv(ndev);
        lapbeth->axdev = ndev;
diff --combined include/linux/skbuff.h
index ab57cf787c1f55ad44ea90798e8b4868a90a08fd,8d9ab50b08c9539e71d5ea0f0878a1df72c34900..ed9bea924dc3e2cac674da7a4d1f7ed1fd741f9e
@@@ -71,7 -71,7 +71,7 @@@
   *    NETIF_F_IPV6_CSUM - Driver (device) is only able to checksum plain
   *                      TCP or UDP packets over IPv6. These are specifically
   *                      unencapsulated packets of the form IPv6|TCP or
-  *                      IPv4|UDP where the Next Header field in the IPv6
+  *                      IPv6|UDP where the Next Header field in the IPv6
   *                      header is either TCP or UDP. IPv6 extension headers
   *                      are not supported with this feature. This feature
   *                      cannot be set in features for a device with
@@@ -1056,7 -1056,16 +1056,16 @@@ void kfree_skb(struct sk_buff *skb)
  void kfree_skb_list(struct sk_buff *segs);
  void skb_dump(const char *level, const struct sk_buff *skb, bool full_pkt);
  void skb_tx_error(struct sk_buff *skb);
+ #ifdef CONFIG_TRACEPOINTS
  void consume_skb(struct sk_buff *skb);
+ #else
+ static inline void consume_skb(struct sk_buff *skb)
+ {
+       return kfree_skb(skb);
+ }
+ #endif
  void __consume_stateless_skb(struct sk_buff *skb);
  void  __kfree_skb(struct sk_buff *skb);
  extern struct kmem_cache *skbuff_head_cache;
@@@ -2658,7 -2667,7 +2667,7 @@@ static inline int pskb_network_may_pull
   *
   * Using max(32, L1_CACHE_BYTES) makes sense (especially with RPS)
   * to reduce average number of cache lines per packet.
-  * get_rps_cpus() for example only access one 64 bytes aligned block :
+  * get_rps_cpu() for example only access one 64 bytes aligned block :
   * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
   */
  #ifndef NET_SKB_PAD
@@@ -3745,19 -3754,19 +3754,19 @@@ static inline bool __skb_metadata_diffe
  #define __it(x, op) (x -= sizeof(u##op))
  #define __it_diff(a, b, op) (*(u##op *)__it(a, op)) ^ (*(u##op *)__it(b, op))
        case 32: diffs |= __it_diff(a, b, 64);
 -               /* fall through */
 +              fallthrough;
        case 24: diffs |= __it_diff(a, b, 64);
 -               /* fall through */
 +              fallthrough;
        case 16: diffs |= __it_diff(a, b, 64);
 -               /* fall through */
 +              fallthrough;
        case  8: diffs |= __it_diff(a, b, 64);
                break;
        case 28: diffs |= __it_diff(a, b, 64);
 -               /* fall through */
 +              fallthrough;
        case 20: diffs |= __it_diff(a, b, 64);
 -               /* fall through */
 +              fallthrough;
        case 12: diffs |= __it_diff(a, b, 64);
 -               /* fall through */
 +              fallthrough;
        case  4: diffs |= __it_diff(a, b, 32);
                break;
        }
diff --combined kernel/bpf/syscall.c
index 1bf960aa615cbeabad791cbd90bc2f4a7964fb3a,ac6c784c0576481d74b58e7590427ab724d4546d..b999e7ff2583b59b52cb864fd804c5f50b2065dd
@@@ -2029,7 -2029,7 +2029,7 @@@ bpf_prog_load_check_attach(enum bpf_pro
        case BPF_PROG_TYPE_EXT:
                if (expected_attach_type)
                        return -EINVAL;
 -              /* fallthrough */
 +              fallthrough;
        default:
                return 0;
        }
@@@ -2634,7 -2634,7 +2634,7 @@@ static int bpf_raw_tp_link_fill_link_in
        u32 ulen = info->raw_tracepoint.tp_name_len;
        size_t tp_len = strlen(tp_name);
  
-       if (ulen && !ubuf)
+       if (!ulen ^ !ubuf)
                return -EINVAL;
  
        info->raw_tracepoint.tp_name_len = tp_len + 1;
diff --combined net/core/dev.c
index b9c6f31ae96eb351d998f460fa0f84987e772b81,95ac7568f6932a250f89ea3e73bf4c542810ce80..4086d335978c1bf62bd3965bd2ea96a4ac06b13d
@@@ -4690,10 -4690,10 +4690,10 @@@ static u32 netif_receive_generic_xdp(st
                break;
        default:
                bpf_warn_invalid_xdp_action(act);
 -              /* fall through */
 +              fallthrough;
        case XDP_ABORTED:
                trace_xdp_exception(skb->dev, xdp_prog, act);
 -              /* fall through */
 +              fallthrough;
        case XDP_DROP:
        do_drop:
                kfree_skb(skb);
@@@ -6612,12 -6612,13 +6612,13 @@@ void netif_napi_add(struct net_device *
                netdev_err_once(dev, "%s() called with weight %d\n", __func__,
                                weight);
        napi->weight = weight;
-       list_add(&napi->dev_list, &dev->napi_list);
        napi->dev = dev;
  #ifdef CONFIG_NETPOLL
        napi->poll_owner = -1;
  #endif
        set_bit(NAPI_STATE_SCHED, &napi->state);
+       set_bit(NAPI_STATE_NPSVC, &napi->state);
+       list_add_rcu(&napi->dev_list, &dev->napi_list);
        napi_hash_add(napi);
  }
  EXPORT_SYMBOL(netif_napi_add);
diff --combined net/core/pktgen.c
index 95f4c6b8f51a3a9c0217855189c914b2393ada8c,fce968b673b30b00c6ae8ed3416db47311e20f47..44fdbb9c6e5347c08a624a07aa9fe616ab3ed4ae
@@@ -3430,7 -3430,7 +3430,7 @@@ xmit_more
                net_info_ratelimited("%s xmit error: %d\n",
                                     pkt_dev->odevname, ret);
                pkt_dev->errors++;
 -              /* fall through */
 +              fallthrough;
        case NETDEV_TX_BUSY:
                /* Retry it next time */
                refcount_dec(&(pkt_dev->skb->users));
@@@ -3699,7 -3699,7 +3699,7 @@@ static int __net_init pktgen_create_thr
                                   cpu_to_node(cpu),
                                   "kpktgend_%d", cpu);
        if (IS_ERR(p)) {
-               pr_err("kernel_thread() failed for cpu %d\n", t->cpu);
+               pr_err("kthread_create_on_node() failed for cpu %d\n", t->cpu);
                list_del(&t->th_list);
                kfree(t);
                return PTR_ERR(p);
diff --combined net/core/sock.c
index f8e5ccc452724cf0a9bb11195bd525865c1dbbb7,8eb2c924805a5269e821f2818350cfbb0fb3ece2..6c5c6b18eff4c5271fd3d510f7a370122ab91964
@@@ -1008,7 -1008,7 +1008,7 @@@ set_sndbuf
                break;
        case SO_TIMESTAMPING_NEW:
                sock_set_flag(sk, SOCK_TSTAMP_NEW);
 -              /* fall through */
 +              fallthrough;
        case SO_TIMESTAMPING_OLD:
                if (val & ~SOF_TIMESTAMPING_MASK) {
                        ret = -EINVAL;
@@@ -3254,7 -3254,7 +3254,7 @@@ void sk_common_release(struct sock *sk
                sk->sk_prot->destroy(sk);
  
        /*
-        * Observation: when sock_common_release is called, processes have
+        * Observation: when sk_common_release is called, processes have
         * no access to socket. But net still has.
         * Step one, detach it from networking:
         *
diff --combined net/mptcp/protocol.c
index 49b81502398636966c089839909c90c2ba74136b,8ccd4a151dcb7e8e78366a65fe220da862d1e8e4..365ba96c84b06dda64eba57b1e811cf9478f97de
@@@ -193,6 -193,7 +193,6 @@@ static void mptcp_check_data_fin_ack(st
                        sk->sk_state_change(sk);
                        break;
                case TCP_CLOSING:
 -                      fallthrough;
                case TCP_LAST_ACK:
                        inet_sk_state_store(sk, TCP_CLOSE);
                        sk->sk_state_change(sk);
@@@ -891,7 -892,6 +891,6 @@@ restart
                goto out;
        }
  
- wait_for_sndbuf:
        __mptcp_flush_join_list(msk);
        ssk = mptcp_subflow_get_send(msk);
        while (!sk_stream_memory_free(sk) ||
                                 */
                                mptcp_set_timeout(sk, ssk);
                                release_sock(ssk);
-                               goto wait_for_sndbuf;
+                               goto restart;
                        }
                }
        }
@@@ -1540,7 -1540,7 +1539,7 @@@ static void mptcp_subflow_shutdown(stru
        case TCP_LISTEN:
                if (!(how & RCV_SHUTDOWN))
                        break;
 -              /* fall through */
 +              fallthrough;
        case TCP_SYN_SENT:
                tcp_disconnect(ssk, O_NONBLOCK);
                break;
diff --combined net/rxrpc/input.c
index fbde8b824e23c470e9ab8e0250c3657bbf4d724d,19ddfc9807e89d57da2b4ef9ce28a32c12e11a17..667c44aa5a63cb1abd90564ac67dccf094a3c0b2
@@@ -608,36 -608,57 +608,57 @@@ unlock
  }
  
  /*
-  * Process a requested ACK.
+  * See if there's a cached RTT probe to complete.
   */
- static void rxrpc_input_requested_ack(struct rxrpc_call *call,
-                                     ktime_t resp_time,
-                                     rxrpc_serial_t orig_serial,
-                                     rxrpc_serial_t ack_serial)
+ static void rxrpc_complete_rtt_probe(struct rxrpc_call *call,
+                                    ktime_t resp_time,
+                                    rxrpc_serial_t acked_serial,
+                                    rxrpc_serial_t ack_serial,
+                                    enum rxrpc_rtt_rx_trace type)
  {
-       struct rxrpc_skb_priv *sp;
-       struct sk_buff *skb;
+       rxrpc_serial_t orig_serial;
+       unsigned long avail;
        ktime_t sent_at;
-       int ix;
+       bool matched = false;
+       int i;
  
-       for (ix = 0; ix < RXRPC_RXTX_BUFF_SIZE; ix++) {
-               skb = call->rxtx_buffer[ix];
-               if (!skb)
-                       continue;
+       avail = READ_ONCE(call->rtt_avail);
+       smp_rmb(); /* Read avail bits before accessing data. */
  
-               sent_at = skb->tstamp;
-               smp_rmb(); /* Read timestamp before serial. */
-               sp = rxrpc_skb(skb);
-               if (sp->hdr.serial != orig_serial)
+       for (i = 0; i < ARRAY_SIZE(call->rtt_serial); i++) {
+               if (!test_bit(i + RXRPC_CALL_RTT_PEND_SHIFT, &avail))
                        continue;
-               goto found;
-       }
  
-       return;
+               sent_at = call->rtt_sent_at[i];
+               orig_serial = call->rtt_serial[i];
+               if (orig_serial == acked_serial) {
+                       clear_bit(i + RXRPC_CALL_RTT_PEND_SHIFT, &call->rtt_avail);
+                       smp_mb(); /* Read data before setting avail bit */
+                       set_bit(i, &call->rtt_avail);
+                       if (type != rxrpc_rtt_rx_cancel)
+                               rxrpc_peer_add_rtt(call, type, i, acked_serial, ack_serial,
+                                                  sent_at, resp_time);
+                       else
+                               trace_rxrpc_rtt_rx(call, rxrpc_rtt_rx_cancel, i,
+                                                  orig_serial, acked_serial, 0, 0);
+                       matched = true;
+               }
+               /* If a later serial is being acked, then mark this slot as
+                * being available.
+                */
+               if (after(acked_serial, orig_serial)) {
+                       trace_rxrpc_rtt_rx(call, rxrpc_rtt_rx_obsolete, i,
+                                          orig_serial, acked_serial, 0, 0);
+                       clear_bit(i + RXRPC_CALL_RTT_PEND_SHIFT, &call->rtt_avail);
+                       smp_wmb();
+                       set_bit(i, &call->rtt_avail);
+               }
+       }
  
- found:
-       rxrpc_peer_add_rtt(call, rxrpc_rtt_rx_requested_ack,
-                          orig_serial, ack_serial, sent_at, resp_time);
+       if (!matched)
+               trace_rxrpc_rtt_rx(call, rxrpc_rtt_rx_lost, 9, 0, acked_serial, 0, 0);
  }
  
  /*
@@@ -682,27 -703,11 +703,11 @@@ static void rxrpc_input_check_for_lost_
   */
  static void rxrpc_input_ping_response(struct rxrpc_call *call,
                                      ktime_t resp_time,
-                                     rxrpc_serial_t orig_serial,
+                                     rxrpc_serial_t acked_serial,
                                      rxrpc_serial_t ack_serial)
  {
-       rxrpc_serial_t ping_serial;
-       ktime_t ping_time;
-       ping_time = call->ping_time;
-       smp_rmb();
-       ping_serial = READ_ONCE(call->ping_serial);
-       if (orig_serial == call->acks_lost_ping)
+       if (acked_serial == call->acks_lost_ping)
                rxrpc_input_check_for_lost_ack(call);
-       if (before(orig_serial, ping_serial) ||
-           !test_and_clear_bit(RXRPC_CALL_PINGING, &call->flags))
-               return;
-       if (after(orig_serial, ping_serial))
-               return;
-       rxrpc_peer_add_rtt(call, rxrpc_rtt_rx_ping_response,
-                          orig_serial, ack_serial, ping_time, resp_time);
  }
  
  /*
@@@ -843,7 -848,7 +848,7 @@@ static void rxrpc_input_ack(struct rxrp
                struct rxrpc_ackinfo info;
                u8 acks[RXRPC_MAXACKS];
        } buf;
-       rxrpc_serial_t acked_serial;
+       rxrpc_serial_t ack_serial, acked_serial;
        rxrpc_seq_t first_soft_ack, hard_ack, prev_pkt;
        int nr_acks, offset, ioffset;
  
        }
        offset += sizeof(buf.ack);
  
+       ack_serial = sp->hdr.serial;
        acked_serial = ntohl(buf.ack.serial);
        first_soft_ack = ntohl(buf.ack.firstPacket);
        prev_pkt = ntohl(buf.ack.previousPacket);
        summary.ack_reason = (buf.ack.reason < RXRPC_ACK__INVALID ?
                              buf.ack.reason : RXRPC_ACK__INVALID);
  
-       trace_rxrpc_rx_ack(call, sp->hdr.serial, acked_serial,
+       trace_rxrpc_rx_ack(call, ack_serial, acked_serial,
                           first_soft_ack, prev_pkt,
                           summary.ack_reason, nr_acks);
  
-       if (buf.ack.reason == RXRPC_ACK_PING_RESPONSE)
+       switch (buf.ack.reason) {
+       case RXRPC_ACK_PING_RESPONSE:
                rxrpc_input_ping_response(call, skb->tstamp, acked_serial,
-                                         sp->hdr.serial);
-       if (buf.ack.reason == RXRPC_ACK_REQUESTED)
-               rxrpc_input_requested_ack(call, skb->tstamp, acked_serial,
-                                         sp->hdr.serial);
+                                         ack_serial);
+               rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial,
+                                        rxrpc_rtt_rx_ping_response);
+               break;
+       case RXRPC_ACK_REQUESTED:
+               rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial,
+                                        rxrpc_rtt_rx_requested_ack);
+               break;
+       default:
+               if (acked_serial != 0)
+                       rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial,
+                                                rxrpc_rtt_rx_cancel);
+               break;
+       }
  
        if (buf.ack.reason == RXRPC_ACK_PING) {
-               _proto("Rx ACK %%%u PING Request", sp->hdr.serial);
+               _proto("Rx ACK %%%u PING Request", ack_serial);
                rxrpc_propose_ACK(call, RXRPC_ACK_PING_RESPONSE,
-                                 sp->hdr.serial, true, true,
+                                 ack_serial, true, true,
                                  rxrpc_propose_ack_respond_to_ping);
        } else if (sp->hdr.flags & RXRPC_REQUEST_ACK) {
                rxrpc_propose_ACK(call, RXRPC_ACK_REQUESTED,
-                                 sp->hdr.serial, true, true,
+                                 ack_serial, true, true,
                                  rxrpc_propose_ack_respond_to_ack);
        }
  
        /* Discard any out-of-order or duplicate ACKs (outside lock). */
        if (!rxrpc_is_ack_valid(call, first_soft_ack, prev_pkt)) {
-               trace_rxrpc_rx_discard_ack(call->debug_id, sp->hdr.serial,
+               trace_rxrpc_rx_discard_ack(call->debug_id, ack_serial,
                                           first_soft_ack, call->ackr_first_seq,
                                           prev_pkt, call->ackr_prev_seq);
                return;
  
        /* Discard any out-of-order or duplicate ACKs (inside lock). */
        if (!rxrpc_is_ack_valid(call, first_soft_ack, prev_pkt)) {
-               trace_rxrpc_rx_discard_ack(call->debug_id, sp->hdr.serial,
+               trace_rxrpc_rx_discard_ack(call->debug_id, ack_serial,
                                           first_soft_ack, call->ackr_first_seq,
                                           prev_pkt, call->ackr_prev_seq);
                goto out;
            RXRPC_TX_ANNO_LAST &&
            summary.nr_acks == call->tx_top - hard_ack &&
            rxrpc_is_client_call(call))
-               rxrpc_propose_ACK(call, RXRPC_ACK_PING, sp->hdr.serial,
+               rxrpc_propose_ACK(call, RXRPC_ACK_PING, ack_serial,
                                  false, true,
                                  rxrpc_propose_ack_ping_for_lost_reply);
  
@@@ -1084,7 -1101,7 +1101,7 @@@ static void rxrpc_input_implicit_end_ca
        switch (READ_ONCE(call->state)) {
        case RXRPC_CALL_SERVER_AWAIT_ACK:
                rxrpc_call_completed(call);
 -              /* Fall through */
 +              fallthrough;
        case RXRPC_CALL_COMPLETE:
                break;
        default:
@@@ -1243,12 -1260,12 +1260,12 @@@ int rxrpc_input_packet(struct sock *udp
        case RXRPC_PACKET_TYPE_BUSY:
                if (rxrpc_to_server(sp))
                        goto discard;
 -              /* Fall through */
 +              fallthrough;
        case RXRPC_PACKET_TYPE_ACK:
        case RXRPC_PACKET_TYPE_ACKALL:
                if (sp->hdr.callNumber == 0)
                        goto bad_message;
 -              /* Fall through */
 +              fallthrough;
        case RXRPC_PACKET_TYPE_ABORT:
                break;
  
diff --combined net/smc/smc_close.c
index 3b5c374c6d2cf373e1f1678bd43b7eb27e311f0a,35e30d39510da1867e4a18d752c6f5d05847a532..0e7409e469c02df8ba02ef90d9cfa5595c244240
@@@ -116,7 -116,6 +116,6 @@@ static void smc_close_cancel_work(struc
        cancel_work_sync(&smc->conn.close_work);
        cancel_delayed_work_sync(&smc->conn.tx_work);
        lock_sock(sk);
-       sk->sk_state = SMC_CLOSED;
  }
  
  /* terminate smc socket abnormally - active abort
@@@ -134,22 -133,22 +133,22 @@@ void smc_close_active_abort(struct smc_
        }
        switch (sk->sk_state) {
        case SMC_ACTIVE:
-               sk->sk_state = SMC_PEERABORTWAIT;
-               smc_close_cancel_work(smc);
-               sk->sk_state = SMC_CLOSED;
-               sock_put(sk); /* passive closing */
-               break;
        case SMC_APPCLOSEWAIT1:
        case SMC_APPCLOSEWAIT2:
+               sk->sk_state = SMC_PEERABORTWAIT;
                smc_close_cancel_work(smc);
+               if (sk->sk_state != SMC_PEERABORTWAIT)
+                       break;
                sk->sk_state = SMC_CLOSED;
-               sock_put(sk); /* postponed passive closing */
+               sock_put(sk); /* (postponed) passive closing */
                break;
        case SMC_PEERCLOSEWAIT1:
        case SMC_PEERCLOSEWAIT2:
        case SMC_PEERFINCLOSEWAIT:
                sk->sk_state = SMC_PEERABORTWAIT;
                smc_close_cancel_work(smc);
+               if (sk->sk_state != SMC_PEERABORTWAIT)
+                       break;
                sk->sk_state = SMC_CLOSED;
                smc_conn_free(&smc->conn);
                release_clcsock = true;
        case SMC_APPFINCLOSEWAIT:
                sk->sk_state = SMC_PEERABORTWAIT;
                smc_close_cancel_work(smc);
+               if (sk->sk_state != SMC_PEERABORTWAIT)
+                       break;
                sk->sk_state = SMC_CLOSED;
                smc_conn_free(&smc->conn);
                release_clcsock = true;
@@@ -372,7 -373,7 +373,7 @@@ static void smc_close_passive_work(stru
        case SMC_PEERCLOSEWAIT1:
                if (rxflags->peer_done_writing)
                        sk->sk_state = SMC_PEERCLOSEWAIT2;
 -              /* fall through */
 +              fallthrough;
                /* to check for closing */
        case SMC_PEERCLOSEWAIT2:
                if (!smc_cdc_rxed_any_close(conn))
diff --combined net/tipc/socket.c
index 2679e97e03896dabc7a555e02205b7c00ee67361,d49c6173954a76104aac6f606d655b067cc55be3..ebd280e767bde87d5603207d03c0c3c32ff925a4
@@@ -783,7 -783,7 +783,7 @@@ static __poll_t tipc_poll(struct file *
        case TIPC_ESTABLISHED:
                if (!tsk->cong_link_cnt && !tsk_conn_cong(tsk))
                        revents |= EPOLLOUT;
 -              /* fall through */
 +              fallthrough;
        case TIPC_LISTEN:
        case TIPC_CONNECTING:
                if (!skb_queue_empty_lockless(&sk->sk_receive_queue))
@@@ -2597,7 -2597,7 +2597,7 @@@ static int tipc_connect(struct socket *
                 * case is EINPROGRESS, rather than EALREADY.
                 */
                res = -EINPROGRESS;
 -              /* fall through */
 +              fallthrough;
        case TIPC_CONNECTING:
                if (!timeout) {
                        if (previous == TIPC_CONNECTING)
@@@ -2771,18 -2771,21 +2771,21 @@@ static int tipc_shutdown(struct socket 
  
        trace_tipc_sk_shutdown(sk, NULL, TIPC_DUMP_ALL, " ");
        __tipc_shutdown(sock, TIPC_CONN_SHUTDOWN);
-       sk->sk_shutdown = SEND_SHUTDOWN;
+       if (tipc_sk_type_connectionless(sk))
+               sk->sk_shutdown = SHUTDOWN_MASK;
+       else
+               sk->sk_shutdown = SEND_SHUTDOWN;
  
        if (sk->sk_state == TIPC_DISCONNECTING) {
                /* Discard any unreceived messages */
                __skb_queue_purge(&sk->sk_receive_queue);
  
-               /* Wake up anyone sleeping in poll */
-               sk->sk_state_change(sk);
                res = 0;
        } else {
                res = -ENOTCONN;
        }
+       /* Wake up anyone sleeping in poll. */
+       sk->sk_state_change(sk);
  
        release_sock(sk);
        return res;
diff --combined net/wireless/chan.c
index e97a4f0c32a3b94286f80315de93da2029307086,edee3a645c068047daa49868405442e597af6bc9..6a6f2f214c10f11b4d6341ed6e533f7c846695d3
@@@ -10,6 -10,7 +10,7 @@@
   */
  
  #include <linux/export.h>
+ #include <linux/bitfield.h>
  #include <net/cfg80211.h>
  #include "core.h"
  #include "rdev-ops.h"
@@@ -912,6 -913,7 +913,7 @@@ bool cfg80211_chandef_usable(struct wip
        struct ieee80211_sta_vht_cap *vht_cap;
        struct ieee80211_edmg *edmg_cap;
        u32 width, control_freq, cap;
+       bool support_80_80 = false;
  
        if (WARN_ON(!cfg80211_chandef_valid(chandef)))
                return false;
                if (!ht_cap->ht_supported &&
                    chandef->chan->band != NL80211_BAND_6GHZ)
                        return false;
 -              /* fall through */
 +              fallthrough;
        case NL80211_CHAN_WIDTH_20_NOHT:
                prohibited_flags |= IEEE80211_CHAN_NO_20MHZ;
                width = 20;
                        return false;
                break;
        case NL80211_CHAN_WIDTH_80P80:
-               cap = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
-               if (chandef->chan->band != NL80211_BAND_6GHZ &&
-                   cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
+               cap = vht_cap->cap;
+               support_80_80 =
+                       (cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ) ||
+                       (cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ &&
+                        cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) ||
+                       u32_get_bits(cap, IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) > 1;
+               if (chandef->chan->band != NL80211_BAND_6GHZ && !support_80_80)
                        return false;
 -              /* fall through */
 +              fallthrough;
        case NL80211_CHAN_WIDTH_80:
                prohibited_flags |= IEEE80211_CHAN_NO_80MHZ;
                width = 80;
                        return false;
                cap = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
                if (cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ &&
-                   cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
+                   cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ &&
+                   !(vht_cap->cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK))
                        return false;
                break;
        default:
diff --combined net/wireless/nl80211.c
index fde420af3f00d7b092ab7bd873de763f39fcce22,19dc0ee807f6451a8f77ba35533de45f88e0248f..2c9e9a2d1688731fa322191ab35a0a17b17f0471
@@@ -2107,7 -2107,7 +2107,7 @@@ static int nl80211_send_wiphy(struct cf
                state->split_start++;
                if (state->split)
                        break;
 -              /* fall through */
 +              fallthrough;
        case 1:
                if (nla_put(msg, NL80211_ATTR_CIPHER_SUITES,
                            sizeof(u32) * rdev->wiphy.n_cipher_suites,
                state->split_start++;
                if (state->split)
                        break;
 -              /* fall through */
 +              fallthrough;
        case 2:
                if (nl80211_put_iftypes(msg, NL80211_ATTR_SUPPORTED_IFTYPES,
                                        rdev->wiphy.interface_modes))
                state->split_start++;
                if (state->split)
                        break;
 -              /* fall through */
 +              fallthrough;
        case 3:
                nl_bands = nla_nest_start_noflag(msg,
                                                 NL80211_ATTR_WIPHY_BANDS);
                                state->chan_start++;
                                if (state->split)
                                        break;
 -                              /* fall through */
 +                              fallthrough;
                        default:
                                /* add frequencies */
                                nl_freqs = nla_nest_start_noflag(msg,
                        state->split_start++;
                if (state->split)
                        break;
 -              /* fall through */
 +              fallthrough;
        case 4:
                nl_cmds = nla_nest_start_noflag(msg,
                                                NL80211_ATTR_SUPPORTED_COMMANDS);
                state->split_start++;
                if (state->split)
                        break;
 -              /* fall through */
 +              fallthrough;
        case 5:
                if (rdev->ops->remain_on_channel &&
                    (rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL) &&
                state->split_start++;
                if (state->split)
                        break;
 -              /* fall through */
 +              fallthrough;
        case 6:
  #ifdef CONFIG_PM
                if (nl80211_send_wowlan(msg, rdev, state->split))
  #else
                state->split_start++;
  #endif
 -              /* fall through */
 +              fallthrough;
        case 7:
                if (nl80211_put_iftypes(msg, NL80211_ATTR_SOFTWARE_IFTYPES,
                                        rdev->wiphy.software_iftypes))
                state->split_start++;
                if (state->split)
                        break;
 -              /* fall through */
 +              fallthrough;
        case 8:
                if ((rdev->wiphy.flags & WIPHY_FLAG_HAVE_AP_SME) &&
                    nla_put_u32(msg, NL80211_ATTR_DEVICE_AP_SME,
@@@ -5207,7 -5207,7 +5207,7 @@@ bool nl80211_put_sta_rate(struct sk_buf
                break;
        default:
                WARN_ON(1);
 -              /* fall through */
 +              fallthrough;
        case RATE_INFO_BW_20:
                rate_flg = 0;
                break;
@@@ -6011,7 -6011,7 +6011,7 @@@ static int nl80211_set_station(struct s
  
        if (info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY])
                params.he_6ghz_capa =
-                       nla_data(info->attrs[NL80211_ATTR_HE_CAPABILITY]);
+                       nla_data(info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]);
  
        if (info->attrs[NL80211_ATTR_AIRTIME_WEIGHT])
                params.airtime_weight =
diff --combined net/wireless/util.c
index 7c5d5365a5eb73a4b1fae786fbb2ea70a472f1a7,c62eb3d9ab3d405ec0ad935b1466704524e11f31..4a9ff9ef513f920d8ec11ffdc02a44920be24478
@@@ -123,11 -123,13 +123,13 @@@ int ieee80211_freq_khz_to_channel(u32 f
                return (freq - 2407) / 5;
        else if (freq >= 4910 && freq <= 4980)
                return (freq - 4000) / 5;
-       else if (freq < 5945)
+       else if (freq < 5925)
                return (freq - 5000) / 5;
+       else if (freq == 5935)
+               return 2;
        else if (freq <= 45000) /* DMG band lower limit */
-               /* see 802.11ax D4.1 27.3.22.2 */
-               return (freq - 5940) / 5;
+               /* see 802.11ax D6.1 27.3.22.2 */
+               return (freq - 5950) / 5;
        else if (freq >= 58320 && freq <= 70200)
                return (freq - 56160) / 2160;
        else
@@@ -198,7 -200,7 +200,7 @@@ static void set_mandatory_flags_band(st
                                sband->bitrates[i].flags |=
                                        IEEE80211_RATE_MANDATORY_G;
                                want--;
 -                              /* fall through */
 +                              fallthrough;
                        default:
                                sband->bitrates[i].flags |=
                                        IEEE80211_RATE_ERP_G;
@@@ -1008,7 -1010,7 +1010,7 @@@ int cfg80211_change_iface(struct cfg802
                case NL80211_IFTYPE_STATION:
                        if (dev->ieee80211_ptr->use_4addr)
                                break;
 -                      /* fall through */
 +                      fallthrough;
                case NL80211_IFTYPE_OCB:
                case NL80211_IFTYPE_P2P_CLIENT:
                case NL80211_IFTYPE_ADHOC:
This page took 0.261524 seconds and 4 git commands to generate.