netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] Mellanox driver fixes
@ 2015-03-01 14:56 Or Gerlitz
  2015-03-01 14:56 ` [PATCH net 1/2] net/mlx4_core: Fix wrong mask and error flow for the update-qp command Or Gerlitz
  2015-03-01 14:56 ` [PATCH net 2/2] net/mlx4_en: Disbale GRO for incoming loopback/selftest packets Or Gerlitz
  0 siblings, 2 replies; 5+ messages in thread
From: Or Gerlitz @ 2015-03-01 14:56 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Amir Vadai, Tal Alon, Or Gerlitz

Hi Dave, 

Two small fixes, please apply to net.

Both patches should go to 3.19.y too.

thanks, 

Or.

Ido Shamay (1):
  net/mlx4_en: Disbale GRO for incoming loopback/selftest packets

Or Gerlitz (1):
  net/mlx4_core: Fix wrong mask and error flow for the update-qp command

 drivers/net/ethernet/mellanox/mlx4/en_selftest.c   |    8 +++++++-
 drivers/net/ethernet/mellanox/mlx4/qp.c            |    1 -
 .../net/ethernet/mellanox/mlx4/resource_tracker.c  |    9 ++++++---
 include/linux/mlx4/qp.h                            |    2 +-
 4 files changed, 14 insertions(+), 6 deletions(-)

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

* [PATCH net 1/2] net/mlx4_core: Fix wrong mask and error flow for the update-qp command
  2015-03-01 14:56 [PATCH net 0/2] Mellanox driver fixes Or Gerlitz
@ 2015-03-01 14:56 ` Or Gerlitz
  2015-03-01 14:56 ` [PATCH net 2/2] net/mlx4_en: Disbale GRO for incoming loopback/selftest packets Or Gerlitz
  1 sibling, 0 replies; 5+ messages in thread
From: Or Gerlitz @ 2015-03-01 14:56 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Amir Vadai, Tal Alon, Or Gerlitz, Matan Barak

The bit mask for currently supported driver features (MLX4_UPDATE_QP_SUPPORTED_ATTRS)
of the update-qp command was defined twice (using enum value and pre-processor
define directive) and wrong.

The return value of the call to mlx4_update_qp() from within the SRIOV
resource-tracker was wrongly voided down.

Fix both issues.

Fixes: 09e05c3f78e9 ('net/mlx4: Set vlan stripping policy by the right command')
Fixes: ce8d9e0d6746 ('net/mlx4_core: Add UPDATE_QP SRIOV wrapper support')
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/qp.c            |    1 -
 .../net/ethernet/mellanox/mlx4/resource_tracker.c  |    9 ++++++---
 include/linux/mlx4/qp.h                            |    2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/qp.c b/drivers/net/ethernet/mellanox/mlx4/qp.c
index 2bb8553..eda29db 100644
--- a/drivers/net/ethernet/mellanox/mlx4/qp.c
+++ b/drivers/net/ethernet/mellanox/mlx4/qp.c
@@ -412,7 +412,6 @@ err_icm:
 
 EXPORT_SYMBOL_GPL(mlx4_qp_alloc);
 
-#define MLX4_UPDATE_QP_SUPPORTED_ATTRS MLX4_UPDATE_QP_SMAC
 int mlx4_update_qp(struct mlx4_dev *dev, u32 qpn,
 		   enum mlx4_update_qp_attr attr,
 		   struct mlx4_update_qp_params *params)
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 486e3d2..d97ca88 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -713,7 +713,7 @@ static int update_vport_qp_param(struct mlx4_dev *dev,
 	struct mlx4_vport_oper_state *vp_oper;
 	struct mlx4_priv *priv;
 	u32 qp_type;
-	int port;
+	int port, err = 0;
 
 	port = (qpc->pri_path.sched_queue & 0x40) ? 2 : 1;
 	priv = mlx4_priv(dev);
@@ -738,7 +738,9 @@ static int update_vport_qp_param(struct mlx4_dev *dev,
 			} else {
 				struct mlx4_update_qp_params params = {.flags = 0};
 
-				mlx4_update_qp(dev, qpn, MLX4_UPDATE_QP_VSD, &params);
+				err = mlx4_update_qp(dev, qpn, MLX4_UPDATE_QP_VSD, &params);
+				if (err)
+					goto out;
 			}
 		}
 
