Skip to content
  1. Aug 10, 2021
  2. Aug 09, 2021
    • Hangbin Liu's avatar
      net: sched: act_mirred: Reset ct info when mirror/redirect skb · d09c548d
      Hangbin Liu authored
      When mirror/redirect a skb to a different port, the ct info should be reset
      for reclassification. Or the pkts will match unexpected rules. For example,
      with following topology and commands:
      
          -----------
                    |
             veth0 -+-------
                    |
             veth1 -+-------
                    |
         ------------
      
       tc qdisc add dev veth0 clsact
       # The same with "action mirred egress mirror dev veth1" or "action mirred ingress redirect dev veth1"
       tc filter add dev veth0 egress chain 1 protocol ip flower ct_state +trk action mirred ingress mirror dev veth1
       tc filter add dev veth0 egress chain 0 protocol ip flower ct_state -inv action ct commit action goto chain 1
       tc qdisc add dev veth1 clsact
       tc filter add dev veth1 ingress chain 0 protocol ip flower ct_state +trk action drop
      
       ping <remove ip via veth0> &
       tc -s filter show dev veth1 ingress
      
      With command 'tc -s filter show', we can find the pkts were dropped on
      veth1.
      
      Fixes: b57dc7c1
      
       ("net/sched: Introduce action ct")
      Signed-off-by: default avatarRoi Dayan <roid@nvidia.com>
      Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d09c548d
    • David S. Miller's avatar
      Merge branch 'smc-fixes' · 605bb443
      David S. Miller authored
      
      
      Guvenc Gulce says:
      
      ====================
      net/smc: fixes 2021-08-09
      
      please apply the following patch series for smc to netdev's net tree.
      One patch fixes invalid connection counting for links and the other
      one fixes an access to an already cleared link.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      605bb443
    • Guvenc Gulce's avatar
      net/smc: Correct smc link connection counter in case of smc client · 64513d26
      Guvenc Gulce authored
      SMC clients may be assigned to a different link after the initial
      connection between two peers was established. In such a case,
      the connection counter was not correctly set.
      
      Update the connection counter correctly when a smc client connection
      is assigned to a different smc link.
      
      Fixes: 07d51580
      
       ("net/smc: Add connection counters for links")
      Signed-off-by: default avatarGuvenc Gulce <guvenc@linux.ibm.com>
      Tested-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      64513d26
    • Karsten Graul's avatar
      net/smc: fix wait on already cleared link · 8f3d65c1
      Karsten Graul authored
      There can be a race between the waiters for a tx work request buffer
      and the link down processing that finally clears the link. Although
      all waiters are woken up before the link is cleared there might be
      waiters which did not yet get back control and are still waiting.
      This results in an access to a cleared wait queue head.
      
      Fix this by introducing atomic reference counting around the wait calls,
      and wait with the link clear processing until all waiters have finished.
      Move the work request layer related calls into smc_wr.c and set the
      link state to INACTIVE before calling smcr_link_clear() in
      smc_llc_srv_add_link().
      
      Fixes: 15e1b99a
      
       ("net/smc: no WR buffer wait for terminating link group")
      Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: default avatarGuvenc Gulce <guvenc@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8f3d65c1