1. 28 Jan, 2021 12 commits
    • Ido Schimmel's avatar
      mlxsw: spectrum_span: Do not overwrite policer configuration · b6f6881a
      Ido Schimmel authored
      The purpose of the delayed work in the SPAN module is to potentially
      update the destination port and various encapsulation parameters of SPAN
      agents that point to a VLAN device or a GRE tap. The destination port
      can change following the insertion of a new route, for example.
      
      SPAN agents that point to a physical port or the CPU port are static and
      never change throughout the lifetime of the SPAN agent. Therefore, skip
      over them in the delayed work.
      
      This fixes an issue where the delayed work overwrites the policer
      that was set on a SPAN agent pointing to the CPU. Modifying the delayed
      work to inherit the original policer configuration is error-prone, as
      the same will be needed for any new parameter.
      
      Fixes: 4039504e ("mlxsw: spectrum_span: Allow setting policer on a SPAN agent")
      Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b6f6881a
    • Danielle Ratson's avatar
      selftests: forwarding: Specify interface when invoking mausezahn · 11df27f7
      Danielle Ratson authored
      Specify the interface through which packets should be transmitted so
      that the test will pass regardless of the libnet version against which
      mausezahn is linked.
      
      Fixes: cab14d10 ("selftests: Add version of router_multipath.sh using nexthop objects")
      Fixes: 3d578d87 ("selftests: forwarding: Test IPv4 weighted nexthops")
      Signed-off-by: default avatarDanielle Ratson <danieller@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      11df27f7
    • Voon Weifeng's avatar
      stmmac: intel: Configure EHL PSE0 GbE and PSE1 GbE to 32 bits DMA addressing · 7cfc4486
      Voon Weifeng authored
      Fix an issue where dump stack is printed and Reset Adapter occurs when
      PSE0 GbE or/and PSE1 GbE is/are enabled. EHL PSE0 GbE and PSE1 GbE use
      32 bits DMA addressing whereas EHL PCH GbE uses 64 bits DMA addressing.
      
      [   25.535095] ------------[ cut here ]------------
      [   25.540276] NETDEV WATCHDOG: enp0s29f2 (intel-eth-pci): transmit queue 2 timed out
      [   25.548749] WARNING: CPU: 2 PID: 0 at net/sched/sch_generic.c:443 dev_watchdog+0x259/0x260
      [   25.558004] Modules linked in: 8021q bnep bluetooth ecryptfs snd_hda_codec_hdmi intel_gpy marvell intel_ishtp_loader intel_ishtp_hid iTCO_wdt mei_hdcp iTCO_vendor_support x86_pkg_temp_thermal kvm_intel dwmac_intel stmmac kvm igb pcs_xpcs irqbypass phylink snd_hda_intel intel_rapl_msr pcspkr dca snd_hda_codec i915 i2c_i801 i2c_smbus libphy intel_ish_ipc snd_hda_core mei_me intel_ishtp mei spi_dw_pci 8250_lpss spi_dw thermal dw_dmac_core parport_pc tpm_crb tpm_tis parport tpm_tis_core tpm intel_pmc_core sch_fq_codel uhid fuse configfs snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc snd_sof_intel_hda_common snd_sof_xtensa_dsp snd_sof snd_soc_acpi_intel_match snd_soc_acpi snd_intel_dspcfg ledtrig_audio snd_soc_core snd_compress ac97_bus snd_pcm snd_timer snd soundcore
      [   25.633795] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G     U            5.11.0-rc4-intel-lts-MISMAIL5+ #5
      [   25.644306] Hardware name: Intel Corporation Elkhart Lake Embedded Platform/ElkhartLake LPDDR4x T4 RVP1, BIOS EHLSFWI1.R00.2434.A00.2010231402 10/23/2020
      [   25.659674] RIP: 0010:dev_watchdog+0x259/0x260
      [   25.664650] Code: e8 3b 6b 60 ff eb 98 4c 89 ef c6 05 ec e7 bf 00 01 e8 fb e5 fa ff 89 d9 4c 89 ee 48 c7 c7 78 31 d2 9e 48 89 c2 e8 79 1b 18 00 <0f> 0b e9 77 ff ff ff 0f 1f 44 00 00 48 c7 47 08 00 00 00 00 48 c7
      [   25.685647] RSP: 0018:ffffb7ca80160eb8 EFLAGS: 00010286
      [   25.691498] RAX: 0000000000000000 RBX: 0000000000000002 RCX: 0000000000000103
      [   25.699483] RDX: 0000000080000103 RSI: 00000000000000f6 RDI: 00000000ffffffff
      [   25.707465] RBP: ffff985709ce0440 R08: 0000000000000000 R09: c0000000ffffefff
      [   25.715455] R10: ffffb7ca80160cf0 R11: ffffb7ca80160ce8 R12: ffff985709ce039c
      [   25.723438] R13: ffff985709ce0000 R14: 0000000000000008 R15: ffff9857068af940
      [   25.731425] FS:  0000000000000000(0000) GS:ffff985864300000(0000) knlGS:0000000000000000
      [   25.740481] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   25.746913] CR2: 00005567f8bb76b8 CR3: 00000001f8e0a000 CR4: 0000000000350ee0
      [   25.754900] Call Trace:
      [   25.757631]  <IRQ>
      [   25.759891]  ? qdisc_put_unlocked+0x30/0x30
      [   25.764565]  ? qdisc_put_unlocked+0x30/0x30
      [   25.769245]  call_timer_fn+0x2e/0x140
      [   25.773346]  run_timer_softirq+0x1f3/0x430
      [   25.777932]  ? __hrtimer_run_queues+0x12c/0x2c0
      [   25.783005]  ? ktime_get+0x3e/0xa0
      [   25.786812]  __do_softirq+0xa6/0x2ef
      [   25.790816]  asm_call_irq_on_stack+0xf/0x20
      [   25.795501]  </IRQ>
      [   25.797852]  do_softirq_own_stack+0x5d/0x80
      [   25.802538]  irq_exit_rcu+0x94/0xb0
      [   25.806475]  sysvec_apic_timer_interrupt+0x42/0xc0
      [   25.811836]  asm_sysvec_apic_timer_interrupt+0x12/0x20
      [   25.817586] RIP: 0010:cpuidle_enter_state+0xd9/0x370
      [   25.823142] Code: 85 c0 0f 8f 0a 02 00 00 31 ff e8 22 d5 7e ff 45 84 ff 74 12 9c 58 f6 c4 02 0f 85 47 02 00 00 31 ff e8 7b a0 84 ff fb 45 85 f6 <0f> 88 ab 00 00 00 49 63 ce 48 2b 2c 24 48 89 c8 48 6b d1 68 48 c1
      [   25.844140] RSP: 0018:ffffb7ca800f7e80 EFLAGS: 00000206
      [   25.849996] RAX: ffff985864300000 RBX: 0000000000000003 RCX: 000000000000001f
      [   25.857975] RDX: 00000005f2028ea8 RSI: ffffffff9ec5907f RDI: ffffffff9ec62a5d
      [   25.865961] RBP: 00000005f2028ea8 R08: 0000000000000000 R09: 0000000000029d00
      [   25.873947] R10: 000000137b0e0508 R11: ffff9858643294e4 R12: ffff9858643336d0
      [   25.881935] R13: ffffffff9ef74b00 R14: 0000000000000003 R15: 0000000000000000
      [   25.889918]  cpuidle_enter+0x29/0x40
      [   25.893922]  do_idle+0x24a/0x290
      [   25.897536]  cpu_startup_entry+0x19/0x20
      [   25.901930]  start_secondary+0x128/0x160
      [   25.906326]  secondary_startup_64_no_verify+0xb0/0xbb
      [   25.911983] ---[ end trace b4c0c8195d0ba61f ]---
      [   25.917193] intel-eth-pci 0000:00:1d.2 enp0s29f2: Reset adapter.
      
      Fixes: 67c08ac4 ("net: stmmac: add EHL PSE0 & PSE1 1Gbps PCI info and PCI ID")
      Signed-off-by: default avatarVoon Weifeng <weifeng.voon@intel.com>
      Co-developed-by: default avatarMohammad Athari Bin Ismail <mohammad.athari.ismail@intel.com>
      Signed-off-by: default avatarMohammad Athari Bin Ismail <mohammad.athari.ismail@intel.com>
      Link: https://lore.kernel.org/r/20210126100844.30326-1-mohammad.athari.ismail@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      7cfc4486
    • Giacinto Cifelli's avatar
      net: usb: cdc_ether: added support for Thales Cinterion PLSx3 modem family. · dad3a72f
      Giacinto Cifelli authored
      lsusb -v for this device:
      
      Bus 003 Device 007: ID 1e2d:0069
      Device Descriptor:
        bLength                18
        bDescriptorType         1
        bcdUSB               2.00
        bDeviceClass          239 Miscellaneous Device
        bDeviceSubClass         2 ?
        bDeviceProtocol         1 Interface Association
        bMaxPacketSize0        64
        idVendor           0x1e2d
        idProduct          0x0069
        bcdDevice            0.00
        iManufacturer           4 Cinterion Wireless Modules
        iProduct                3 PLSx3
        iSerial                 5 fa3c1419
        bNumConfigurations      1
        Configuration Descriptor:
          bLength                 9
          bDescriptorType         2
          wTotalLength          352
          bNumInterfaces         10
          bConfigurationValue     1
          iConfiguration          2 Cinterion Configuration
          bmAttributes         0xe0
            Self Powered
            Remote Wakeup
          MaxPower              500mA
          Interface Association:
            bLength                 8
            bDescriptorType        11
            bFirstInterface         0
            bInterfaceCount         2
            bFunctionClass          2 Communications
            bFunctionSubClass       2 Abstract (modem)
            bFunctionProtocol       1 AT-commands (v.25ter)
            iFunction               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        0
            bAlternateSetting       0
            bNumEndpoints           1
            bInterfaceClass         2 Communications
            bInterfaceSubClass      2 Abstract (modem)
            bInterfaceProtocol      1 AT-commands (v.25ter)
            iInterface              0
            CDC Header:
              bcdCDC               1.10
            CDC ACM:
              bmCapabilities       0x02
                line coding and serial state
            CDC Call Management:
              bmCapabilities       0x03
                call management
                use DataInterface
              bDataInterface          1
            CDC Union:
              bMasterInterface        0
              bSlaveInterface         1
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x81  EP 1 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0040  1x 64 bytes
              bInterval               5
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        1
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass        10 CDC Data
            bInterfaceSubClass      0 Unused
            bInterfaceProtocol      0
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x82  EP 2 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x01  EP 1 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
          Interface Association:
            bLength                 8
            bDescriptorType        11
            bFirstInterface         2
            bInterfaceCount         2
            bFunctionClass          2 Communications
            bFunctionSubClass       2 Abstract (modem)
            bFunctionProtocol       1 AT-commands (v.25ter)
            iFunction               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        2
            bAlternateSetting       0
            bNumEndpoints           1
            bInterfaceClass         2 Communications
            bInterfaceSubClass      2 Abstract (modem)
            bInterfaceProtocol      1 AT-commands (v.25ter)
            iInterface              0
            CDC Header:
              bcdCDC               1.10
            CDC ACM:
              bmCapabilities       0x02
                line coding and serial state
            CDC Call Management:
              bmCapabilities       0x03
                call management
                use DataInterface
              bDataInterface          3
            CDC Union:
              bMasterInterface        2
              bSlaveInterface         3
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x83  EP 3 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0040  1x 64 bytes
              bInterval               5
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        3
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass        10 CDC Data
            bInterfaceSubClass      0 Unused
            bInterfaceProtocol      0
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x84  EP 4 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x02  EP 2 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
          Interface Association:
            bLength                 8
            bDescriptorType        11
            bFirstInterface         4
            bInterfaceCount         2
            bFunctionClass          2 Communications
            bFunctionSubClass       2 Abstract (modem)
            bFunctionProtocol       1 AT-commands (v.25ter)
            iFunction               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        4
            bAlternateSetting       0
            bNumEndpoints           1
            bInterfaceClass         2 Communications
            bInterfaceSubClass      2 Abstract (modem)
            bInterfaceProtocol      1 AT-commands (v.25ter)
            iInterface              0
            CDC Header:
              bcdCDC               1.10
            CDC ACM:
              bmCapabilities       0x02
                line coding and serial state
            CDC Call Management:
              bmCapabilities       0x03
                call management
                use DataInterface
              bDataInterface          5
            CDC Union:
              bMasterInterface        4
              bSlaveInterface         5
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x85  EP 5 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0040  1x 64 bytes
              bInterval               5
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        5
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass        10 CDC Data
            bInterfaceSubClass      0 Unused
            bInterfaceProtocol      0
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x86  EP 6 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x03  EP 3 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
          Interface Association:
            bLength                 8
            bDescriptorType        11
            bFirstInterface         6
            bInterfaceCount         2
            bFunctionClass          2 Communications
            bFunctionSubClass       2 Abstract (modem)
            bFunctionProtocol       1 AT-commands (v.25ter)
            iFunction               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        6
            bAlternateSetting       0
            bNumEndpoints           1
            bInterfaceClass         2 Communications
            bInterfaceSubClass      2 Abstract (modem)
            bInterfaceProtocol      1 AT-commands (v.25ter)
            iInterface              0
            CDC Header:
              bcdCDC               1.10
            CDC ACM:
              bmCapabilities       0x02
                line coding and serial state
            CDC Call Management:
              bmCapabilities       0x03
                call management
                use DataInterface
              bDataInterface          7
            CDC Union:
              bMasterInterface        6
              bSlaveInterface         7
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x87  EP 7 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0040  1x 64 bytes
              bInterval               5
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        7
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass        10 CDC Data
            bInterfaceSubClass      0 Unused
            bInterfaceProtocol      0
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x88  EP 8 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x04  EP 4 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
          Interface Association:
            bLength                 8
            bDescriptorType        11
            bFirstInterface         8
            bInterfaceCount         2
            bFunctionClass          2 Communications
            bFunctionSubClass       0
            bFunctionProtocol       0
            iFunction               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        8
            bAlternateSetting       0
            bNumEndpoints           1
            bInterfaceClass         2 Communications
            bInterfaceSubClass      6 Ethernet Networking
            bInterfaceProtocol      0
            iInterface              0
            CDC Header:
              bcdCDC               1.10
            CDC Ethernet:
              iMacAddress                      1 00A0C6C14190
              bmEthernetStatistics    0x00000000
              wMaxSegmentSize              16384
              wNumberMCFilters            0x0001
              bNumberPowerFilters              0
            CDC Union:
              bMasterInterface        8
              bSlaveInterface         9
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x89  EP 9 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0040  1x 64 bytes
              bInterval               5
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        9
            bAlternateSetting       0
            bNumEndpoints           0
            bInterfaceClass        10 CDC Data
            bInterfaceSubClass      0 Unused
            bInterfaceProtocol      0
            iInterface              0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        9
            bAlternateSetting       1
            bNumEndpoints           2
            bInterfaceClass        10 CDC Data
            bInterfaceSubClass      0 Unused
            bInterfaceProtocol      0
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x8a  EP 10 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x05  EP 5 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
      Device Qualifier (for other device speed):
        bLength                10
        bDescriptorType         6
        bcdUSB               2.00
        bDeviceClass          239 Miscellaneous Device
        bDeviceSubClass         2 ?
        bDeviceProtocol         1 Interface Association
        bMaxPacketSize0        64
        bNumConfigurations      1
      Device Status:     0x0000
        (Bus Powered)
      Signed-off-by: default avatarGiacinto Cifelli <gciofono@gmail.com>
      Link: https://lore.kernel.org/r/20210126044245.8455-1-gciofono@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      dad3a72f
    • Jakub Kicinski's avatar
      Merge tag 'mlx5-fixes-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · 44a674d6
      Jakub Kicinski authored
      Saeed Mahameed says:
      
      ====================
      mlx5 fixes 2021-01-26
      
      This series introduces some fixes to mlx5 driver.
      
      * tag 'mlx5-fixes-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux:
        net/mlx5: CT: Fix incorrect removal of tuple_nat_node from nat rhashtable
        net/mlx5e: Revert parameters on errors when changing MTU and LRO state without reset
        net/mlx5e: Revert parameters on errors when changing trust state without reset
        net/mlx5e: Correctly handle changing the number of queues when the interface is down
        net/mlx5e: Fix CT rule + encap slow path offload and deletion
        net/mlx5e: Disable hw-tc-offload when MLX5_CLS_ACT config is disabled
        net/mlx5: Maintain separate page trees for ECPF and PF functions
        net/mlx5e: Fix IPSEC stats
        net/mlx5e: Reduce tc unsupported key print level
        net/mlx5e: free page before return
        net/mlx5e: E-switch, Fix rate calculation for overflow
        net/mlx5: Fix memory leak on flow table creation error flow
      ====================
      
      Link: https://lore.kernel.org/r/20210126234345.202096-1-saeedm@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      44a674d6
    • Lijun Pan's avatar
      ibmvnic: Ensure that CRQ entry read are correctly ordered · e41aec79
      Lijun Pan authored
      Ensure that received Command-Response Queue (CRQ) entries are
      properly read in order by the driver. dma_rmb barrier has
      been added before accessing the CRQ descriptor to ensure
      the entire descriptor is read before processing.
      
      Fixes: 032c5e82 ("Driver for IBM System i/p VNIC protocol")
      Signed-off-by: default avatarLijun Pan <ljp@linux.ibm.com>
      Link: https://lore.kernel.org/r/20210128013442.88319-1-ljp@linux.ibm.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e41aec79
    • Jakub Kicinski's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · 0f764eec
      Jakub Kicinski authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      1) Honor stateful expressions defined in the set from the dynset
         extension. The set definition provides a stateful expression
         that must be used by the dynset expression in case it is specified.
      
      2) Missing timeout extension in the set element in the dynset
         extension leads to inconsistent ruleset listing, not allowing
         the user to restore timeout and expiration on ruleset reload.
      
      3) Do not dump the stateful expression from the dynset extension
         if it coming from the set definition.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf:
        netfilter: nft_dynset: dump expressions when set definition contains no expressions
        netfilter: nft_dynset: add timeout extension to template
        netfilter: nft_dynset: honor stateful expressions in set definition
      ====================
      
      Link: https://lore.kernel.org/r/20210127132512.5472-1-pablo@netfilter.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0f764eec
    • Jakub Kicinski's avatar
      Merge tag 'linux-can-fixes-for-5.11-20210127' of... · 45a81464
      Jakub Kicinski authored
      Merge tag 'linux-can-fixes-for-5.11-20210127' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
      
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can 2021-01-27
      
      The patch is by Dan Carpenter and fixes a potential information leak in
      can_fill_info().
      
      * tag 'linux-can-fixes-for-5.11-20210127' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can:
        can: dev: prevent potential information leak in can_fill_info()
      ====================
      
      Link: https://lore.kernel.org/r/20210127094028.2778793-1-mkl@pengutronix.deSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      45a81464
    • Jakub Kicinski's avatar
      MAINTAINERS: add missing header for bonding · b770753c
      Jakub Kicinski authored
      include/net/bonding.h is missing from bonding entry.
      
      Link: https://lore.kernel.org/r/20210127021844.4071706-1-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b770753c
    • Jakub Kicinski's avatar
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue · 5ae3a25b
      Jakub Kicinski authored
      Anthony Nguyen says:
      
      ====================
      Intel Wired LAN Driver Updates 2021-01-26
      
      This series contains updates to the ice, i40e, and igc driver.
      
      Henry corrects setting an unspecified protocol to IPPROTO_NONE instead of
      0 for IPv6 flexbytes filters for ice.
      
      Nick fixes the IPv6 extension header being processed incorrectly and
      updates the netdev->dev_addr if it exists in hardware as it may have been
      modified outside the ice driver.
      
      Brett ensures a user cannot request more channels than available LAN MSI-X
      and fixes the minimum allocation logic as it was incorrectly trying to use
      more MSI-X than allocated for ice.
      
      Stefan Assmann minimizes the delay between getting and using the VSI
      pointer to prevent a possible crash for i40e.
      
      Corinna Vinschen fixes link speed advertising for igc.
      
      * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue:
        igc: fix link speed advertising
        i40e: acquire VSI pointer only after VF is initialized
        ice: Fix MSI-X vector fallback logic
        ice: Don't allow more channels than LAN MSI-X available
        ice: update dev_addr in ice_set_mac_address even if HW filter exists
        ice: Implement flow for IPv6 next header (extension header)
        ice: fix FDir IPv6 flexbyte
      ====================
      
      Link: https://lore.kernel.org/r/20210126221035.658124-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5ae3a25b
    • Vadim Fedorenko's avatar
      net: decnet: fix netdev refcount leaking on error path · 3f96d644
      Vadim Fedorenko authored
      On building the route there is an assumption that the destination
      could be local. In this case loopback_dev is used to get the address.
      If the address is still cannot be retrieved dn_route_output_slow
      returns EADDRNOTAVAIL with loopback_dev reference taken.
      
      Cannot find hash for the fixes tag because this code was introduced
      long time ago. I don't think that this bug has ever fired but the
      patch is done just to have a consistent code base.
      Signed-off-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
      Link: https://lore.kernel.org/r/1611619334-20955-1-git-send-email-vfedorenko@novek.ruSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3f96d644
    • Rasmus Villemoes's avatar
      net: switchdev: don't set port_obj_info->handled true when -EOPNOTSUPP · 20776b46
      Rasmus Villemoes authored
      It's not true that switchdev_port_obj_notify() only inspects the
      ->handled field of "struct switchdev_notifier_port_obj_info" if
      call_switchdev_blocking_notifiers() returns 0 - there's a WARN_ON()
      triggering for a non-zero return combined with ->handled not being
      true. But the real problem here is that -EOPNOTSUPP is not being
      properly handled.
      
      The wrapper functions switchdev_handle_port_obj_add() et al change a
      return value of -EOPNOTSUPP to 0, and the treatment of ->handled in
      switchdev_port_obj_notify() seems to be designed to change that back
      to -EOPNOTSUPP in case nobody actually acted on the notifier (i.e.,
      everybody returned -EOPNOTSUPP).
      
      Currently, as soon as some device down the stack passes the check_cb()
      check, ->handled gets set to true, which means that
      switchdev_port_obj_notify() cannot actually ever return -EOPNOTSUPP.
      
      This, for example, means that the detection of hardware offload
      support in the MRP code is broken: switchdev_port_obj_add() used by
      br_mrp_switchdev_send_ring_test() always returns 0, so since the MRP
      code thinks the generation of MRP test frames has been offloaded, no
      such frames are actually put on the wire. Similarly,
      br_mrp_switchdev_set_ring_role() also always returns 0, causing
      mrp->ring_role_offloaded to be set to 1.
      
      To fix this, continue to set ->handled true if any callback returns
      success or any error distinct from -EOPNOTSUPP. But if all the
      callbacks return -EOPNOTSUPP, make sure that ->handled stays false, so
      the logic in switchdev_port_obj_notify() can propagate that
      information.
      
      Fixes: 9a9f26e8 ("bridge: mrp: Connect MRP API with the switchdev API")
      Fixes: f30f0601 ("switchdev: Add helpers to aid traversal through lower devices")
      Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
      Link: https://lore.kernel.org/r/20210125124116.102928-1-rasmus.villemoes@prevas.dkSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      20776b46
  2. 27 Jan, 2021 6 commits
    • Dan Carpenter's avatar
      can: dev: prevent potential information leak in can_fill_info() · b552766c
      Dan Carpenter authored
      The "bec" struct isn't necessarily always initialized. For example, the
      mcp251xfd_get_berr_counter() function doesn't initialize anything if the
      interface is down.
      
      Fixes: 52c793f2 ("can: netlink support for bus-error reporting and counters")
      Link: https://lore.kernel.org/r/YAkaRdRJncsJO8Ve@mwandaSigned-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      b552766c
    • Jakub Kicinski's avatar
      Merge branch 'net-fec-fix-temporary-rmii-clock-reset-on-link-up' · 2bd29748
      Jakub Kicinski authored
      Laurent Badel says:
      
      ====================
      net: fec: Fix temporary RMII clock reset on link up
      
      v2: fixed a compilation warning
      
      The FEC drivers performs a "hardware reset" of the MAC module when the
      link is reported to be up. This causes a short glitch in the RMII clock
      due to the hardware reset clearing the receive control register which
      controls the MII mode. It seems that some link partners do not tolerate
      this glitch, and invalidate the link, which leads to a never-ending loop
      of negotiation-link up-link down events.
      
      This was observed with the iMX28 Soc and LAN8720/LAN8742 PHYs, with two
      Intel adapters I218-LM and X722-DA2 as link partners, though a number of
      other link partners do not seem to mind the clock glitch. Changing the
      hardware reset to a software reset (clearing bit 1 of the ECR register)
      cured the issue.
      
      Attempts to optimize fec_restart() in order to minimize the duration of
      the glitch were unsuccessful. Furthermore manually producing the glitch by
      setting MII mode and then back to RMII in two consecutive instructions,
      resulting in a clock glitch <10us in duration, was enough to cause the
      partner to invalidate the link. This strongly suggests that the root cause
      of the link being dropped is indeed the change in clock frequency.
      
      In an effort to minimize changes to driver, the patch proposes to use
      soft reset only for tested SoCs (iMX28) and only if the link is up. This
      preserves hardware reset in other situations, which might be required for
      proper setup of the MAC.
      ====================
      
      Link: https://lore.kernel.org/r/20210125100745.5090-1-laurentbadel@eaton.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2bd29748
    • Laurent Badel's avatar
      net: fec: Fix temporary RMII clock reset on link up · c730ab42
      Laurent Badel authored
      fec_restart() does a hard reset of the MAC module when the link status
      changes to up. This temporarily resets the R_CNTRL register which controls
      the MII mode of the ENET_OUT clock. In the case of RMII, the clock
      frequency momentarily drops from 50MHz to 25MHz until the register is
      reconfigured. Some link partners do not tolerate this glitch and
      invalidate the link causing failure to establish a stable link when using
      PHY polling mode. Since as per IEEE802.3 the criteria for link validity
      are PHY-specific, what the partner should tolerate cannot be assumed, so
      avoid resetting the MII clock by using software reset instead of hardware
      reset when the link is up. This is generally relevant only if the SoC
      provides the clock to an external PHY and the PHY is configured for RMII.
      Signed-off-by: default avatarLaurent Badel <laurentbadel@eaton.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c730ab42
    • Xie He's avatar
      net: lapb: Add locking to the lapb module · b491e6a7
      Xie He authored
      In the lapb module, the timers may run concurrently with other code in
      this module, and there is currently no locking to prevent the code from
      racing on "struct lapb_cb". This patch adds locking to prevent racing.
      
      1. Add "spinlock_t lock" to "struct lapb_cb"; Add "spin_lock_bh" and
      "spin_unlock_bh" to APIs, timer functions and notifier functions.
      
      2. Add "bool t1timer_stop, t2timer_stop" to "struct lapb_cb" to make us
      able to ask running timers to abort; Modify "lapb_stop_t1timer" and
      "lapb_stop_t2timer" to make them able to abort running timers;
      Modify "lapb_t2timer_expiry" and "lapb_t1timer_expiry" to make them
      abort after they are stopped by "lapb_stop_t1timer", "lapb_stop_t2timer",
      and "lapb_start_t1timer", "lapb_start_t2timer".
      
      3. Let lapb_unregister wait for other API functions and running timers
      to stop.
      
      4. The lapb_device_event function calls lapb_disconnect_request. In
      order to avoid trying to hold the lock twice, add a new function named
      "__lapb_disconnect_request" which assumes the lock is held, and make
      it called by lapb_disconnect_request and lapb_device_event.
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Cc: Martin Schiller <ms@dev.tdt.de>
      Signed-off-by: default avatarXie He <xie.he.0141@gmail.com>
      Link: https://lore.kernel.org/r/20210126040939.69995-1-xie.he.0141@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b491e6a7
    • Ivan Vecera's avatar
      team: protect features update by RCU to avoid deadlock · f0947d0d
      Ivan Vecera authored
      Function __team_compute_features() is protected by team->lock
      mutex when it is called from team_compute_features() used when
      features of an underlying device is changed. This causes
      a deadlock when NETDEV_FEAT_CHANGE notifier for underlying device
      is fired due to change propagated from team driver (e.g. MTU
      change). It's because callbacks like team_change_mtu() or
      team_vlan_rx_{add,del}_vid() protect their port list traversal
      by team->lock mutex.
      
      Example (r8169 case where this driver disables TSO for certain MTU
      values):
      ...
      [ 6391.348202]  __mutex_lock.isra.6+0x2d0/0x4a0
      [ 6391.358602]  team_device_event+0x9d/0x160 [team]
      [ 6391.363756]  notifier_call_chain+0x47/0x70
      [ 6391.368329]  netdev_update_features+0x56/0x60
      [ 6391.373207]  rtl8169_change_mtu+0x14/0x50 [r8169]
      [ 6391.378457]  dev_set_mtu_ext+0xe1/0x1d0
      [ 6391.387022]  dev_set_mtu+0x52/0x90
      [ 6391.390820]  team_change_mtu+0x64/0xf0 [team]
      [ 6391.395683]  dev_set_mtu_ext+0xe1/0x1d0
      [ 6391.399963]  do_setlink+0x231/0xf50
      ...
      
      In fact team_compute_features() called from team_device_event()
      does not need to be protected by team->lock mutex and rcu_read_lock()
      is sufficient there for port list traversal.
      
      Fixes: 3d249d4c ("net: introduce ethernet teaming device")
      Cc: Saeed Mahameed <saeed@kernel.org>
      Signed-off-by: default avatarIvan Vecera <ivecera@redhat.com>
      Reviewed-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Link: https://lore.kernel.org/r/20210125074416.4056484-1-ivecera@redhat.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f0947d0d
    • Jakub Kicinski's avatar
      MAINTAINERS: add David Ahern to IPv4/IPv6 maintainers · 5cfeb562
      Jakub Kicinski authored
      David has been the de-facto maintainer for much of the IP code
      for the last couple of years, let's make it official.
      
      Link: https://lore.kernel.org/r/20210122173220.3579491-1-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5cfeb562
  3. 26 Jan, 2021 22 commits
    • Paul Blakey's avatar
      net/mlx5: CT: Fix incorrect removal of tuple_nat_node from nat rhashtable · e2194a17
      Paul Blakey authored
      If a non nat tuple entry is inserted just to the regular tuples
      rhashtable (ct_tuples_ht) and not to natted tuples rhashtable
      (ct_nat_tuples_ht). Commit bc562be9 ("net/mlx5e: CT: Save ct entries
      tuples in hashtables") mixed up the return labels and names sot that on
      cleanup or failure we still try to remove for the natted tuples rhashtable.
      
      Fix that by correctly checking if a natted tuples insertion
      before removing it. While here make it more readable.
      
      Fixes: bc562be9 ("net/mlx5e: CT: Save ct entries tuples in hashtables")
      Reviewed-by: default avatarRoi Dayan <roid@nvidia.com>
      Signed-off-by: default avatarPaul Blakey <paulb@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      e2194a17
    • Maxim Mikityanskiy's avatar
      net/mlx5e: Revert parameters on errors when changing MTU and LRO state without reset · 8355060f
      Maxim Mikityanskiy authored
      Sometimes, channel params are changed without recreating the channels.
      It happens in two basic cases: when the channels are closed, and when
      the parameter being changed doesn't affect how channels are configured.
      Such changes invoke a hardware command that might fail. The whole
      operation should be reverted in such cases, but the code that restores
      the parameters' values in the driver was missing. This commit adds this
      handling.
      
      Fixes: 2e20a151 ("net/mlx5e: Fail safe mtu and lro setting")
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      8355060f
    • Maxim Mikityanskiy's avatar
      net/mlx5e: Revert parameters on errors when changing trust state without reset · 912c9b5f
      Maxim Mikityanskiy authored
      Trust state may be changed without recreating the channels. It happens
      when the channels are closed, and when channel parameters (min inline
      mode) stay the same after changing the trust state. Changing the trust
      state is a hardware command that may fail. The current code didn't
      restore the channel parameters to their old values if an error happened
      and the channels were closed. This commit adds handling for this case.
      
      Fixes: 6e0504c6 ("net/mlx5e: Change inline mode correctly when changing trust state")
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      912c9b5f
    • Maxim Mikityanskiy's avatar
      net/mlx5e: Correctly handle changing the number of queues when the interface is down · 57ac4a31
      Maxim Mikityanskiy authored
      This commit addresses two issues related to changing the number of
      queues when the channels are closed:
      
      1. Missing call to mlx5e_num_channels_changed to update
      real_num_tx_queues when the number of TCs is changed.
      
      2. When mlx5e_num_channels_changed returns an error, the channel
      parameters must be reverted.
      
      Two Fixes: tags correspond to the first commits where these two issues
      were introduced.
      
      Fixes: 3909a12e ("net/mlx5e: Fix configuration of XPS cpumasks and netdev queues in corner cases")
      Fixes: fa374877 ("net/mlx5e: Handle errors from netif_set_real_num_{tx,rx}_queues")
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      57ac4a31
    • Paul Blakey's avatar
      net/mlx5e: Fix CT rule + encap slow path offload and deletion · 89e39467
      Paul Blakey authored
      Currently, if a neighbour isn't valid when offloading tunnel encap rules,
      we offload the original match and replace the original action with
      "goto slow path" action. For this we use a temporary flow attribute based
      on the original flow attribute and then change the action. Flow flags,
      which among those is the CT flag, are still shared for the slow path rule
      offload, so we end up parsing this flow as a CT + goto slow path rule.
      
      Besides being unnecessary, CT action offload saves extra information in
      the passed flow attribute, such as created ct_flow and mod_hdr, which
      is lost onces the temporary flow attribute is freed.
      
      When a neigh is updated and is valid, we offload the original CT rule
      with original CT action, which again creates a ct_flow and mod_hdr
      and saves it in the flow's original attribute. Then we delete the slow
      path rule with a temporary flow attribute based on original updated
      flow attribute, and we free the relevant ct_flow and mod_hdr.
      
      Then when tc deletes this flow, we try to free the ct_flow and mod_hdr
      on the flow's attribute again.
      
      To fix the issue, skip all furture proccesing (CT/Sample/Split rules)
      in offload/unoffload of slow path rules.
      
      Call trace:
      [  758.850525] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000218
      [  758.952987] Internal error: Oops: 96000005 [#1] PREEMPT SMP
      [  758.964170] Modules linked in: act_csum(E) act_pedit(E) act_tunnel_key(E) act_ct(E) nf_flow_table(E) xt_nat(E) ip6table_filter(E) ip6table_nat(E) xt_comment(E) ip6_tables(E) xt_conntrack(E) xt_MASQUERADE(E) nf_conntrack_netlink(E) xt_addrtype(E) iptable_filter(E) iptable_nat(E) bpfilter(E) br_netfilter(E) bridge(E) stp(E) llc(E) xfrm_user(E) overlay(E) act_mirred(E) act_skbedit(E) rdma_ucm(OE) rdma_cm(OE) iw_cm(OE) ib_ipoib(OE) ib_cm(OE) ib_umad(OE) esp6_offload(E) esp6(E) esp4_offload(E) esp4(E) xfrm_algo(E) mlx5_ib(OE) ib_uverbs(OE) geneve(E) ip6_udp_tunnel(E) udp_tunnel(E) nfnetlink_cttimeout(E) nfnetlink(E) mlx5_core(OE) act_gact(E) cls_flower(E) sch_ingress(E) openvswitch(E) nsh(E) nf_conncount(E) nf_nat(E) mlxfw(OE) psample(E) nf_conntrack(E) nf_defrag_ipv4(E) vfio_mdev(E) mdev(E) ib_core(OE) mlx_compat(OE) crct10dif_ce(E) uio_pdrv_genirq(E) uio(E) i2c_mlx(E) mlxbf_pmc(E) sbsa_gwdt(E) mlxbf_gige(E) gpio_mlxbf2(E) mlxbf_pka(E) mlx_trio(E) mlx_bootctl(E) bluefield_edac(E) knem(O)
      [  758.964225]  ip_tables(E) mlxbf_tmfifo(E) ipv6(E) crc_ccitt(E) nf_defrag_ipv6(E)
      [  759.154186] CPU: 5 PID: 122 Comm: kworker/u16:1 Tainted: G           OE     5.4.60-mlnx.52.gde81e85 #1
      [  759.172870] Hardware name: https://www.mellanox.com BlueField SoC/BlueField SoC, BIOS BlueField:3.5.0-2-gc1b5d64 Jan  4 2021
      [  759.195466] Workqueue: mlx5e mlx5e_rep_neigh_update [mlx5_core]
      [  759.207344] pstate: a0000005 (NzCv daif -PAN -UAO)
      [  759.217003] pc : mlx5_del_flow_rules+0x5c/0x160 [mlx5_core]
      [  759.228229] lr : mlx5_del_flow_rules+0x34/0x160 [mlx5_core]
      [  759.405858] Call trace:
      [  759.410804]  mlx5_del_flow_rules+0x5c/0x160 [mlx5_core]
      [  759.421337]  __mlx5_eswitch_del_rule.isra.43+0x5c/0x1c8 [mlx5_core]
      [  759.433963]  mlx5_eswitch_del_offloaded_rule_ct+0x34/0x40 [mlx5_core]
      [  759.446942]  mlx5_tc_rule_delete_ct+0x68/0x74 [mlx5_core]
      [  759.457821]  mlx5_tc_ct_delete_flow+0x160/0x21c [mlx5_core]
      [  759.469051]  mlx5e_tc_unoffload_fdb_rules+0x158/0x168 [mlx5_core]
      [  759.481325]  mlx5e_tc_encap_flows_del+0x140/0x26c [mlx5_core]
      [  759.492901]  mlx5e_rep_update_flows+0x11c/0x1ec [mlx5_core]
      [  759.504127]  mlx5e_rep_neigh_update+0x160/0x200 [mlx5_core]
      [  759.515314]  process_one_work+0x178/0x400
      [  759.523350]  worker_thread+0x58/0x3e8
      [  759.530685]  kthread+0x100/0x12c
      [  759.537152]  ret_from_fork+0x10/0x18
      [  759.544320] Code: 97ffef55 51000673 3100067f 54ffff41 (b9421ab3)
      [  759.556548] ---[ end trace fab818bb1085832d ]---
      
      Fixes: 4c3844d9 ("net/mlx5e: CT: Introduce connection tracking")
      Signed-off-by: default avatarPaul Blakey <paulb@nvidia.com>
      Reviewed-by: default avatarRoi Dayan <roid@nvidia.com>
      Reviewed-by: default avatarVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      89e39467
    • Maor Dickman's avatar
      net/mlx5e: Disable hw-tc-offload when MLX5_CLS_ACT config is disabled · 156878d0
      Maor Dickman authored
      The cited commit introduce new CONFIG_MLX5_CLS_ACT kconfig variable
      to control compilation of TC hardware offloads implementation.
      When this configuration is disabled the driver is still wrongly
      reports in ethtool that hw-tc-offload is supported.
      
      Fixed by reporting hw-tc-offload is supported only when
      CONFIG_MLX5_CLS_ACT is enabled.
      
      Fixes: d956873f ("net/mlx5e: Introduce kconfig var for TC support")
      Signed-off-by: default avatarMaor Dickman <maord@nvidia.com>
      Reviewed-by: default avatarVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      156878d0
    • Daniel Jurgens's avatar
      net/mlx5: Maintain separate page trees for ECPF and PF functions · 0aa12847
      Daniel Jurgens authored
      Pages for the host PF and ECPF were stored in the same tree, so the ECPF
      pages were being freed along with the host PF's when the host driver
      unloaded.
      
      Combine the function ID and ECPF flag to use as an index into the
      x-array containing the trees to get a different tree for the host PF and
      ECPF.
      
      Fixes: c6168161 ("net/mlx5: Add support for release all pages event")
      Signed-off-by: default avatarDaniel Jurgens <danielj@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      0aa12847
    • Maxim Mikityanskiy's avatar
      net/mlx5e: Fix IPSEC stats · 45c9a308
      Maxim Mikityanskiy authored
      When IPSEC offload isn't active, the number of stats is not zero, but
      the strings are not filled, leading to exposing stats with empty names.
      Fix this by using the same condition for NUM_STATS and FILL_STRS.
      
      Fixes: 0aab3e1b ("net/mlx5e: IPSec, Expose IPsec HW stat only for supporting HW")
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Reviewed-by: default avatarRaed Salem <raeds@nvidia.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      45c9a308
    • Maor Dickman's avatar
      net/mlx5e: Reduce tc unsupported key print level · 48470a90
      Maor Dickman authored
      "Unsupported key used:" appears in kernel log when flows with
      unsupported key are used, arp fields for example.
      
      OpenVSwitch was changed to match on arp fields by default that
      caused this warning to appear in kernel log for every arp rule, which
      can be a lot.
      
      Fix by lowering print level from warning to debug.
      
      Fixes: e3a2b7ed ("net/mlx5e: Support offload cls_flower with drop action")
      Signed-off-by: default avatarMaor Dickman <maord@nvidia.com>
      Reviewed-by: default avatarRoi Dayan <roid@nvidia.com>
      Reviewed-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      48470a90
    • Pan Bian's avatar
      net/mlx5e: free page before return · 258ed19f
      Pan Bian authored
      Instead of directly return, goto the error handling label to free
      allocated page.
      
      Fixes: 5f29458b ("net/mlx5e: Support dump callback in TX reporter")
      Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
      Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      258ed19f
    • Parav Pandit's avatar
      net/mlx5e: E-switch, Fix rate calculation for overflow · 1fe3e316
      Parav Pandit authored
      rate_bytes_ps is a 64-bit field. It passed as 32-bit field to
      apply_police_params(). Due to this when police rate is higher
      than 4Gbps, 32-bit calculation ignores the carry. This results
      in incorrect rate configurationn the device.
      
      Fix it by performing 64-bit calculation.
      
      Fixes: fcb64c0f ("net/mlx5: E-Switch, add ingress rate support")
      Signed-off-by: default avatarParav Pandit <parav@nvidia.com>
      Reviewed-by: default avatarEli Cohen <elic@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      1fe3e316
    • Roi Dayan's avatar
      net/mlx5: Fix memory leak on flow table creation error flow · 487c6ef8
      Roi Dayan authored
      When we create the ft object we also init rhltable in ft->fgs_hash.
      So in error flow before kfree of ft we need to destroy that rhltable.
      
      Fixes: 693c6883 ("net/mlx5: Add hash table for flow groups in flow table")
      Signed-off-by: default avatarRoi Dayan <roid@nvidia.com>
      Reviewed-by: default avatarMaor Dickman <maord@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      487c6ef8
    • Jakub Kicinski's avatar
      Merge tag 'mac80211-for-net-2021-01-26' of... · c5e9e8d4
      Jakub Kicinski authored
      Merge tag 'mac80211-for-net-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
      
      Johannes Berg says:
      
      ====================
      A couple of fixes:
       * fix 160 MHz channel switch in mac80211
       * fix a staging driver to not deadlock due to some
         recent cfg80211 changes
       * fix NULL-ptr deref if cfg80211 returns -EINPROGRESS
         to wext (syzbot)
       * pause TX in mac80211 in type change to prevent crashes
         (syzbot)
      
      * tag 'mac80211-for-net-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211:
        staging: rtl8723bs: fix wireless regulatory API misuse
        mac80211: pause TX while changing interface type
        wext: fix NULL-ptr-dereference with cfg80211's lack of commit()
        mac80211: 160MHz with extended NSS BW in CSA
      ====================
      
      Link: https://lore.kernel.org/r/20210126130529.75225-1-johannes@sipsolutions.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c5e9e8d4
    • Jakub Kicinski's avatar
      Merge tag 'wireless-drivers-2021-01-26' of... · db22ce68
      Jakub Kicinski authored
      Merge tag 'wireless-drivers-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
      
      Kalle Valo says:
      
      ====================
      wireless-drivers fixes for v5.11
      
      Second set of fixes for v5.11. Like in last time we again have more
      fixes than usual Actually a bit too much for my liking in this state
      of the cycle, but due to unrelated challenges I was only able to
      submit them now.
      
      We have few important crash fixes, iwlwifi modifying read-only data
      being the most reported issue, and also smaller fixes to iwlwifi.
      
      mt76
       * fix a clang warning about enum usage
       * fix rx buffer refcounting crash
      
      mt7601u
       * fix rx buffer refcounting crash
       * fix crash when unbplugging the device
      
      iwlwifi
       * fix a crash where we were modifying read-only firmware data
       * lots of smaller fixes all over the driver
      
      * tag 'wireless-drivers-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers: (24 commits)
        mt7601u: fix kernel crash unplugging the device
        iwlwifi: queue: bail out on invalid freeing
        iwlwifi: mvm: guard against device removal in reprobe
        iwlwifi: Fix IWL_SUBDEVICE_NO_160 macro to use the correct bit.
        iwlwifi: mvm: clear IN_D3 after wowlan status cmd
        iwlwifi: pcie: add rules to match Qu with Hr2
        iwlwifi: mvm: invalidate IDs of internal stations at mvm start
        iwlwifi: mvm: fix the return type for DSM functions 1 and 2
        iwlwifi: pcie: reschedule in long-running memory reads
        iwlwifi: pcie: use jiffies for memory read spin time limit
        iwlwifi: pcie: fix context info memory leak
        iwlwifi: pcie: add a NULL check in iwl_pcie_txq_unmap
        iwlwifi: pcie: set LTR on more devices
        iwlwifi: queue: don't crash if txq->entries is NULL
        iwlwifi: fix the NMI flow for old devices
        iwlwifi: pnvm: don't try to load after failures
        iwlwifi: pnvm: don't skip everything when not reloading
        iwlwifi: pcie: avoid potential PNVM leaks
        iwlwifi: mvm: take mutex for calling iwl_mvm_get_sync_time()
        iwlwifi: mvm: skip power command when unbinding vif during CSA
        ...
      ====================
      
      Link: https://lore.kernel.org/r/20210126092202.6A367C433CA@smtp.codeaurora.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      db22ce68
    • Eric Dumazet's avatar
      iwlwifi: provide gso_type to GSO packets · 81a86e1b
      Eric Dumazet authored
      net/core/tso.c got recent support for USO, and this broke iwlfifi
      because the driver implemented a limited form of GSO.
      
      Providing ->gso_type allows for skb_is_gso_tcp() to provide
      a correct result.
      
      Fixes: 3d5b459b ("net: tso: add UDP segmentation support")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarBen Greear <greearb@candelatech.com>
      Tested-by: default avatarBen Greear <greearb@candelatech.com>
      Cc: Luca Coelho <luciano.coelho@intel.com>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=209913
      Link: https://lore.kernel.org/r/20210125150949.619309-1-eric.dumazet@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      81a86e1b
    • Corinna Vinschen's avatar
      igc: fix link speed advertising · 329a3678
      Corinna Vinschen authored
      Link speed advertising in igc has two problems:
      
      - When setting the advertisement via ethtool, the link speed is converted
        to the legacy 32 bit representation for the intel PHY code.
        This inadvertently drops ETHTOOL_LINK_MODE_2500baseT_Full_BIT (being
        beyond bit 31).  As a result, any call to `ethtool -s ...' drops the
        2500Mbit/s link speed from the PHY settings.  Only reloading the driver
        alleviates that problem.
      
        Fix this by converting the ETHTOOL_LINK_MODE_2500baseT_Full_BIT to the
        Intel PHY ADVERTISE_2500_FULL bit explicitly.
      
      - Rather than checking the actual PHY setting, the .get_link_ksettings
        function always fills link_modes.advertising with all link speeds
        the device is capable of.
      
        Fix this by checking the PHY autoneg_advertised settings and report
        only the actually advertised speeds up to ethtool.
      
      Fixes: 8c5ad0da ("igc: Add ethtool support")
      Signed-off-by: default avatarCorinna Vinschen <vinschen@redhat.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      329a3678
    • Stefan Assmann's avatar
      i40e: acquire VSI pointer only after VF is initialized · 67a3c6b3
      Stefan Assmann authored
      This change simplifies the VF initialization check and also minimizes
      the delay between acquiring the VSI pointer and using it. As known by
      the commit being fixed, there is a risk of the VSI pointer getting
      changed. Therefore minimize the delay between getting and using the
      pointer.
      
      Fixes: 9889707b ("i40e: Fix crash caused by stress setting of VF MAC addresses")
      Signed-off-by: default avatarStefan Assmann <sassmann@kpanic.de>
      Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      67a3c6b3
    • Brett Creeley's avatar
      ice: Fix MSI-X vector fallback logic · f3fe97f6
      Brett Creeley authored
      The current MSI-X enablement logic tries to enable best-case MSI-X
      vectors and if that fails we only support a bare-minimum set. This
      includes a single MSI-X for 1 Tx and 1 Rx queue and a single MSI-X
      for the OICR interrupt. Unfortunately, the driver fails to load when we
      don't get as many MSI-X as requested for a couple reasons.
      
      First, the code to allocate MSI-X in the driver tries to allocate
      num_online_cpus() MSI-X for LAN traffic without caring about the number
      of MSI-X actually enabled/requested from the kernel for LAN traffic.
      So, when calling ice_get_res() for the PF VSI, it returns failure
      because the number of available vectors is less than requested. Fix
      this by not allowing the PF VSI to allocation  more than
      pf->num_lan_msix MSI-X vectors and pf->num_lan_msix Rx/Tx queues.
      Limiting the number of queues is done because we don't want more than
      1 Tx/Rx queue per interrupt due to performance conerns.
      
      Second, the driver assigns pf->num_lan_msix = 2, to account for LAN
      traffic and the OICR. However, pf->num_lan_msix is only meant for LAN
      MSI-X. This is causing a failure when the PF VSI tries to
      allocate/reserve the minimum pf->num_lan_msix because the OICR MSI-X has
      already been reserved, so there may not be enough MSI-X vectors left.
      Fix this by setting pf->num_lan_msix = 1 for the failure case. Then the
      ICE_MIN_MSIX accounts for the LAN MSI-X and the OICR MSI-X needed for
      the failure case.
      
      Update the related defines used in ice_ena_msix_range() to align with
      the above behavior and remove the unused RDMA defines because RDMA is
      currently not supported. Also, remove the now incorrect comment.
      
      Fixes: 152b978a ("ice: Rework ice_ena_msix_range")
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      f3fe97f6
    • Brett Creeley's avatar
      ice: Don't allow more channels than LAN MSI-X available · 943b881e
      Brett Creeley authored
      Currently users could create more channels than LAN MSI-X available.
      This is happening because there is no check against pf->num_lan_msix
      when checking the max allowed channels and will cause performance issues
      if multiple Tx and Rx queues are tied to a single MSI-X. Fix this by not
      allowing more channels than LAN MSI-X available in pf->num_lan_msix.
      
      Fixes: 87324e74 ("ice: Implement ethtool ops for channels")
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      943b881e
    • Nick Nunley's avatar
      ice: update dev_addr in ice_set_mac_address even if HW filter exists · 13ed5e8a
      Nick Nunley authored
      Fix the driver to copy the MAC address configured in ndo_set_mac_address
      into dev_addr, even if the MAC filter already exists in HW. In some
      situations (e.g. bonding) the netdev's dev_addr could have been modified
      outside of the driver, with no change to the HW filter, so the driver
      cannot assume that they match.
      
      Fixes: 757976ab ("ice: Fix check for removing/adding mac filters")
      Signed-off-by: default avatarNick Nunley <nicholas.d.nunley@intel.com>
      Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      13ed5e8a
    • Nick Nunley's avatar
      ice: Implement flow for IPv6 next header (extension header) · 1b0b0b58
      Nick Nunley authored
      This patch is based on a similar change to i40e by Slawomir Laba:
      "i40e: Implement flow for IPv6 next header (extension header)".
      
      When a packet contains an IPv6 header with next header which is
      an extension header and not a protocol one, the kernel function
      skb_transport_header called with such sk_buff will return a
      pointer to the extension header and not to the TCP one.
      
      The above explained call caused a problem with packet processing
      for skb with encapsulation for tunnel with ICE_TX_CTX_EIPT_IPV6.
      The extension header was not skipped at all.
      
      The ipv6_skip_exthdr function does check if next header of the IPV6
      header is an extension header and doesn't modify the l4_proto pointer
      if it points to a protocol header value so its safe to omit the
      comparison of exthdr and l4.hdr pointers. The ipv6_skip_exthdr can
      return value -1. This means that the skipping process failed
      and there is something wrong with the packet so it will be dropped.
      
      Fixes: a4e82a81 ("ice: Add support for tunnel offloads")
      Signed-off-by: default avatarNick Nunley <nicholas.d.nunley@intel.com>
      Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      1b0b0b58
    • Henry Tieman's avatar
      ice: fix FDir IPv6 flexbyte · 29e2d9eb
      Henry Tieman authored
      The packet classifier would occasionally misrecognize an IPv6 training
      packet when the next protocol field was 0. The correct value for
      unspecified protocol is IPPROTO_NONE.
      
      Fixes: 165d80d6 ("ice: Support IPv6 Flow Director filters")
      Signed-off-by: default avatarHenry Tieman <henry.w.tieman@intel.com>
      Reviewed-by: default avatarPaul Menzel <pmenzel@molgen.mpg.de>
      Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      29e2d9eb