diff mbox series

[SRU,G,1/1] net/mlx5e: Add missing capability check for uplink follow

Message ID 20210326162102.1060126-3-frank.heimes@canonical.com
State New
Headers show
Series [SRU,G,1/1] net/mlx5e: Add missing capability check for uplink follow | expand

Commit Message

Frank Heimes March 26, 2021, 4:21 p.m. UTC
From: Alexander Schmidt <alexschm@de.ibm.com>

BugLink: https://bugs.launchpad.net/bugs/1921104

Expose firmware indication that it supports setting eswitch uplink state
to follow (follow the physical link). Condition setting the eswitch
uplink admin-state with this capability bit. Older FW may not support
the uplink state setting.

Fixes: 7d0314b11cdd ("net/mlx5e: Modify uplink state on interface up/down")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reported-and-Tested-by: Alexander Schmidt <alexschm@de.ibm.com>
(backported from commit 9c9be85f6b59d80efe4705109c0396df18d4e11d)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>

---
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ++-
 include/linux/mlx5/mlx5_ifc.h                     | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

Comments

Krzysztof Kozlowski March 26, 2021, 4:27 p.m. UTC | #1
On 26/03/2021 17:21, frank.heimes@canonical.com wrote:
> From: Alexander Schmidt <alexschm@de.ibm.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1921104
> 
> Expose firmware indication that it supports setting eswitch uplink state
> to follow (follow the physical link). Condition setting the eswitch
> uplink admin-state with this capability bit. Older FW may not support
> the uplink state setting.
> 
> Fixes: 7d0314b11cdd ("net/mlx5e: Modify uplink state on interface up/down")
> Signed-off-by: Aya Levin <ayal@nvidia.com>
> Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
> Reported-and-Tested-by: Alexander Schmidt <alexschm@de.ibm.com>

Alexander's signed-off-by is missing here. Since his the author (From),
his SoB is expected to be the first.

> (backported from commit 9c9be85f6b59d80efe4705109c0396df18d4e11d)
> Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
> 
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ++-
>  include/linux/mlx5/mlx5_ifc.h                     | 4 +++-
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index 6da50845f614..8076051d2b95 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> @@ -3160,7 +3160,8 @@ static void mlx5e_modify_admin_state(struct mlx5_core_dev *mdev,
>  
>  	mlx5_set_port_admin_status(mdev, state);
>  
> -	if (!MLX5_ESWITCH_MANAGER(mdev) ||  mlx5_eswitch_mode(esw) == MLX5_ESWITCH_OFFLOADS)
> +	if (!MLX5_ESWITCH_MANAGER(mdev) || mlx5_eswitch_mode(esw) == MLX5_ESWITCH_OFFLOADS ||
> +			!MLX5_CAP_GEN(mdev, uplink_follow))

A nit: changed indentation.


Best regards,
Krzysztof
Krzysztof Kozlowski March 26, 2021, 4:29 p.m. UTC | #2
On 26/03/2021 17:27, Krzysztof Kozlowski wrote:
> On 26/03/2021 17:21, frank.heimes@canonical.com wrote:
>> From: Alexander Schmidt <alexschm@de.ibm.com>
>>
>> BugLink: https://bugs.launchpad.net/bugs/1921104
>>
>> Expose firmware indication that it supports setting eswitch uplink state
>> to follow (follow the physical link). Condition setting the eswitch
>> uplink admin-state with this capability bit. Older FW may not support
>> the uplink state setting.
>>
>> Fixes: 7d0314b11cdd ("net/mlx5e: Modify uplink state on interface up/down")
>> Signed-off-by: Aya Levin <ayal@nvidia.com>
>> Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
>> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
>> Reported-and-Tested-by: Alexander Schmidt <alexschm@de.ibm.com>
> 
> Alexander's signed-off-by is missing here. Since his the author (From),
> his SoB is expected to be the first.

I see in original commit Aya Levin as the author, so the From field got
corrupted during format-patch.


Best regards,
Krzysztof
Frank Heimes March 26, 2021, 4:42 p.m. UTC | #3
Hi Krzystof,
well, it was done that way by me by intention.
Yes, Aya Levin is the upstream original author of the commit (as it is in
5.11).
But Alexander is the author of the backport(s).

That is how I always submitted such patches/backports in the past.

So what is expected then? Just to double check:

Replace:
"From: Alexander Schmidt <alexschm@de.ibm.com>"
by :
"From: Aya Levin <ayal@nvidia.com>"
(even if the backport was done by Alexander ?)

And then adding:
"Signed-off-by: Alexander Schmidt <alexschm@de.ibm.com>"
(on top of:
"Signed-off-by: Aya Levin <ayal@nvidia.com>
and
"Signed-off-by: Frank Heimes <f <ayal@nvidia.com>rank.heimes@canonical.com>
 )

Do you expect it like this?

Bye, Frank

irc: jfh -- ubuntu-on-big-iron.blogspot.com
<http://ubuntu-on-big-iron.blogspot.com/?view=sidebar>


On Fri, Mar 26, 2021 at 5:29 PM Krzysztof Kozlowski <
krzysztof.kozlowski@canonical.com> wrote:

> On 26/03/2021 17:27, Krzysztof Kozlowski wrote:
> > On 26/03/2021 17:21, frank.heimes@canonical.com wrote:
> >> From: Alexander Schmidt <alexschm@de.ibm.com>
> >>
> >> BugLink: https://bugs.launchpad.net/bugs/1921104
> >>
> >> Expose firmware indication that it supports setting eswitch uplink state
> >> to follow (follow the physical link). Condition setting the eswitch
> >> uplink admin-state with this capability bit. Older FW may not support
> >> the uplink state setting.
> >>
> >> Fixes: 7d0314b11cdd ("net/mlx5e: Modify uplink state on interface
> up/down")
> >> Signed-off-by: Aya Levin <ayal@nvidia.com>
> >> Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
> >> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
> >> Reported-and-Tested-by: Alexander Schmidt <alexschm@de.ibm.com>
> >
> > Alexander's signed-off-by is missing here. Since his the author (From),
> > his SoB is expected to be the first.
>
> I see in original commit Aya Levin as the author, so the From field got
> corrupted during format-patch.
>
>
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski March 26, 2021, 4:47 p.m. UTC | #4
On 26/03/2021 17:42, Frank Heimes wrote:
> Hi Krzystof, well, it was done that way by me by intention. Yes, Aya
> Levin is the upstream original author of the commit (as it is in
> 5.11). But Alexander is the author of the backport(s).
> 
> That is how I always submitted such patches/backports in the past.
> 
> So what is expected then? Just to double check:
> 
> Replace: "From: Alexander Schmidt <alexschm@de.ibm.com
> <mailto:alexschm@de.ibm.com>>" by : "From: Aya Levin <ayal@nvidia.com
> <mailto:ayal@nvidia.com>>" (even if the backport was done by
> Alexander ?)

Yes, the From: is the author of the original patch.

> 
> And then adding: "Signed-off-by: Alexander Schmidt 
> <alexschm@de.ibm.com <mailto:alexschm@de.ibm.com>>" (on top of: 
> "Signed-off-by: Aya Levin <ayal@nvidia.com <mailto:ayal@nvidia.com>> 
> and "Signed-off-by: Frank Heimes <f 
> <mailto:ayal@nvidia.com>rank.heimes@canonical.com 
> <mailto:rank.heimes@canonical.com>>   )

