All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21
@ 2017-03-21 13:59 Saeed Mahameed
  2017-03-21 13:59 ` [PATCH net 1/8] net/mlx5: Add missing entries for set/query rate limit commands Saeed Mahameed
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Saeed Mahameed @ 2017-03-21 13:59 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Or Gerlitz, Saeed Mahameed

Hi Dave,

This series contains some mlx5 core and ethernet driver fixes.

For -stable:
net/mlx5e: Count LRO packets correctly (for kernel >= 4.2)
net/mlx5e: Count GSO packets correctly (for kernel >= 4.2)
net/mlx5: Increase number of max QPs in default profile (for kernel >= 4.0)
net/mlx5e: Avoid supporting udp tunnel port ndo for VF reps (for kernel >= 4.10)
net/mlx5e: Use the proper UAPI values when offloading TC vlan actions (for kernel >= v4.9)
net/mlx5: E-Switch, Don't allow changing inline mode when flows are configured (for kernel >= 4.10)
net/mlx5e: Change the TC offload rule add/del code path to be per NIC or E-Switch (for kernel >= 4.10)
net/mlx5: Add missing entries for set/query rate limit commands (for kernel >= 4.8)

Thanks,
Saeed.

Gal Pressman (2):
  net/mlx5e: Count GSO packets correctly
  net/mlx5e: Count LRO packets correctly

Maor Gottlieb (1):
  net/mlx5: Increase number of max QPs in default profile

Or Gerlitz (3):
  net/mlx5: Add missing entries for set/query rate limit commands
  net/mlx5e: Change the TC offload rule add/del code path to be per NIC
    or E-Switch
  net/mlx5e: Use the proper UAPI values when offloading TC vlan actions

Paul Blakey (1):
  net/mlx5e: Avoid supporting udp tunnel port ndo for VF reps

Roi Dayan (1):
  net/mlx5: E-Switch, Don't allow changing inline mode when flows are
    configured

 drivers/net/ethernet/mellanox/mlx5/core/cmd.c      |  4 ++
 drivers/net/ethernet/mellanox/mlx5/core/en.h       |  4 --
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  8 +--
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c   |  2 -
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c    |  4 ++
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c    | 74 +++++++++++++++-------
 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c    |  5 +-
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.h  |  6 ++
 .../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 22 +++++++
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |  2 +-
 10 files changed, 94 insertions(+), 37 deletions(-)

-- 
2.11.0

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

* [PATCH net 1/8] net/mlx5: Add missing entries for set/query rate limit commands
  2017-03-21 13:59 [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21 Saeed Mahameed
@ 2017-03-21 13:59 ` Saeed Mahameed
  2017-03-21 13:59 ` [PATCH net 2/8] net/mlx5e: Change the TC offload rule add/del code path to be per NIC or E-Switch Saeed Mahameed
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Saeed Mahameed @ 2017-03-21 13:59 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Or Gerlitz, Saeed Mahameed

From: Or Gerlitz <ogerlitz@mellanox.com>

The switch cases for the rate limit set and query commands were
missing, which could get us wrong under fw error or driver reset
flow, fix that.

Fixes: 1466cc5b23d1 ('net/mlx5: Rate limit tables support')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
index caa837e5e2b9..a380353a78c2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
@@ -361,6 +361,8 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
 	case MLX5_CMD_OP_QUERY_VPORT_COUNTER:
 	case MLX5_CMD_OP_ALLOC_Q_COUNTER:
 	case MLX5_CMD_OP_QUERY_Q_COUNTER:
+	case MLX5_CMD_OP_SET_RATE_LIMIT:
+	case MLX5_CMD_OP_QUERY_RATE_LIMIT:
 	case MLX5_CMD_OP_ALLOC_PD:
 	case MLX5_CMD_OP_ALLOC_UAR:
 	case MLX5_CMD_OP_CONFIG_INT_MODERATION:
@@ -497,6 +499,8 @@ const char *mlx5_command_str(int command)
 	MLX5_COMMAND_STR_CASE(ALLOC_Q_COUNTER);
 	MLX5_COMMAND_STR_CASE(DEALLOC_Q_COUNTER);
 	MLX5_COMMAND_STR_CASE(QUERY_Q_COUNTER);
+	MLX5_COMMAND_STR_CASE(SET_RATE_LIMIT);
+	MLX5_COMMAND_STR_CASE(QUERY_RATE_LIMIT);
 	MLX5_COMMAND_STR_CASE(ALLOC_PD);
 	MLX5_COMMAND_STR_CASE(DEALLOC_PD);
 	MLX5_COMMAND_STR_CASE(ALLOC_UAR);
-- 
2.11.0

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

* [PATCH net 2/8] net/mlx5e: Change the TC offload rule add/del code path to be per NIC or E-Switch
  2017-03-21 13:59 [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21 Saeed Mahameed
  2017-03-21 13:59 ` [PATCH net 1/8] net/mlx5: Add missing entries for set/query rate limit commands Saeed Mahameed
@ 2017-03-21 13:59 ` Saeed Mahameed
  2017-03-21 13:59 ` [PATCH net 3/8] net/mlx5: E-Switch, Don't allow changing inline mode when flows are configured Saeed Mahameed
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Saeed Mahameed @ 2017-03-21 13:59 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Or Gerlitz, Saeed Mahameed

From: Or Gerlitz <ogerlitz@mellanox.com>

Refactor the code to deal with add/del TC rules to have handler per NIC/E-switch
offloading use case, and push the latter into the e-switch code. This provides
better separation and is to be used in down-stream patch for applying a fix.

Fixes: bffaa916588e ("net/mlx5: E-Switch, Add control for inline mode")
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c    | 59 ++++++++++++++--------
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.h  |  5 ++
 .../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 14 +++++
 3 files changed, 58 insertions(+), 20 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 79481f4cf264..2825b5665456 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -133,6 +133,23 @@ mlx5e_tc_add_nic_flow(struct mlx5e_priv *priv,
 	return rule;
 }
 
+static void mlx5e_tc_del_nic_flow(struct mlx5e_priv *priv,
+				  struct mlx5e_tc_flow *flow)
+{
+	struct mlx5_fc *counter = NULL;
+
+	if (!IS_ERR(flow->rule)) {
+		counter = mlx5_flow_rule_counter(flow->rule);
+		mlx5_del_flow_rules(flow->rule);
+		mlx5_fc_destroy(priv->mdev, counter);
+	}
+
+	if (!mlx5e_tc_num_filters(priv) && (priv->fs.tc.t)) {
+		mlx5_destroy_flow_table(priv->fs.tc.t);
+		priv->fs.tc.t = NULL;
+	}
+}
+
 static struct mlx5_flow_handle *
 mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
 		      struct mlx5_flow_spec *spec,
@@ -149,7 +166,24 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
 }
 
 static void mlx5e_detach_encap(struct mlx5e_priv *priv,
-			       struct mlx5e_tc_flow *flow) {
+			       struct mlx5e_tc_flow *flow);
+
+static void mlx5e_tc_del_fdb_flow(struct mlx5e_priv *priv,
+				  struct mlx5e_tc_flow *flow)
+{
+	struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
+
+	mlx5_eswitch_del_offloaded_rule(esw, flow->rule, flow->attr);
+
+	mlx5_eswitch_del_vlan_action(esw, flow->attr);
+
+	if (flow->attr->action & MLX5_FLOW_CONTEXT_ACTION_ENCAP)
+		mlx5e_detach_encap(priv, flow);
+}
+
+static void mlx5e_detach_encap(struct mlx5e_priv *priv,
+			       struct mlx5e_tc_flow *flow)
+{
 	struct list_head *next = flow->encap.next;
 
 	list_del(&flow->encap);
@@ -173,25 +207,10 @@ static void mlx5e_detach_encap(struct mlx5e_priv *priv,
 static void mlx5e_tc_del_flow(struct mlx5e_priv *priv,
 			      struct mlx5e_tc_flow *flow)
 {
-	struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
-	struct mlx5_fc *counter = NULL;
-
-	if (!IS_ERR(flow->rule)) {
-		counter = mlx5_flow_rule_counter(flow->rule);
-		mlx5_del_flow_rules(flow->rule);
-		mlx5_fc_destroy(priv->mdev, counter);
-	}
-
-	if (flow->flags & MLX5E_TC_FLOW_ESWITCH) {
-		mlx5_eswitch_del_vlan_action(esw, flow->attr);
-		if (flow->attr->action & MLX5_FLOW_CONTEXT_ACTION_ENCAP)
-			mlx5e_detach_encap(priv, flow);
-	}
-
-	if (!mlx5e_tc_num_filters(priv) && (priv->fs.tc.t)) {
-		mlx5_destroy_flow_table(priv->fs.tc.t);
-		priv->fs.tc.t = NULL;
-	}
+	if (flow->flags & MLX5E_TC_FLOW_ESWITCH)
+		mlx5e_tc_del_fdb_flow(priv, flow);
+	else
+		mlx5e_tc_del_nic_flow(priv, flow);
 }
 
 static void parse_vxlan_attr(struct mlx5_flow_spec *spec,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index 5b78883d5654..9227a83a97e3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -271,6 +271,11 @@ struct mlx5_flow_handle *
 mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
 				struct mlx5_flow_spec *spec,
 				struct mlx5_esw_flow_attr *attr);
+void
+mlx5_eswitch_del_offloaded_rule(struct mlx5_eswitch *esw,
+				struct mlx5_flow_handle *rule,
+				struct mlx5_esw_flow_attr *attr);
+
 struct mlx5_flow_handle *
 mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport, u32 tirn);
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 4f5b0d47d5f3..bfabefe20ac0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -97,6 +97,20 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
 	return rule;
 }
 
