Netdev List
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: Zhengchao Shao <shaozhengchao@huawei.com>
Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	shuah@kernel.org, j.vosburgh@gmail.com, andy@greyhouse.net,
	weiyongjun1@huawei.com, yuehaibing@huawei.com
Subject: Re: [PATCH net-next,v3] selftests: bonding: create directly devices in the target namespaces
Date: Mon, 28 Aug 2023 14:04:16 +0800	[thread overview]
Message-ID: <ZOw44Bvbr4qRhz8x@Laptop-X1> (raw)
In-Reply-To: <20230826022330.3474899-1-shaozhengchao@huawei.com>

On Sat, Aug 26, 2023 at 10:23:30AM +0800, Zhengchao Shao wrote:
> If failed to set link1_1 to netns client, we should delete link1_1 in the
> cleanup path. But if set link1_1 to netns client successfully, delete
> link1_1 will report warning. So it will be safer creating directly the
> devices in the target namespaces.
> 
> Reported-by: Hangbin Liu <liuhangbin@gmail.com>
> Closes: https://lore.kernel.org/all/ZNyJx1HtXaUzOkNA@Laptop-X1/
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
> ---
> v3: create the eth0 in the namespace
> v2: create directly devices in the target namespaces
> ---
>  .../drivers/net/bonding/bond-arp-interval-causes-panic.sh | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/testing/selftests/drivers/net/bonding/bond-arp-interval-causes-panic.sh b/tools/testing/selftests/drivers/net/bonding/bond-arp-interval-causes-panic.sh
> index 7b2d421f09cf..4917dbb35a44 100755
> --- a/tools/testing/selftests/drivers/net/bonding/bond-arp-interval-causes-panic.sh
> +++ b/tools/testing/selftests/drivers/net/bonding/bond-arp-interval-causes-panic.sh
> @@ -22,14 +22,12 @@ server_ip4=192.168.1.254
>  echo 180 >/proc/sys/kernel/panic
>  
>  # build namespaces
> -ip link add dev link1_1 type veth peer name link1_2
> -
>  ip netns add "server"
> -ip link set dev link1_2 netns server up name eth0
> +ip netns add "client"
> +ip -n client link add eth0 type veth peer name eth0 netns server
> +ip netns exec server ip link set dev eth0 up
>  ip netns exec server ip addr add ${server_ip4}/24 dev eth0
>  
> -ip netns add "client"
> -ip link set dev link1_1 netns client down name eth0
>  ip netns exec client ip link add dev bond0 down type bond mode 1 \
>  	miimon 100 all_slaves_active 1
>  ip netns exec client ip link set dev eth0 down master bond0
> -- 
> 2.34.1
> 

Acked-by: Hangbin Liu <liuhangbin@gmail.com>

  reply	other threads:[~2023-08-28  6:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-26  2:23 [PATCH net-next,v3] selftests: bonding: create directly devices in the target namespaces Zhengchao Shao
2023-08-28  6:04 ` Hangbin Liu [this message]
2023-08-28  9:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZOw44Bvbr4qRhz8x@Laptop-X1 \
    --to=liuhangbin@gmail.com \
    --cc=andy@greyhouse.net \
    --cc=j.vosburgh@gmail.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shaozhengchao@huawei.com \
    --cc=shuah@kernel.org \
    --cc=weiyongjun1@huawei.com \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox