Re: [PATCH net 1/3] ipvlan: fix NETDEV_UP/NETDEV_DOWN event handling

2025-04-14 Thread Hangbin Liu
On Thu, Apr 03, 2025 at 05:00:14PM +0200, Sabrina Dubroca wrote: > 2025-04-03, 13:09:02 +0000, Hangbin Liu wrote: > > Hi Sabrina, > > On Thu, Apr 03, 2025 at 12:28:54PM +0200, Sabrina Dubroca wrote: > > > Hello Hangbin, > > > > > > 2025-04-03, 08:58

Re: [PATCH net-next v3 6/6] bonding: Fix multiple long standing offload races

2025-04-11 Thread Hangbin Liu
xs) { > + list_del(&ipsec->list); > + kfree(ipsec); > + break; > + } > + } > + mutex_unlock(&bond->ipsec_lock); > } > > /** > diff --git a/include/net/xfrm.h b/include/net/xfrm.h > index 3d2f6c879311..b7e8f3f49627 100644 > --- a/include/net/xfrm.h > +++ b/include/net/xfrm.h > @@ -154,8 +154,11 @@ struct xfrm_dev_offload { >*/ > struct net_device *dev; > netdevice_tracker dev_tracker; > - /* This is a private pointer used by the bonding driver. > - * Device drivers should not use it. > + /* This is a private pointer used by the bonding driver (and eventually > + * should be moved there). Device drivers should not use it. > + * Protected by xfrm_state.lock AND bond.ipsec_lock in most cases, > + * except in the .xdo_dev_state_del() flow, where only xfrm_state.lock > + * is held. >*/ > struct net_device *real_dev; > unsigned long offload_handle; > -- > 2.45.0 > Tested-by: Hangbin Liu Reviewed-by: Hangbin Liu

Re: [PATCH net-next v3 5/6] bonding: Mark active offloaded xfrm_states

