Subject: Re: [PATCH net-next v7 3/4] netdevsim: add selftest for forwarding skb between connected ports

From: Simon Horman <[email-masked]>
Date: Mon, 29 Jan 2024 20:34:01 +0000

On Fri, Jan 26, 2024 at 08:03:53PM -0800, David Wei wrote:
> Connect two netdevsim ports in different namespaces together, then send
> packets between them using socat.
> 
> Signed-off-by: David Wei <[email-masked]>
> ---
>  .../selftests/drivers/net/netdevsim/peer.sh   | 127 ++++++++++++++++++
>  1 file changed, 127 insertions(+)
>  create mode 100755 tools/testing/selftests/drivers/net/netdevsim/peer.sh
> 
> diff --git a/tools/testing/selftests/drivers/net/netdevsim/peer.sh b/tools/testing/selftests/drivers/net/netdevsim/peer.sh
> new file mode 100755
> index 000000000000..05f3cefa53f3
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/net/netdevsim/peer.sh
> @@ -0,0 +1,127 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0-only
> +
> +NSIM_DEV_1_ID=$((RANDOM % 1024))
> +NSIM_DEV_1_SYS=/sys/bus/netdevsim/devices/netdevsim$NSIM_DEV_1_ID
> +NSIM_DEV_1_DFS=/sys/kernel/debug/netdevsim/netdevsim$NSIM_DEV_1_ID
> +NSIM_DEV_2_ID=$((RANDOM % 1024))
> +NSIM_DEV_2_SYS=/sys/bus/netdevsim/devices/netdevsim$NSIM_DEV_2_ID
> +NSIM_DEV_2_DFS=/sys/kernel/debug/netdevsim/netdevsim$NSIM_DEV_2_ID

nit: NSIM_DEV_1_DFS and SIM_DEV_2_DFS appear to be unused.

Flagged by shellcheck.

...