+void
+mlx5_eswitch_del_offloaded_rule(struct mlx5_eswitch *esw,
+				struct mlx5_flow_handle *rule,
+				struct mlx5_esw_flow_attr *attr)
+{
+	struct mlx5_fc *counter = NULL;
+
+	if (!IS_ERR(rule)) {
+		counter = mlx5_flow_rule_counter(rule);
+		mlx5_del_flow_rules(rule);
+		mlx5_fc_destroy(esw->dev, counter);
+	}
+}
+
 static int esw_set_global_vlan_pop(struct mlx5_eswitch *esw, u8 val)
 {
 	struct mlx5_eswitch_rep *rep;
-- 
2.11.0

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

* [PATCH net 3/8] net/mlx5: E-Switch, Don't allow changing inline mode when flows are configured
  2017-03-21 13:59 [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21 Saeed Mahameed
  2017-03-21 13:59 ` [PATCH net 1/8] net/mlx5: Add missing entries for set/query rate limit commands Saeed Mahameed
  2017-03-21 13:59 ` [PATCH net 2/8] net/mlx5e: Change the TC offload rule add/del code path to be per NIC or E-Switch Saeed Mahameed
@ 2017-03-21 13:59 ` Saeed Mahameed
  2017-03-21 13:59 ` [PATCH net 4/8] net/mlx5e: Use the proper UAPI values when offloading TC vlan actions Saeed Mahameed
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Saeed Mahameed @ 2017-03-21 13:59 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Or Gerlitz, Roi Dayan, Saeed Mahameed

From: Roi Dayan <roid@mellanox.com>

Changing the eswitch inline mode can potentially cause already configured
flows not to match the policy. E.g. set policy L4, add some L4 rules,
set policy to L2 --> bad! Hence we disallow it.

Keep track of how many offloaded rules are now set and refuse
inline mode changes if this isn't zero.

Fixes: bffaa916588e ("net/mlx5: E-Switch, Add control for inline mode")
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.h          | 1 +
 drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index 9227a83a97e3..ad329b1680b4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -209,6 +209,7 @@ struct mlx5_esw_offload {
 	struct mlx5_eswitch_rep *vport_reps;
 	DECLARE_HASHTABLE(encap_tbl, 8);
 	u8 inline_mode;
+	u64 num_flows;
 };
 
 struct mlx5_eswitch {
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index bfabefe20ac0..307ec6c5fd3b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -93,6 +93,8 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
 				   spec, &flow_act, dest, i);
 	if (IS_ERR(rule))
 		mlx5_fc_destroy(esw->dev, counter);
+	else
+		esw->offloads.num_flows++;
 
 	return rule;
 }
@@ -108,6 +110,7 @@ mlx5_eswitch_del_offloaded_rule(struct mlx5_eswitch *esw,
 		counter = mlx5_flow_rule_counter(rule);
 		mlx5_del_flow_rules(rule);
 		mlx5_fc_destroy(esw->dev, counter);
+		esw->offloads.num_flows--;
 	}
 }
 
@@ -922,6 +925,11 @@ int mlx5_devlink_eswitch_inline_mode_set(struct devlink *devlink, u8 mode)
 	    MLX5_CAP_INLINE_MODE_VPORT_CONTEXT)
 		return -EOPNOTSUPP;
 
+	if (esw->offloads.num_flows > 0) {
+		esw_warn(dev, "Can't set inline mode when flows are configured\n");
+		return -EOPNOTSUPP;
+	}
+
 	err = esw_inline_mode_from_devlink(mode, &mlx5_mode);
 	if (err)
 		goto out;
-- 
2.11.0

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