2025-04-11 Thread Hangbin Liu
.real_dev = NULL; > real_dev->xfrmdev_ops->xdo_dev_state_delete(real_dev, > ipsec->xs); > if (real_dev->xfrmdev_ops->xdo_dev_state_free) > @@ -664,6 +665,7 @@ static void bond_ipsec_free_sa(struct net_device > *bond_dev, > > WARN_ON(xs->xso.real_dev != real_dev); > > + xs->xso.real_dev = NULL; > if (real_dev && real_dev->xfrmdev_ops && > real_dev->xfrmdev_ops->xdo_dev_state_free) > real_dev->xfrmdev_ops->xdo_dev_state_free(real_dev, xs); > -- > 2.45.0 > Tested-by: Hangbin Liu Reviewed-by: Hangbin Liu

[PATCHv6 net-next 2/2] wireguard: selftests: update to using nft for qemu test

2025-04-10 Thread Hangbin Liu
Since we will replace iptables with nft for wireguard netns testing, let's also convert the qemu test to use nft at the same time. Co-developed-by: Phil Sutter Signed-off-by: Phil Sutter Signed-off-by: Hangbin Liu --- .../testing/selftests/wireguard/qemu/Makefile

Re: [PATCH net-next v2 6/6] bonding: Fix multiple long standing offload races

2025-04-09 Thread Hangbin Liu
On Wed, Apr 09, 2025 at 05:41:33PM +0300, Cosmin Ratiu wrote: > Refactor the bonding ipsec offload operations to fix a number of > long-standing control plane races between state migration and user > deletion and a few other issues. > > xfrm state deletion can happen concurrently with > bond_chang

Re: [PATCH net-next v2 5/6] bonding: Mark active offloaded xfrm_states

2025-04-09 Thread Hangbin Liu
.real_dev = NULL; > real_dev->xfrmdev_ops->xdo_dev_state_delete(real_dev, > ipsec->xs); > if (real_dev->xfrmdev_ops->xdo_dev_state_free) > @@ -664,6 +665,7 @@ static void bond_ipsec_free_sa(struct net_device > *bond_dev, > > WARN_ON(xs->xso.real_dev != real_dev); > > + xs->xso.real_dev = NULL; > if (real_dev && real_dev->xfrmdev_ops && > real_dev->xfrmdev_ops->xdo_dev_state_free) > real_dev->xfrmdev_ops->xdo_dev_state_free(real_dev, xs); > -- > 2.45.0 > Tested-by: Hangbin Liu Reviewed-by: Hangbin Liu Thanks Hangbin

[PATCHv6 net-next 0/2] wireguard: selftests: use nftables for testing

2025-04-08 Thread Hangbin Liu
update, just re-send v3: drop iptables directly (Jason A. Donenfeld) Also convert to using nft for qemu testing (Jason A. Donenfeld) v2: use one nft table for testing (Phil Sutter) Hangbin Liu (2): wireguard: selftests: convert iptables to nft wireguard: selftests: update to using nft for qemu

[PATCHv6 net-next 1/2] wireguard: selftests: convert iptables to nft

2025-04-08 Thread Hangbin Liu
Convert the selftest to nft as it is the replacement for iptables, which is used by default in most releases. Signed-off-by: Hangbin Liu --- tools/testing/selftests/wireguard/netns.sh | 29 ++ 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/tools/testing

Re: [PATCH net-next 6/6] bonding: Fix multiple long standing offload races

2025-04-08 Thread Hangbin Liu
Hi Cosmin, On Mon, Apr 07, 2025 at 04:35:42PM +0300, Cosmin Ratiu wrote: > Refactor the bonding ipsec offload operations to fix a number of > long-standing control plane races between state migration and user > deletion and a few other issues. > > xfrm state deletion can happen concurrently with >

[OS-BUILD PATCH] redhat/kernel.spec.template: add net packetdrill selftests

2025-04-06 Thread Hangbin Liu (via Email Bridge)
From: Hangbin Liu redhat/kernel.spec.template: add net packetdrill selftests Add net packetdrill selftests to internal selftests rpm. Signed-off-by: Hangbin Liu diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index blahblah..blahblah 100644 --- a/redhat

[OS-BUILD PATCH] [redhat] move TEST_BLACKHOLE_DEV to BLACKHOLE_DEV_KUNIT_TEST and enable it

2025-04-06 Thread Hangbin Liu (via Email Bridge)
From: Hangbin Liu [redhat] move TEST_BLACKHOLE_DEV to BLACKHOLE_DEV_KUNIT_TEST and enable it Since commit b341f6fd45ab ("blackhole_dev: convert self-test to KUnit"), config TEST_BLACKHOLE_DEV is renamed to BLACKHOLE_DEV_KUNIT_TEST. Also enable it for kunit testing. Signed-off-by: H

[PATCH net 3/3] selftests/rtnetlink.sh: add vlan/ipvlan/macvlan link state test

2025-04-05 Thread Hangbin Liu
rect PASS: ipvlan link state correct PASS: macvlan link state correct Signed-off-by: Hangbin Liu --- tools/testing/selftests/net/rtnetlink.sh | 64 1 file changed, 64 insertions(+) diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rt

Re: [PATCHv4 RESEND net-next 2/2] selftests: wireguard: update to using nft for qemu test

2025-04-05 Thread Hangbin Liu
On Fri, Mar 21, 2025 at 12:42:42PM +0100, Phil Sutter wrote: > Hi Hangbin, > > On Fri, Mar 21, 2025 at 10:40:25AM +, Hangbin Liu wrote: > > Hi Jason, Phil, > > On Wed, Mar 19, 2025 at 05:15:41PM +0100, Jason A. Donenfeld wrote: > > > On Mon, Jan 06, 2025 at 08:10

[PATCH net 2/3] macvlan: fix NETDEV_UP/NETDEV_DOWN event handling

2025-04-04 Thread Hangbin Liu
become out of sync. Fix this by updating the handling logic to be similar to VLAN. Fixes: de7d244d0a35 ("macvlan: make operstate and carrier more accurate") Fixes: 80fd2d6ca546 ("macvlan: Change status when lower device goes down") Signed-off-by: Hangbin Liu --- driver

Re: [PATCH net 1/3] ipvlan: fix NETDEV_UP/NETDEV_DOWN event handling

2025-04-03 Thread Hangbin Liu
Hi Sabrina, On Thu, Apr 03, 2025 at 12:28:54PM +0200, Sabrina Dubroca wrote: > Hello Hangbin, > > 2025-04-03, 08:58:55 +, Hangbin Liu wrote: > > When setting the lower-layer link up/down, the ipvlan device synchronizes > > its state via netif_stacked_transfer_operstate

[PATCH net 1/3] ipvlan: fix NETDEV_UP/NETDEV_DOWN event handling

2025-04-03 Thread Hangbin Liu
quot;) Signed-off-by: Hangbin Liu --- drivers/net/ipvlan/ipvlan_main.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 0ed2fd833a5d..2abe6ddc4d15 100644 --- a/drivers/net/ipvlan/ipvlan_

[PATCH net 0/3] fix ipvlan/macvlan link event handing

2025-04-03 Thread Hangbin Liu
pvlan link state incorrect FAIL: macvlan link state incorrect After the patch set: # ./rtnetlink.sh -t "kci_test_vlan kci_test_ipvlan kci_test_macvlan" PASS: vlan link state correct PASS: ipvlan link state correct PASS: macvlan link state correct Hangbin Liu (3): ipvlan: fix N

Re: [PATCHv5 net-next 1/2] wireguard: selftests: convert iptables to nft

2025-03-25 Thread Hangbin Liu
On Sun, Mar 23, 2025 at 10:10:33PM +0100, Phil Sutter wrote: > On Sat, Mar 22, 2025 at 09:30:15AM +0000, Hangbin Liu wrote: > > Convert iptabels to nft as it is the replacement for iptables, which is used > > > Typo, but I would write "Convert the selft

Re: [PATCHv5 net-next 1/2] wireguard: selftests: convert iptables to nft

2025-03-23 Thread Hangbin Liu
On Sun, Mar 23, 2025 at 10:10:33PM +0100, Phil Sutter wrote: > On Sat, Mar 22, 2025 at 09:30:15AM +0000, Hangbin Liu wrote: > > Convert iptabels to nft as it is the replacement for iptables, which is used > > > Typo, but I would write "Convert the selft

[PATCHv5 net-next 2/2] wireguard: selftests: update to using nft for qemu test

2025-03-22 Thread Hangbin Liu
Since we will replace iptables with nft for wireguard netns testing, let's also convert the qemu test to use nft at the same time. Co-developed-by: Phil Sutter Signed-off-by: Phil Sutter Signed-off-by: Hangbin Liu --- .../testing/selftests/wireguard/qemu/Makefile

[PATCHv5 net-next 1/2] wireguard: selftests: convert iptables to nft

2025-03-22 Thread Hangbin Liu
Convert iptabels to nft as it is the replacement for iptables, which is used by default in most releases. Signed-off-by: Hangbin Liu --- tools/testing/selftests/wireguard/netns.sh | 29 ++ 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/tools/testing

[PATCHv5 net-next 0/2] wireguard: selftests: use nftables for testing

2025-03-22 Thread Hangbin Liu
. Donenfeld) Also convert to using nft for qemu testing (Jason A. Donenfeld) v2: use one nft table for testing (Phil Sutter) Hangbin Liu (2): wireguard: selftests: convert iptables to nft wireguard: selftests: update to using nft for qemu test tools/testing/selftests/wireguard/netns.sh| 29

Re: [PATCHv4 RESEND net-next 2/2] selftests: wireguard: update to using nft for qemu test

