netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] net/mlx5e: Add bonding device for indr block to offload the packet received from bonding device
@ 2019-05-17  9:17 wenxu
  2019-05-17 20:34 ` Saeed Mahameed
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: wenxu @ 2019-05-17  9:17 UTC (permalink / raw)
  To: saeedm, roid; +Cc: netdev

From: wenxu <wenxu@ucloud.cn>

The mlx5e support the lag mode. When add mlx_p0 and mlx_p1 to bond0.
packet received from mlx_p0 or mlx_p1 and in the ingress tc flower
forward to vf0. The tc rule can't be offloaded because there is
no indr_register_block for the bonding device.

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

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 91e24f1..134fa0b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -796,6 +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) &&
+	    !netif_is_bond_master(netdev) &&
 	    !is_vlan_dev(netdev))
 		return NOTIFY_OK;
 
-- 
1.8.3.1


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

* Re: [PATCH v2] net/mlx5e: Add bonding device for indr block to offload the packet received from bonding device
  2019-05-17  9:17 [PATCH v2] net/mlx5e: Add bonding device for indr block to offload the packet received from bonding device wenxu
@ 2019-05-17 20:34 ` Saeed Mahameed
  2019-05-17 22:11 ` Mark Bloch
  2019-05-19  7:23 ` Or Gerlitz
  2 siblings, 0 replies; 6+ messages in thread
From: Saeed Mahameed @ 2019-05-17 20:34 UTC (permalink / raw)
  To: wenxu, Roi Dayan, Or Gerlitz; +Cc: netdev

On Fri, 2019-05-17 at 17:17 +0800, wenxu@ucloud.cn wrote:
> From: wenxu <wenxu@ucloud.cn>
> 
> The mlx5e support the lag mode. When add mlx_p0 and mlx_p1 to bond0.
> packet received from mlx_p0 or mlx_p1 and in the ingress tc flower
> forward to vf0. The tc rule can't be offloaded because there is
> no indr_register_block for the bonding device.
> 
> Signed-off-by: wenxu <wenxu@ucloud.cn>

Hi Wenxu, thanks for the patch

I would like to wait for some feedback from Roi and his team, 
Guys can you please provide feedback ?

Thanks,
Saeed

> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> index 91e24f1..134fa0b 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> @@ -796,6 +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) &&
> +	    !netif_is_bond_master(netdev) &&
>  	    !is_vlan_dev(netdev))
>  		return NOTIFY_OK;
>  

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

* Re: [PATCH v2] net/mlx5e: Add bonding device for indr block to offload the packet received from bonding device
  2019-05-17  9:17 [PATCH v2] net/mlx5e: Add bonding device for indr block to offload the packet received from bonding device wenxu
  2019-05-17 20:34 ` Saeed Mahameed
@ 2019-05-17 22:11 ` Mark Bloch
  2019-05-18  3:17   ` wenxu
  2019-05-19  7:23 ` Or Gerlitz
  2 siblings, 1 reply; 6+ messages in thread
From: Mark Bloch @ 2019-05-17 22:11 UTC (permalink / raw)
  To: wenxu, Saeed Mahameed, Roi Dayan; +Cc: netdev



On 5/17/19 2:17 AM, wenxu@ucloud.cn wrote:
> From: wenxu <wenxu@ucloud.cn>
> 
> The mlx5e support the lag mode. When add mlx_p0 and mlx_p1 to bond0.
> packet received from mlx_p0 or mlx_p1 and in the ingress tc flower
> forward to vf0. The tc rule can't be offloaded because there is
> no indr_register_block for the bonding device.
> 
> Signed-off-by: wenxu <wenxu@ucloud.cn>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> index 91e24f1..134fa0b 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> @@ -796,6 +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) &&
> +	    !netif_is_bond_master(netdev) &&

I'm not that familiar with this code path, but shouldn't you check the mlx5e
netdevices are slaves of the bond device (what if you have multiple
bond devices in the system?)

>  	    !is_vlan_dev(netdev))
>  		return NOTIFY_OK;
>  
> 

Mark

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

* Re: [PATCH v2] net/mlx5e: Add bonding device for indr block to offload the packet received from bonding device
  2019-05-17 22:11 ` Mark Bloch
@ 2019-05-18  3:17   ` wenxu
  2019-05-18  5:09     ` Mark Bloch
  0 siblings, 1 reply; 6+ messages in thread
From: wenxu @ 2019-05-18  3:17 UTC (permalink / raw)
  To: Mark Bloch, Saeed Mahameed, Roi Dayan; +Cc: netdev


在 2019/5/18 6:11, Mark Bloch 写道:
>
> On 5/17/19 2:17 AM, wenxu@ucloud.cn wrote:
>> From: wenxu <wenxu@ucloud.cn>
>>
>> The mlx5e support the lag mode. When add mlx_p0 and mlx_p1 to bond0.
>> packet received from mlx_p0 or mlx_p1 and in the ingress tc flower
>> forward to vf0. The tc rule can't be offloaded because there is
>> no indr_register_block for the bonding device.
>>
>> Signed-off-by: wenxu <wenxu@ucloud.cn>
>> ---
>>  drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
>> index 91e24f1..134fa0b 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
>> @@ -796,6 +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) &&
>> +	    !netif_is_bond_master(netdev) &&
> I'm not that familiar with this code path, but shouldn't you check the mlx5e
> netdevices are slaves of the bond device (what if you have multiple
> bond devices in the system?)

The bonding device is not simlilar with vlan device,  when vlan device is register, the real device is defintived.  But the when the bonding device is register, there maybe not slave device.

As the following codes. Any NETDEV_REGISTER EVENT will do indr register block.

    if (!mlx5e_tc_tun_device_to_offload(priv, netdev) &&
        !netif_is_bond_master(netdev) &&
        !is_vlan_dev(netdev))
        return NOTIFY_OK;

    switch (event) {
    case NETDEV_REGISTER:
        mlx5e_rep_indr_register_block(rpriv, netdev);

>>  	    !is_vlan_dev(netdev))
>>  		return NOTIFY_OK;
>>  
>>
> Mark

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

* Re: [PATCH v2] net/mlx5e: Add bonding device for indr block to offload the packet received from bonding device
  2019-05-18  3:17   ` wenxu