The Signed-off-by are added incrementally in a chronological order, so
(beginning coming from original commit):

Fixes: 7d0314b11cdd ("net/mlx5e: Modify uplink state on interface up/down")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reported-and-Tested-by: Alexander Schmidt <alexschm@de.ibm.com>
(backported from commit 9c9be85f6b59d80efe4705109c0396df18d4e11d)
Signed-off-by: Alexander Schmidt <alexschm@de.ibm.com>
Signed-off-by: Frank Heimes ...

Thanks!

Best regards,
Krzysztof
Frank Heimes March 26, 2021, 4:49 p.m. UTC | #5
Ok, I'll send a v2 like this ...

Thx, Frank

On Fri, Mar 26, 2021 at 5:47 PM Krzysztof Kozlowski <
krzysztof.kozlowski@canonical.com> wrote:

>
> On 26/03/2021 17:42, Frank Heimes wrote:
> > Hi Krzystof, well, it was done that way by me by intention. Yes, Aya
> > Levin is the upstream original author of the commit (as it is in
> > 5.11). But Alexander is the author of the backport(s).
> >
> > That is how I always submitted such patches/backports in the past.
> >
> > So what is expected then? Just to double check:
> >
> > Replace: "From: Alexander Schmidt <alexschm@de.ibm.com
> > <mailto:alexschm@de.ibm.com>>" by : "From: Aya Levin <ayal@nvidia.com
> > <mailto:ayal@nvidia.com>>" (even if the backport was done by
> > Alexander ?)
>
> Yes, the From: is the author of the original patch.
>
> >
> > And then adding: "Signed-off-by: Alexander Schmidt
> > <alexschm@de.ibm.com <mailto:alexschm@de.ibm.com>>" (on top of:
> > "Signed-off-by: Aya Levin <ayal@nvidia.com <mailto:ayal@nvidia.com>>
> > and "Signed-off-by: Frank Heimes <f
> > <mailto:ayal@nvidia.com>rank.heimes@canonical.com
> > <mailto:rank.heimes@canonical.com>>   )
>
> The Signed-off-by are added incrementally in a chronological order, so
> (beginning coming from original commit):
>
> Fixes: 7d0314b11cdd ("net/mlx5e: Modify uplink state on interface up/down")
> Signed-off-by: Aya Levin <ayal@nvidia.com>
> Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
> Reported-and-Tested-by: Alexander Schmidt <alexschm@de.ibm.com>
> (backported from commit 9c9be85f6b59d80efe4705109c0396df18d4e11d)
> Signed-off-by: Alexander Schmidt <alexschm@de.ibm.com>
> Signed-off-by: Frank Heimes ...
>
> Thanks!
>
> Best regards,
> Krzysztof
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 6da50845f614..8076051d2b95 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3160,7 +3160,8 @@  static void mlx5e_modify_admin_state(struct mlx5_core_dev *mdev,
 
 	mlx5_set_port_admin_status(mdev, state);
 
-	if (!MLX5_ESWITCH_MANAGER(mdev) ||  mlx5_eswitch_mode(esw) == MLX5_ESWITCH_OFFLOADS)
+	if (!MLX5_ESWITCH_MANAGER(mdev) || mlx5_eswitch_mode(esw) == MLX5_ESWITCH_OFFLOADS ||
+			!MLX5_CAP_GEN(mdev, uplink_follow))
 		return;
 
 	if (state == MLX5_PORT_UP)
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 28de7b1b50a5..11f218a05e37 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -1217,7 +1217,9 @@  struct mlx5_ifc_cmd_hca_cap_bits {
 	u8	   ece_support[0x1];
 	u8	   reserved_at_a4[0x7];
 	u8         log_max_srq[0x5];
-	u8         reserved_at_b0[0x10];
+	u8         reserved_at_b0[0x1];
+	u8         uplink_follow[0x1];
+	u8         reserved_at_b2[0xe];
 
 	u8         max_sgl_for_optimized_performance[0x8];
 	u8         log_max_cq_sz[0x8];