2025-03-22 Thread Hangbin Liu
On Fri, Mar 21, 2025 at 03:40:20PM +0100, Phil Sutter wrote: > On Fri, Mar 21, 2025 at 12:45:17PM +0000, Hangbin Liu wrote: > > On Fri, Mar 21, 2025 at 12:42:42PM +0100, Phil Sutter wrote: > > > Hi Hangbin, > > > > > > On Fri, Mar 21, 2025 at 10:40:25AM +,

Re: [PATCHv4 RESEND net-next 2/2] selftests: wireguard: update to using nft for qemu test

2025-03-21 Thread Hangbin Liu
Hi Jason, Phil, On Wed, Mar 19, 2025 at 05:15:41PM +0100, Jason A. Donenfeld wrote: > On Mon, Jan 06, 2025 at 08:10:43AM +0000, Hangbin Liu wrote: > > + echo "file /bin/nft $(NFTABLES_PATH)/src/nft 755 0 0" >> $@ > > + echo "file /lib/libmnl.so.0 $(TOO

Re: [PATCHv4 RESEND net-next 0/2] selftests: wireguards: use nftables for testing

2025-03-20 Thread Hangbin Liu
On Wed, Mar 19, 2025 at 05:11:15PM +0100, Jason A. Donenfeld wrote: > On Tue, Mar 18, 2025 at 10:24:40AM +0000, Hangbin Liu wrote: > > I saw the patch status[1] is still "Awaiting Upstream". > > Is there anything I need to do? > > I'm looking at it now, but

Re: [PATCHv4 RESEND net-next 0/2] selftests: wireguards: use nftables for testing

2025-03-18 Thread Hangbin Liu
Hi Jason, I saw the patch status[1] is still "Awaiting Upstream". Is there anything I need to do? https://patchwork.kernel.org/project/netdevbpf/patch/20250106081043.2073169-2-liuhang...@gmail.com/ Thanks Hangbin On Mon, Jan 06, 2025 at 08:10:41AM +0000, Hangbin Liu wrote: > T

[PATCHv5 net 0/3] bond: fix xfrm offload issues

2025-03-15 Thread Hangbin Liu
del, add}_sa_all (Cosmin Ratiu) use the defer helpers in lib.sh for selftest (Petr Machata) v3: move the ipsec deletion to bond_ipsec_free_sa (Cosmin Ratiu) v2: do not turn carrier on if bond change link failed (Nikolay Aleksandrov) move the mutex lock to a work queue (Cosmin Ratiu) Hangbi

Re: [PATCHv5 net 1/3] bonding: fix calling sleeping function in spin lock and some race conditions

2025-03-15 Thread Hangbin Liu
Hi Nikolay, On Fri, Mar 07, 2025 at 09:42:49AM +0200, Nikolay Aleksandrov wrote: > On 3/7/25 05:19, Hangbin Liu wrote: > > The fixed commit placed mutex_lock() inside spin_lock_bh(), which triggers > > a warning: > > > > BUG: sleeping function called from invalid cont

Re: [PATCHv5 net 1/3] bonding: fix calling sleeping function in spin lock and some race conditions

2025-03-11 Thread Hangbin Liu
On Tue, Mar 11, 2025 at 09:08:49PM +, Cosmin Ratiu wrote: > On Fri, 2025-03-07 at 09:03 -0800, Jakub Kicinski wrote: > > On Fri, 7 Mar 2025 09:42:49 +0200 Nikolay Aleksandrov wrote: > > > TBH, keeping buggy code with a comment doesn't sound good to me. > > > I'd rather remove this > > > support

Re: [PATCHv5 net 1/3] bonding: fix calling sleeping function in spin lock and some race conditions

2025-03-10 Thread Hangbin Liu
On Fri, Mar 07, 2025 at 09:03:32AM -0800, Jakub Kicinski wrote: > On Fri, 7 Mar 2025 09:42:49 +0200 Nikolay Aleksandrov wrote: > > TBH, keeping buggy code with a comment doesn't sound good to me. I'd rather > > remove this > > support than tell people "good luck, it might crash". It's better to be

Re: [PATCHv5 net 1/3] bonding: fix calling sleeping function in spin lock and some race conditions

2025-03-10 Thread Hangbin Liu
On Sat, Mar 08, 2025 at 08:54:51AM +, Simon Horman wrote: > On Fri, Mar 07, 2025 at 03:19:01AM +0000, Hangbin Liu wrote: > > ... > > > @@ -616,9 +615,22 @@ static void bond_ipsec_del_sa_all(struct bonding *bond) > > return; > > > &

Re: [PATCHv5 net 1/3] bonding: fix calling sleeping function in spin lock and some race conditions

2025-03-07 Thread Hangbin Liu
On Fri, Mar 07, 2025 at 10:33:57AM +0200, Nikolay Aleksandrov wrote: > On 3/7/25 10:11, Hangbin Liu wrote: > > Hi Nikolay, > > On Fri, Mar 07, 2025 at 09:42:49AM +0200, Nikolay Aleksandrov wrote: > >> On 3/7/25 05:19, Hangbin Liu wrote: > >>> The fix

[PATCHv5 net 1/3] bonding: fix calling sleeping function in spin lock and some race conditions

2025-03-07 Thread Hangbin Liu
Jakub Kicinski Closes: https://lore.kernel.org/netdev/20241212062734.182a0...@kernel.org Suggested-by: Cosmin Ratiu Signed-off-by: Hangbin Liu --- drivers/net/bonding/bond_main.c | 69 - 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a/drivers/net/bonding/bon

Re: [PATCHv4 net 1/3] bonding: move IPsec deletion to bond_ipsec_free_sa

