All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/mlx5e: restrict the real_dev of vlan device is the same as uplink device
@ 2019-05-15  9:25 wenxu
  2019-05-17 20:30 ` Saeed Mahameed
  0 siblings, 1 reply; 5+ messages in thread
From: wenxu @ 2019-05-15  9:25 UTC (permalink / raw)
  To: saeedm; +Cc: netdev

From: wenxu <wenxu@ucloud.cn>

When register indr block for vlan device, it should check the real_dev
of vlan device is same as uplink device. Or it will set offload rule
to mlx5e which will never hit.

Signed-off-by: wenxu <wenxu@ucloud.cn>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 91e24f1..a39fdac 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -796,7 +796,7 @@ static int mlx5e_nic_rep_netdevice_event(struct notifier_block *nb,
 	struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
 
 	if (!mlx5e_tc_tun_device_to_offload(priv, netdev) &&
-	    !is_vlan_dev(netdev))
+	    !(is_vlan_dev(netdev) && vlan_dev_real_dev(netdev) == rpriv->netdev))
 		return NOTIFY_OK;
 
 	switch (event) {
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] net/mlx5e: restrict the real_dev of vlan device is the same as uplink device
  2019-05-15  9:25 [PATCH] net/mlx5e: restrict the real_dev of vlan device is the same as uplink device wenxu
@ 2019-05-17 20:30 ` Saeed Mahameed
  2019-05-18  3:10   ` wenxu
  0 siblings, 1 reply; 5+ messages in thread
From: Saeed Mahameed @ 2019-05-17 20:30 UTC (permalink / raw)
  To: Gavi Teitz, wenxu, Roi Dayan, Vlad Buslov, Jianbo Liu; +Cc: netdev

On Wed, 2019-05-15 at 17:25 +0800, wenxu@ucloud.cn wrote:
> From: wenxu <wenxu@ucloud.cn>
> 
> When register indr block for vlan device, it should check the
> real_dev
> of vlan device is same as uplink device. Or it will set offload rule
> to mlx5e which will never hit.
> 

I would improve the commit message, it is not really clear to me what
is going on here.

Anyway Roi and team, can you please provide feedback ..

> Signed-off-by: wenxu <wenxu@ucloud.cn>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> index 91e24f1..a39fdac 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> @@ -796,7 +796,7 @@ static int mlx5e_nic_rep_netdevice_event(struct
> notifier_block *nb,
>  	struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
>  
>  	if (!mlx5e_tc_tun_device_to_offload(priv, netdev) &&
> -	    !is_vlan_dev(netdev))
> +	    !(is_vlan_dev(netdev) && vlan_dev_real_dev(netdev) ==
> rpriv->netdev))
>  		return NOTIFY_OK;
>  
>  	switch (event) {

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net/mlx5e: restrict the real_dev of vlan device is the same as uplink device
  2019-05-17 20:30 ` Saeed Mahameed
@ 2019-05-18  3:10   ` wenxu
  2019-05-19  6:49     ` Roi Dayan
  0 siblings, 1 reply; 5+ messages in thread
From: wenxu @ 2019-05-18  3:10 UTC (permalink / raw)
  To: Saeed Mahameed, Gavi Teitz, Roi Dayan, Vlad Buslov, Jianbo Liu; +Cc: netdev

There will be multiple vlan device which maybe not belong to the uplink rep device, so wen can limit it

