Merge tag 'blk-dim-v2' into rdma.git for-next
authorJason Gunthorpe <jgg@mellanox.com>
Mon, 8 Jul 2019 17:58:59 +0000 (14:58 -0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 8 Jul 2019 19:37:21 +0000 (16:37 -0300)
Generic DIM

From: Tal Gilboa and Yamin Fridman

Implement net DIM over a generic DIM library, add RDMA DIM

dim.h lib exposes an implementation of the DIM algorithm for
dynamically-tuned interrupt moderation for networking interfaces.

We want a similar functionality for other protocols, which might need to
optimize interrupts differently. Main motivation here is DIM for NVMf
storage protocol.

Current DIM implementation prioritizes reducing interrupt overhead over
latency. Also, in order to reduce DIM's own overhead, the algorithm might
take some time to identify it needs to change profiles. While this is
acceptable for networking, it might not work well on other scenarios.

Here we propose a new structure to DIM. The idea is to allow a slightly
modified functionality without the risk of breaking Net DIM behavior for
netdev. We verified there are no degradations in current DIM behavior with
the modified solution.

Suggested solution:
- Common logic is implemented in lib/dim/dim.c
- Net DIM (existing) logic is implemented in lib/dim/net_dim.c, which uses
  the common logic in dim.c
- Any new DIM logic will be implemented in "lib/dim/new_dim.c".
  This new implementation will expose modified versions of profiles,
  dim_step() and dim_decision().
- DIM API is declared in include/linux/dim.h for all implementations.

Pros for this solution are:
- Zero impact on existing net_dim implementation and usage
- Relatively more code reuse (compared to two separate solutions)
- Increased extensibility

Required for dependencies in the next series.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1  2 
MAINTAINERS
drivers/net/ethernet/broadcom/bcmsysport.c
drivers/net/ethernet/broadcom/bcmsysport.h
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h
drivers/net/ethernet/broadcom/genet/bcmgenet.c
drivers/net/ethernet/broadcom/genet/bcmgenet.h
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c

diff --combined MAINTAINERS
@@@ -364,7 -364,7 +364,7 @@@ F: drivers/acpi/fan.
  
  ACPI FOR ARM64 (ACPI/arm64)
  M:    Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
 -M:    Hanjun Guo <hanjun.guo@linaro.org>
 +M:    Hanjun Guo <guohanjun@huawei.com>
  M:    Sudeep Holla <sudeep.holla@arm.com>
  L:    linux-acpi@vger.kernel.org
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -696,7 -696,6 +696,7 @@@ F: drivers/input/mouse/alps.
  ALTERA I2C CONTROLLER DRIVER
  M:    Thor Thayer <thor.thayer@linux.intel.com>
  S:    Maintained
 +F:    Documentation/devicetree/bindings/i2c/i2c-altera.txt
  F:    drivers/i2c/busses/i2c-altera.c
  
  ALTERA MAILBOX DRIVER
@@@ -1175,7 -1174,6 +1175,7 @@@ S:      Maintaine
  F:    Documentation/devicetree/bindings/arm/arm-boards
  F:    Documentation/devicetree/bindings/auxdisplay/arm-charlcd.txt
  F:    Documentation/devicetree/bindings/clock/arm-integrator.txt
 +F:    Documentation/devicetree/bindings/i2c/i2c-versatile.txt
  F:    Documentation/devicetree/bindings/interrupt-controller/arm,versatile-fpga-irq.txt
  F:    Documentation/devicetree/bindings/mtd/arm-versatile.txt
  F:    arch/arm/mach-integrator/
@@@ -1235,7 -1233,7 +1235,7 @@@ F:      arch/arm/lib/floppydma.
  F:    arch/arm/include/asm/floppy.h
  
  ARM PMU PROFILING AND DEBUGGING
 -M:    Will Deacon <will.deacon@arm.com>
 +M:    Will Deacon <will@kernel.org>
  M:    Mark Rutland <mark.rutland@arm.com>
  S:    Maintained
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -1307,7 -1305,7 +1307,7 @@@ F:      Documentation/devicetree/bindings/in
  F:    drivers/irqchip/irq-vic.c
  
  ARM SMMU DRIVERS
 -M:    Will Deacon <will.deacon@arm.com>
 +M:    Will Deacon <will@kernel.org>
  R:    Robin Murphy <robin.murphy@arm.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
@@@ -1783,7 -1781,6 +1783,7 @@@ ARM/LPC18XX ARCHITECTUR
  M:    Vladimir Zapolskiy <vz@mleia.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
 +F:    Documentation/devicetree/bindings/i2c/i2c-lpc2k.txt
  F:    arch/arm/boot/dts/lpc43*
  F:    drivers/i2c/busses/i2c-lpc2k.c
  F:    drivers/memory/pl172.c
@@@ -1797,7 -1794,6 +1797,7 @@@ M:      Sylvain Lemieux <slemieux.tyco@gmail
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  T:    git git://github.com/vzapolskiy/linux-lpc32xx.git
  S:    Maintained
 +F:    Documentation/devicetree/bindings/i2c/i2c-pnx.txt
  F:    arch/arm/boot/dts/lpc32*
  F:    arch/arm/mach-lpc32xx/
  F:    drivers/i2c/busses/i2c-pnx.c
@@@ -1922,8 -1918,6 +1922,8 @@@ ARM/NOMADIK/U300/Ux500 ARCHITECTURE
  M:    Linus Walleij <linus.walleij@linaro.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
 +F:    Documentation/devicetree/bindings/i2c/i2c-nomadik.txt
 +F:    Documentation/devicetree/bindings/i2c/i2c-stu300.txt
  F:    arch/arm/mach-nomadik/
  F:    arch/arm/mach-u300/
  F:    arch/arm/mach-ux500/
@@@ -2085,7 -2079,7 +2085,7 @@@ F:      drivers/tty/serial/msm_serial.
  F:    drivers/usb/dwc3/dwc3-qcom.c
  F:    include/dt-bindings/*/qcom*
  F:    include/linux/*/qcom*
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git
  
  ARM/RADISYS ENP2611 MACHINE SUPPORT
  M:    Lennert Buytenhek <kernel@wantstofly.org>
@@@ -2146,7 -2140,6 +2146,7 @@@ L:      linux-arm-kernel@lists.infradead.or
  L:    linux-rockchip@lists.infradead.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
  S:    Maintained
 +F:    Documentation/devicetree/bindings/i2c/i2c-rk3x.txt
  F:    arch/arm/boot/dts/rk3*
  F:    arch/arm/boot/dts/rv1108*
  F:    arch/arm/mach-rockchip/
@@@ -2282,7 -2275,6 +2282,7 @@@ M:      Patrice Chotard <patrice.chotard@st.
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  W:    http://www.stlinux.com
  S:    Maintained
 +F:    Documentation/devicetree/bindings/i2c/i2c-st.txt
  F:    arch/arm/mach-sti/
  F:    arch/arm/boot/dts/sti*
  F:    drivers/char/hw_random/st-rng.c
@@@ -2474,7 -2466,6 +2474,7 @@@ ARM/VT8500 ARM ARCHITECTUR
  M:    Tony Prisk <linux@prisktech.co.nz>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
 +F:    Documentation/devicetree/bindings/i2c/i2c-wmt.txt
  F:    arch/arm/mach-vt8500/
  F:    drivers/clocksource/timer-vt8500.c
  F:    drivers/i2c/busses/i2c-wmt.c
@@@ -2540,8 -2531,6 +2540,8 @@@ F:      drivers/cpuidle/cpuidle-zynq.
  F:    drivers/block/xsysace.c
  N:    zynq
  N:    xilinx
 +F:    Documentation/devicetree/bindings/i2c/i2c-cadence.txt
 +F:    Documentation/devicetree/bindings/i2c/i2c-xiic.txt
  F:    drivers/clocksource/timer-cadence-ttc.c
  F:    drivers/i2c/busses/i2c-cadence.c
  F:    drivers/mmc/host/sdhci-of-arasan.c
@@@ -2550,7 -2539,7 +2550,7 @@@ F:      drivers/i2c/busses/i2c-xiic.
  
  ARM64 PORT (AARCH64 ARCHITECTURE)
  M:    Catalin Marinas <catalin.marinas@arm.com>
 -M:    Will Deacon <will.deacon@arm.com>
 +M:    Will Deacon <will@kernel.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
  S:    Maintained
@@@ -2734,7 -2723,7 +2734,7 @@@ S:      Maintaine
  F:    drivers/net/wireless/atmel/atmel*
  
  ATOMIC INFRASTRUCTURE
 -M:    Will Deacon <will.deacon@arm.com>
 +M:    Will Deacon <will@kernel.org>
  M:    Peter Zijlstra <peterz@infradead.org>
  R:    Boqun Feng <boqun.feng@gmail.com>
  L:    linux-kernel@vger.kernel.org
@@@ -3060,9 -3049,8 +3060,9 @@@ S:      Maintaine
  F:    arch/riscv/net/
  
  BPF JIT for S390
 -M:    Martin Schwidefsky <schwidefsky@de.ibm.com>
  M:    Heiko Carstens <heiko.carstens@de.ibm.com>
 +M:    Vasily Gorbik <gor@linux.ibm.com>
 +M:    Christian Borntraeger <borntraeger@de.ibm.com>
  L:    netdev@vger.kernel.org
  L:    bpf@vger.kernel.org
  S:    Maintained
@@@ -3121,7 -3109,7 +3121,7 @@@ F:      arch/arm/mach-bcm
  
  BROADCOM BCM2835 ARM ARCHITECTURE
  M:    Eric Anholt <eric@anholt.net>
 -M:    Stefan Wahren <stefan.wahren@i2se.com>
 +M:    Stefan Wahren <wahrenst@gmx.net>
  L:    linux-rpi-kernel@lists.infradead.org (moderated for non-subscribers)
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  T:    git git://github.com/anholt/linux
@@@ -5600,7 -5588,8 +5600,8 @@@ F:      include/linux/dynamic_debug.
  DYNAMIC INTERRUPT MODERATION
  M:    Tal Gilboa <talgi@mellanox.com>
  S:    Maintained
- F:    include/linux/net_dim.h
+ F:    include/linux/dim.h
+ F:    lib/dim/
  
  DZ DECSTATION DZ11 SERIAL DRIVER
  M:    "Maciej W. Rozycki" <macro@linux-mips.org>
@@@ -6234,6 -6223,7 +6235,6 @@@ F:      include/linux/ipmi-fru.
  K:    fmc_d.*register
  
  FPGA MANAGER FRAMEWORK
 -M:    Alan Tull <atull@kernel.org>
  M:    Moritz Fischer <mdf@kernel.org>
  L:    linux-fpga@vger.kernel.org
  S:    Maintained
@@@ -7352,7 -7342,6 +7353,7 @@@ I2C MV64XXX MARVELL AND ALLWINNER DRIVE
  M:    Gregory CLEMENT <gregory.clement@bootlin.com>
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
 +F:    Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
  F:    drivers/i2c/busses/i2c-mv64xxx.c
  
  I2C OVER PARALLEL PORT
@@@ -8565,7 -8554,7 +8566,7 @@@ S:      Odd Fixe
  
  KERNEL NFSD, SUNRPC, AND LOCKD SERVERS
  M:    "J. Bruce Fields" <bfields@fieldses.org>
 -M:    Jeff Layton <jlayton@kernel.org>
 +M:    Chuck Lever <chuck.lever@oracle.com>
  L:    linux-nfs@vger.kernel.org
  W:    http://nfs.sourceforge.net/
  T:    git git://linux-nfs.org/~bfields/linux.git
@@@ -9120,7 -9109,7 +9121,7 @@@ F:      drivers/misc/lkdtm/
  LINUX KERNEL MEMORY CONSISTENCY MODEL (LKMM)
  M:    Alan Stern <stern@rowland.harvard.edu>
  M:    Andrea Parri <andrea.parri@amarulasolutions.com>
 -M:    Will Deacon <will.deacon@arm.com>
 +M:    Will Deacon <will@kernel.org>
  M:    Peter Zijlstra <peterz@infradead.org>
  M:    Boqun Feng <boqun.feng@gmail.com>
  M:    Nicholas Piggin <npiggin@gmail.com>
@@@ -9228,7 -9217,7 +9229,7 @@@ F:      Documentation/admin-guide/LSM/LoadPi
  LOCKING PRIMITIVES
  M:    Peter Zijlstra <peterz@infradead.org>
  M:    Ingo Molnar <mingo@redhat.com>
 -M:    Will Deacon <will.deacon@arm.com>
 +M:    Will Deacon <will@kernel.org>
  L:    linux-kernel@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core
  S:    Maintained
@@@ -10549,7 -10538,7 +10550,7 @@@ F:   arch/arm/boot/dts/mmp
  F:    arch/arm/mach-mmp/
  
  MMU GATHER AND TLB INVALIDATION
 -M:    Will Deacon <will.deacon@arm.com>
 +M:    Will Deacon <will@kernel.org>
  M:    "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
  M:    Andrew Morton <akpm@linux-foundation.org>
  M:    Nick Piggin <npiggin@gmail.com>
@@@ -10840,6 -10829,14 +10841,6 @@@ F:  driver/net/net_failover.
  F:    include/net/net_failover.h
  F:    Documentation/networking/net_failover.rst
  
 -NETEFFECT IWARP RNIC DRIVER (IW_NES)
 -M:    Faisal Latif <faisal.latif@intel.com>
 -L:    linux-rdma@vger.kernel.org
 -W:    http://www.intel.com/Products/Server/Adapters/Server-Cluster/Server-Cluster-overview.htm
 -S:    Supported
 -F:    drivers/infiniband/hw/nes/
 -F:    include/uapi/rdma/nes-abi.h
 -
  NETEM NETWORK EMULATOR
  M:    Stephen Hemminger <stephen@networkplumber.org>
  L:    netem@lists.linux-foundation.org (moderated for non-subscribers)
@@@ -11728,7 -11725,6 +11729,7 @@@ M:   Peter Korsgaard <peter@korsgaard.com
  M:    Andrew Lunn <andrew@lunn.ch>
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
 +F:    Documentation/devicetree/bindings/i2c/i2c-ocores.txt
  F:    Documentation/i2c/busses/i2c-ocores
  F:    drivers/i2c/busses/i2c-ocores.c
  F:    include/linux/platform_data/i2c-ocores.h
@@@ -12030,7 -12026,7 +12031,7 @@@ S:   Maintaine
  F:    drivers/pci/controller/dwc/*layerscape*
  
  PCI DRIVER FOR GENERIC OF HOSTS
 -M:    Will Deacon <will.deacon@arm.com>
 +M:    Will Deacon <will@kernel.org>
  L:    linux-pci@vger.kernel.org
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
@@@ -13048,6 -13044,7 +13049,6 @@@ F:   Documentation/devicetree/bindings/ne
  
  QUALCOMM GENERIC INTERFACE I2C DRIVER
  M:    Alok Chauhan <alokc@codeaurora.org>
 -M:    Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
  L:    linux-i2c@vger.kernel.org
  L:    linux-arm-msm@vger.kernel.org
  S:    Supported
@@@ -13367,7 -13364,6 +13368,7 @@@ F:   drivers/clk/renesas
  RENESAS EMEV2 I2C DRIVER
  M:    Wolfram Sang <wsa+renesas@sang-engineering.com>
  S:    Supported
 +F:    Documentation/devicetree/bindings/i2c/i2c-emev2.txt
  F:    drivers/i2c/busses/i2c-emev2.c
  
  RENESAS ETHERNET DRIVERS
@@@ -13389,8 -13385,6 +13390,8 @@@ F:   drivers/iio/adc/rcar-gyroadc.
  RENESAS R-CAR I2C DRIVERS
  M:    Wolfram Sang <wsa+renesas@sang-engineering.com>
  S:    Supported
 +F:    Documentation/devicetree/bindings/i2c/i2c-rcar.txt
 +F:    Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt
  F:    drivers/i2c/busses/i2c-rcar.c
  F:    drivers/i2c/busses/i2c-sh_mobile.c
  
@@@ -13621,9 -13615,8 +13622,9 @@@ S:   Maintaine
  F:    drivers/video/fbdev/savage/
  
  S390
 -M:    Martin Schwidefsky <schwidefsky@de.ibm.com>
  M:    Heiko Carstens <heiko.carstens@de.ibm.com>
 +M:    Vasily Gorbik <gor@linux.ibm.com>
 +M:    Christian Borntraeger <borntraeger@de.ibm.com>
  L:    linux-s390@vger.kernel.org
  W:    http://www.ibm.com/developerworks/linux/linux390/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git
@@@ -14326,15 -14319,6 +14327,15 @@@ S: Supporte
  K:    sifive
  N:    sifive
  
 +SIFIVE FU540 SYSTEM-ON-CHIP
 +M:    Paul Walmsley <paul.walmsley@sifive.com>
 +M:    Palmer Dabbelt <palmer@sifive.com>
 +L:    linux-riscv@lists.infradead.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/pjw/sifive.git
 +S:    Supported
 +K:    fu540
 +N:    fu540
 +
  SILEAD TOUCHSCREEN DRIVER
  M:    Hans de Goede <hdegoede@redhat.com>
  L:    linux-input@vger.kernel.org
@@@ -14395,7 -14379,7 +14396,7 @@@ F:   lib/test_siphash.
  F:    include/linux/siphash.h
  
  SIOX
 -M:    Gavin Schenk <g.schenk@eckelmann.de>
 +M:    Thorsten Scherer <t.scherer@eckelmann.de>
  M:    Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
  R:    Pengutronix Kernel Team <kernel@pengutronix.de>
  S:    Supported
@@@ -14558,13 -14542,6 +14559,13 @@@ M: Chris Boot <bootc@bootc.net
  S:    Maintained
  F:    drivers/leds/leds-net48xx.c
  
 +SOFT-IWARP DRIVER (siw)
 +M:    Bernard Metzler <bmt@zurich.ibm.com>
 +L:    linux-rdma@vger.kernel.org
 +S:    Supported
 +F:    drivers/infiniband/sw/siw/
 +F:    include/uapi/rdma/siw-abi.h
 +
  SOFT-ROCE DRIVER (rxe)
  M:    Moni Shoua <monis@mellanox.com>
  L:    linux-rdma@vger.kernel.org
@@@ -15001,7 -14978,7 +15002,7 @@@ S:   Odd Fixe
  F:    drivers/net/ethernet/adaptec/starfire*
  
  STEC S1220 SKD DRIVER
 -M:    Bart Van Assche <bart.vanassche@wdc.com>
 +M:    Damien Le Moal <Damien.LeMoal@wdc.com>
  L:    linux-block@vger.kernel.org
  S:    Maintained
  F:    drivers/block/skd*[ch]
@@@ -15696,7 -15673,6 +15697,7 @@@ R:   Bartosz Golaszewski <bgolaszewski@ba
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci.git
  S:    Supported
 +F:    Documentation/devicetree/bindings/i2c/i2c-davinci.txt
  F:    arch/arm/mach-davinci/
  F:    drivers/i2c/busses/i2c-davinci.c
  F:    arch/arm/boot/dts/da850*
@@@ -17318,7 -17294,7 +17319,7 @@@ F:   Documentation/ABI/stable/sysfs-hyper
  F:    Documentation/ABI/testing/sysfs-hypervisor-xen
  
  XEN NETWORK BACKEND DRIVER
 -M:    Wei Liu <wei.liu2@citrix.com>
 +M:    Wei Liu <wei.liu@kernel.org>
  M:    Paul Durrant <paul.durrant@citrix.com>
  L:    xen-devel@lists.xenproject.org (moderated for non-subscribers)
  L:    netdev@vger.kernel.org
@@@ -17400,7 -17376,6 +17401,7 @@@ M:   Jan Glauber <jglauber@cavium.com
  L:    linux-i2c@vger.kernel.org
  W:    http://www.cavium.com
  S:    Supported
 +F:    Documentation/devicetree/bindings/i2c/i2c-xlp9xx.txt
  F:    drivers/i2c/busses/i2c-xlp9xx.c
  
  XRA1403 GPIO EXPANDER
@@@ -1,8 -1,11 +1,8 @@@
 +// SPDX-License-Identifier: GPL-2.0-only
  /*
   * Broadcom BCM7xxx System Port Ethernet MAC driver
   *
   * Copyright (C) 2014 Broadcom Corporation
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License version 2 as
 - * published by the Free Software Foundation.
   */
  
  #define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
@@@ -609,7 -612,7 +609,7 @@@ static int bcm_sysport_set_coalesce(str
                                    struct ethtool_coalesce *ec)
  {
        struct bcm_sysport_priv *priv = netdev_priv(dev);
-       struct net_dim_cq_moder moder;
+       struct dim_cq_moder moder;
        u32 usecs, pkts;
        unsigned int i;
  
@@@ -992,7 -995,7 +992,7 @@@ static int bcm_sysport_poll(struct napi
  {
        struct bcm_sysport_priv *priv =
                container_of(napi, struct bcm_sysport_priv, napi);
-       struct net_dim_sample dim_sample;
+       struct dim_sample dim_sample;
        unsigned int work_done = 0;
  
        work_done = bcm_sysport_desc_rx(priv, budget);
        }
  
        if (priv->dim.use_dim) {
-               net_dim_sample(priv->dim.event_ctr, priv->dim.packets,
-                              priv->dim.bytes, &dim_sample);
+               dim_update_sample(priv->dim.event_ctr, priv->dim.packets,
+                                 priv->dim.bytes, &dim_sample);
                net_dim(&priv->dim.dim, dim_sample);
        }
  
@@@ -1087,16 -1090,16 +1087,16 @@@ static void bcm_sysport_resume_from_wol
  
  static void bcm_sysport_dim_work(struct work_struct *work)
  {
-       struct net_dim *dim = container_of(work, struct net_dim, work);
+       struct dim *dim = container_of(work, struct dim, work);
        struct bcm_sysport_net_dim *ndim =
                        container_of(dim, struct bcm_sysport_net_dim, dim);
        struct bcm_sysport_priv *priv =
                        container_of(ndim, struct bcm_sysport_priv, dim);
-       struct net_dim_cq_moder cur_profile =
-                       net_dim_get_rx_moderation(dim->mode, dim->profile_ix);
+       struct dim_cq_moder cur_profile = net_dim_get_rx_moderation(dim->mode,
+                                                                   dim->profile_ix);
  
        bcm_sysport_set_rx_coalesce(priv, cur_profile.usec, cur_profile.pkts);
-       dim->state = NET_DIM_START_MEASURE;
+       dim->state = DIM_START_MEASURE;
  }
  
  /* RX and misc interrupt routine */
@@@ -1437,7 -1440,7 +1437,7 @@@ static void bcm_sysport_init_dim(struc
        struct bcm_sysport_net_dim *dim = &priv->dim;
  
        INIT_WORK(&dim->dim.work, cb);
-       dim->dim.mode = NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE;
+       dim->dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
        dim->event_ctr = 0;
        dim->packets = 0;
        dim->bytes = 0;
  static void bcm_sysport_init_rx_coalesce(struct bcm_sysport_priv *priv)
  {
        struct bcm_sysport_net_dim *dim = &priv->dim;
-       struct net_dim_cq_moder moder;
+       struct dim_cq_moder moder;
        u32 usecs, pkts;
  
        usecs = priv->rx_coalesce_usecs;
@@@ -1,8 -1,11 +1,8 @@@
 +/* SPDX-License-Identifier: GPL-2.0-only */
  /*
   * Broadcom BCM7xxx System Port Ethernet MAC driver
   *
   * Copyright (C) 2014 Broadcom Corporation
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License version 2 as
 - * published by the Free Software Foundation.
   */
  
  #ifndef __BCM_SYSPORT_H
@@@ -11,7 -14,7 +11,7 @@@
  #include <linux/bitmap.h>
  #include <linux/ethtool.h>
  #include <linux/if_vlan.h>
- #include <linux/net_dim.h>
+ #include <linux/dim.h>
  
  /* Receive/transmit descriptor format */
  #define DESC_ADDR_HI_STATUS_LEN       0x00
@@@ -702,7 -705,7 +702,7 @@@ struct bcm_sysport_net_dim 
        u16                     event_ctr;
        unsigned long           packets;
        unsigned long           bytes;
-       struct net_dim          dim;
+       struct dim              dim;
  };
  
  /* Software view of the TX ring */
@@@ -1642,8 -1642,6 +1642,8 @@@ static int bnxt_rx_pkt(struct bnxt *bp
                skb = bnxt_copy_skb(bnapi, data_ptr, len, dma_addr);
                bnxt_reuse_rx_data(rxr, cons, data);
                if (!skb) {
 +                      if (agg_bufs)
 +                              bnxt_reuse_rx_agg_bufs(cpr, cp_cons, agg_bufs);
                        rc = -ENOMEM;
                        goto next_rx;
                }
@@@ -2130,12 -2128,12 +2130,12 @@@ static int bnxt_poll(struct napi_struc
                }
        }
        if (bp->flags & BNXT_FLAG_DIM) {
-               struct net_dim_sample dim_sample;
+               struct dim_sample dim_sample;
  
-               net_dim_sample(cpr->event_ctr,
-                              cpr->rx_packets,
-                              cpr->rx_bytes,
-                              &dim_sample);
+               dim_update_sample(cpr->event_ctr,
+                                 cpr->rx_packets,
+                                 cpr->rx_bytes,
+                                 &dim_sample);
                net_dim(&cpr->dim, dim_sample);
        }
        return work_done;
@@@ -6379,7 -6377,7 +6379,7 @@@ static int bnxt_alloc_ctx_mem(struct bn
        if (!ctx || (ctx->flags & BNXT_CTX_FLAG_INITED))
                return 0;
  
 -      if (bp->flags & BNXT_FLAG_ROCE_CAP) {
 +      if ((bp->flags & BNXT_FLAG_ROCE_CAP) && !is_kdump_kernel()) {
                pg_lvl = 2;
                extra_qps = 65536;
                extra_srqs = 8192;
@@@ -7618,23 -7616,22 +7618,23 @@@ static void bnxt_clear_int_mode(struct 
        bp->flags &= ~BNXT_FLAG_USING_MSIX;
  }
  
 -int bnxt_reserve_rings(struct bnxt *bp)
 +int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init)
  {
        int tcs = netdev_get_num_tc(bp->dev);
 -      bool reinit_irq = false;
 +      bool irq_cleared = false;
        int rc;
  
        if (!bnxt_need_reserve_rings(bp))
                return 0;
  
 -      if (BNXT_NEW_RM(bp) && (bnxt_get_num_msix(bp) != bp->total_irqs)) {
 +      if (irq_re_init && BNXT_NEW_RM(bp) &&
 +          bnxt_get_num_msix(bp) != bp->total_irqs) {
                bnxt_ulp_irq_stop(bp);
                bnxt_clear_int_mode(bp);
 -              reinit_irq = true;
 +              irq_cleared = true;
        }
        rc = __bnxt_reserve_rings(bp);
 -      if (reinit_irq) {
 +      if (irq_cleared) {
                if (!rc)
                        rc = bnxt_init_int_mode(bp);
                bnxt_ulp_irq_restart(bp, rc);
@@@ -7813,7 -7810,7 +7813,7 @@@ static void bnxt_enable_napi(struct bnx
  
                if (bp->bnapi[i]->rx_ring) {
                        INIT_WORK(&cpr->dim.work, bnxt_dim_work);
-                       cpr->dim.mode = NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE;
+                       cpr->dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
                }
                napi_enable(&bp->bnapi[i]->napi);
        }
@@@ -8533,7 -8530,7 +8533,7 @@@ static int __bnxt_open_nic(struct bnxt 
                        return rc;
                }
        }
 -      rc = bnxt_reserve_rings(bp);
 +      rc = bnxt_reserve_rings(bp, irq_re_init);
        if (rc)
                return rc;
        if ((bp->flags & BNXT_FLAG_RFS) &&
@@@ -10437,7 -10434,7 +10437,7 @@@ static int bnxt_set_dflt_rings(struct b
  
        if (sh)
                bp->flags |= BNXT_FLAG_SHARED_RINGS;
 -      dflt_rings = netif_get_num_default_rss_queues();
 +      dflt_rings = is_kdump_kernel() ? 1 : netif_get_num_default_rss_queues();
        /* Reduce default rings on multi-port cards so that total default
         * rings do not exceed CPU count.
         */
@@@ -10725,12 -10722,11 +10725,12 @@@ static int bnxt_init_one(struct pci_de
                goto init_err_pci_clean;
        }
  
 -      /* Read the adapter's DSN to use as the eswitch switch_id */
 -      rc = bnxt_pcie_dsn_get(bp, bp->switch_id);
 -      if (rc)
 -              goto init_err_pci_clean;
 -
 +      if (BNXT_PF(bp)) {
 +              /* Read the adapter's DSN to use as the eswitch switch_id */
 +              rc = bnxt_pcie_dsn_get(bp, bp->switch_id);
 +              if (rc)
 +                      goto init_err_pci_clean;
 +      }
        bnxt_hwrm_func_qcfg(bp);
        bnxt_hwrm_vnic_qcaps(bp);
        bnxt_hwrm_port_led_qcaps(bp);
  
  #include <linux/interrupt.h>
  #include <linux/rhashtable.h>
 +#include <linux/crash_dump.h>
  #include <net/devlink.h>
  #include <net/dst_metadata.h>
  #include <net/xdp.h>
- #include <linux/net_dim.h>
+ #include <linux/dim.h>
  
  struct tx_bd {
        __le32 tx_bd_len_flags_type;
@@@ -810,7 -809,7 +810,7 @@@ struct bnxt_cp_ring_info 
        u64                     rx_bytes;
        u64                     event_ctr;
  
-       struct net_dim          dim;
+       struct dim              dim;
  
        union {
                struct tx_cmp   *cp_desc_ring[MAX_CP_PAGES];
@@@ -1370,8 -1369,7 +1370,8 @@@ struct bnxt 
  #define BNXT_CHIP_TYPE_NITRO_A0(bp) ((bp)->flags & BNXT_FLAG_CHIP_NITRO_A0)
  #define BNXT_RX_PAGE_MODE(bp) ((bp)->flags & BNXT_FLAG_RX_PAGE_MODE)
  #define BNXT_SUPPORTS_TPA(bp) (!BNXT_CHIP_TYPE_NITRO_A0(bp) &&        \
 -                               !(bp->flags & BNXT_FLAG_CHIP_P5))
 +                               !(bp->flags & BNXT_FLAG_CHIP_P5) &&    \
 +                               !is_kdump_kernel())
  
  /* Chip class phase 5 */
  #define BNXT_CHIP_P5(bp)                      \
@@@ -1792,7 -1790,7 +1792,7 @@@ unsigned int bnxt_get_avail_stat_ctxs_f
  unsigned int bnxt_get_max_func_cp_rings(struct bnxt *bp);
  unsigned int bnxt_get_avail_cp_rings_for_en(struct bnxt *bp);
  int bnxt_get_avail_msix(struct bnxt *bp, int num);
 -int bnxt_reserve_rings(struct bnxt *bp);
 +int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init);
  void bnxt_tx_disable(struct bnxt *bp);
  void bnxt_tx_enable(struct bnxt *bp);
  int bnxt_hwrm_set_pause(struct bnxt *);
@@@ -1,8 -1,11 +1,8 @@@
 +// SPDX-License-Identifier: GPL-2.0-only
  /*
   * Broadcom GENET (Gigabit Ethernet) controller driver
   *
   * Copyright (c) 2014-2017 Broadcom
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License version 2 as
 - * published by the Free Software Foundation.
   */
  
  #define pr_fmt(fmt)                           "bcmgenet: " fmt
@@@ -640,7 -643,7 +640,7 @@@ static void bcmgenet_set_rx_coalesce(st
  static void bcmgenet_set_ring_rx_coalesce(struct bcmgenet_rx_ring *ring,
                                          struct ethtool_coalesce *ec)
  {
-       struct net_dim_cq_moder moder;
+       struct dim_cq_moder moder;
        u32 usecs, pkts;
  
        ring->rx_coalesce_usecs = ec->rx_coalesce_usecs;
@@@ -1895,7 -1898,7 +1895,7 @@@ static int bcmgenet_rx_poll(struct napi
  {
        struct bcmgenet_rx_ring *ring = container_of(napi,
                        struct bcmgenet_rx_ring, napi);
-       struct net_dim_sample dim_sample;
+       struct dim_sample dim_sample;
        unsigned int work_done;
  
        work_done = bcmgenet_desc_rx(ring, budget);
        }
  
        if (ring->dim.use_dim) {
-               net_dim_sample(ring->dim.event_ctr, ring->dim.packets,
-                              ring->dim.bytes, &dim_sample);
+               dim_update_sample(ring->dim.event_ctr, ring->dim.packets,
+                                 ring->dim.bytes, &dim_sample);
                net_dim(&ring->dim.dim, dim_sample);
        }
  
  
  static void bcmgenet_dim_work(struct work_struct *work)
  {
-       struct net_dim *dim = container_of(work, struct net_dim, work);
+       struct dim *dim = container_of(work, struct dim, work);
        struct bcmgenet_net_dim *ndim =
                        container_of(dim, struct bcmgenet_net_dim, dim);
        struct bcmgenet_rx_ring *ring =
                        container_of(ndim, struct bcmgenet_rx_ring, dim);
-       struct net_dim_cq_moder cur_profile =
+       struct dim_cq_moder cur_profile =
                        net_dim_get_rx_moderation(dim->mode, dim->profile_ix);
  
        bcmgenet_set_rx_coalesce(ring, cur_profile.usec, cur_profile.pkts);
-       dim->state = NET_DIM_START_MEASURE;
+       dim->state = DIM_START_MEASURE;
  }
  
  /* Assign skb to RX DMA descriptor. */
@@@ -2082,7 -2085,7 +2082,7 @@@ static void bcmgenet_init_dim(struct bc
        struct bcmgenet_net_dim *dim = &ring->dim;
  
        INIT_WORK(&dim->dim.work, cb);
-       dim->dim.mode = NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE;
+       dim->dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
        dim->event_ctr = 0;
        dim->packets = 0;
        dim->bytes = 0;
  static void bcmgenet_init_rx_coalesce(struct bcmgenet_rx_ring *ring)
  {
        struct bcmgenet_net_dim *dim = &ring->dim;
-       struct net_dim_cq_moder moder;
+       struct dim_cq_moder moder;
        u32 usecs, pkts;
  
        usecs = ring->rx_coalesce_usecs;
@@@ -1,6 -1,9 +1,6 @@@
 +/* SPDX-License-Identifier: GPL-2.0-only */
  /*
   * Copyright (c) 2014-2017 Broadcom
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License version 2 as
 - * published by the Free Software Foundation.
   */
  
  #ifndef __BCMGENET_H__
@@@ -13,7 -16,7 +13,7 @@@
  #include <linux/mii.h>
  #include <linux/if_vlan.h>
  #include <linux/phy.h>
- #include <linux/net_dim.h>
+ #include <linux/dim.h>
  
  /* total number of Buffer Descriptors, same for Rx/Tx */
  #define TOTAL_DESC                            256
@@@ -578,7 -581,7 +578,7 @@@ struct bcmgenet_net_dim 
        u16             event_ctr;
        unsigned long   packets;
        unsigned long   bytes;
-       struct net_dim  dim;
+       struct dim      dim;
  };
  
  struct bcmgenet_rx_ring {
@@@ -48,7 -48,7 +48,7 @@@
  #include <linux/rhashtable.h>
  #include <net/switchdev.h>
  #include <net/xdp.h>
- #include <linux/net_dim.h>
+ #include <linux/dim.h>
  #include <linux/bits.h>
  #include "wq.h"
  #include "mlx5_core.h"
@@@ -238,9 -238,9 +238,9 @@@ struct mlx5e_params 
        u16 num_channels;
        u8  num_tc;
        bool rx_cqe_compress_def;
-       struct net_dim_cq_moder rx_cq_moderation;
-       struct net_dim_cq_moder tx_cq_moderation;
        bool tunneled_offload_en;
+       struct dim_cq_moder rx_cq_moderation;
+       struct dim_cq_moder tx_cq_moderation;
        bool lro_en;
        u8  tx_min_inline_mode;
        bool vlan_strip_disable;
@@@ -356,7 -356,7 +356,7 @@@ struct mlx5e_txqsq 
        /* dirtied @completion */
        u16                        cc;
        u32                        dma_fifo_cc;
-       struct net_dim             dim; /* Adaptive Moderation */
+       struct dim                 dim; /* Adaptive Moderation */
  
        /* dirtied @xmit */
        u16                        pc ____cacheline_aligned_in_smp;
        /* control path */
        struct mlx5_wq_ctrl        wq_ctrl;
        struct mlx5e_channel      *channel;
 +      int                        ch_ix;
        int                        txq_ix;
        u32                        rate_limit;
        struct work_struct         recover_work;
@@@ -596,7 -595,7 +596,7 @@@ struct mlx5e_rq 
        int                    ix;
        unsigned int           hw_mtu;
  
-       struct net_dim         dim; /* Dynamic Interrupt Moderation */
+       struct dim         dim; /* Dynamic Interrupt Moderation */
  
        /* XDP */
        struct bpf_prog       *xdp_prog;
@@@ -781,7 -780,7 +781,7 @@@ netdev_tx_t mlx5e_sq_xmit(struct mlx5e_
                          struct mlx5e_tx_wqe *wqe, u16 pi, bool xmit_more);
  
  void mlx5e_trigger_irq(struct mlx5e_icosq *sq);
 -void mlx5e_completion_event(struct mlx5_core_cq *mcq);
 +void mlx5e_completion_event(struct mlx5_core_cq *mcq, struct mlx5_eqe *eqe);
  void mlx5e_cq_error_event(struct mlx5_core_cq *mcq, enum mlx5_event event);
  int mlx5e_napi_poll(struct napi_struct *napi, int budget);
  bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget);
@@@ -1113,7 -1112,6 +1113,7 @@@ void mlx5e_del_vxlan_port(struct net_de
  netdev_features_t mlx5e_features_check(struct sk_buff *skb,
                                       struct net_device *netdev,
                                       netdev_features_t features);
 +int mlx5e_set_features(struct net_device *netdev, netdev_features_t features);
  #ifdef CONFIG_MLX5_ESWITCH
  int mlx5e_set_vf_mac(struct net_device *dev, int vf, u8 *mac);
  int mlx5e_set_vf_rate(struct net_device *dev, int vf, int min_tx_rate, int max_tx_rate);
@@@ -584,11 -584,11 +584,11 @@@ static int mlx5e_alloc_rq(struct mlx5e_
  
        switch (params->rx_cq_moderation.cq_period_mode) {
        case MLX5_CQ_PERIOD_MODE_START_FROM_CQE:
-               rq->dim.mode = NET_DIM_CQ_PERIOD_MODE_START_FROM_CQE;
+               rq->dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_CQE;
                break;
        case MLX5_CQ_PERIOD_MODE_START_FROM_EQE:
        default:
-               rq->dim.mode = NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE;
+               rq->dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
        }
  
        rq->page_cache.head = 0;
@@@ -1082,7 -1082,6 +1082,7 @@@ static int mlx5e_alloc_txqsq(struct mlx
        sq->clock     = &mdev->clock;
        sq->mkey_be   = c->mkey_be;
        sq->channel   = c;
 +      sq->ch_ix     = c->ix;
        sq->txq_ix    = txq_ix;
        sq->uar_map   = mdev->mlx5e_res.bfreg.map;
        sq->min_inline_mode = params->tx_min_inline_mode;
@@@ -1518,7 -1517,6 +1518,7 @@@ static void mlx5e_free_cq(struct mlx5e_
  
  static int mlx5e_create_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param)
  {
 +      u32 out[MLX5_ST_SZ_DW(create_cq_out)];
        struct mlx5_core_dev *mdev = cq->mdev;
        struct mlx5_core_cq *mcq = &cq->mcq;
  
                                            MLX5_ADAPTER_PAGE_SHIFT);
        MLX5_SET64(cqc, cqc, dbr_addr,      cq->wq_ctrl.db.dma);
  
 -      err = mlx5_core_create_cq(mdev, mcq, in, inlen);
 +      err = mlx5_core_create_cq(mdev, mcq, in, inlen, out, sizeof(out));
  
        kvfree(in);
  
@@@ -1571,7 -1569,7 +1571,7 @@@ static void mlx5e_destroy_cq(struct mlx
  }
  
  static int mlx5e_open_cq(struct mlx5e_channel *c,
-                        struct net_dim_cq_moder moder,
+                        struct dim_cq_moder moder,
                         struct mlx5e_cq_param *param,
                         struct mlx5e_cq *cq)
  {
@@@ -1776,7 -1774,7 +1776,7 @@@ static int mlx5e_open_channel(struct ml
                              struct mlx5e_channel **cp)
  {
        int cpu = cpumask_first(mlx5_comp_irq_get_affinity_mask(priv->mdev, ix));
-       struct net_dim_cq_moder icocq_moder = {0, 0};
+       struct dim_cq_moder icocq_moder = {0, 0};
        struct net_device *netdev = priv->netdev;
        struct mlx5e_channel *c;
        unsigned int irq;
@@@ -2153,7 -2151,7 +2153,7 @@@ static void mlx5e_build_ico_cq_param(st
  
        mlx5e_build_common_cq_param(priv, param);
  
-       param->cq_period_mode = NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE;
+       param->cq_period_mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
  }
  
  static void mlx5e_build_icosq_param(struct mlx5e_priv *priv,
@@@ -3637,7 -3635,8 +3637,7 @@@ static int mlx5e_handle_feature(struct 
        return 0;
  }
  
 -static int mlx5e_set_features(struct net_device *netdev,
 -                            netdev_features_t features)
 +int mlx5e_set_features(struct net_device *netdev, netdev_features_t features)
  {
        netdev_features_t oper_features = netdev->features;
        int err = 0;
@@@ -3688,12 -3687,6 +3688,12 @@@ static netdev_features_t mlx5e_fix_feat
                        netdev_warn(netdev, "Disabling LRO, not supported in legacy RQ\n");
        }
  
 +      if (MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_CQE_COMPRESS)) {
 +              features &= ~NETIF_F_RXHASH;
 +              if (netdev->features & NETIF_F_RXHASH)
 +                      netdev_warn(netdev, "Disabling rxhash, not supported when CQE compress is active\n");
 +      }
 +
        mutex_unlock(&priv->state_lock);
  
        return features;
@@@ -3819,9 -3812,6 +3819,9 @@@ int mlx5e_hwstamp_set(struct mlx5e_pri
        memcpy(&priv->tstamp, &config, sizeof(config));
        mutex_unlock(&priv->state_lock);
  
 +      /* might need to fix some features */
 +      netdev_update_features(priv->netdev);
 +
        return copy_to_user(ifr->ifr_data, &config,
                            sizeof(config)) ? -EFAULT : 0;
  }
@@@ -4421,9 -4411,9 +4421,9 @@@ static bool slow_pci_heuristic(struct m
                link_speed > MLX5E_SLOW_PCI_RATIO * pci_bw;
  }
  
- static struct net_dim_cq_moder mlx5e_get_def_tx_moderation(u8 cq_period_mode)
+ static struct dim_cq_moder mlx5e_get_def_tx_moderation(u8 cq_period_mode)
  {
-       struct net_dim_cq_moder moder;
+       struct dim_cq_moder moder;
  
        moder.cq_period_mode = cq_period_mode;
        moder.pkts = MLX5E_PARAMS_DEFAULT_TX_CQ_MODERATION_PKTS;
        return moder;
  }
  
- static struct net_dim_cq_moder mlx5e_get_def_rx_moderation(u8 cq_period_mode)
+ static struct dim_cq_moder mlx5e_get_def_rx_moderation(u8 cq_period_mode)
  {
-       struct net_dim_cq_moder moder;
+       struct dim_cq_moder moder;
  
        moder.cq_period_mode = cq_period_mode;
        moder.pkts = MLX5E_PARAMS_DEFAULT_RX_CQ_MODERATION_PKTS;
  static u8 mlx5_to_net_dim_cq_period_mode(u8 cq_period_mode)
  {
        return cq_period_mode == MLX5_CQ_PERIOD_MODE_START_FROM_CQE ?
-               NET_DIM_CQ_PERIOD_MODE_START_FROM_CQE :
-               NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE;
+               DIM_CQ_PERIOD_MODE_START_FROM_CQE :
+               DIM_CQ_PERIOD_MODE_START_FROM_EQE;
  }
  
  void mlx5e_set_tx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode)
@@@ -4591,7 -4581,7 +4591,7 @@@ static void mlx5e_set_netdev_dev_addr(s
  {
        struct mlx5e_priv *priv = netdev_priv(netdev);
  
 -      mlx5_query_nic_vport_mac_address(priv->mdev, 0, netdev->dev_addr);
 +      mlx5_query_mac_address(priv->mdev, netdev->dev_addr);
        if (is_zero_ether_addr(netdev->dev_addr) &&
            !MLX5_CAP_GEN(priv->mdev, vport_group_manager)) {
                eth_hw_addr_random(netdev);
@@@ -4690,10 -4680,6 +4690,10 @@@ static void mlx5e_build_nic_netdev(stru
        if (!priv->channels.params.scatter_fcs_en)
                netdev->features  &= ~NETIF_F_RXFCS;
  
 +      /* prefere CQE compression over rxhash */
 +      if (MLX5E_GET_PFLAG(&priv->channels.params, MLX5E_PFLAG_RX_CQE_COMPRESS))
 +              netdev->features &= ~NETIF_F_RXHASH;
 +
  #define FT_CAP(f) MLX5_CAP_FLOWTABLE(mdev, flow_table_properties_nic_receive.f)
        if (FT_CAP(flow_modify_en) &&
            FT_CAP(modify_root) &&
@@@ -5109,11 -5095,6 +5109,11 @@@ static void mlx5e_detach(struct mlx5_co
        struct mlx5e_priv *priv = vpriv;
        struct net_device *netdev = priv->netdev;
  
 +#ifdef CONFIG_MLX5_ESWITCH
 +      if (MLX5_ESWITCH_MANAGER(mdev) && vpriv == mdev)
 +              return;
 +#endif
 +
        if (!netif_device_present(netdev))
                return;
  
@@@ -5134,7 -5115,7 +5134,7 @@@ static void *mlx5e_add(struct mlx5_core
  
  #ifdef CONFIG_MLX5_ESWITCH
        if (MLX5_ESWITCH_MANAGER(mdev) &&
 -          mlx5_eswitch_mode(mdev->priv.eswitch) == SRIOV_OFFLOADS) {
 +          mlx5_eswitch_mode(mdev->priv.eswitch) == MLX5_ESWITCH_OFFLOADS) {
                mlx5e_rep_register_vport_reps(mdev);
                return mdev;
        }
@@@ -48,26 -48,24 +48,24 @@@ static inline bool mlx5e_channel_no_aff
  static void mlx5e_handle_tx_dim(struct mlx5e_txqsq *sq)
  {
        struct mlx5e_sq_stats *stats = sq->stats;
-       struct net_dim_sample dim_sample;
+       struct dim_sample dim_sample;
  
        if (unlikely(!test_bit(MLX5E_SQ_STATE_AM, &sq->state)))
                return;
  
-       net_dim_sample(sq->cq.event_ctr, stats->packets, stats->bytes,
-                      &dim_sample);
+       dim_update_sample(sq->cq.event_ctr, stats->packets, stats->bytes, &dim_sample);
        net_dim(&sq->dim, dim_sample);
  }
  
  static void mlx5e_handle_rx_dim(struct mlx5e_rq *rq)
  {
        struct mlx5e_rq_stats *stats = rq->stats;
-       struct net_dim_sample dim_sample;
+       struct dim_sample dim_sample;
  
        if (unlikely(!test_bit(MLX5E_RQ_STATE_AM, &rq->state)))
                return;
  
-       net_dim_sample(rq->cq.event_ctr, stats->packets, stats->bytes,
-                      &dim_sample);
+       dim_update_sample(rq->cq.event_ctr, stats->packets, stats->bytes, &dim_sample);
        net_dim(&rq->dim, dim_sample);
  }
  
@@@ -136,7 -134,7 +134,7 @@@ int mlx5e_napi_poll(struct napi_struct 
        return work_done;
  }
  
 -void mlx5e_completion_event(struct mlx5_core_cq *mcq)
 +void mlx5e_completion_event(struct mlx5_core_cq *mcq, struct mlx5_eqe *eqe)
  {
        struct mlx5e_cq *cq = container_of(mcq, struct mlx5e_cq, mcq);