2025-03-06 Thread Hangbin Liu
On Wed, Mar 05, 2025 at 04:12:18PM +, Cosmin Ratiu wrote: > +++ b/drivers/net/bonding/bond_main.c > @@ -613,8 +613,11 @@ static void bond_ipsec_del_sa_all(struct bonding > *bond) > > mutex_lock(&bond->ipsec_lock); > list_for_each_entry(ipsec, &bond->ipsec_list, list) { > -

[PATCHv5 net 3/3] selftests: bonding: add ipsec offload test

2025-03-06 Thread Hangbin Liu
is the test result: TEST: bond_ipsec_offload (active_slave eth0)[ OK ] TEST: bond_ipsec_offload (active_slave eth1)[ OK ] Reviewed-by: Petr Machata Signed-off-by: Hangbin Liu --- .../selftests/drivers/net/bonding/Makefile| 3 +- .../drivers

[PATCHv5 net 2/3] bonding: fix xfrm offload feature setup on active-backup mode

2025-03-06 Thread Hangbin Liu
registered first before changing the bond link parameters. This change will allow the XFRM ESP offload feature to be correctly enabled. Fixes: 007ab5345545 ("bonding: fix feature flag setting at init time") Signed-off-by: Hangbin Liu --- drivers/net/bonding/bond_main.c| 2 +- d

Re: [PATCHv4 net 1/3] bonding: move IPsec deletion to bond_ipsec_free_sa

2025-03-06 Thread Hangbin Liu
On Thu, Mar 06, 2025 at 01:37:15PM +, Cosmin Ratiu wrote: > On Thu, 2025-03-06 at 10:02 +0000, Hangbin Liu wrote: > > > For bond_ipsec_add_sa_all(), I will move the xso.real_dev = > > > real_dev > > > after .xdo_dev_state_add() in case the following situation.

Re: [PATCHv4 net 1/3] bonding: move IPsec deletion to bond_ipsec_free_sa

2025-03-06 Thread Hangbin Liu
On Thu, Mar 06, 2025 at 10:02:34AM +, Hangbin Liu wrote: > > Set xs->xso.real_dev = NULL is a good idea. As we will break > > in bond_ipsec_del_sa()/bond_ipsec_free_sa() when there is no > > xs->xso.real_dev. > > > > For bond_ipsec_add_sa_all(), I w

Re: [PATCHv4 net 1/3] bonding: move IPsec deletion to bond_ipsec_free_sa

2025-03-06 Thread Hangbin Liu
On Wed, Mar 05, 2025 at 04:12:18PM +, Cosmin Ratiu wrote: > On Wed, 2025-03-05 at 14:13 +0000, Hangbin Liu wrote: > > On Wed, Mar 05, 2025 at 10:38:36AM +0200, Nikolay Aleksandrov wrote: > > > > @@ -617,8 +614,18 @@ static void bond_ipsec_del_sa_all(struct

Re: [PATCHv4 net 1/3] bonding: move IPsec deletion to bond_ipsec_free_sa

2025-03-06 Thread Hangbin Liu
On Thu, Mar 06, 2025 at 09:37:53AM +, Hangbin Liu wrote: > > > > The reason the mutex was added (instead of the spinlock used before) > > was exactly because the add and free offload operations could sleep. > > > > > With your reply, I also c

[PATCHv4 net 1/2] bonding: fix incorrect MAC address setting to receive NS messages

2025-03-05 Thread Hangbin Liu
functions. Also only use one mac_addr variable in slave_set_ns_maddr() to save some code and logic. Fixes: 8eb36164d1a6 ("bonding: add ns target multicast address to slave device") Acked-by: Jay Vosburgh Reviewed-by: Nikolay Aleksandrov Signed-off-by: Hangbin Liu --- drivers/n

[PATCHv4 net 2/2] selftests: bonding: fix incorrect mac address

2025-03-05 Thread Hangbin Liu
The correct mac address for NS target 2001:db8::254 is 33:33:ff:00:02:54, not 33:33:00:00:02:54. The same with client maddress. Fixes: 86fb6173d11e ("selftests: bonding: add ns multicast group testing") Acked-by: Jay Vosburgh Reviewed-by: Nikolay Aleksandrov Signed-off-by: H

[PATCHv4 net 0/2] bonding: fix incorrect mac address setting

2025-03-05 Thread Hangbin Liu
: fix patch 01's subject Hangbin Liu (2): bonding: fix incorrect MAC address setting to receive NS messages selftests: bonding: fix incorrect mac address drivers/net/bonding/bond_options.c| 55 --- .../drivers/net/bonding/bond_options.sh | 4 +- 2

Re: [PATCHv4 net 1/3] bonding: move IPsec deletion to bond_ipsec_free_sa

2025-03-05 Thread Hangbin Liu
On Wed, Mar 05, 2025 at 10:38:36AM +0200, Nikolay Aleksandrov wrote: > > @@ -617,8 +614,18 @@ static void bond_ipsec_del_sa_all(struct bonding *bond) > > > > mutex_lock(&bond->ipsec_lock); > > list_for_each_entry(ipsec, &bond->ipsec_list, list) { > > Second time - you should use list_for

Re: [PATCHv3 net 0/2] bonding: fix incorrect mac address setting

2025-03-05 Thread Hangbin Liu
Hi David, This patch set was marked as "Changes Requested" due to my initial reply. The series has now been approved by Jay and Nikolay. Could you help process it, or should I re-post it? Thanks Hangbin On Fri, Feb 07, 2025 at 09:29:18AM +0000, Hangbin Liu wrote: > The mac addr

[PATCHv4 net 0/3] bond: fix xfrm offload issues

2025-03-04 Thread Hangbin Liu
for selftest (Petr Machata) v3: move the ipsec deletion to bond_ipsec_free_sa (Cosmin Ratiu) v2: do not turn carrier on if bond change link failed (Nikolay Aleksandrov) move the mutex lock to a work queue (Cosmin Ratiu) Hangbin Liu (3): bonding: move IPsec deletion to bond_ipsec_free_sa bond

[PATCHv4 net 2/3] bonding: fix xfrm offload feature setup on active-backup mode

2025-03-04 Thread Hangbin Liu
registered first before changing the bond link parameters. This change will allow the XFRM ESP offload feature to be correctly enabled. Fixes: 007ab5345545 ("bonding: fix feature flag setting at init time") Signed-off-by: Hangbin Liu --- drivers/net/bonding/bond_main.c| 2 +- d

[PATCHv4 net 3/3] selftests: bonding: add ipsec offload test

2025-03-04 Thread Hangbin Liu
is the test result: TEST: bond_ipsec_offload (active_slave eth0)[ OK ] TEST: bond_ipsec_offload (active_slave eth1)[ OK ] Signed-off-by: Hangbin Liu --- .../selftests/drivers/net/bonding/Makefile| 3 +- .../drivers/net/bonding

[PATCHv4 net 1/3] bonding: move IPsec deletion to bond_ipsec_free_sa

2025-03-04 Thread Hangbin Liu
concurrently initiating add/delete operations on the managed states. Fixes: 2aeeef906d5a ("bonding: change ipsec_lock from spin lock to mutex") Reported-by: Jakub Kicinski Closes: https://lore.kernel.org/netdev/20241212062734.182a0...@kernel.org Suggested-by: Cosmin Ratiu Signed-off-by: Hangbin

Re: [PATCHv3 net 1/3] bonding: move IPsec deletion to bond_ipsec_free_sa

2025-03-04 Thread Hangbin Liu
Hi Cosmin, On Fri, Feb 28, 2025 at 10:31:58AM +, Cosmin Ratiu wrote: > On Fri, 2025-02-28 at 02:20 +0000, Hangbin Liu wrote: > > On Thu, Feb 27, 2025 at 03:31:01PM +0200, Nikolay Aleksandrov wrote: > > > > > One more thing - note I'm not an xfrm expert by far but

Re: [PATCHv3 net 1/3] bonding: move IPsec deletion to bond_ipsec_free_sa

2025-02-28 Thread Hangbin Liu
Hi Cosmin, On Fri, Feb 28, 2025 at 10:31:58AM +, Cosmin Ratiu wrote: > On Fri, 2025-02-28 at 02:20 +0000, Hangbin Liu wrote: > > On Thu, Feb 27, 2025 at 03:31:01PM +0200, Nikolay Aleksandrov wrote: > > > > > One more thing - note I'm not an xfrm expert by far but

Re: [PATCHv3 net 1/3] bonding: move IPsec deletion to bond_ipsec_free_sa

2025-02-27 Thread Hangbin Liu
On Thu, Feb 27, 2025 at 03:31:01PM +0200, Nikolay Aleksandrov wrote: > >> One more thing - note I'm not an xfrm expert by far but it seems to me > >> here you have > >> to also call xdo_dev_state_free() with the old active slave dev otherwise > >> that will > >> never get called with the origina

Re: [PATCHv3 net 1/3] bonding: move IPsec deletion to bond_ipsec_free_sa

2025-02-27 Thread Hangbin Liu
On Thu, Feb 27, 2025 at 11:21:51AM +0200, Nikolay Aleksandrov wrote: > >> @@ -617,6 +611,12 @@ static void bond_ipsec_del_sa_all(struct bonding > >> *bond) > >> > >>mutex_lock(&bond->ipsec_lock); > >>list_for_each_entry(ipsec, &bond->ipsec_list, list) { > >> + if (ipsec->xs->km.

[PATCHv3 net 3/3] selftests: bonding: add ipsec offload test

2025-02-27 Thread Hangbin Liu
. Signed-off-by: Hangbin Liu --- .../selftests/drivers/net/bonding/Makefile| 3 +- .../drivers/net/bonding/bond_ipsec_offload.sh | 155 ++ .../selftests/drivers/net/bonding/config | 4 + 3 files changed, 161 insertions(+), 1 deletion(-) create mode 100755 tools/testing

[PATCHv3 net 2/3] bonding: fix xfrm offload feature setup on active-backup mode

2025-02-27 Thread Hangbin Liu
registered first before changing the bond link parameters. This change will allow the XFRM ESP offload feature to be correctly enabled. Fixes: 007ab5345545 ("bonding: fix feature flag setting at init time") Signed-off-by: Hangbin Liu --- drivers/net/bonding/bond_main.c| 2 +- d

[PATCHv3 net 1/3] bonding: move IPsec deletion to bond_ipsec_free_sa

2025-02-27 Thread Hangbin Liu
e.kernel.org/netdev/20241212062734.182a0...@kernel.org Suggested-by: Cosmin Ratiu Signed-off-by: Hangbin Liu --- drivers/net/bonding/bond_main.c | 34 ++--- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c

[PATCHv3 net 0/3] bond: fix xfrm offload issues

2025-02-27 Thread Hangbin Liu
link failed (Nikolay Aleksandrov) move the mutex lock to a work queue (Cosmin Ratiu) Hangbin Liu (3): bonding: move IPsec deletion to bond_ipsec_free_sa bonding: fix xfrm offload feature setup on active-backup mode selftests: bonding: add ipsec offload test drivers/net/bonding

Re: [PATCHv2 net 1/3] bonding: move mutex lock to a work queue for XFRM GC tasks

2025-02-26 Thread Hangbin Liu
On Wed, Feb 26, 2025 at 11:05:47AM +, Cosmin Ratiu wrote: > > > What do you think about this idea? > > > > Thanks a lot for the comments. I also skipped the DEAD xs in > > add_sa_all. > > What about the patch like: > > This is what I had in mind, thanks for proposing it. Maybe you should > pa

Re: [PATCHv2 net 1/3] bonding: move mutex lock to a work queue for XFRM GC tasks

2025-02-26 Thread Hangbin Liu
Hi Cosmin, On Tue, Feb 25, 2025 at 02:00:05PM +, Cosmin Ratiu wrote: > This got me to stare at the code again. What if we move the removal of > the xs from bond->ipsec from bond_ipsec_del_sa to bond_ipsec_free_sa? > bond_ipsec_free_sa, unlike bond_ipsec_del_sa, is not called with x- > >lock hel

Re: [PATCHv2 net 1/3] bonding: move mutex lock to a work queue for XFRM GC tasks

2025-02-25 Thread Hangbin Liu
On Tue, Feb 25, 2025 at 01:05:24PM +0200, Nikolay Aleksandrov wrote: > > @@ -592,15 +611,17 @@ static void bond_ipsec_del_sa(struct xfrm_state *xs) > > real_dev->xfrmdev_ops->xdo_dev_state_delete(xs); > > out: > > netdev_put(real_dev, &tracker); > > - mutex_lock(&bond->ipsec_lock); > > -

Re: [PATCH net-next] selftests/net: ensure mptcp is enabled in netns

2025-02-25 Thread Hangbin Liu
On Mon, Feb 24, 2025 at 02:53:13PM +0100, Matthieu Baerts wrote: > Hi Hangbin, Davide, > > On 24/02/2025 10:40, Hangbin Liu wrote: > > Some distributions may not enable MPTCP by default. All other MPTCP tests > > source mptcp_lib.sh to ensure MPTCP is enabled before test

[PATCHv2 net 3/3] selftests: bonding: add ipsec offload test

2025-02-25 Thread Hangbin Liu
. Signed-off-by: Hangbin Liu --- .../selftests/drivers/net/bonding/Makefile| 3 +- .../drivers/net/bonding/bond_ipsec_offload.sh | 155 ++ .../selftests/drivers/net/bonding/config | 4 + 3 files changed, 161 insertions(+), 1 deletion(-) create mode 100755 tools/testing

[PATCHv2 net 2/3] bonding: fix xfrm offload feature setup on active-backup mode

2025-02-25 Thread Hangbin Liu
registered first before changing the bond link parameters. This change will allow the XFRM ESP offload feature to be correctly enabled. Fixes: 007ab5345545 ("bonding: fix feature flag setting at init time") Signed-off-by: Hangbin Liu --- drivers/net/bonding/bond_main.c| 2 +- d

[PATCHv2 net 1/3] bonding: move mutex lock to a work queue for XFRM GC tasks

2025-02-25 Thread Hangbin Liu
) Reported-by: Jakub Kicinski Closes: https://lore.kernel.org/netdev/20241212062734.182a0...@kernel.org Signed-off-by: Hangbin Liu --- drivers/net/bonding/bond_main.c | 41 + include/net/bonding.h | 6 + 2 files changed, 37 insertions(+), 10 deletion

[PATCHv2 net 0/3] bond: fix xfrm offload issues

2025-02-25 Thread Hangbin Liu
The first patch fixes the incorrect locks using in bond driver. The second patch fixes the xfrm offload feature during setup active-backup mode. The third patch add a ipsec offload testing. v2: move the mutex lock to a work queue (Cosmin Ratiu) Hangbin Liu (3): bonding: move mutex lock to a

[PATCH net-next] selftests/net: ensure mptcp is enabled in netns

2025-02-24 Thread Hangbin Liu
ge so that it passes on all distributions. Suggested-by: Davide Caratti Signed-off-by: Hangbin Liu --- tools/testing/selftests/net/ip_local_port_range.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/ip_local_port_range.sh b/tools/testing/self

Re: [PATCH net 0/2] bond: fix xfrm offload feature during init

2025-02-20 Thread Hangbin Liu
On Thu, Feb 20, 2025 at 10:48:43AM +, Cosmin Ratiu wrote: > On Mon, 2025-01-20 at 23:59 +0000, Hangbin Liu wrote: > > > > > > I am not sure this can be fixed in bonding given that the > > > xdo_dev_state_delete op could, in the general case, sleep while > >

[PATCH net-next] selftests: fib_nexthops: do not mark skipped tests as failed

2025-02-20 Thread Hangbin Liu
The current test marks all unexpected return values as failed and sets ret to 1. If a test is skipped, the entire test also returns 1, incorrectly indicating failure. To fix this, add a skipped variable and set ret to 4 if it was previously 0. Otherwise, keep ret set to 1. Signed-off-by: Hangbin

[Need help] Issue Authorizing fedpkg push in a Container.

2025-02-18 Thread Hangbin Liu
Hi everyone, Apologies if I’m sending this to the wrong list. I’m facing an issue authorizing fedpkg push inside a container. When I run the command, it provides a link for authorization. However, after logging in, the link redirects to a localhost address, which is unreachable since I’m running

Re: [PATCH] selftests: make shell scripts POSIX-compliant

2025-02-16 Thread Hangbin Liu
On Sun, Feb 16, 2025 at 06:11:51AM -1000, Tejun Heo wrote: > On Sun, Feb 16, 2025 at 05:32:25PM +0530, Aditya Dutt wrote: > > Changes include: > > - Replaced [[ ... ]] with [ ... ] > > - Replaced == with = > > - Replaced printf -v with cur=$(printf ...). > > - Replaced echo -e with printf "%b\n" ..

Re: [PATCH net-next] selftest:net: fixed spelling mistakes

2025-02-16 Thread Hangbin Liu
On Sun, Feb 16, 2025 at 07:14:50PM -0500, Andres Urian Florez wrote: > Fixed spelling errors in test_redirect6() error message and > test_port_shadowing() comments > > Signed-off-by: Andres Urian Florez Reviewed-by: Hangbin Liu > --- > tools/testing/selftests/net/netfil

Re: [PATCHv3 net 0/2] bonding: fix incorrect mac address setting

2025-02-13 Thread Hangbin Liu
Hi Jay, Any comments? Thanks Hangbin On Tue, Feb 11, 2025 at 07:31:32AM +, Hangbin Liu wrote: > Hi Jay, > On Sat, Feb 08, 2025 at 06:34:21AM +, Hangbin Liu wrote: > > Please hold on this patch. Our QE reported that with bare NIC, the > > backup NIC can't recei

Re: [PATCHv3 net 0/2] bonding: fix incorrect mac address setting

2025-02-10 Thread Hangbin Liu
Hi Jay, On Sat, Feb 08, 2025 at 06:34:21AM +, Hangbin Liu wrote: > Please hold on this patch. Our QE reported that with bare NIC, the > backup NIC can't receive the NS messages even after joining the multicast > MAC group. But after remove the backup NIC from bond, the NIC int

Re: [PATCHv3 net 0/2] bonding: fix incorrect mac address setting

2025-02-07 Thread Hangbin Liu
he NS message somewhere, even using tcpdump (the NIC will be in promisc mode) I can't capture the NS message on backup slave. I need to debug more. Thanks Hangbin On Fri, Feb 07, 2025 at 09:29:18AM +0000, Hangbin Liu wrote: > The mac address on backup slave should be convert from S

[PATCHv3 net 2/2] selftests: bonding: fix incorrect mac address

2025-02-07 Thread Hangbin Liu
The correct mac address for NS target 2001:db8::254 is 33:33:ff:00:02:54, not 33:33:00:00:02:54. The same with client maddress. Fixes: 86fb6173d11e ("selftests: bonding: add ns multicast group testing") Signed-off-by: Hangbin Liu --- tools/testing/selftests/drivers/net/bonding/bond_

[PATCHv3 net 1/2] bonding: fix incorrect MAC address setting to receive NS messages

2025-02-07 Thread Hangbin Liu
functions. Also only use one mac_addr variable in slave_set_ns_maddr() to save some code and logic. Fixes: 8eb36164d1a6 ("bonding: add ns target multicast address to slave device") Signed-off-by: Hangbin Liu --- drivers/net/bonding/bond_options.c | 55 +---

[PATCHv3 net 0/2] bonding: fix incorrect mac address setting

2025-02-07 Thread Hangbin Liu
bject Hangbin Liu (2): bonding: fix incorrect MAC address setting to receive NS messages selftests: bonding: fix incorrect mac address drivers/net/bonding/bond_options.c| 55 --- .../drivers/net/bonding/bond_options.sh | 4 +- 2 files changed, 49 insertions(+

Re: [PATCHv2 net 1/2] bonding: fix incorrect MAC address setting to receive NS messages

2025-02-06 Thread Hangbin Liu
On Thu, Feb 06, 2025 at 05:19:34PM -0800, Jay Vosburgh wrote: > I think this now deserves some commentary in the code. Not > because this function itself is unclear, but because there's the > similarly-named slave_set_ns_maddr() (singular, not plural as in this > patch) that will behave in a

[PATCHv2 net 2/2] selftests: bonding: fix incorrect mac address

2025-02-06 Thread Hangbin Liu
The correct mac address for NS target 2001:db8::254 is 33:33:ff:00:02:54, not 33:33:00:00:02:54. The same with client maddress. Fixes: 86fb6173d11e ("selftests: bonding: add ns multicast group testing") Signed-off-by: Hangbin Liu --- tools/testing/selftests/drivers/net/bonding/bond_

[PATCHv2 net 1/2] bonding: fix incorrect MAC address setting to receive NS messages

2025-02-06 Thread Hangbin Liu
use directly. Instead, we should first convert it to a Solicited-Node Multicast Address and then derive the corresponding MAC address. Fixes: 8eb36164d1a6 ("bonding: add ns target multicast address to slave device") Signed-off-by: Hangbin Liu --- drivers/net/bonding/bond_options.c |

[PATCHv2 net 0/2] bonding: fix incorrect mac address setting

2025-02-06 Thread Hangbin Liu
The mac address on backup slave should be convert from Solicited-Node Multicast address, not from bonding unicast target address. v2: fix patch 01's subject Hangbin Liu (2): bonding: fix incorrect MAC address setting to receive NS messages selftests: bonding: fix incorrect mac ad

Re: [PATCH net 1/2] bonding: fix incorrect MAC address setting to receive NA messages

2025-02-05 Thread Hangbin Liu
Oh, I just found the subject is incorrect. We want to receive the NS message, not NA message on backup slaves. Thanks Hangbin On Wed, Feb 05, 2025 at 08:03:35AM +, Hangbin Liu wrote: > In order to receive the neighbor solicitation messages on the backup slave, > we should add

[PATCH net 2/2] selftests: bonding: fix incorrect mac address

2025-02-05 Thread Hangbin Liu
The correct mac address for NS target 2001:db8::254 is 33:33:ff:00:02:54, not 33:33:00:00:02:54. The same with client maddress. Fixes: 86fb6173d11e ("selftests: bonding: add ns multicast group testing") Signed-off-by: Hangbin Liu --- tools/testing/selftests/drivers/net/bonding/bond_

[PATCH net 1/2] bonding: fix incorrect MAC address setting to receive NA messages

2025-02-05 Thread Hangbin Liu
t and then convert the multicast address to the right MAC address. Fixes: 8eb36164d1a6 ("bonding: add ns target multicast address to slave device") Signed-off-by: Hangbin Liu --- drivers/net/bonding/bond_options.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a

[PATCH net 0/2] bonding: fix incorrect mac address setting

2025-02-05 Thread Hangbin Liu
The mac address on backup slave should be convert from Solicited-Node Multicast address, not from bonding unicast target address. Hangbin Liu (2): bonding: fix incorrect MAC address setting to receive NA messages selftests: bonding: fix incorrect mac address drivers/net/bonding

Re: [PATCH net v3] bonding: Correctly support GSO ESP offload

2025-01-27 Thread Hangbin Liu
On Mon, Jan 27, 2025 at 10:45:21AM +, Cosmin Ratiu wrote: > Same as v2, but I added Hangbin to 'Signed-off-by'. > Thanks for adding me to 'Signed-off-by'. Next time you can add the change log in the patch directly. e.g. Commit description --- v3 changes v2 changes --- Codes ... Thanks Han

Re: [PATCH net] selftests: net/{lib,openvswitch}: extend CFLAGS to keep options from environment

2025-01-25 Thread Hangbin Liu
so add Fixes: 25f16c873fb1 ("selftests: add openvswitch selftest suite") Reviewed-by: Hangbin Liu

Re: [PATCH net v2] bonding: Correctly support GSO ESP offload

2025-01-24 Thread Hangbin Liu
On Fri, Jan 24, 2025 at 10:35:40AM +, Cosmin Ratiu wrote: > On Fri, 2025-01-24 at 09:54 +0000, Hangbin Liu wrote: > > On Fri, Jan 24, 2025 at 10:57:44AM +0200, Cosmin Ratiu wrote: > > > --- > > >  drivers/net/bonding/bond_main.c | 19 ++- > >

Re: [PATCH net v2] bonding: Correctly support GSO ESP offload

2025-01-24 Thread Hangbin Liu
On Fri, Jan 24, 2025 at 10:57:44AM +0200, Cosmin Ratiu wrote: > --- > drivers/net/bonding/bond_main.c | 19 ++- > 1 file changed, 10 insertions(+), 9 deletions(-) > > diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c > index 7b78c2bada81..e45bba240cbc

Re: [PATCH net] bonding: Correctly support GSO ESP offload

2025-01-23 Thread Hangbin Liu
27; now reports: > tx-esp-segmentation: on > esp-hw-offload: on > esp-tx-csum-hw-offload: on > > Fixes: 4861333b4217 ("bonding: add ESP offload features when slaves support") > Signed-off-by: Cosmin Ratiu > Change-Id: Iebd2a9d903d3e056e7717e8ca2527a9adf21b2e1 What's Change-Id here? Others looks good to me. Reviewed-by: Hangbin Liu

Re: [PATCH] selftests: mptcp: extend CFLAGS to keep options from environment

2025-01-23 Thread Hangbin Liu
On Thu, Jan 23, 2025 at 08:39:53AM +, Hangbin Liu wrote: > On Thu, Jan 23, 2025 at 09:35:42AM +0100, Jan Stancek wrote: > > Package build environments like Fedora rpmbuild introduced hardening > > options (e.g. -pie -Wl,-z,now) by passing a -spec option to CFLAGS

Re: [PATCH] selftests: mptcp: extend CFLAGS to keep options from environment

2025-01-23 Thread Hangbin Liu
nk.sh mptcp_join.sh diag.sh \ > simult_flows.sh mptcp_sockopt.sh userspace_pm.sh > -- > 2.43.0 > Reviewed-by: Hangbin Liu

[PATCHv2 net] Bonding: Fix support for gso_partial_features

2025-01-22 Thread Hangbin Liu
333b4217 ("bonding: add ESP offload features when slaves support") Reported-by: Liang Li Signed-off-by: Hangbin Liu --- v2: remove NETIF_F_GSO_PARTIAL bit if not set gso_partial_features. The issue is reported internally, so there is no Closes tag. BTW, I saw some drivers set NETIF_F_GSO_PARTIA

Re: [PATCH net] Bonding: Fix support for gso_partial_features

2025-01-21 Thread Hangbin Liu
On Tue, Jan 21, 2025 at 08:55:25AM +, Hangbin Liu wrote: > The fixed commit adds NETIF_F_GSO_ESP bit for bonding gso_partial_features. > However, if we don't set the dev NETIF_F_GSO_PARTIAL bit, the later > netdev_change_features() -> netdev_fix_features() will remove the >

[PATCH net] Bonding: Fix support for gso_partial_features

2025-01-21 Thread Hangbin Liu
333b4217 ("bonding: add ESP offload features when slaves support") Reported-by: Liang Li Signed-off-by: Hangbin Liu --- drivers/net/bonding/bond_main.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c

Re: [PATCH net 0/2] bond: fix xfrm offload feature during init

2025-01-20 Thread Hangbin Liu
On Mon, Jan 20, 2025 at 04:16:49PM +, Cosmin Ratiu wrote: > On Fri, 2025-01-17 at 08:54 +0100, Steffen Klassert wrote: > > > > > > Hi Jianbo, > > > > > > I talked with Sabrina and it looks we can't simply do this. Because > > > both > > > xfrm_add_sa_expire() and xfrm_timer_handler() calling

Re: [PATCH net 0/2] bond: fix xfrm offload feature during init

2025-01-15 Thread Hangbin Liu
On Wed, Jan 08, 2025 at 07:15:00AM +, Hangbin Liu wrote: > > > > > > I don't know how to disable bonding sleeping since we use > > > > > > mutex_lock now. > > > > > > Hi Jianbo, do you have any idea? > > > > > > &

Re: [PATCH] selftests/net/forwarding: teamd command not found

2025-01-10 Thread Hangbin Liu
On Fri, Jan 10, 2025 at 03:35:23PM +0100, Alessandro Zanni wrote: > On Fri, Jan 10, 2025 at 04:09:07AM +0000, Hangbin Liu wrote: > > On Fri, Jan 10, 2025 at 01:07:44AM +0100, Alessandro Zanni wrote: > > > Running "make kselftest TARGETS=net/forwarding" results in seve

Re: [PATCH] selftests/net/forwarding: teamd command not found

2025-01-09 Thread Hangbin Liu
On Fri, Jan 10, 2025 at 01:07:44AM +0100, Alessandro Zanni wrote: > Running "make kselftest TARGETS=net/forwarding" results in several > occurrences of the same error: > ./lib.sh: line 787: teamd: command not found > > Since many tests depends on teamd, this fix stops the tests if the > teamd com

Re: [PATCH net 0/2] bond: fix xfrm offload feature during init

2025-01-09 Thread Hangbin Liu
On Thu, Jan 09, 2025 at 05:51:07PM +0800, Jianbo Liu wrote: > > > No, we don't need. But I am trying to understand what you said in your > > > last > > > email about adding a new lock, or unlocking spin lock in > > > > I *thought* we need the spin lock in xfrm_state_delete(). So to protect > > x

  1   2   3   4   5   6   7   8   9   10   >