netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] mlxsw: spectrum_switchdev: Use is_zero_ether_addr() instead of ether_addr_equal()
@ 2023-08-08 13:35 Ruan Jinjie
  2023-08-08 14:44 ` Ido Schimmel
  2023-08-09 20:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Ruan Jinjie @ 2023-08-08 13:35 UTC (permalink / raw)
  To: netdev, Ido Schimmel, Petr Machata, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: ruanjinjie

Use is_zero_ether_addr() instead of ether_addr_equal()
to check if the ethernet address is all zeros.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
index 5376d4af5f91..efacb057d1d4 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
@@ -3549,7 +3549,6 @@ mlxsw_sp_switchdev_vxlan_fdb_add(struct mlxsw_sp *mlxsw_sp,
 	struct switchdev_notifier_vxlan_fdb_info *vxlan_fdb_info;
 	struct mlxsw_sp_bridge_device *bridge_device;
 	struct net_device *dev = switchdev_work->dev;
-	u8 all_zeros_mac[ETH_ALEN] = { 0 };
 	enum mlxsw_sp_l3proto proto;
 	union mlxsw_sp_l3addr addr;
 	struct net_device *br_dev;
@@ -3571,7 +3570,7 @@ mlxsw_sp_switchdev_vxlan_fdb_add(struct mlxsw_sp *mlxsw_sp,
 	mlxsw_sp_switchdev_vxlan_addr_convert(&vxlan_fdb_info->remote_ip,
 					      &proto, &addr);
 
-	if (ether_addr_equal(vxlan_fdb_info->eth_addr, all_zeros_mac)) {
+	if (is_zero_ether_addr(vxlan_fdb_info->eth_addr)) {
 		err = mlxsw_sp_nve_flood_ip_add(mlxsw_sp, fid, proto, &addr);
 		if (err) {
 			mlxsw_sp_fid_put(fid);
@@ -3623,7 +3622,6 @@ mlxsw_sp_switchdev_vxlan_fdb_del(struct mlxsw_sp *mlxsw_sp,
 	struct mlxsw_sp_bridge_device *bridge_device;
 	struct net_device *dev = switchdev_work->dev;
 	struct net_device *br_dev = netdev_master_upper_dev_get(dev);
-	u8 all_zeros_mac[ETH_ALEN] = { 0 };
 	enum mlxsw_sp_l3proto proto;
 	union mlxsw_sp_l3addr addr;
 	struct mlxsw_sp_fid *fid;
@@ -3644,7 +3642,7 @@ mlxsw_sp_switchdev_vxlan_fdb_del(struct mlxsw_sp *mlxsw_sp,
 	mlxsw_sp_switchdev_vxlan_addr_convert(&vxlan_fdb_info->remote_ip,
 					      &proto, &addr);
 
-	if (ether_addr_equal(vxlan_fdb_info->eth_addr, all_zeros_mac)) {
+	if (is_zero_ether_addr(vxlan_fdb_info->eth_addr)) {
 		mlxsw_sp_nve_flood_ip_del(mlxsw_sp, fid, proto, &addr);
 		mlxsw_sp_fid_put(fid);
 		return;
-- 
2.34.1


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

* Re: [PATCH -next] mlxsw: spectrum_switchdev: Use is_zero_ether_addr() instead of ether_addr_equal()
  2023-08-08 13:35 [PATCH -next] mlxsw: spectrum_switchdev: Use is_zero_ether_addr() instead of ether_addr_equal() Ruan Jinjie
@ 2023-08-08 14:44 ` Ido Schimmel
  2023-08-09  1:21   ` Ruan Jinjie
  2023-08-09 20:20 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Ido Schimmel @ 2023-08-08 14:44 UTC (permalink / raw)
  To: Ruan Jinjie
  Cc: netdev, Petr Machata, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni

In the future, please use the correct patch prefix for netdev
submissions. See:

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#tl-dr

On Tue, Aug 08, 2023 at 09:35:28PM +0800, Ruan Jinjie wrote:
> Use is_zero_ether_addr() instead of ether_addr_equal()
> to check if the ethernet address is all zeros.
> 
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

Thanks

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

* Re: [PATCH -next] mlxsw: spectrum_switchdev: Use is_zero_ether_addr() instead of ether_addr_equal()
  2023-08-08 14:44 ` Ido Schimmel
@ 2023-08-09  1:21   ` Ruan Jinjie
  0 siblings, 0 replies; 4+ messages in thread
From: Ruan Jinjie @ 2023-08-09  1:21 UTC (permalink / raw)
  To: Ido Schimmel
  Cc: netdev, Petr Machata, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni



On 2023/8/8 22:44, Ido Schimmel wrote:
> In the future, please use the correct patch prefix for netdev
> submissions. See:
> 
> https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#tl-dr

Thank you! I'll keep an eye on these issues.

> 
> On Tue, Aug 08, 2023 at 09:35:28PM +0800, Ruan Jinjie wrote:
>> Use is_zero_ether_addr() instead of ether_addr_equal()
>> to check if the ethernet address is all zeros.
>>
>> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> 
> Reviewed-by: Ido Schimmel <idosch@nvidia.com>
> 
> Thanks

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

* Re: [PATCH -next] mlxsw: spectrum_switchdev: Use is_zero_ether_addr() instead of ether_addr_equal()
  2023-08-08 13:35 [PATCH -next] mlxsw: spectrum_switchdev: Use is_zero_ether_addr() instead of ether_addr_equal() Ruan Jinjie
  2023-08-08 14:44 ` Ido Schimmel
@ 2023-08-09 20:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-09 20:20 UTC (permalink / raw)
  To: Ruan Jinjie; +Cc: netdev, idosch, petrm, davem, edumazet, kuba, pabeni

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 8 Aug 2023 21:35:28 +0800 you wrote:
> Use is_zero_ether_addr() instead of ether_addr_equal()
> to check if the ethernet address is all zeros.
> 
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> ---
>  drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Here is the summary with links:
  - [-next] mlxsw: spectrum_switchdev: Use is_zero_ether_addr() instead of ether_addr_equal()
    https://git.kernel.org/netdev/net-next/c/99ecd6d06527

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



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

end of thread, other threads:[~2023-08-09 20:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-08 13:35 [PATCH -next] mlxsw: spectrum_switchdev: Use is_zero_ether_addr() instead of ether_addr_equal() Ruan Jinjie
2023-08-08 14:44 ` Ido Schimmel
2023-08-09  1:21   ` Ruan Jinjie
2023-08-09 20:20 ` patchwork-bot+netdevbpf

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).