2022-07-29 10:27:36

by Guangbin Huang

[permalink] [raw]
Subject: [PATCH net 0/2] net: fix using wrong flags to check features

We find that some drivers may use wrong flags to check features, so fix
them.

Jian Shen (2):
net: ice: fix error NETIF_F_HW_VLAN_CTAG_FILTER check in
ice_vsi_sync_fltr()
net: ionic: fix error check for vlan flags in ionic_set_nic_features()

drivers/net/ethernet/intel/ice/ice_main.c | 2 +-
drivers/net/ethernet/pensando/ionic/ionic_lif.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

--
2.33.0


2022-07-29 10:28:37

by Guangbin Huang

[permalink] [raw]
Subject: [PATCH net 1/2] net: ice: fix error NETIF_F_HW_VLAN_CTAG_FILTER check in ice_vsi_sync_fltr()

From: Jian Shen <[email protected]>

vsi->current_netdev_flags is used store the current net device
flags, not the active netdevice features. So it should use
vsi->netdev->featurs, rather than vsi->current_netdev_flags
to check NETIF_F_HW_VLAN_CTAG_FILTER.

Fixes: 1babaf77f49d ("ice: Advertise 802.1ad VLAN filtering and offloads for PF netdev")

Signed-off-by: Jian Shen <[email protected]>
Signed-off-by: Guangbin Huang <[email protected]>
---
drivers/net/ethernet/intel/ice/ice_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 9f02b60459f1..bc68dc5c6927 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -433,7 +433,7 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
IFF_PROMISC;
goto out_promisc;
}
- if (vsi->current_netdev_flags &
+ if (vsi->netdev->features &
NETIF_F_HW_VLAN_CTAG_FILTER)
vlan_ops->ena_rx_filtering(vsi);
}
--
2.33.0

2022-07-29 10:35:37

by Guangbin Huang

[permalink] [raw]
Subject: [PATCH net 2/2] net: ionic: fix error check for vlan flags in ionic_set_nic_features()

From: Jian Shen <[email protected]>

The prototype of input features of ionic_set_nic_features() is
netdev_features_t, but the vlan_flags is using the private
definition of ionic drivers. It should use the variable
ctx.cmd.lif_setattr.features, rather than features to check
the vlan flags. So fixes it.

Fixes: beead698b173 ("ionic: Add the basic NDO callbacks for netdev support")

Signed-off-by: Jian Shen <[email protected]>
Signed-off-by: Guangbin Huang <[email protected]>
---
drivers/net/ethernet/pensando/ionic/ionic_lif.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
index f3568901eb91..1443f788ee37 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
@@ -1437,7 +1437,7 @@ static int ionic_set_nic_features(struct ionic_lif *lif,
if ((old_hw_features ^ lif->hw_features) & IONIC_ETH_HW_RX_HASH)
ionic_lif_rss_config(lif, lif->rss_types, NULL, NULL);

- if ((vlan_flags & features) &&
+ if ((vlan_flags & le64_to_cpu(ctx.cmd.lif_setattr.features)) &&
!(vlan_flags & le64_to_cpu(ctx.comp.lif_setattr.features)))
dev_info_once(lif->ionic->dev, "NIC is not supporting vlan offload, likely in SmartNIC mode\n");

--
2.33.0

2022-07-29 16:38:05

by Shannon Nelson

[permalink] [raw]
Subject: Re: [PATCH net 2/2] net: ionic: fix error check for vlan flags in ionic_set_nic_features()

On 7/29/22 3:17 AM, Guangbin Huang wrote:
> From: Jian Shen <[email protected]>
>
> The prototype of input features of ionic_set_nic_features() is
> netdev_features_t, but the vlan_flags is using the private
> definition of ionic drivers. It should use the variable
> ctx.cmd.lif_setattr.features, rather than features to check
> the vlan flags. So fixes it.
>
> Fixes: beead698b173 ("ionic: Add the basic NDO callbacks for netdev support")
>
> Signed-off-by: Jian Shen <[email protected]>
> Signed-off-by: Guangbin Huang <[email protected]>

Good catch - thanks!

Acked-by: Shannon Nelson <[email protected]>


> ---
> drivers/net/ethernet/pensando/ionic/ionic_lif.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> index f3568901eb91..1443f788ee37 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> @@ -1437,7 +1437,7 @@ static int ionic_set_nic_features(struct ionic_lif *lif,
> if ((old_hw_features ^ lif->hw_features) & IONIC_ETH_HW_RX_HASH)
> ionic_lif_rss_config(lif, lif->rss_types, NULL, NULL);
>
> - if ((vlan_flags & features) &&
> + if ((vlan_flags & le64_to_cpu(ctx.cmd.lif_setattr.features)) &&
> !(vlan_flags & le64_to_cpu(ctx.comp.lif_setattr.features)))
> dev_info_once(lif->ionic->dev, "NIC is not supporting vlan offload, likely in SmartNIC mode\n");
>

2022-07-29 17:26:44

by Tony Nguyen

[permalink] [raw]
Subject: Re: [PATCH net 1/2] net: ice: fix error NETIF_F_HW_VLAN_CTAG_FILTER check in ice_vsi_sync_fltr()



On 7/29/2022 3:17 AM, Guangbin Huang wrote:
> From: Jian Shen <[email protected]>
>
> vsi->current_netdev_flags is used store the current net device
> flags, not the active netdevice features. So it should use
> vsi->netdev->featurs, rather than vsi->current_netdev_flags
> to check NETIF_F_HW_VLAN_CTAG_FILTER.
>
> Fixes: 1babaf77f49d ("ice: Advertise 802.1ad VLAN filtering and offloads for PF netdev")
>
> Signed-off-by: Jian Shen <[email protected]>
> Signed-off-by: Guangbin Huang <[email protected]>

Acked-by: Tony Nguyen <[email protected]>

> ---
> drivers/net/ethernet/intel/ice/ice_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index 9f02b60459f1..bc68dc5c6927 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -433,7 +433,7 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
> IFF_PROMISC;
> goto out_promisc;
> }
> - if (vsi->current_netdev_flags &
> + if (vsi->netdev->features &
> NETIF_F_HW_VLAN_CTAG_FILTER)
> vlan_ops->ena_rx_filtering(vsi);
> }

2022-08-01 19:58:51

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH net 0/2] net: fix using wrong flags to check features

Hello:

This series was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

On Fri, 29 Jul 2022 18:17:53 +0800 you wrote:
> We find that some drivers may use wrong flags to check features, so fix
> them.
>
> Jian Shen (2):
> net: ice: fix error NETIF_F_HW_VLAN_CTAG_FILTER check in
> ice_vsi_sync_fltr()
> net: ionic: fix error check for vlan flags in ionic_set_nic_features()
>
> [...]

Here is the summary with links:
- [net,1/2] net: ice: fix error NETIF_F_HW_VLAN_CTAG_FILTER check in ice_vsi_sync_fltr()
https://git.kernel.org/netdev/net/c/7dc839fe4761
- [net,2/2] net: ionic: fix error check for vlan flags in ionic_set_nic_features()
https://git.kernel.org/netdev/net/c/a86e86db5e6d

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html