1. 04 Feb, 2021 1 commit
    • Sven Auhagen's avatar
      netfilter: flowtable: fix tcp and udp header checksum update · 8d6bca15
      Sven Auhagen authored
      When updating the tcp or udp header checksum on port nat the function
      inet_proto_csum_replace2 with the last parameter pseudohdr as true.
      This leads to an error in the case that GRO is used and packets are
      split up in GSO. The tcp or udp checksum of all packets is incorrect.
      
      The error is probably masked due to the fact the most network driver
      implement tcp/udp checksum offloading. It also only happens when GRO is
      applied and not on single packets.
      
      The error is most visible when using a pppoe connection which is not
      triggering the tcp/udp checksum offload.
      
      Fixes: ac2a6666 ("netfilter: add generic flow table infrastructure")
      Signed-off-by: default avatarSven Auhagen <sven.auhagen@voleatech.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      8d6bca15
  2. 03 Feb, 2021 3 commits
  3. 28 Jan, 2021 8 commits
  4. 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
  5. 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