1. 13 Feb, 2023 4 commits
  2. 11 Feb, 2023 8 commits
  3. 10 Feb, 2023 10 commits
  4. 09 Feb, 2023 10 commits
    • Linus Torvalds's avatar
      Merge tag 'net-6.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 35674e78
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from can and ipsec subtrees.
      
        Current release - regressions:
      
         - sched: fix off by one in htb_activate_prios()
      
         - eth: mana: fix accessing freed irq affinity_hint
      
         - eth: ice: fix out-of-bounds KASAN warning in virtchnl
      
        Current release - new code bugs:
      
         - eth: mtk_eth_soc: enable special tag when any MAC uses DSA
      
        Previous releases - always broken:
      
         - core: fix sk->sk_txrehash default
      
         - neigh: make sure used and confirmed times are valid
      
         - mptcp: be careful on subflow status propagation on errors
      
         - xfrm: prevent potential spectre v1 gadget in xfrm_xlate32_attr()
      
         - phylink: move phy_device_free() to correctly release phy device
      
         - eth: mlx5:
            - fix crash unsetting rx-vlan-filter in switchdev mode
            - fix hang on firmware reset
            - serialize module cleanup with reload and remove"
      
      * tag 'net-6.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (57 commits)
        selftests: forwarding: lib: quote the sysctl values
        net: mscc: ocelot: fix all IPv6 getting trapped to CPU when PTP timestamping is used
        rds: rds_rm_zerocopy_callback() use list_first_entry()
        net: txgbe: Update support email address
        selftests: Fix failing VXLAN VNI filtering test
        selftests: mptcp: stop tests earlier
        selftests: mptcp: allow more slack for slow test-case
        mptcp: be careful on subflow status propagation on errors
        mptcp: fix locking for in-kernel listener creation
        mptcp: fix locking for setsockopt corner-case
        mptcp: do not wait for bare sockets' timeout
        net: ethernet: mtk_eth_soc: fix DSA TX tag hwaccel for switch port 0
        nfp: ethtool: fix the bug of setting unsupported port speed
        txhash: fix sk->sk_txrehash default
        net: ethernet: mtk_eth_soc: fix wrong parameters order in __xdp_rxq_info_reg()
        net: ethernet: mtk_eth_soc: enable special tag when any MAC uses DSA
        net: sched: sch: Fix off by one in htb_activate_prios()
        igc: Add ndo_tx_timeout support
        net: mana: Fix accessing freed irq affinity_hint
        hv_netvsc: Allocate memory in netvsc_dma_map() with GFP_ATOMIC
        ...
      35674e78
    • Linus Torvalds's avatar
      Merge tag 'for-linus-2023020901' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · 0b028189
      Linus Torvalds authored
      Pull HID fixes from Benjamin Tissoires:
      
       - fix potential infinite loop with a badly crafted HID device (Xin
         Zhao)
      
       - fix regression from 6.1 in USB logitech devices potentially making
         their mouse wheel not working (Bastien Nocera)
      
       - clean up in AMD sensors, which fixes a long time resume bug (Mario
         Limonciello)
      
       - few device small fixes and quirks
      
      * tag 'for-linus-2023020901' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
        HID: Ignore battery for ELAN touchscreen 29DF on HP
        HID: amd_sfh: if no sensors are enabled, clean up
        HID: logitech: Disable hi-res scrolling on USB
        HID: core: Fix deadloop in hid_apply_multiplier.
        HID: Ignore battery for Elan touchscreen on Asus TP420IA
        HID: elecom: add support for TrackBall 056E:011C
      0b028189
    • Linus Torvalds's avatar
      Merge tag '6.2-rc8-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6 · 94a1f56d
      Linus Torvalds authored
      Pull cifx fix from Steve French:
       "Small fix for use after free"
      
      * tag '6.2-rc8-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: Fix use-after-free in rdata->read_into_pages()
      94a1f56d
    • Hangbin Liu's avatar
      selftests: forwarding: lib: quote the sysctl values · 3a082086
      Hangbin Liu authored
      When set/restore sysctl value, we should quote the value as some keys
      may have multi values, e.g. net.ipv4.ping_group_range
      
      Fixes: f5ae5778 ("selftests: forwarding: lib: Add sysctl_set(), sysctl_restore()")
      Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
      Link: https://lore.kernel.org/r/20230208032110.879205-1-liuhangbin@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      3a082086
    • Vladimir Oltean's avatar
      net: mscc: ocelot: fix all IPv6 getting trapped to CPU when PTP timestamping is used · 2fcde9fe
      Vladimir Oltean authored
      While running this selftest which usually passes:
      
      ~/selftests/drivers/net/dsa# ./local_termination.sh eno0 swp0
      TEST: swp0: Unicast IPv4 to primary MAC address                     [ OK ]
      TEST: swp0: Unicast IPv4 to macvlan MAC address                     [ OK ]
      TEST: swp0: Unicast IPv4 to unknown MAC address                     [ OK ]
      TEST: swp0: Unicast IPv4 to unknown MAC address, promisc            [ OK ]
      TEST: swp0: Unicast IPv4 to unknown MAC address, allmulti           [ OK ]
      TEST: swp0: Multicast IPv4 to joined group                          [ OK ]
      TEST: swp0: Multicast IPv4 to unknown group                         [ OK ]
      TEST: swp0: Multicast IPv4 to unknown group, promisc                [ OK ]
      TEST: swp0: Multicast IPv4 to unknown group, allmulti               [ OK ]
      TEST: swp0: Multicast IPv6 to joined group                          [ OK ]
      TEST: swp0: Multicast IPv6 to unknown group                         [ OK ]
      TEST: swp0: Multicast IPv6 to unknown group, promisc                [ OK ]
      TEST: swp0: Multicast IPv6 to unknown group, allmulti               [ OK ]
      
      if I start PTP timestamping then run it again (debug prints added by me),
      the unknown IPv6 MC traffic is seen by the CPU port even when it should
      have been dropped:
      
      ~/selftests/drivers/net/dsa# ptp4l -i swp0 -2 -P -m
      ptp4l[225.410]: selected /dev/ptp1 as PTP clock
      [  225.445746] mscc_felix 0000:00:00.5: ocelot_l2_ptp_trap_add: port 0 adding L2 PTP trap
      [  225.453815] mscc_felix 0000:00:00.5: ocelot_ipv4_ptp_trap_add: port 0 adding IPv4 PTP event trap
      [  225.462703] mscc_felix 0000:00:00.5: ocelot_ipv4_ptp_trap_add: port 0 adding IPv4 PTP general trap
      [  225.471768] mscc_felix 0000:00:00.5: ocelot_ipv6_ptp_trap_add: port 0 adding IPv6 PTP event trap
      [  225.480651] mscc_felix 0000:00:00.5: ocelot_ipv6_ptp_trap_add: port 0 adding IPv6 PTP general trap
      ptp4l[225.488]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
      ptp4l[225.488]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
      ^C
      ~/selftests/drivers/net/dsa# ./local_termination.sh eno0 swp0
      TEST: swp0: Unicast IPv4 to primary MAC address                     [ OK ]
      TEST: swp0: Unicast IPv4 to macvlan MAC address                     [ OK ]
      TEST: swp0: Unicast IPv4 to unknown MAC address                     [ OK ]
      TEST: swp0: Unicast IPv4 to unknown MAC address, promisc            [ OK ]
      TEST: swp0: Unicast IPv4 to unknown MAC address, allmulti           [ OK ]
      TEST: swp0: Multicast IPv4 to joined group                          [ OK ]
      TEST: swp0: Multicast IPv4 to unknown group                         [ OK ]
      TEST: swp0: Multicast IPv4 to unknown group, promisc                [ OK ]
      TEST: swp0: Multicast IPv4 to unknown group, allmulti               [ OK ]
      TEST: swp0: Multicast IPv6 to joined group                          [ OK ]
      TEST: swp0: Multicast IPv6 to unknown group                         [FAIL]
              reception succeeded, but should have failed
      TEST: swp0: Multicast IPv6 to unknown group, promisc                [ OK ]
      TEST: swp0: Multicast IPv6 to unknown group, allmulti               [ OK ]
      
      The PGID_MCIPV6 is configured correctly to not flood to the CPU,
      I checked that.
      
      Furthermore, when I disable back PTP RX timestamping (ptp4l doesn't do
      that when it exists), packets are RX filtered again as they should be:
      
      ~/selftests/drivers/net/dsa# hwstamp_ctl -i swp0 -r 0
      [  218.202854] mscc_felix 0000:00:00.5: ocelot_l2_ptp_trap_del: port 0 removing L2 PTP trap
      [  218.212656] mscc_felix 0000:00:00.5: ocelot_ipv4_ptp_trap_del: port 0 removing IPv4 PTP event trap
      [  218.222975] mscc_felix 0000:00:00.5: ocelot_ipv4_ptp_trap_del: port 0 removing IPv4 PTP general trap
      [  218.233133] mscc_felix 0000:00:00.5: ocelot_ipv6_ptp_trap_del: port 0 removing IPv6 PTP event trap
      [  218.242251] mscc_felix 0000:00:00.5: ocelot_ipv6_ptp_trap_del: port 0 removing IPv6 PTP general trap
      current settings:
      tx_type 1
      rx_filter 12
      new settings:
      tx_type 1
      rx_filter 0
      ~/selftests/drivers/net/dsa# ./local_termination.sh eno0 swp0
      TEST: swp0: Unicast IPv4 to primary MAC address                     [ OK ]
      TEST: swp0: Unicast IPv4 to macvlan MAC address                     [ OK ]
      TEST: swp0: Unicast IPv4 to unknown MAC address                     [ OK ]
      TEST: swp0: Unicast IPv4 to unknown MAC address, promisc            [ OK ]
      TEST: swp0: Unicast IPv4 to unknown MAC address, allmulti           [ OK ]
      TEST: swp0: Multicast IPv4 to joined group                          [ OK ]
      TEST: swp0: Multicast IPv4 to unknown group                         [ OK ]
      TEST: swp0: Multicast IPv4 to unknown group, promisc                [ OK ]
      TEST: swp0: Multicast IPv4 to unknown group, allmulti               [ OK ]
      TEST: swp0: Multicast IPv6 to joined group                          [ OK ]
      TEST: swp0: Multicast IPv6 to unknown group                         [ OK ]
      TEST: swp0: Multicast IPv6 to unknown group, promisc                [ OK ]
      TEST: swp0: Multicast IPv6 to unknown group, allmulti               [ OK ]
      
      So it's clear that something in the PTP RX trapping logic went wrong.
      
      Looking a bit at the code, I can see that there are 4 typos, which
      populate "ipv4" VCAP IS2 key filter fields for IPv6 keys.
      
      VCAP IS2 keys of type OCELOT_VCAP_KEY_IPV4 and OCELOT_VCAP_KEY_IPV6 are
      handled by is2_entry_set(). OCELOT_VCAP_KEY_IPV4 looks at
      &filter->key.ipv4, and OCELOT_VCAP_KEY_IPV6 at &filter->key.ipv6.
      Simply put, when we populate the wrong key field, &filter->key.ipv6
      fields "proto.mask" and "proto.value" remain all zeroes (or "don't care").
      So is2_entry_set() will enter the "else" of this "if" condition:
      
      	if (msk == 0xff && (val == IPPROTO_TCP || val == IPPROTO_UDP))
      
      and proceed to ignore the "proto" field. The resulting rule will match
      on all IPv6 traffic, trapping it to the CPU.
      
      This is the reason why the local_termination.sh selftest sees it,
      because control traps are stronger than the PGID_MCIPV6 used for
      flooding (from the forwarding data path).
      
      But the problem is in fact much deeper. We trap all IPv6 traffic to the
      CPU, but if we're bridged, we set skb->offload_fwd_mark = 1, so software
      forwarding will not take place and IPv6 traffic will never reach its
      destination.
      
      The fix is simple - correct the typos.
      
      I was intentionally inaccurate in the commit message about the breakage
      occurring when any PTP timestamping is enabled. In fact it only happens
      when L4 timestamping is requested (HWTSTAMP_FILTER_PTP_V2_EVENT or
      HWTSTAMP_FILTER_PTP_V2_L4_EVENT). But ptp4l requests a larger RX
      timestamping filter than it needs for "-2": HWTSTAMP_FILTER_PTP_V2_EVENT.
      I wanted people skimming through git logs to not think that the bug
      doesn't affect them because they only use ptp4l in L2 mode.
      
      Fixes: 96ca08c0 ("net: mscc: ocelot: set up traps for PTP packets")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Link: https://lore.kernel.org/r/20230207183117.1745754-1-vladimir.oltean@nxp.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      2fcde9fe
    • Pietro Borrello's avatar
      rds: rds_rm_zerocopy_callback() use list_first_entry() · f753a689
      Pietro Borrello authored
      rds_rm_zerocopy_callback() uses list_entry() on the head of a list
      causing a type confusion.
      Use list_first_entry() to actually access the first element of the
      rs_zcookie_queue list.
      
      Fixes: 9426bbc6 ("rds: use list structure to track information for zerocopy completion notification")
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarPietro Borrello <borrello@diag.uniroma1.it>
      Link: https://lore.kernel.org/r/20230202-rds-zerocopy-v3-1-83b0df974f9a@diag.uniroma1.itSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      f753a689
    • Jakub Kicinski's avatar
      Merge tag 'ipsec-2023-02-08' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec · 646be03e
      Jakub Kicinski authored
      Steffen Klassert says:
      
      ====================
      ipsec 2023-02-08
      
      1) Fix policy checks for nested IPsec tunnels when using
         xfrm interfaces. From Benedict Wong.
      
      2) Fix netlink message expression on 32=>64-bit
         messages translators. From Anastasia Belova.
      
      3) Prevent potential spectre v1 gadget in xfrm_xlate32_attr.
         From Eric Dumazet.
      
      4) Always consistently use time64_t in xfrm_timer_handler.
         From Eric Dumazet.
      
      5) Fix KCSAN reported bug: Multiple cpus can update use_time
         at the same time. From Eric Dumazet.
      
      6) Fix SCP copy from IPv4 to IPv6 on interfamily tunnel.
         From Christian Hopps.
      
      * tag 'ipsec-2023-02-08' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec:
        xfrm: fix bug with DSCP copy to v6 from v4 tunnel
        xfrm: annotate data-race around use_time
        xfrm: consistently use time64_t in xfrm_timer_handler()
        xfrm/compat: prevent potential spectre v1 gadget in xfrm_xlate32_attr()
        xfrm: compat: change expression for switch in xfrm_xlate64
        Fix XFRM-I support for nested ESP tunnels
      ====================
      
      Link: https://lore.kernel.org/r/20230208114322.266510-1-steffen.klassert@secunet.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      646be03e
    • Jiawen Wu's avatar
      net: txgbe: Update support email address · 363d7c22
      Jiawen Wu authored
      Update new email address for Wangxun 10Gb NIC support team.
      Signed-off-by: default avatarJiawen Wu <jiawenwu@trustnetic.com>
      Link: https://lore.kernel.org/r/20230208023035.3371250-1-jiawenwu@trustnetic.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      363d7c22
    • Jakub Kicinski's avatar
      Merge tag 'mlx5-fixes-2023-02-07' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · ff8ced4e
      Jakub Kicinski authored
      Saeed Mahameed says:
      
      ====================
      mlx5 fixes 2023-02-07
      
      This series provides bug fixes to mlx5 driver.
      
      * tag 'mlx5-fixes-2023-02-07' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux:
        net/mlx5: Serialize module cleanup with reload and remove
        net/mlx5: fw_tracer, Zero consumer index when reloading the tracer
        net/mlx5: fw_tracer, Clear load bit when freeing string DBs buffers
        net/mlx5: Expose SF firmware pages counter
        net/mlx5: Store page counters in a single array
        net/mlx5e: IPoIB, Show unknown speed instead of error
        net/mlx5e: Fix crash unsetting rx-vlan-filter in switchdev mode
        net/mlx5: Bridge, fix ageing of peer FDB entries
        net/mlx5: DR, Fix potential race in dr_rule_create_rule_nic
        net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change
      ====================
      
      Link: https://lore.kernel.org/r/20230208030302.95378-1-saeed@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ff8ced4e
    • Ido Schimmel's avatar
      selftests: Fix failing VXLAN VNI filtering test · b963d9d5
      Ido Schimmel authored
      iproute2 does not recognize the "group6" and "remote6" keywords. Fix by
      using "group" and "remote" instead.
      
      Before:
      
       # ./test_vxlan_vnifiltering.sh
       [...]
       Tests passed:  25
       Tests failed:   2
      
      After:
      
       # ./test_vxlan_vnifiltering.sh
       [...]
       Tests passed:  27
       Tests failed:   0
      
      Fixes: 3edf5f66 ("selftests: add new tests for vxlan vnifiltering")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarAlexander Duyck <alexanderduyck@fb.com>
      Link: https://lore.kernel.org/r/20230207141819.256689-1-idosch@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b963d9d5
  5. 08 Feb, 2023 8 commits
    • David S. Miller's avatar
      Merge branch 'mptcp-fixes' · 965bffd2
      David S. Miller authored
      Matthieu Baerts says:
      
      ====================
      mptcp: fixes for v6.2
      
      Patch 1 clears resources earlier if there is no more reasons to keep
      MPTCP sockets alive.
      
      Patches 2 and 3 fix some locking issues visible in some rare corner
      cases: the linked issues should be quite hard to reproduce.
      
      Patch 4 makes sure subflows are correctly cleaned after the end of a
      connection.
      
      Patch 5 and 6 improve the selftests stability when running in a slow
      environment by transfering data for a longer period on one hand and by
      stopping the tests when all expected events have been observed on the
      other hand.
      
      All these patches fix issues introduced before v6.2.
      ====================
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      965bffd2
    • Matthieu Baerts's avatar
      selftests: mptcp: stop tests earlier · 070d6daf
      Matthieu Baerts authored
      These 'endpoint' tests from 'mptcp_join.sh' selftest start a transfer in
      the background and check the status during this transfer.
      
      Once the expected events have been recorded, there is no reason to wait
      for the data transfer to finish. It can be stopped earlier to reduce the
      execution time by more than half.
      
      For these tests, the exchanged data were not verified. Errors, if any,
      were ignored but that's fine, plenty of other tests are looking at that.
      It is then OK to mute stderr now that we are sure errors will be printed
      (and still ignored) because the transfer is stopped before the end.
      
      Fixes: e274f715 ("selftests: mptcp: add subflow limits test-cases")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      070d6daf
    • Paolo Abeni's avatar
      selftests: mptcp: allow more slack for slow test-case · a635a8c3
      Paolo Abeni authored
      A test-case is frequently failing on some extremely slow VMs.
      The mptcp transfer completes before the script is able to do
      all the required PM manipulation.
      
      Address the issue in the simplest possible way, making the
      transfer even more slow.
      
      Additionally dump more info in case of failures, to help debugging
      similar problems in the future and init dump_stats var.
      
      Fixes: e274f715 ("selftests: mptcp: add subflow limits test-cases")
      Cc: stable@vger.kernel.org
      Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/323Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a635a8c3
    • Paolo Abeni's avatar
      mptcp: be careful on subflow status propagation on errors · 1249db44
      Paolo Abeni authored
      Currently the subflow error report callback unconditionally
      propagates the fallback subflow status to the owning msk.
      
      If the msk is already orphaned, the above prevents the code
      from correctly tracking the msk moving to the TCP_CLOSE state
      and doing the appropriate cleanup.
      
      All the above causes increasing memory usage over time and
      sporadic self-tests failures.
      
      There is a great deal of infrastructure trying to propagate
      correctly the fallback subflow status to the owning mptcp socket,
      e.g. via mptcp_subflow_eof() and subflow_sched_work_if_closed():
      in the error propagation path we need only to cope with unorphaned
      sockets.
      
      Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/339
      Fixes: 15cc1045 ("mptcp: deliver ssk errors to msk")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1249db44
    • Paolo Abeni's avatar
      mptcp: fix locking for in-kernel listener creation · ad217100
      Paolo Abeni authored
      For consistency, in mptcp_pm_nl_create_listen_socket(), we need to
      call the __mptcp_nmpc_socket() under the msk socket lock.
      
      Note that as a side effect, mptcp_subflow_create_socket() needs a
      'nested' lockdep annotation, as it will acquire the subflow (kernel)
      socket lock under the in-kernel listener msk socket lock.
      
      The current lack of locking is almost harmless, because the relevant
      socket is not exposed to the user space, but in future we will add
      more complexity to the mentioned helper, let's play safe.
      
      Fixes: 1729cf18 ("mptcp: create the listening socket for new port")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ad217100
    • Paolo Abeni's avatar
      mptcp: fix locking for setsockopt corner-case · 21e43569
      Paolo Abeni authored
      We need to call the __mptcp_nmpc_socket(), and later subflow socket
      access under the msk socket lock, or e.g. a racing connect() could
      change the socket status under the hood, with unexpected results.
      
      Fixes: 54635bd0 ("mptcp: add TCP_FASTOPEN_CONNECT socket option")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      21e43569
    • Paolo Abeni's avatar
      mptcp: do not wait for bare sockets' timeout · d4e85922
      Paolo Abeni authored
      If the peer closes all the existing subflows for a given
      mptcp socket and later the application closes it, the current
      implementation let it survive until the timewait timeout expires.
      
      While the above is allowed by the protocol specification it
      consumes resources for almost no reason and additionally
      causes sporadic self-tests failures.
      
      Let's move the mptcp socket to the TCP_CLOSE state when there are
      no alive subflows at close time, so that the allocated resources
      will be freed immediately.
      
      Fixes: e16163b6 ("mptcp: refactor shutdown and close")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d4e85922
    • Vladimir Oltean's avatar
      net: ethernet: mtk_eth_soc: fix DSA TX tag hwaccel for switch port 0 · 1a3245fe
      Vladimir Oltean authored
      Arınç reports that on his MT7621AT Unielec U7621-06 board and MT7623NI
      Bananapi BPI-R2, packets received by the CPU over mt7530 switch port 0
      (of which this driver acts as the DSA master) are not processed
      correctly by software. More precisely, they arrive without a DSA tag
      (in packet or in the hwaccel area - skb_metadata_dst()), so DSA cannot
      demux them towards the switch's interface for port 0. Traffic from other
      ports receives a skb_metadata_dst() with the correct port and is demuxed
      properly.
      
      Looking at mtk_poll_rx(), it becomes apparent that this driver uses the
      skb vlan hwaccel area:
      
      	union {
      		u32		vlan_all;
      		struct {
      			__be16	vlan_proto;
      			__u16	vlan_tci;
      		};
      	};
      
      as a temporary storage for the VLAN hwaccel tag, or the DSA hwaccel tag.
      If this is a DSA master it's a DSA hwaccel tag, and finally clears up
      the skb VLAN hwaccel header.
      
      I'm guessing that the problem is the (mis)use of API.
      skb_vlan_tag_present() looks like this:
      
       #define skb_vlan_tag_present(__skb)	(!!(__skb)->vlan_all)
      
      So if both vlan_proto and vlan_tci are zeroes, skb_vlan_tag_present()
      returns precisely false. I don't know for sure what is the format of the
      DSA hwaccel tag, but I surely know that lowermost 3 bits of vlan_proto
      are 0 when receiving from port 0:
      
      	unsigned int port = vlan_proto & GENMASK(2, 0);
      
      If the RX descriptor has no other bits set to non-zero values in
      RX_DMA_VTAG, then the call to __vlan_hwaccel_put_tag() will not, in
      fact, make the subsequent skb_vlan_tag_present() return true, because
      it's implemented like this:
      
      static inline void __vlan_hwaccel_put_tag(struct sk_buff *skb,
      					  __be16 vlan_proto, u16 vlan_tci)
      {
      	skb->vlan_proto = vlan_proto;
      	skb->vlan_tci = vlan_tci;
      }
      
      What we need to do to fix this problem (assuming this is the problem) is
      to stop using skb->vlan_all as temporary storage for driver affairs, and
      just create some local variables that serve the same purpose, but
      hopefully better. Instead of calling skb_vlan_tag_present(), let's look
      at a boolean has_hwaccel_tag which we set to true when the RX DMA
      descriptors have something. Disambiguate based on netdev_uses_dsa()
      whether this is a VLAN or DSA hwaccel tag, and only call
      __vlan_hwaccel_put_tag() if we're certain it's a VLAN tag.
      
      Arınç confirms that the treatment works, so this validates the
      assumption.
      
      Link: https://lore.kernel.org/netdev/704f3a72-fc9e-714a-db54-272e17612637@arinc9.com/
      Fixes: 2d7605a7 ("net: ethernet: mtk_eth_soc: enable hardware DSA untagging")
      Reported-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Tested-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarFelix Fietkau <nbd@nbd.name>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1a3245fe