@@ -773,7 +775,8 @@ static int update_vport_qp_param(struct mlx4_dev *dev,
 		qpc->pri_path.feup |= MLX4_FSM_FORCE_ETH_SRC_MAC;
 		qpc->pri_path.grh_mylmc = (0x80 & qpc->pri_path.grh_mylmc) + vp_oper->mac_idx;
 	}
-	return 0;
+out:
+	return err;
 }
 
 static int mpt_mask(struct mlx4_dev *dev)
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 2bbc62a..551f854 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -427,7 +427,7 @@ struct mlx4_wqe_inline_seg {
 
 enum mlx4_update_qp_attr {
 	MLX4_UPDATE_QP_SMAC		= 1 << 0,
-	MLX4_UPDATE_QP_VSD		= 1 << 2,
+	MLX4_UPDATE_QP_VSD		= 1 << 1,
 	MLX4_UPDATE_QP_SUPPORTED_ATTRS	= (1 << 2) - 1
 };
 
-- 
1.7.1

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

* [PATCH net 2/2] net/mlx4_en: Disbale GRO for incoming loopback/selftest packets
  2015-03-01 14:56 [PATCH net 0/2] Mellanox driver fixes Or Gerlitz
  2015-03-01 14:56 ` [PATCH net 1/2] net/mlx4_core: Fix wrong mask and error flow for the update-qp command Or Gerlitz
@ 2015-03-01 14:56 ` Or Gerlitz
  2015-03-01 17:24   ` Sergei Shtylyov
  1 sibling, 1 reply; 5+ messages in thread
From: Or Gerlitz @ 2015-03-01 14:56 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Amir Vadai, Tal Alon, Ido Shamay, Or Gerlitz

From: Ido Shamay <idos@mellanox.com>

Packets which are sent from the selftest (ethtool) flow, should not 
be passed to the GRO stack but rather dropped by the driver after validation. 
To achieve that, we disable GRO for the duration of the selftest.

Fixes: dd65beac48a5 ("net/mlx4_en: Extend usage of napi_gro_frags")
Reported-by: Carol Soto <clsoto@linux.vnet.ibm.com>
Signed-off-by: Ido Shamay <idos@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_selftest.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
index 2d8ee66..ac8870c 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
@@ -81,12 +81,14 @@ static int mlx4_en_test_loopback(struct mlx4_en_priv *priv)
 {
 	u32 loopback_ok = 0;
 	int i;
-
+	bool gro_enabled;
 
         priv->loopback_ok = 0;
 	priv->validate_loopback = 1;
+	gro_enabled = (priv->dev->features & NETIF_F_GRO);
 
 	mlx4_en_update_loopback_state(priv->dev, priv->dev->features);
+	priv->dev->features &= ~NETIF_F_GRO;
 
 	/* xmit */
 	if (mlx4_en_test_loopback_xmit(priv)) {
@@ -108,6 +110,10 @@ static int mlx4_en_test_loopback(struct mlx4_en_priv *priv)
 mlx4_en_test_loopback_exit:
 
 	priv->validate_loopback = 0;
+
+	if (gro_enabled)
+		priv->dev->features |= NETIF_F_GRO;
+
 	mlx4_en_update_loopback_state(priv->dev, priv->dev->features);
 	return !loopback_ok;
 }
-- 
1.7.1

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

* Re: [PATCH net 2/2] net/mlx4_en: Disbale GRO for incoming loopback/selftest packets
  2015-03-01 14:56 ` [PATCH net 2/2] net/mlx4_en: Disbale GRO for incoming loopback/selftest packets Or Gerlitz
@ 2015-03-01 17:24   ` Sergei Shtylyov
  2015-03-02  7:47     ` Ido Shamay
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2015-03-01 17:24 UTC (permalink / raw)
  To: Or Gerlitz, David S. Miller; +Cc: netdev, Amir Vadai, Tal Alon, Ido Shamay

Hello.

On 3/1/2015 5:56 PM, Or Gerlitz wrote:

> From: Ido Shamay <idos@mellanox.com>

> Packets which are sent from the selftest (ethtool) flow, should not
> be passed to the GRO stack but rather dropped by the driver after validation.
> To achieve that, we disable GRO for the duration of the selftest.

> Fixes: dd65beac48a5 ("net/mlx4_en: Extend usage of napi_gro_frags")
> Reported-by: Carol Soto <clsoto@linux.vnet.ibm.com>
> Signed-off-by: Ido Shamay <idos@mellanox.com>
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
> ---
>   drivers/net/ethernet/mellanox/mlx4/en_selftest.c |    8 +++++++-
>   1 files changed, 7 insertions(+), 1 deletions(-)

> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
> index 2d8ee66..ac8870c 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
> @@ -81,12 +81,14 @@ static int mlx4_en_test_loopback(struct mlx4_en_priv *priv)
>   {
>   	u32 loopback_ok = 0;
>   	int i;
> -
> +	bool gro_enabled;
>
>           priv->loopback_ok = 0;
>   	priv->validate_loopback = 1;
> +	gro_enabled = (priv->dev->features & NETIF_F_GRO);

    Parens not necessary here.

[...]

WBR, Sergei

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

* Re: [PATCH net 2/2] net/mlx4_en: Disbale GRO for incoming loopback/selftest packets
  2015-03-01 17:24   ` Sergei Shtylyov
@ 2015-03-02  7:47     ` Ido Shamay
  0 siblings, 0 replies; 5+ messages in thread
From: Ido Shamay @ 2015-03-02  7:47 UTC (permalink / raw)
  To: Sergei Shtylyov, Or Gerlitz, David S. Miller; +Cc: netdev, Amir Vadai, Tal Alon

On 3/1/2015 7:24 PM, Sergei Shtylyov wrote:
> Hello.
>
> On 3/1/2015 5:56 PM, Or Gerlitz wrote:
>
>> From: Ido Shamay <idos@mellanox.com>
>
>> Packets which are sent from the selftest (ethtool) flow, should not
>> be passed to the GRO stack but rather dropped by the driver after
>> validation.
>> To achieve that, we disable GRO for the duration of the selftest.
>
>> Fixes: dd65beac48a5 ("net/mlx4_en: Extend usage of napi_gro_frags")
>> Reported-by: Carol Soto <clsoto@linux.vnet.ibm.com>
>> Signed-off-by: Ido Shamay <idos@mellanox.com>
>> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
>> ---
>>   drivers/net/ethernet/mellanox/mlx4/en_selftest.c |    8 +++++++-
>>   1 files changed, 7 insertions(+), 1 deletions(-)
>
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
>> b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
>> index 2d8ee66..ac8870c 100644
>> --- a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
>> +++ b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
>> @@ -81,12 +81,14 @@ static int mlx4_en_test_loopback(struct
>> mlx4_en_priv *priv)
>>   {
>>       u32 loopback_ok = 0;
>>       int i;
>> -
>> +    bool gro_enabled;
>>
>>           priv->loopback_ok = 0;
>>       priv->validate_loopback = 1;
>> +    gro_enabled = (priv->dev->features & NETIF_F_GRO);
>
>     Parens not necessary here.
>
Will be fixed in V1, thanks.
Any chance checkpatch can identify such cases?

> [...]
>
> WBR, Sergei
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

end of thread, other threads:[~2015-03-02  7:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-01 14:56 [PATCH net 0/2] Mellanox driver fixes Or Gerlitz
2015-03-01 14:56 ` [PATCH net 1/2] net/mlx4_core: Fix wrong mask and error flow for the update-qp command Or Gerlitz
2015-03-01 14:56 ` [PATCH net 2/2] net/mlx4_en: Disbale GRO for incoming loopback/selftest packets Or Gerlitz
2015-03-01 17:24   ` Sergei Shtylyov
2015-03-02  7:47     ` Ido Shamay

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