From: Saeed Mahameed <saeedm@nvidia.com>
Hi Dave, Jakub,
This series introduces some fixes to mlx5 driver.
Please pull and let me know if there is any problem.
Thanks,
Saeed.
---
The following changes since commit 8373cd38a8888549ace7c7617163a2e826970a92:
net: hns3: change the method of obtaining default ptp cycle (2021-07-27 20:59:32 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-fixes-2021-07-27
for you to fetch changes up to 740452e09cf5fc489ce60831cf11abef117b5d26:
net/mlx5: Fix mlx5_vport_tbl_attr chain from u16 to u32 (2021-07-27 16:10:06 -0700)
----------------------------------------------------------------
mlx5-fixes-2021-07-27
----------------------------------------------------------------
Aya Levin (4):
net/mlx5e: Consider PTP-RQ when setting RX VLAN stripping
net/mlx5e: Fix page allocation failure for trap-RQ over SF
net/mlx5e: Fix page allocation failure for ptp-RQ over SF
net/mlx5: Unload device upon firmware fatal error
Chris Mi (1):
net/mlx5: Fix mlx5_vport_tbl_attr chain from u16 to u32
Dima Chumak (1):
net/mlx5e: Fix nullptr in mlx5e_hairpin_get_mdev()
Maor Dickman (2):
net/mlx5e: Disable Rx ntuple offload for uplink representor
net/mlx5: E-Switch, Set destination vport vhca id only when merged eswitch is supported
Maor Gottlieb (1):
net/mlx5: Fix flow table chaining
Maxim Mikityanskiy (1):
net/mlx5e: Add NETIF_F_HW_TC to hw_features when HTB offload is available
Roi Dayan (1):
net/mlx5: E-Switch, handle devcom events only for ports on the same device
Tariq Toukan (1):
net/mlx5e: RX, Avoid possible data corruption when relaxed ordering and LRO combined
drivers/net/ethernet/mellanox/mlx5/core/dev.c | 5 +--
.../net/ethernet/mellanox/mlx5/core/en/params.c | 11 ++++++-
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c | 7 ++--
drivers/net/ethernet/mellanox/mlx5/core/en/trap.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 38 +++++++++++++++-------
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 33 +++++++++++++++++--
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 2 +-
.../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 10 ++++--
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 10 +++---
drivers/net/ethernet/mellanox/mlx5/core/health.c | 12 +++++--
10 files changed, 98 insertions(+), 32 deletions(-)
@@ -3829,6 +3829,24 @@ int mlx5e_set_features(struct net_device *netdev, netdev_features_t features)return0;}+staticnetdev_features_tmlx5e_fix_uplink_rep_features(structnet_device*netdev,+netdev_features_tfeatures)+{+features&=~NETIF_F_HW_TLS_RX;+if(netdev->features&NETIF_F_HW_TLS_RX)+netdev_warn(netdev,"Disabling hw_tls_rx, not supported in switchdev mode\n");++features&=~NETIF_F_HW_TLS_TX;+if(netdev->features&NETIF_F_HW_TLS_TX)+netdev_warn(netdev,"Disabling hw_tls_tx, not supported in switchdev mode\n");++features&=~NETIF_F_NTUPLE;+if(netdev->features&NETIF_F_NTUPLE)+netdev_warn(netdev,"Disabling ntuple, not supported in switchdev mode\n");++returnfeatures;+}+staticnetdev_features_tmlx5e_fix_features(structnet_device*netdev,netdev_features_tfeatures){
@@ -3860,15 +3878,8 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev,netdev_warn(netdev,"Disabling rxhash, not supported when CQE compress is active\n");}-if(mlx5e_is_uplink_rep(priv)){-features&=~NETIF_F_HW_TLS_RX;-if(netdev->features&NETIF_F_HW_TLS_RX)-netdev_warn(netdev,"Disabling hw_tls_rx, not supported in switchdev mode\n");--features&=~NETIF_F_HW_TLS_TX;-if(netdev->features&NETIF_F_HW_TLS_TX)-netdev_warn(netdev,"Disabling hw_tls_tx, not supported in switchdev mode\n");-}+if(mlx5e_is_uplink_rep(priv))+features=mlx5e_fix_uplink_rep_features(netdev,features);mutex_unlock(&priv->state_lock);
From: Maor Gottlieb <redacted>
Fix a bug when flow table is created in priority that already
has other flow tables as shown in the below diagram.
If the new flow table (FT-B) has the lowest level in the priority,
we need to connect the flow tables from the previous priority (p0)
to this new table. In addition when this flow table is destroyed
(FT-B), we need to connect the flow tables from the previous
priority (p0) to the next level flow table (FT-C) in the same
priority of the destroyed table (if exists).
---------
|root_ns|
---------
|
--------------------------------
| | |
---------- ---------- ---------
|p(prio)-x| | p-y | | p-n |
---------- ---------- ---------
| |
---------------- ------------------
|ns(e.g bypass)| |ns(e.g. kernel) |
---------------- ------------------
| | |
------- ------ ----
| p0 | | p1 | |p2|
------- ------ ----
| | \
-------- ------- ------
| FT-A | |FT-B | |FT-C|
-------- ------- ------
Fixes: f90edfd279f3 ("net/mlx5_core: Connect flow tables")
Signed-off-by: Maor Gottlieb <redacted>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
From: Maor Dickman <redacted>
Destination vport vhca id is valid flag is set only merged eswitch isn't supported.
Change destination vport vhca id value to be set also only when merged eswitch
is supported.
Fixes: e4ad91f23f10 ("net/mlx5e: Split offloaded eswitch TC rules for port mirroring")
Signed-off-by: Maor Dickman <redacted>
Reviewed-by: Roi Dayan <redacted>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
From: Roi Dayan <redacted>
This is the same check as LAG mode checks if to enable lag.
This will fix adding peer miss rules if lag is not supported
and even an incorrect rules in socket direct mode.
Also fix the incorrect comment on mlx5_get_next_phys_dev() as flow #1
doesn't exists.
Fixes: ac004b832128 ("net/mlx5e: E-Switch, Add peer miss rules")
Signed-off-by: Roi Dayan <redacted>
Reviewed-by: Maor Dickman <redacted>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/dev.c | 5 +----
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 3 +++
2 files changed, 4 insertions(+), 4 deletions(-)
@@ -500,10 +500,7 @@ static int next_phys_dev(struct device *dev, const void *data)return1;}-/* This function is called with two flows:-*1.Duringinitializationofmlx5_core_devandwedon'tneedtolockit.-*2.DuringLAGconfigurestageandcallerholds&mlx5_intf_mutex.-*/+/* Must be called with intf_mutex held */structmlx5_core_dev*mlx5_get_next_phys_dev(structmlx5_core_dev*dev){structauxiliary_device*adev;
From: Tariq Toukan <tariqt@nvidia.com>
When HW aggregates packets for an LRO session, it writes the payload
of two consecutive packets of a flow contiguously, so that they usually
share a cacheline.
The first byte of a packet's payload is written immediately after
the last byte of the preceding packet.
In this flow, there are two consecutive write requests to the shared
cacheline:
1. Regular write for the earlier packet.
2. Read-modify-write for the following packet.
In case of relaxed-ordering on, these two writes might be re-ordered.
Using the end padding optimization (to avoid partial write for the last
cacheline of a packet) becomes problematic if the two writes occur
out-of-order, as the padding would overwrite payload that belongs to
the following packet, causing data corruption.
Avoid this by disabling the end padding optimization when both
LRO and relaxed-ordering are enabled.
Fixes: 17347d5430c4 ("net/mlx5e: Add support for PCI relaxed ordering")
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Moshe Shemesh <redacted>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en/params.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
From: Maxim Mikityanskiy <redacted>
If a feature flag is only present in features, but not in hw_features,
the user can't reset it. Although hw_features may contain NETIF_F_HW_TC
by the point where the driver checks whether HTB offload is supported,
this flag is controlled by another condition that may not hold. Set it
explicitly to make sure the user can disable it.
Fixes: 214baf22870c ("net/mlx5e: Support HTB offload")
Signed-off-by: Maxim Mikityanskiy <redacted>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
From: Aya Levin <redacted>
When fw_fatal reporter reports an error, the firmware in not responding.
Unload the device to ensure that the driver closes all its resources,
even if recovery is not due (user disabled auto-recovery or reporter is
in grace period). On successful recovery the device is loaded back up.
Fixes: b3bd076f7501 ("net/mlx5: Report devlink health on FW fatal issues")
Signed-off-by: Aya Levin <redacted>
Reviewed-by: Moshe Shemesh <redacted>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/health.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
From: Dima Chumak <redacted>
The result of __dev_get_by_index() is not checked for NULL and then gets
dereferenced immediately.
Also, __dev_get_by_index() must be called while holding either RTNL lock
or @dev_base_lock, which isn't satisfied by mlx5e_hairpin_get_mdev() or
its callers. This makes the underlying hlist_for_each_entry() loop not
safe, and can have adverse effects in itself.
Fix by using dev_get_by_index() and handling nullptr return value when
ifindex device is not found. Update mlx5e_hairpin_get_mdev() callers to
check for possible PTR_ERR() result.
Fixes: 77ab67b7f0f9 ("net/mlx5e: Basic setup of hairpin object")
Addresses-Coverity: ("Dereference null return value")
Signed-off-by: Dima Chumak <redacted>
Reviewed-by: Vlad Buslov <redacted>
Reviewed-by: Roi Dayan <redacted>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
.../net/ethernet/mellanox/mlx5/core/en_tc.c | 33 +++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
@@ -804,6 +828,11 @@ static int mlx5e_hairpin_flow_add(struct mlx5e_priv *priv,interr;peer_mdev=mlx5e_hairpin_get_mdev(dev_net(priv->netdev),peer_ifindex);+if(IS_ERR(peer_mdev)){+NL_SET_ERR_MSG_MOD(extack,"invalid ifindex of mirred device");+returnPTR_ERR(peer_mdev);+}+if(!MLX5_CAP_GEN(priv->mdev,hairpin)||!MLX5_CAP_GEN(peer_mdev,hairpin)){NL_SET_ERR_MSG_MOD(extack,"hairpin is not supported");return-EOPNOTSUPP;
Hello:
This series was applied to netdev/net.git (refs/heads/master):
On Tue, 27 Jul 2021 16:20:39 -0700 you wrote:
From: Maor Gottlieb <redacted>
Fix a bug when flow table is created in priority that already
has other flow tables as shown in the below diagram.
If the new flow table (FT-B) has the lowest level in the priority,
we need to connect the flow tables from the previous priority (p0)
to this new table. In addition when this flow table is destroyed
(FT-B), we need to connect the flow tables from the previous
priority (p0) to the next level flow table (FT-C) in the same
priority of the destroyed table (if exists).
[...]