在 2019/5/18 4:30, Saeed Mahameed 写道:
> On Wed, 2019-05-15 at 17:25 +0800, wenxu@ucloud.cn wrote:
>> From: wenxu <wenxu@ucloud.cn>
>>
>> When register indr block for vlan device, it should check the
>> real_dev
>> of vlan device is same as uplink device. Or it will set offload rule
>> to mlx5e which will never hit.
>>
> I would improve the commit message, it is not really clear to me what
> is going on here.
>
> Anyway Roi and team, can you please provide feedback ..
>
>> Signed-off-by: wenxu <wenxu@ucloud.cn>
>> ---
>>  drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
>> b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
>> index 91e24f1..a39fdac 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
>> @@ -796,7 +796,7 @@ static int mlx5e_nic_rep_netdevice_event(struct
>> notifier_block *nb,
>>  	struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
>>  
>>  	if (!mlx5e_tc_tun_device_to_offload(priv, netdev) &&
>> -	    !is_vlan_dev(netdev))
>> +	    !(is_vlan_dev(netdev) && vlan_dev_real_dev(netdev) ==
>> rpriv->netdev))
>>  		return NOTIFY_OK;
>>  
>>  	switch (event) {

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net/mlx5e: restrict the real_dev of vlan device is the same as uplink device
  2019-05-18  3:10   ` wenxu
@ 2019-05-19  6:49     ` Roi Dayan
  2019-05-20 21:23       ` Saeed Mahameed
  0 siblings, 1 reply; 5+ messages in thread
From: Roi Dayan @ 2019-05-19  6:49 UTC (permalink / raw)
  To: wenxu, Saeed Mahameed, Gavi Teitz, Vlad Buslov, Jianbo Liu; +Cc: netdev



On 18/05/2019 06:10, wenxu wrote:
> There will be multiple vlan device which maybe not belong to the uplink rep device, so wen can limit it
> 
> 在 2019/5/18 4:30, Saeed Mahameed 写道:
>> On Wed, 2019-05-15 at 17:25 +0800, wenxu@ucloud.cn wrote:
>>> From: wenxu <wenxu@ucloud.cn>
>>>
>>> When register indr block for vlan device, it should check the
>>> real_dev
>>> of vlan device is same as uplink device. Or it will set offload rule
>>> to mlx5e which will never hit.
>>>
>> I would improve the commit message, it is not really clear to me what
>> is going on here.
>>
>> Anyway Roi and team, can you please provide feedback ..
>>
>>> Signed-off-by: wenxu <wenxu@ucloud.cn>
>>> ---
>>>  drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
>>> b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
>>> index 91e24f1..a39fdac 100644
>>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
>>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
>>> @@ -796,7 +796,7 @@ static int mlx5e_nic_rep_netdevice_event(struct
>>> notifier_block *nb,
>>>  	struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
>>>  
>>>  	if (!mlx5e_tc_tun_device_to_offload(priv, netdev) &&
>>> -	    !is_vlan_dev(netdev))
>>> +	    !(is_vlan_dev(netdev) && vlan_dev_real_dev(netdev) ==
>>> rpriv->netdev))
>>>  		return NOTIFY_OK;
>>>  
>>>  	switch (event) {

thanks!

you should add a fixes line
Fixes: 35a605db168c ("net/mlx5e: Offload TC e-switch rules with ingress VLAN device")

beside that all good.
Reviewed-by: Roi Dayan <roid@mellanox.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net/mlx5e: restrict the real_dev of vlan device is the same as uplink device
  2019-05-19  6:49     ` Roi Dayan
@ 2019-05-20 21:23       ` Saeed Mahameed
  0 siblings, 0 replies; 5+ messages in thread
From: Saeed Mahameed @ 2019-05-20 21:23 UTC (permalink / raw)
  To: Gavi Teitz, wenxu, Roi Dayan, Vlad Buslov, Jianbo Liu; +Cc: netdev

On Sun, 2019-05-19 at 06:49 +0000, Roi Dayan wrote:
> 
> On 18/05/2019 06:10, wenxu wrote:
> > There will be multiple vlan device which maybe not belong to the
> > uplink rep device, so wen can limit it
> > 
> > 在 2019/5/18 4:30, Saeed Mahameed 写道:
> > > On Wed, 2019-05-15 at 17:25 +0800, wenxu@ucloud.cn wrote:
> > > > From: wenxu <wenxu@ucloud.cn>
> > > > 
> > > > When register indr block for vlan device, it should check the
> > > > real_dev
> > > > of vlan device is same as uplink device. Or it will set offload
> > > > rule
> > > > to mlx5e which will never hit.
> > > > 
> > > I would improve the commit message, it is not really clear to me
> > > what
> > > is going on here.
> > > 
> > > Anyway Roi and team, can you please provide feedback ..
> > > 
> > > > Signed-off-by: wenxu <wenxu@ucloud.cn>
> > > > ---
> > > >  drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > 
> > > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> > > > b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> > > > index 91e24f1..a39fdac 100644
> > > > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> > > > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> > > > @@ -796,7 +796,7 @@ static int
> > > > mlx5e_nic_rep_netdevice_event(struct
> > > > notifier_block *nb,
> > > >  	struct net_device *netdev =
> > > > netdev_notifier_info_to_dev(ptr);
> > > >  
> > > >  	if (!mlx5e_tc_tun_device_to_offload(priv, netdev) &&
> > > > -	    !is_vlan_dev(netdev))
> > > > +	    !(is_vlan_dev(netdev) && vlan_dev_real_dev(netdev)
> > > > ==
> > > > rpriv->netdev))
> > > >  		return NOTIFY_OK;
> > > >  
> > > >  	switch (event) {
> 
> thanks!
> 
> you should add a fixes line
> Fixes: 35a605db168c ("net/mlx5e: Offload TC e-switch rules with
> ingress VLAN device")
> 
> beside that all good.
> Reviewed-by: Roi Dayan <roid@mellanox.com>
> 
> 

Applied to net-mlx5 and added the Fixes line.
Thanks !

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-20 21:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15  9:25 [PATCH] net/mlx5e: restrict the real_dev of vlan device is the same as uplink device wenxu
2019-05-17 20:30 ` Saeed Mahameed
2019-05-18  3:10   ` wenxu
2019-05-19  6:49     ` Roi Dayan
2019-05-20 21:23       ` Saeed Mahameed

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.