[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zr32ZZ8e4RhYN1xd@nanopsycho.orion>
Date: Thu, 15 Aug 2024 14:36:53 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Paolo Abeni <pabeni@...hat.com>
Cc: Feng zhou <zhoufeng.zf@...edance.com>, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, ast@...nel.org,
daniel@...earbox.net, hawk@...nel.org, john.fastabend@...il.com,
bigeasy@...utronix.de, lorenzo@...nel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, bpf@...r.kernel.org,
yangzhenze@...edance.com, wangdongdong.6@...edance.com
Subject: Re: [PATCH] net: Don't allow to attach xdp if bond slave device's
upper already has a program
Thu, Aug 15, 2024 at 01:18:33PM CEST, pabeni@...hat.com wrote:
>On 8/14/24 11:08, Feng zhou wrote:
>> From: Feng Zhou <zhoufeng.zf@...edance.com>
>>
>> Cannot attach when an upper device already has a program, This
>> restriction is only for bond's slave devices, and should not be
>> accidentally injured for devices like eth0 and vxlan0.
>>
>> Signed-off-by: Feng Zhou <zhoufeng.zf@...edance.com>
>> ---
>> net/core/dev.c | 10 ++++++----
>> 1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index 6ea1d20676fb..e1f87662376a 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -9501,10 +9501,12 @@ static int dev_xdp_attach(struct net_device *dev, struct netlink_ext_ack *extack
>> }
>> /* don't allow if an upper device already has a program */
>> - netdev_for_each_upper_dev_rcu(dev, upper, iter) {
>> - if (dev_xdp_prog_count(upper) > 0) {
>> - NL_SET_ERR_MSG(extack, "Cannot attach when an upper device already has a program");
>> - return -EEXIST;
>> + if (netif_is_bond_slave(dev)) {
>
>I think we want to consider even team port devices.
netif_is_lag_port()
>
>Thanks,
>
>Paolo
>
Powered by blists - more mailing lists