* [PATCH net 4/8] net/mlx5e: Use the proper UAPI values when offloading TC vlan actions
  2017-03-21 13:59 [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21 Saeed Mahameed
                   ` (2 preceding siblings ...)
  2017-03-21 13:59 ` [PATCH net 3/8] net/mlx5: E-Switch, Don't allow changing inline mode when flows are configured Saeed Mahameed
@ 2017-03-21 13:59 ` Saeed Mahameed
  2017-03-21 13:59 ` [PATCH net 5/8] net/mlx5e: Avoid supporting udp tunnel port ndo for VF reps Saeed Mahameed
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Saeed Mahameed @ 2017-03-21 13:59 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Or Gerlitz, Saeed Mahameed

From: Or Gerlitz <ogerlitz@mellanox.com>

Currently we use the non UAPI values and we miss erring on
the modify action which is not supported, fix that.

Fixes: 8b32580df1cb ('net/mlx5e: Add TC vlan action for SRIOV offloads')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 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 2825b5665456..9c13abaf3885 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -1131,14 +1131,16 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
 		}
 
 		if (is_tcf_vlan(a)) {
-			if (tcf_vlan_action(a) == VLAN_F_POP) {
+			if (tcf_vlan_action(a) == TCA_VLAN_ACT_POP) {
 				attr->action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_POP;
-			} else if (tcf_vlan_action(a) == VLAN_F_PUSH) {
+			} else if (tcf_vlan_action(a) == TCA_VLAN_ACT_PUSH) {
 				if (tcf_vlan_push_proto(a) != htons(ETH_P_8021Q))
 					return -EOPNOTSUPP;
 
 				attr->action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH;
 				attr->vlan = tcf_vlan_push_vid(a);
+			} else { /* action is TCA_VLAN_ACT_MODIFY */
+				return -EOPNOTSUPP;
 			}
 			continue;
 		}
-- 
2.11.0

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

* [PATCH net 5/8] net/mlx5e: Avoid supporting udp tunnel port ndo for VF reps
  2017-03-21 13:59 [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21 Saeed Mahameed
                   ` (3 preceding siblings ...)
  2017-03-21 13:59 ` [PATCH net 4/8] net/mlx5e: Use the proper UAPI values when offloading TC vlan actions Saeed Mahameed
@ 2017-03-21 13:59 ` Saeed Mahameed
  2017-03-21 13:59 ` [PATCH net 6/8] net/mlx5: Increase number of max QPs in default profile Saeed Mahameed
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Saeed Mahameed @ 2017-03-21 13:59 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Or Gerlitz, Paul Blakey, Saeed Mahameed

From: Paul Blakey <paulb@mellanox.com>

This was added to allow the TC offloading code to identify offloading
encap/decap vxlan rules.

The VF reps are effectively related to the same mlx5 PCI device as the
PF. Since the kernel invokes the (say) delete ndo for each netdev, the
FW erred on multiple vxlan dst port deletes when the port was deleted
from the system.

We fix that by keeping the registration to be carried out only by the
PF. Since the PF serves as the uplink device, the VF reps will look
up a port there and realize if they are ok to offload that.

Tested:
 <SETUP VFS>
 <SETUP switchdev mode to have representors>
 ip link add vxlan1 type vxlan id 44 dev ens5f0 dstport 9999
 ip link set vxlan1 up
 ip link del dev vxlan1

Fixes: 4a25730eb202 ('net/mlx5e: Add ndo_udp_tunnel_add to VF representors')
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h      | 4 ----
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 8 ++++----
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c  | 2 --
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c   | 9 +++++++--
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index f6a6ded204f6..dc52053128bc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -928,10 +928,6 @@ void mlx5e_destroy_netdev(struct mlx5_core_dev *mdev, struct mlx5e_priv *priv);
 int mlx5e_attach_netdev(struct mlx5_core_dev *mdev, struct net_device *netdev);
 void mlx5e_detach_netdev(struct mlx5_core_dev *mdev, struct net_device *netdev);
 u32 mlx5e_choose_lro_timeout(struct mlx5_core_dev *mdev, u32 wanted_timeout);
-void mlx5e_add_vxlan_port(struct net_device *netdev,
-			  struct udp_tunnel_info *ti);
-void mlx5e_del_vxlan_port(struct net_device *netdev,
-			  struct udp_tunnel_info *ti);
 
 int mlx5e_get_offload_stats(int attr_id, const struct net_device *dev,
 			    void *sp);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 8ef64c4db2c2..66c133757a5e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3100,8 +3100,8 @@ static int mlx5e_get_vf_stats(struct net_device *dev,
 					    vf_stats);
 }
 
-void mlx5e_add_vxlan_port(struct net_device *netdev,
-			  struct udp_tunnel_info *ti)
+static void mlx5e_add_vxlan_port(struct net_device *netdev,
+				 struct udp_tunnel_info *ti)
 {
 	struct mlx5e_priv *priv = netdev_priv(netdev);
 
@@ -3114,8 +3114,8 @@ void mlx5e_add_vxlan_port(struct net_device *netdev,
 	mlx5e_vxlan_queue_work(priv, ti->sa_family, be16_to_cpu(ti->port), 1);
 }
 
-void mlx5e_del_vxlan_port(struct net_device *netdev,
-			  struct udp_tunnel_info *ti)
+static void mlx5e_del_vxlan_port(struct net_device *netdev,
+				 struct udp_tunnel_info *ti)
 {
 	struct mlx5e_priv *priv = netdev_priv(netdev);
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 2c864574a9d5..f621373bd7a5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -393,8 +393,6 @@ static const struct net_device_ops mlx5e_netdev_ops_rep = {
 	.ndo_get_phys_port_name  = mlx5e_rep_get_phys_port_name,
 	.ndo_setup_tc            = mlx5e_rep_ndo_setup_tc,
 	.ndo_get_stats64         = mlx5e_rep_get_stats,
-	.ndo_udp_tunnel_add      = mlx5e_add_vxlan_port,
-	.ndo_udp_tunnel_del      = mlx5e_del_vxlan_port,
 	.ndo_has_offload_stats	 = mlx5e_has_offload_stats,
 	.ndo_get_offload_stats	 = mlx5e_get_offload_stats,
 };
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 9c13abaf3885..fade7233dac5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -267,12 +267,15 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv,
 			skb_flow_dissector_target(f->dissector,
 						  FLOW_DISSECTOR_KEY_ENC_PORTS,
 						  f->mask);
+		struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
+		struct net_device *up_dev = mlx5_eswitch_get_uplink_netdev(esw);
+		struct mlx5e_priv *up_priv = netdev_priv(up_dev);
 
 		/* Full udp dst port must be given */
 		if (memchr_inv(&mask->dst, 0xff, sizeof(mask->dst)))
 			goto vxlan_match_offload_err;
 
-		if (mlx5e_vxlan_lookup_port(priv, be16_to_cpu(key->dst)) &&
+		if (mlx5e_vxlan_lookup_port(up_priv, be16_to_cpu(key->dst)) &&
 		    MLX5_CAP_ESW(priv->mdev, vxlan_encap_decap))
 			parse_vxlan_attr(spec, f);
 		else {
@@ -995,6 +998,8 @@ static int mlx5e_attach_encap(struct mlx5e_priv *priv,
 			      struct mlx5_esw_flow_attr *attr)
 {
 	struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
+	struct net_device *up_dev = mlx5_eswitch_get_uplink_netdev(esw);
+	struct mlx5e_priv *up_priv = netdev_priv(up_dev);
 	unsigned short family = ip_tunnel_info_af(tun_info);
 	struct ip_tunnel_key *key = &tun_info->key;
 	struct mlx5_encap_entry *e;
@@ -1015,7 +1020,7 @@ static int mlx5e_attach_encap(struct mlx5e_priv *priv,
 		return -EOPNOTSUPP;
 	}
 
-	if (mlx5e_vxlan_lookup_port(priv, be16_to_cpu(key->tp_dst)) &&
+	if (mlx5e_vxlan_lookup_port(up_priv, be16_to_cpu(key->tp_dst)) &&
 	    MLX5_CAP_ESW(priv->mdev, vxlan_encap_decap)) {
 		tunnel_type = MLX5_HEADER_TYPE_VXLAN;
 	} else {
-- 
2.11.0

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

* [PATCH net 6/8] net/mlx5: Increase number of max QPs in default profile
  2017-03-21 13:59 [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21 Saeed Mahameed
                   ` (4 preceding siblings ...)
  2017-03-21 13:59 ` [PATCH net 5/8] net/mlx5e: Avoid supporting udp tunnel port ndo for VF reps Saeed Mahameed
@ 2017-03-21 13:59 ` Saeed Mahameed
  2017-03-21 13:59 ` [PATCH net 7/8] net/mlx5e: Count GSO packets correctly Saeed Mahameed
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Saeed Mahameed @ 2017-03-21 13:59 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Or Gerlitz, Maor Gottlieb, Saeed Mahameed

From: Maor Gottlieb <maorg@mellanox.com>

With ConnectX-4 sharing SRQs from the same space as QPs, we hit a
limit preventing some applications to allocate needed QPs amount.
Double the size to 256K.

Fixes: e126ba97dba9e ('mlx5: Add driver for Mellanox Connect-IB adapters')
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index e2bd600d19de..60154a175bd3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -87,7 +87,7 @@ static struct mlx5_profile profile[] = {
 	[2] = {
 		.mask		= MLX5_PROF_MASK_QP_SIZE |
 				  MLX5_PROF_MASK_MR_CACHE,
-		.log_max_qp	= 17,
+		.log_max_qp	= 18,
 		.mr_cache[0]	= {
 			.size	= 500,
 			.limit	= 250
-- 
2.11.0

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

* [PATCH net 7/8] net/mlx5e: Count GSO packets correctly
  2017-03-21 13:59 [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21 Saeed Mahameed
                   ` (5 preceding siblings ...)
  2017-03-21 13:59 ` [PATCH net 6/8] net/mlx5: Increase number of max QPs in default profile Saeed Mahameed
@ 2017-03-21 13:59 ` Saeed Mahameed
  2017-03-21 14:40   ` Alexei Starovoitov
  2017-03-21 16:15   ` Eric Dumazet
  2017-03-21 13:59 ` [PATCH net 8/8] net/mlx5e: Count LRO " Saeed Mahameed
  2017-03-22 19:13 ` [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21 David Miller
  8 siblings, 2 replies; 14+ messages in thread
From: Saeed Mahameed @ 2017-03-21 13:59 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Or Gerlitz, Gal Pressman, kernel-team, Saeed Mahameed

From: Gal Pressman <galp@mellanox.com>

TX packets statistics ('tx_packets' counter) used to count GSO packets
as one, even though it contains multiple segments.
This patch will increment the counter by the number of segments, and
align the driver with the behavior of other drivers in the stack.

Note that no information is lost in this patch due to 'tx_tso_packets'
counter existence.

Before, ethtool showed:
$ ethtool -S ens6 | egrep "tx_packets|tx_tso_packets"
     tx_packets: 61340
     tx_tso_packets: 60954
     tx_packets_phy: 2451115

Now, we will see the more logical statistics:
$ ethtool -S ens6 | egrep "tx_packets|tx_tso_packets"
     tx_packets: 2451115
     tx_tso_packets: 60954
     tx_packets_phy: 2451115

Fixes: e586b3b0baee ("net/mlx5: Ethernet Datapath files")
Signed-off-by: Gal Pressman <galp@mellanox.com>
Cc: kernel-team@fb.com
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
index f193128bac4b..57f5e2d7ebd1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -274,15 +274,18 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb)
 			sq->stats.tso_bytes += skb->len - ihs;
 		}
 
+		sq->stats.packets += skb_shinfo(skb)->gso_segs;
 		num_bytes = skb->len + (skb_shinfo(skb)->gso_segs - 1) * ihs;
 	} else {
 		bf = sq->bf_budget &&
 		     !skb->xmit_more &&
 		     !skb_shinfo(skb)->nr_frags;
 		ihs = mlx5e_get_inline_hdr_size(sq, skb, bf);
+		sq->stats.packets++;
 		num_bytes = max_t(unsigned int, skb->len, ETH_ZLEN);
 	}
 
+	sq->stats.bytes += num_bytes;
 	wi->num_bytes = num_bytes;
 
 	ds_cnt = sizeof(*wqe) / MLX5_SEND_WQE_DS;
@@ -381,8 +384,6 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb)
 	if (bf)
 		sq->bf_budget--;
 
-	sq->stats.packets++;
-	sq->stats.bytes += num_bytes;
 	return NETDEV_TX_OK;
 
 dma_unmap_wqe_err:
-- 
2.11.0

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

* [PATCH net 8/8] net/mlx5e: Count LRO packets correctly
  2017-03-21 13:59 [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21 Saeed Mahameed
                   ` (6 preceding siblings ...)
  2017-03-21 13:59 ` [PATCH net 7/8] net/mlx5e: Count GSO packets correctly Saeed Mahameed
@ 2017-03-21 13:59 ` Saeed Mahameed
  2017-03-21 14:41   ` Alexei Starovoitov
  2017-03-22 19:13 ` [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21 David Miller
  8 siblings, 1 reply; 14+ messages in thread
From: Saeed Mahameed @ 2017-03-21 13:59 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Or Gerlitz, Gal Pressman, kernel-team, Saeed Mahameed

From: Gal Pressman <galp@mellanox.com>

RX packets statistics ('rx_packets' counter) used to count LRO packets
as one, even though it contains multiple segments.
This patch will increment the counter by the number of segments, and
align the driver with the behavior of other drivers in the stack.

Note that no information is lost in this patch due to 'rx_lro_packets'
counter existence.

Before, ethtool showed:
$ ethtool -S ens6 | egrep "rx_packets|rx_lro_packets"
     rx_packets: 435277
     rx_lro_packets: 35847
     rx_packets_phy: 1935066

Now, we will see the more logical statistics:
$ ethtool -S ens6 | egrep "rx_packets|rx_lro_packets"
     rx_packets: 1935066
     rx_lro_packets: 35847
     rx_packets_phy: 1935066

Fixes: e586b3b0baee ("net/mlx5: Ethernet Datapath files")
Signed-off-by: Gal Pressman <galp@mellanox.com>
Cc: kernel-team@fb.com
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index 3d371688fbbb..bafcb349a50c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -601,6 +601,10 @@ static inline void mlx5e_build_rx_skb(struct mlx5_cqe64 *cqe,
 	if (lro_num_seg > 1) {
 		mlx5e_lro_update_hdr(skb, cqe, cqe_bcnt);
 		skb_shinfo(skb)->gso_size = DIV_ROUND_UP(cqe_bcnt, lro_num_seg);
+		/* Subtract one since we already counted this as one
+		 * "regular" packet in mlx5e_complete_rx_cqe()
+		 */
+		rq->stats.packets += lro_num_seg - 1;
 		rq->stats.lro_packets++;
 		rq->stats.lro_bytes += cqe_bcnt;
 	}
-- 
2.11.0

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

* Re: [PATCH net 7/8] net/mlx5e: Count GSO packets correctly
  2017-03-21 13:59 ` [PATCH net 7/8] net/mlx5e: Count GSO packets correctly Saeed Mahameed
@ 2017-03-21 14:40   ` Alexei Starovoitov
  2017-03-21 16:15   ` Eric Dumazet
  1 sibling, 0 replies; 14+ messages in thread
From: Alexei Starovoitov @ 2017-03-21 14:40 UTC (permalink / raw)
  To: Saeed Mahameed, David S. Miller
  Cc: netdev, Or Gerlitz, Gal Pressman, kernel-team

On 3/21/17 6:59 AM, Saeed Mahameed wrote:
> From: Gal Pressman <galp@mellanox.com>
>
> TX packets statistics ('tx_packets' counter) used to count GSO packets
> as one, even though it contains multiple segments.
> This patch will increment the counter by the number of segments, and
> align the driver with the behavior of other drivers in the stack.
>
> Note that no information is lost in this patch due to 'tx_tso_packets'
> counter existence.
>
> Before, ethtool showed:
> $ ethtool -S ens6 | egrep "tx_packets|tx_tso_packets"
>      tx_packets: 61340
>      tx_tso_packets: 60954
>      tx_packets_phy: 2451115
>
> Now, we will see the more logical statistics:
> $ ethtool -S ens6 | egrep "tx_packets|tx_tso_packets"
>      tx_packets: 2451115
>      tx_tso_packets: 60954
>      tx_packets_phy: 2451115
>
> Fixes: e586b3b0baee ("net/mlx5: Ethernet Datapath files")
> Signed-off-by: Gal Pressman <galp@mellanox.com>
> Cc: kernel-team@fb.com
> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>

thank you for fixing!
Acked-by: Alexei Starovoitov <ast@kernel.org>

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

* Re: [PATCH net 8/8] net/mlx5e: Count LRO packets correctly
  2017-03-21 13:59 ` [PATCH net 8/8] net/mlx5e: Count LRO " Saeed Mahameed
@ 2017-03-21 14:41   ` Alexei Starovoitov
  0 siblings, 0 replies; 14+ messages in thread
From: Alexei Starovoitov @ 2017-03-21 14:41 UTC (permalink / raw)
  To: Saeed Mahameed, David S. Miller
  Cc: netdev, Or Gerlitz, Gal Pressman, kernel-team

On 3/21/17 6:59 AM, Saeed Mahameed wrote:
> From: Gal Pressman <galp@mellanox.com>
>
> RX packets statistics ('rx_packets' counter) used to count LRO packets
> as one, even though it contains multiple segments.
> This patch will increment the counter by the number of segments, and
> align the driver with the behavior of other drivers in the stack.
>
> Note that no information is lost in this patch due to 'rx_lro_packets'
> counter existence.
>
> Before, ethtool showed:
> $ ethtool -S ens6 | egrep "rx_packets|rx_lro_packets"
>      rx_packets: 435277
>      rx_lro_packets: 35847
>      rx_packets_phy: 1935066
>
> Now, we will see the more logical statistics:
> $ ethtool -S ens6 | egrep "rx_packets|rx_lro_packets"
>      rx_packets: 1935066
>      rx_lro_packets: 35847
>      rx_packets_phy: 1935066
>
> Fixes: e586b3b0baee ("net/mlx5: Ethernet Datapath files")
> Signed-off-by: Gal Pressman <galp@mellanox.com>
> Cc: kernel-team@fb.com
> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>

Acked-by: Alexei Starovoitov <ast@kernel.org>

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

* Re: [PATCH net 7/8] net/mlx5e: Count GSO packets correctly
  2017-03-21 13:59 ` [PATCH net 7/8] net/mlx5e: Count GSO packets correctly Saeed Mahameed
  2017-03-21 14:40   ` Alexei Starovoitov
@ 2017-03-21 16:15   ` Eric Dumazet
  2017-03-21 16:45     ` Saeed Mahameed
  1 sibling, 1 reply; 14+ messages in thread
From: Eric Dumazet @ 2017-03-21 16:15 UTC (permalink / raw)
  To: Saeed Mahameed; +Cc: David S. Miller, netdev, Or Gerlitz, Gal Pressman

On Tue, 2017-03-21 at 15:59 +0200, Saeed Mahameed wrote:
> From: Gal Pressman <galp@mellanox.com>
> 
> TX packets statistics ('tx_packets' counter) used to count GSO packets
> as one, even though it contains multiple segments.
> This patch will increment the counter by the number of segments, and
> align the driver with the behavior of other drivers in the stack.
> 
> Note that no information is lost in this patch due to 'tx_tso_packets'
> counter existence.

> Signed-off-by: Gal Pressman <galp@mellanox.com>
> Cc: kernel-team@fb.com
> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
> index f193128bac4b..57f5e2d7ebd1 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
> @@ -274,15 +274,18 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb)
>  			sq->stats.tso_bytes += skb->len - ihs;
>  		}
>  
> +		sq->stats.packets += skb_shinfo(skb)->gso_segs;
>  		num_bytes = skb->len + (skb_shinfo(skb)->gso_segs - 1) * ihs;

This reminds me that mlx4 does not trust gso_segs yet, not sure why.


diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index e0c5ffb3e3a6607456e1f191b0b8c8becfc71219..3ba89bc43d74d8c023776079bcd0bbadd70fb5c6 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -978,8 +978,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
 
 		ring->tso_packets++;
 
-		i = ((skb->len - lso_header_size) / shinfo->gso_size) +
-			!!((skb->len - lso_header_size) % shinfo->gso_size);
+		i = shinfo->gso_segs;
 		tx_info->nr_bytes = skb->len + (i - 1) * lso_header_size;
 		ring->packets += i;
 	} else {

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

* Re: [PATCH net 7/8] net/mlx5e: Count GSO packets correctly
  2017-03-21 16:15   ` Eric Dumazet
@ 2017-03-21 16:45     ` Saeed Mahameed
  0 siblings, 0 replies; 14+ messages in thread
From: Saeed Mahameed @ 2017-03-21 16:45 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Saeed Mahameed, David S. Miller, Linux Netdev List, Or Gerlitz,
	Gal Pressman

On Tue, Mar 21, 2017 at 6:15 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Tue, 2017-03-21 at 15:59 +0200, Saeed Mahameed wrote:
>> From: Gal Pressman <galp@mellanox.com>
>>
>> TX packets statistics ('tx_packets' counter) used to count GSO packets
>> as one, even though it contains multiple segments.
>> This patch will increment the counter by the number of segments, and
>> align the driver with the behavior of other drivers in the stack.
>>
>> Note that no information is lost in this patch due to 'tx_tso_packets'
>> counter existence.
>
>> Signed-off-by: Gal Pressman <galp@mellanox.com>
>> Cc: kernel-team@fb.com
>> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
>> ---
>>  drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
>> index f193128bac4b..57f5e2d7ebd1 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
>> @@ -274,15 +274,18 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb)
>>                       sq->stats.tso_bytes += skb->len - ihs;
>>               }
>>
>> +             sq->stats.packets += skb_shinfo(skb)->gso_segs;
>>               num_bytes = skb->len + (skb_shinfo(skb)->gso_segs - 1) * ihs;
>
> This reminds me that mlx4 does not trust gso_segs yet, not sure why.

maybe gso_segs wasn't around when mlx4 driver was written :)..

>
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> index e0c5ffb3e3a6607456e1f191b0b8c8becfc71219..3ba89bc43d74d8c023776079bcd0bbadd70fb5c6 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> @@ -978,8 +978,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
>
>                 ring->tso_packets++;
>
> -               i = ((skb->len - lso_header_size) / shinfo->gso_size) +
> -                       !!((skb->len - lso_header_size) % shinfo->gso_size);
> +               i = shinfo->gso_segs;
>                 tx_info->nr_bytes = skb->len + (i - 1) * lso_header_size;
>                 ring->packets += i;
>         } else {
>
>

Right, I Already discussed this with the team, we will fix this

Thank you Eric.

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

* Re: [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21
  2017-03-21 13:59 [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21 Saeed Mahameed
                   ` (7 preceding siblings ...)
  2017-03-21 13:59 ` [PATCH net 8/8] net/mlx5e: Count LRO " Saeed Mahameed
@ 2017-03-22 19:13 ` David Miller
  8 siblings, 0 replies; 14+ messages in thread
From: David Miller @ 2017-03-22 19:13 UTC (permalink / raw)
  To: saeedm; +Cc: netdev, ogerlitz

From: Saeed Mahameed <saeedm@mellanox.com>
Date: Tue, 21 Mar 2017 15:59:11 +0200

> This series contains some mlx5 core and ethernet driver fixes.

Series applied, thanks.

> For -stable:
> net/mlx5e: Count LRO packets correctly (for kernel >= 4.2)
> net/mlx5e: Count GSO packets correctly (for kernel >= 4.2)
> net/mlx5: Increase number of max QPs in default profile (for kernel >= 4.0)
> net/mlx5e: Avoid supporting udp tunnel port ndo for VF reps (for kernel >= 4.10)
> net/mlx5e: Use the proper UAPI values when offloading TC vlan actions (for kernel >= v4.9)
> net/mlx5: E-Switch, Don't allow changing inline mode when flows are configured (for kernel >= 4.10)
> net/mlx5e: Change the TC offload rule add/del code path to be per NIC or E-Switch (for kernel >= 4.10)
> net/mlx5: Add missing entries for set/query rate limit commands (for kernel >= 4.8)

Ok, queued up.

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

end of thread, other threads:[~2017-03-22 19:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-21 13:59 [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21 Saeed Mahameed
2017-03-21 13:59 ` [PATCH net 1/8] net/mlx5: Add missing entries for set/query rate limit commands Saeed Mahameed
2017-03-21 13:59 ` [PATCH net 2/8] net/mlx5e: Change the TC offload rule add/del code path to be per NIC or E-Switch Saeed Mahameed
2017-03-21 13:59 ` [PATCH net 3/8] net/mlx5: E-Switch, Don't allow changing inline mode when flows are configured Saeed Mahameed
2017-03-21 13:59 ` [PATCH net 4/8] net/mlx5e: Use the proper UAPI values when offloading TC vlan actions Saeed Mahameed
2017-03-21 13:59 ` [PATCH net 5/8] net/mlx5e: Avoid supporting udp tunnel port ndo for VF reps Saeed Mahameed
2017-03-21 13:59 ` [PATCH net 6/8] net/mlx5: Increase number of max QPs in default profile Saeed Mahameed
2017-03-21 13:59 ` [PATCH net 7/8] net/mlx5e: Count GSO packets correctly Saeed Mahameed
2017-03-21 14:40   ` Alexei Starovoitov
2017-03-21 16:15   ` Eric Dumazet
2017-03-21 16:45     ` Saeed Mahameed
2017-03-21 13:59 ` [PATCH net 8/8] net/mlx5e: Count LRO " Saeed Mahameed
2017-03-21 14:41   ` Alexei Starovoitov
2017-03-22 19:13 ` [PATCH net 0/8] Mellanox mlx5 fixes 2017-03-21 David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.