Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
authorJakub Kicinski <kuba@kernel.org>
Thu, 14 Oct 2021 23:50:14 +0000 (16:50 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 14 Oct 2021 23:50:14 +0000 (16:50 -0700)
tools/testing/selftests/net/ioam6.sh
  7b1700e009cc ("selftests: net: modify IOAM tests for undef bits")
  bf77b1400a56 ("selftests: net: Test for the IOAM encapsulation with IPv6")

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
23 files changed:
1  2 
drivers/net/dsa/ocelot/felix.c
drivers/net/ethernet/arc/Kconfig
drivers/net/ethernet/intel/ice/ice_ptp.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/microchip/encx24j600.c
drivers/net/ethernet/microsoft/mana/mana_en.c
drivers/net/ethernet/mscc/ocelot.c
drivers/net/ethernet/mscc/ocelot_net.c
drivers/net/ethernet/neterion/s2io.c
drivers/net/ethernet/pensando/ionic/ionic_lif.c
drivers/net/ethernet/qlogic/qed/qed_main.c
drivers/net/ethernet/stmicro/stmmac/hwif.h
drivers/net/phy/phy_device.c
drivers/net/virtio_net.c
include/linux/dsa/ocelot.h
net/dsa/dsa2.c
net/dsa/tag_ocelot.c
net/ipv6/ioam6.c
net/ipv6/ioam6_iptunnel.c
net/mptcp/protocol.c
net/sched/sch_mqprio.c
net/smc/smc_core.c
tools/testing/selftests/net/ioam6.sh

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -210,9 -242,26 +242,26 @@@ static inline void ocelot_ifh_set_tag_t
        packing(injection, &tag_type, 16, 16, OCELOT_TAG_LEN, PACK, 0);
  }
  
 -static inline void ocelot_ifh_set_vid(void *injection, u64 vid)
 +static inline void ocelot_ifh_set_vlan_tci(void *injection, u64 vlan_tci)
  {
 -      packing(injection, &vid, 11, 0, OCELOT_TAG_LEN, PACK, 0);
 +      packing(injection, &vlan_tci, 15, 0, OCELOT_TAG_LEN, PACK, 0);
  }
  
+ /* Determine the PTP REW_OP to use for injecting the given skb */
+ static inline u32 ocelot_ptp_rew_op(struct sk_buff *skb)
+ {
+       struct sk_buff *clone = OCELOT_SKB_CB(skb)->clone;
+       u8 ptp_cmd = OCELOT_SKB_CB(skb)->ptp_cmd;
+       u32 rew_op = 0;
+       if (ptp_cmd == IFH_REW_OP_TWO_STEP_PTP && clone) {
+               rew_op = ptp_cmd;
+               rew_op |= OCELOT_SKB_CB(clone)->ts_id << 3;
+       } else if (ptp_cmd == IFH_REW_OP_ORIGIN_PTP) {
+               rew_op = ptp_cmd;
+       }
+       return rew_op;
+ }
  #endif
diff --cc net/dsa/dsa2.c
Simple merge
@@@ -2,43 -2,8 +2,42 @@@
  /* Copyright 2019 NXP
   */
  #include <linux/dsa/ocelot.h>