@ 2019-05-18  5:09     ` Mark Bloch
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Bloch @ 2019-05-18  5:09 UTC (permalink / raw)
  To: wenxu, Saeed Mahameed, Roi Dayan; +Cc: netdev



On 5/17/2019 20:17, wenxu wrote:
> 
> 在 2019/5/18 6:11, Mark Bloch 写道:
>>
>> On 5/17/19 2:17 AM, wenxu@ucloud.cn wrote:
>>> From: wenxu <wenxu@ucloud.cn>
>>>
>>> The mlx5e support the lag mode. When add mlx_p0 and mlx_p1 to bond0.
>>> packet received from mlx_p0 or mlx_p1 and in the ingress tc flower
>>> forward to vf0. The tc rule can't be offloaded because there is
>>> no indr_register_block for the bonding device.
>>>
>>> Signed-off-by: wenxu <wenxu@ucloud.cn>
>>> ---
>>>  drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
>>> index 91e24f1..134fa0b 100644
>>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
>>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
>>> @@ -796,6 +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) &&
>>> +	    !netif_is_bond_master(netdev) &&
>> I'm not that familiar with this code path, but shouldn't you check the mlx5e
>> netdevices are slaves of the bond device (what if you have multiple
>> bond devices in the system?)
> 
> The bonding device is not simlilar with vlan device,  when vlan device is register, the real device is defintived.  But the when the bonding device is register, there maybe not slave device.

I know how bonding works, that's why I asked what I asked.
It seems there is a piece of code missing which filters the rules (probably in mlx5e_configure_flower())
 
> 
> As the following codes. Any NETDEV_REGISTER EVENT will do indr register block.
> 
>     if (!mlx5e_tc_tun_device_to_offload(priv, netdev) &&
>         !netif_is_bond_master(netdev) &&
>         !is_vlan_dev(netdev))
>         return NOTIFY_OK;
> 
>     switch (event) {
>     case NETDEV_REGISTER:
>         mlx5e_rep_indr_register_block(rpriv, netdev);
> 
>>>  	    !is_vlan_dev(netdev))
>>>  		return NOTIFY_OK;
>>>  
>>>
>> Mark

Mark

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

* Re: [PATCH v2] net/mlx5e: Add bonding device for indr block to offload the packet received from bonding device
  2019-05-17  9:17 [PATCH v2] net/mlx5e: Add bonding device for indr block to offload the packet received from bonding device wenxu
  2019-05-17 20:34 ` Saeed Mahameed
  2019-05-17 22:11 ` Mark Bloch
@ 2019-05-19  7:23 ` Or Gerlitz
  2 siblings, 0 replies; 6+ messages in thread
From: Or Gerlitz @ 2019-05-19  7:23 UTC (permalink / raw)
  To: wenxu; +Cc: Saeed Mahameed, Roi Dayan, Linux Netdev List

On Fri, May 17, 2019 at 12:45 PM <wenxu@ucloud.cn> wrote:
> From: wenxu <wenxu@ucloud.cn>
>
> The mlx5e support the lag mode. When add mlx_p0 and mlx_p1 to bond0.
> packet received from mlx_p0 or mlx_p1 and in the ingress tc flower
> forward to vf0. The tc rule can't be offloaded because there is
> no indr_register_block for the bonding device.

For the bonding case, the offloading strategy is tc block sharing,
namly have user-space
share the tc block of the upper device (bond) with the lower devices
(mlx5 p0 and p1).

This is implemented for example in ovs.

You can read on tc block sharing in the mlxsw driver wiki [1]

Or.

[1] https://github.com/Mellanox/mlxsw/wiki/ACLs#shared-blocks-support

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

end of thread, other threads:[~2019-05-19 18:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-17  9:17 [PATCH v2] net/mlx5e: Add bonding device for indr block to offload the packet received from bonding device wenxu
2019-05-17 20:34 ` Saeed Mahameed
2019-05-17 22:11 ` Mark Bloch
2019-05-18  3:17   ` wenxu
2019-05-18  5:09     ` Mark Bloch
2019-05-19  7:23 ` Or Gerlitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).