1. 21 Jun, 2024 4 commits
  2. 20 Jun, 2024 33 commits
  3. 19 Jun, 2024 3 commits
    • Matthias Schiffer's avatar
      net: dsa: mt7530: add support for bridge port isolation · 3d49ee21
      Matthias Schiffer authored
      Remove a pair of ports from the port matrix when both ports have the
      isolated flag set.
      Signed-off-by: default avatarMatthias Schiffer <mschiffer@universe-factory.net>
      Reviewed-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
      Reviewed-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Tested-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d49ee21
    • Matthias Schiffer's avatar
      net: dsa: mt7530: factor out bridge join/leave logic · c25c961f
      Matthias Schiffer authored
      As preparation for implementing bridge port isolation, move the logic to
      add and remove bits in the port matrix into a new helper
      mt7530_update_port_member(), which is called from
      mt7530_port_bridge_join() and mt7530_port_bridge_leave().
      
      Another part of the preparation is using dsa_port_offloads_bridge_dev()
      instead of dsa_port_offloads_bridge() to check for bridge membership, as
      we don't have a struct dsa_bridge in mt7530_port_bridge_flags().
      
      The port matrix setting is slightly streamlined, now always first setting
      the mt7530_port's pm field and then writing the port matrix from that
      field into the hardware register, instead of duplicating the bit
      manipulation for both the struct field and the register.
      
      mt7530_port_bridge_join() was previously using |= to update the port
      matrix with the port bitmap, which was unnecessary, as pm would only
      have the CPU port set before joining a bridge; a simple assignment can
      be used for both joining and leaving (and will also work when individual
      bits are added/removed in port_bitmap with regard to the previous port
      matrix, which is what happens with port isolation).
      
      No functional change intended.
      Signed-off-by: default avatarMatthias Schiffer <mschiffer@universe-factory.net>
      Reviewed-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
      Reviewed-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Tested-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c25c961f
    • David S. Miller's avatar
      Merge branch 'net-drop-rx-socket-tracepoint' · 65e4efa0
      David S. Miller authored
      Yan Zhai says:
      
      ====================
      net: pass receive socket to drop tracepoint
      
      We set up our production packet drop monitoring around the kfree_skb
      tracepoint. While this tracepoint is extremely valuable for diagnosing
      critical problems, it also has some limitation with drops on the local
      receive path: this tracepoint can only inspect the dropped skb itself,
      but such skb might not carry enough information to:
      
      1. determine in which netns/container this skb gets dropped
      2. determine by which socket/service this skb oughts to be received
      
      The 1st issue is because skb->dev is the only member field with valid
      netns reference. But skb->dev can get cleared or reused. For example,
      tcp_v4_rcv will clear skb->dev and in later processing it might be reused
      for OFO tree.
      
      The 2nd issue is because there is no reference on an skb that reliably
      points to a receiving socket. skb->sk usually points to the local
      sending socket, and it only points to a receive socket briefly after
      early demux stage, yet the socket can get stolen later. For certain drop
      reason like TCP OFO_MERGE, Zerowindow, UDP at PROTO_MEM error, etc, it
      is hard to infer which receiving socket is impacted. This cannot be
      overcome by simply looking at the packet header, because of
      complications like sk lookup programs. In the past, single purpose
      tracepoints like trace_udp_fail_queue_rcv_skb, trace_sock_rcvqueue_full,
      etc are added as needed to provide more visibility. This could be
      handled in a more generic way.
      
      In this change set we propose a new 'sk_skb_reason_drop' call as a drop-in
      replacement for kfree_skb_reason at various local input path. It accepts
      an extra receiving socket argument. Both issues above can be resolved
      via this new argument.
      
      V4->V5: rename rx_skaddr to rx_sk to be more clear visually, suggested
      by Jesper Dangaard Brouer.
      
      V3->V4: adjusted the TP_STRUCT field order to align better, suggested by
      Steven Rostedt.
      
      V2->V3: fixed drop_monitor function signatures; fixed a few uninitialized sks;
      Added a few missing report tags from test bots (also noticed by Dan
      Carpenter and Simon Horman).
      
      V1->V2: instead of using skb->cb, directly add the needed argument to
      trace_kfree_skb tracepoint. Also renamed functions as Eric Dumazet
      suggested.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      65e4efa0