- #include <soc/mscc/ocelot.h>
  #include "dsa_priv.h"
  
 +/* If the port is under a VLAN-aware bridge, remove the VLAN header from the
 + * payload and move it into the DSA tag, which will make the switch classify
 + * the packet to the bridge VLAN. Otherwise, leave the classified VLAN at zero,
 + * which is the pvid of standalone and VLAN-unaware bridge ports.
 + */
 +static void ocelot_xmit_get_vlan_info(struct sk_buff *skb, struct dsa_port *dp,
 +                                    u64 *vlan_tci, u64 *tag_type)
 +{
 +      struct net_device *br = READ_ONCE(dp->bridge_dev);
 +      struct vlan_ethhdr *hdr;
 +      u16 proto, tci;
 +
 +      if (!br || !br_vlan_enabled(br)) {
 +              *vlan_tci = 0;
 +              *tag_type = IFH_TAG_TYPE_C;
 +              return;
 +      }
 +
 +      hdr = (struct vlan_ethhdr *)skb_mac_header(skb);
 +      br_vlan_get_proto(br, &proto);
 +
 +      if (ntohs(hdr->h_vlan_proto) == proto) {
 +              __skb_vlan_pop(skb, &tci);
 +              *vlan_tci = tci;
 +      } else {
 +              rcu_read_lock();
 +              br_vlan_get_pvid_rcu(br, &tci);
 +              rcu_read_unlock();
 +              *vlan_tci = tci;
 +      }
 +
 +      *tag_type = (proto != ETH_P_8021Q) ? IFH_TAG_TYPE_S : IFH_TAG_TYPE_C;
 +}
 +
  static void ocelot_xmit_common(struct sk_buff *skb, struct net_device *netdev,
                               __be32 ifh_prefix, void **ifh)
  {
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -529,21 -465,31 +529,36 @@@ out_bits(
    local tmp=${bit2size[22]}
    bit2size[22]=$(( $tmp + ${#ALPHA[9]} + ((4 - (${#ALPHA[9]} % 4)) % 4) ))
  
 +  [ "$1" = "encap" ] && mode="$1 tundst db01::1" || mode="$1"
 +  [ "$1" = "encap" ] && ip -netns ioam-node-beta link set ip6tnl0 up
 +
    for i in {0..22}
    do
 -    ip -netns ioam-node-alpha route change db01::/64 encap ioam6 trace \
 -           prealloc type ${bit2type[$i]} ns 123 size ${bit2size[$i]} \
 +    ip -netns ioam-node-alpha route change db01::/64 encap ioam6 mode $mode \
 +           trace prealloc type ${bit2type[$i]} ns 123 size ${bit2size[$i]} \
-            dev veth0
+            dev veth0 &>/dev/null
+     local cmd_res=$?
+     local descr="${desc/<n>/$i}"
  
-     run_test "out_bit$i" "${desc/<n>/$i} ($1 mode)" ioam-node-alpha \
+     if [[ $i -ge 12 && $i -le 21 ]]
+     then
+       if [ $cmd_res != 0 ]
+       then
+         npassed=$((npassed+1))
+         log_test_passed "$descr"
+       else
+         nfailed=$((nfailed+1))
+         log_test_failed "$descr"
+       fi
+     else
 -      run_test "out_bit$i" "$descr" ioam-node-alpha ioam-node-beta \
 -             db01::2 db01::1 veth0 ${bit2type[$i]} 123
++      run_test "out_bit$i" "$descr ($1 mode)" ioam-node-alpha \
 +           ioam-node-beta db01::2 db01::1 veth0 ${bit2type[$i]} 123
+     fi
    done
  
 +  [ "$1" = "encap" ] && ip -netns ioam-node-beta link set ip6tnl0 down
 +
    bit2size[22]=$tmp
  }
  
@@@ -629,21 -560,15 +644,21 @@@ in_bits(
    local tmp=${bit2size[22]}
    bit2size[22]=$(( $tmp + ${#BETA[9]} + ((4 - (${#BETA[9]} % 4)) % 4) ))
  
-   for i in {0..22}
 +  [ "$1" = "encap" ] && mode="$1 tundst db01::1" || mode="$1"
 +  [ "$1" = "encap" ] && ip -netns ioam-node-beta link set ip6tnl0 up
 +
+   for i in {0..11} {22..22}
    do
 -    ip -netns ioam-node-alpha route change db01::/64 encap ioam6 trace \
 -           prealloc type ${bit2type[$i]} ns 123 size ${bit2size[$i]} dev veth0
 +    ip -netns ioam-node-alpha route change db01::/64 encap ioam6 mode $mode \
 +           trace prealloc type ${bit2type[$i]} ns 123 size ${bit2size[$i]} \
 +           dev veth0
  
 -    run_test "in_bit$i" "${desc/<n>/$i}" ioam-node-alpha ioam-node-beta \
 -           db01::2 db01::1 veth0 ${bit2type[$i]} 123
 +    run_test "in_bit$i" "${desc/<n>/$i} ($1 mode)" ioam-node-alpha \
 +           ioam-node-beta db01::2 db01::1 veth0 ${bit2type[$i]} 123
    done
  
 +  [ "$1" = "encap" ] && ip -netns ioam-node-beta link set ip6tnl0 down
 +
    bit2size[22]=$tmp
  }