From 1b7eb337502f5654fa5ee6132e6b95020e2e698f Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 15 Dec 2020 14:49:46 +0000 Subject: [PATCH 01/11] net/mlx5: fix spelling mistake in Kconfig "accelaration" -> "acceleration" There are some spelling mistakes in the Kconfig. Fix these. Signed-off-by: Colin Ian King Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig index ad45d20f9d44d..c38b791e2406b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig +++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig @@ -149,14 +149,14 @@ config MLX5_IPSEC IPsec support for the Connect-X family. config MLX5_EN_IPSEC - bool "IPSec XFRM cryptography-offload accelaration" + bool "IPSec XFRM cryptography-offload acceleration" depends on MLX5_CORE_EN depends on XFRM_OFFLOAD depends on INET_ESP_OFFLOAD || INET6_ESP_OFFLOAD depends on MLX5_FPGA_IPSEC || MLX5_IPSEC default n help - Build support for IPsec cryptography-offload accelaration in the NIC. + Build support for IPsec cryptography-offload acceleration in the NIC. Note: Support for hardware with this capability needs to be selected for this option to become available. @@ -192,7 +192,7 @@ config MLX5_TLS config MLX5_EN_TLS bool help - Build support for TLS cryptography-offload accelaration in the NIC. + Build support for TLS cryptography-offload acceleration in the NIC. Note: Support for hardware with this capability needs to be selected for this option to become available. From b171fcd29c928d86e094b7e86c68daf77da12e26 Mon Sep 17 00:00:00 2001 From: Zou Wei Date: Wed, 9 Dec 2020 15:01:32 +0800 Subject: [PATCH 02/11] net/mlx5_core: remove unused including Remove including that don't need it. Fixes: 17a7612b99e6 ("net/mlx5_core: Clean driver version and name") Signed-off-by: Zou Wei Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 1 - 1 file changed, 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 84eeaa33033f9..a132fff7a980f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -30,7 +30,6 @@ * SOFTWARE. */ -#include #include #include #include From 5b74df80f301e872143fa716f3f4361b2e293e19 Mon Sep 17 00:00:00 2001 From: Leon Romanovsky Date: Mon, 4 Jan 2021 09:38:57 +0200 Subject: [PATCH 03/11] net/mlx5: Delete device list leftover Device list is not stored in mlx5_priv anymore, so delete it as it's not used. Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed --- include/linux/mlx5/driver.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 88197b87bd81f..936302b2c1419 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -588,7 +588,6 @@ struct mlx5_priv { /* end: alloc staff */ struct dentry *dbg_root; - struct list_head dev_list; struct list_head ctx_list; spinlock_t ctx_lock; struct mlx5_adev **adev; From 83907506f7ed7d9d233d8ee39a57a4dd48c63161 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Thu, 4 Feb 2021 09:32:32 +0000 Subject: [PATCH 04/11] net/mlx5e: Fix spelling mistake "channles" -> "channels" There is a spelling mistake in a netdev_warn message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 4cfdba997f247..35f69354e07ae 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -5647,7 +5647,7 @@ int mlx5e_netdev_change_profile(struct mlx5e_priv *priv, /* sanity */ if (new_max_nch != priv->max_nch) { netdev_warn(priv->netdev, - "%s: Replacing profile with different max channles\n", + "%s: Replacing profile with different max channels\n", __func__); return -EINVAL; } From a3f5a4520075cafbce7d58771b2b7fff6832d60b Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 3 Feb 2021 11:10:49 +0000 Subject: [PATCH 05/11] net/mlx5e: Fix spelling mistake "Unknouwn" -> "Unknown" There is a spelling mistake in a netdev_warn message. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Jesse Brandeburg Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 35f69354e07ae..d3534b657b980 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -223,7 +223,7 @@ static int blocking_event(struct notifier_block *nb, unsigned long event, void * err = mlx5e_handle_trap_event(priv, data); break; default: - netdev_warn(priv->netdev, "Sync event: Unknouwn event %ld\n", event); + netdev_warn(priv->netdev, "Sync event: Unknown event %ld\n", event); err = -EINVAL; } return err; From 793985432daadaf443b213fdd30123778a7e40cf Mon Sep 17 00:00:00 2001 From: Jiapeng Zhong Date: Mon, 25 Jan 2021 15:50:37 +0800 Subject: [PATCH 06/11] net/mlx5: Assign boolean values to a bool variable Fix the following coccicheck warnings: ./drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:575:2-14: WARNING: Assignment of 0/1 to bool variable. Reported-by: Abaci Robot Signed-off-by: Jiapeng Zhong Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index 11b89a3a2ff57..66ad599bd4889 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c @@ -572,7 +572,7 @@ static void del_hw_fte(struct fs_node *node) mlx5_core_warn(dev, "flow steering can't delete fte in index %d of flow group id %d\n", fte->index, fg->id); - node->active = 0; + node->active = false; } } From 36280f0797dfca856cda25feec085b03bc4f5609 Mon Sep 17 00:00:00 2001 From: Vlad Buslov Date: Tue, 9 Feb 2021 10:11:45 +0200 Subject: [PATCH 07/11] net/mlx5e: Fix tc_tun.h to verify MLX5_ESWITCH config Exclude contents of tc_tun.h header when CONFIG_MLX5_ESWITCH is disabled to prevent compile-time errors when compiling with such config. Fixes: 0d9f96471493 ("net/mlx5e: Extract tc tunnel encap/decap code to dedicated file") Signed-off-by: Vlad Buslov Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h index fa992e8690440..67de2bf36861d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h @@ -11,6 +11,8 @@ #include "en.h" #include "en_rep.h" +#ifdef CONFIG_MLX5_ESWITCH + enum { MLX5E_TC_TUNNEL_TYPE_UNKNOWN, MLX5E_TC_TUNNEL_TYPE_VXLAN, @@ -99,4 +101,6 @@ int mlx5e_tc_tun_parse_udp_ports(struct mlx5e_priv *priv, void *headers_c, void *headers_v); +#endif /* CONFIG_MLX5_ESWITCH */ + #endif //__MLX5_EN_TC_TUNNEL_H__ From 2dd4571b43dcf7921b21d57b9ad2df3a61056e55 Mon Sep 17 00:00:00 2001 From: Lukas Bulwahn Date: Fri, 5 Feb 2021 10:55:06 +0100 Subject: [PATCH 08/11] net/mlx5: docs: correct section reference in table of contents Commit 142d93d12dc1 ("net/mlx5: Add devlink subfunction port documentation") refers to a section 'mlx5 port function' in the table of contents, but includes a section 'mlx5 function attributes' instead. Hence, make htmldocs warns: mlx5.rst:16: WARNING: Unknown target name: "mlx5 port function". Correct the section reference in table of contents to the actual name of section in the documentation. Also, tune another section underline while visiting this document. Signed-off-by: Lukas Bulwahn Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed --- .../networking/device_drivers/ethernet/mellanox/mlx5.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5.rst b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5.rst index a1b32fcd0d76f..1b7e32d8a61b3 100644 --- a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5.rst +++ b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5.rst @@ -13,12 +13,12 @@ Contents - `Devlink info`_ - `Devlink parameters`_ - `mlx5 subfunction`_ -- `mlx5 port function`_ +- `mlx5 function attributes`_ - `Devlink health reporters`_ - `mlx5 tracepoints`_ Enabling the driver and kconfig options -================================================ +======================================= | mlx5 core is modular and most of the major mlx5 core driver features can be selected (compiled in/out) | at build time via kernel Kconfig flags. From 4782c5d8b972ba26a2558f064601ecff743e0d25 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 10 Feb 2021 14:06:28 +0300 Subject: [PATCH 09/11] net/mlx5: Fix a NULL vs IS_ERR() check The mlx5_chains_get_table() function doesn't return NULL, it returns error pointers so we need to fix this condition. Fixes: 34ca65352ddf ("net/mlx5: E-Switch, Indirect table infrastructure") Signed-off-by: Dan Carpenter Reviewed-by: Vlad Buslov Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c index b7d00c4c70468..6f6772bf61a26 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c @@ -216,7 +216,7 @@ static int mlx5_esw_indir_table_rule_get(struct mlx5_eswitch *esw, flow_act.flags = FLOW_ACT_IGNORE_FLOW_LEVEL | FLOW_ACT_NO_APPEND; dest.type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE; dest.ft = mlx5_chains_get_table(chains, 0, 1, 0); - if (!dest.ft) { + if (IS_ERR(dest.ft)) { err = PTR_ERR(dest.ft); goto err_table; } From 2b6c3c1e74e53f370074eb03769c9499aa30c55a Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Wed, 10 Feb 2021 07:46:05 +0000 Subject: [PATCH 10/11] net/mlx5e: Fix error return code in mlx5e_tc_esw_init() Fix to return negative error code from the mlx5e_tc_tun_init() error handling case instead of 0, as done elsewhere in this function. This commit also using 0 instead of 'ret' when success since it is always equal to 0. Fixes: 8914add2c9e5 ("net/mlx5e: Handle FIB events to update tunnel endpoint device") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index db142ee96510c..9f126054d3714 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -4750,10 +4750,12 @@ int mlx5e_tc_esw_init(struct rhashtable *tc_ht) lockdep_set_class(&tc_ht->mutex, &tc_ht_lock_key); uplink_priv->encap = mlx5e_tc_tun_init(priv); - if (IS_ERR(uplink_priv->encap)) + if (IS_ERR(uplink_priv->encap)) { + err = PTR_ERR(uplink_priv->encap); goto err_register_fib_notifier; + } - return err; + return 0; err_register_fib_notifier: rhashtable_destroy(tc_ht); From b50c4892cb98417df96b73119c54520da34a3e88 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Wed, 10 Feb 2021 07:54:17 +0000 Subject: [PATCH 11/11] net/mlx5: SF, Fix error return code in mlx5_sf_dev_probe() Fix to return negative error code -ENOMEM from the ioremap() error handling case instead of 0, as done elsewhere in this function. Fixes: 1958fc2f0712 ("net/mlx5: SF, Add auxiliary device driver") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c index daf63a8115e07..c4bf555c25eaa 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c @@ -37,6 +37,7 @@ static int mlx5_sf_dev_probe(struct auxiliary_device *adev, const struct auxilia mdev->iseg = ioremap(mdev->iseg_base, sizeof(*mdev->iseg)); if (!mdev->iseg) { mlx5_core_warn(mdev, "remap error\n"); + err = -ENOMEM; goto remap_err; }