* [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc
@ 2016-06-09 21:07 Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 01/13] net/mlx5: Fix the size of modify QP mailbox Saeed Mahameed
` (13 more replies)
0 siblings, 14 replies; 15+ messages in thread
From: Saeed Mahameed @ 2016-06-09 21:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Saeed Mahameed
Hi Dave,
The following series provides some small fixes for mlx5 driver.
Two small fixes for the mlx5e netdev, the 1st is for the blue flame
quota accounting and the 2nd is a small refactoring in shutdown flow.
Five trivial fixes for mlx5 E-Switch.
- Allmulti mc_promisc flag was not set in a specific flow.
- Modify VF node guid when admin mac is changed.
- Race in vport enable flow.
- Misc code fixes (kvfree when needed and error pointers checking).
Three in mlx5 steering area. Correct capabilities checking and root flow table update.
Three misc fixes in mlx5 commands enum and layouts.
Thanks,
Saeed.
Eli Cohen (1):
net/mlx5e: Fix blue flame quota logic
Eran Ben Elisha (1):
net/mlx5e: Use ndo_stop explicitly at shutdown flow
Majd Dibbiny (2):
net/mlx5: Fix the size of modify QP mailbox
net/mlx5: Fix masking of reserved bits in XRCD number
Maor Gottlieb (3):
net/mlx5: Fix root flow table update
net/mlx5: Fix flow steering NIC capabilities check
net/mlx5: Fix E-Switch flow steering capabilities check
Mohamad Haj Yahia (2):
net/mlx5: E-Switch, Fix vport enable flow
net/mlx5: E-Switch, always set mc_promisc for allmulti vports
Noa Osherovich (1):
net/mlx5: E-Switch, Modify node guid on vf set MAC
Or Gerlitz (2):
net/mlx5: E-Switch, Use the correct free() function
net/mlx5: E-Switch, Use the correct error check on returned pointers
Shahar Klein (1):
net/mlx5: Fix MLX5_CMD_OP_MAX to be defined correctly
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 5 +-
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 3 +-
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 69 ++++++++++++++---------
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 40 ++++++++-----
drivers/net/ethernet/mellanox/mlx5/core/qp.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/vport.c | 38 +++++++++++++
include/linux/mlx5/device.h | 8 ++-
include/linux/mlx5/mlx5_ifc.h | 12 +++-
include/linux/mlx5/qp.h | 1 +
include/linux/mlx5/vport.h | 2 +
10 files changed, 128 insertions(+), 52 deletions(-)
--
2.8.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH net 01/13] net/mlx5: Fix the size of modify QP mailbox
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
@ 2016-06-09 21:07 ` Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 02/13] net/mlx5: Fix masking of reserved bits in XRCD number Saeed Mahameed
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Saeed Mahameed @ 2016-06-09 21:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Majd Dibbiny, Saeed Mahameed
From: Majd Dibbiny <majd@mellanox.com>
Add 16 reserved bytes at the end of mlx5_modify_qp_mbox_in to
match the hardware spec definition.
Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
include/linux/mlx5/qp.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h
index 6422102..1532dcf 100644
--- a/include/linux/mlx5/qp.h
+++ b/include/linux/mlx5/qp.h
@@ -560,6 +560,7 @@ struct mlx5_modify_qp_mbox_in {
__be32 optparam;
u8 rsvd0[4];
struct mlx5_qp_context ctx;
+ u8 rsvd2[16];
};
struct mlx5_modify_qp_mbox_out {
--
2.8.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net 02/13] net/mlx5: Fix masking of reserved bits in XRCD number
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 01/13] net/mlx5: Fix the size of modify QP mailbox Saeed Mahameed
@ 2016-06-09 21:07 ` Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 03/13] net/mlx5: Fix MLX5_CMD_OP_MAX to be defined correctly Saeed Mahameed
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Saeed Mahameed @ 2016-06-09 21:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Majd Dibbiny, Saeed Mahameed
From: Majd Dibbiny <majd@mellanox.com>
Mask the reserved bits when reading the number of newly
created XRCD.
Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/qp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/qp.c b/drivers/net/ethernet/mellanox/mlx5/core/qp.c
index b720a27..b82d658 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/qp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/qp.c
@@ -418,7 +418,7 @@ int mlx5_core_xrcd_alloc(struct mlx5_core_dev *dev, u32 *xrcdn)
if (out.hdr.status)
err = mlx5_cmd_status_to_err(&out.hdr);
else
- *xrcdn = be32_to_cpu(out.xrcdn);
+ *xrcdn = be32_to_cpu(out.xrcdn) & 0xffffff;
return err;
}
--
2.8.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net 03/13] net/mlx5: Fix MLX5_CMD_OP_MAX to be defined correctly
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 01/13] net/mlx5: Fix the size of modify QP mailbox Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 02/13] net/mlx5: Fix masking of reserved bits in XRCD number Saeed Mahameed
@ 2016-06-09 21:07 ` Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 04/13] net/mlx5: Fix root flow table update Saeed Mahameed
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Saeed Mahameed @ 2016-06-09 21:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Shahar Klein, Saeed Mahameed
From: Shahar Klein <shahark@mellanox.com>
Having MLX5_CMD_OP_MAX on another file causes us to repeatedly miss
accounting new commands added to the driver and hence there're no entries
for them in debugfs. To solve that, we integrate it into the commands enum
as the last entry.
Fixes: 34a40e689393 ('net/mlx5_core: Introduce modify flow table command')
Signed-off-by: Shahar Klein <shahark@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
include/linux/mlx5/device.h | 2 --
include/linux/mlx5/mlx5_ifc.h | 3 ++-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 035abdf..51f0caf 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -1240,8 +1240,6 @@ struct mlx5_destroy_psv_out {
u8 rsvd[8];
};
-#define MLX5_CMD_OP_MAX 0x920
-
enum {
VPORT_STATE_DOWN = 0x0,
VPORT_STATE_UP = 0x1,
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 9a05cd7..986a615 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -205,7 +205,8 @@ enum {
MLX5_CMD_OP_ALLOC_FLOW_COUNTER = 0x939,
MLX5_CMD_OP_DEALLOC_FLOW_COUNTER = 0x93a,
MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b,
- MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c
+ MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c,
+ MLX5_CMD_OP_MAX
};
struct mlx5_ifc_flow_table_fields_supported_bits {
--
2.8.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net 04/13] net/mlx5: Fix root flow table update
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
` (2 preceding siblings ...)
2016-06-09 21:07 ` [PATCH net 03/13] net/mlx5: Fix MLX5_CMD_OP_MAX to be defined correctly Saeed Mahameed
@ 2016-06-09 21:07 ` Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 05/13] net/mlx5: Fix flow steering NIC capabilities check Saeed Mahameed
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Saeed Mahameed @ 2016-06-09 21:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Maor Gottlieb, Saeed Mahameed
From: Maor Gottlieb <maorg@mellanox.com>
When we destroy the last flow table we need to update
the root_ft to NULL.
It fixes an issue for when the last flow table is destroyed
and recreated again, root_ft pointer will not be updated,
as a result traffic will be dropped.
Fixes: 2cc43b494a6c ('net/mlx5_core: Managing root flow table')
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
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 8b5f0b2..fa6fec1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -1292,8 +1292,8 @@ static int update_root_ft_destroy(struct mlx5_flow_table *ft)
ft->id);
return err;
}
- root->root_ft = new_root_ft;
}
+ root->root_ft = new_root_ft;
return 0;
}
--
2.8.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net 05/13] net/mlx5: Fix flow steering NIC capabilities check
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
` (3 preceding siblings ...)
2016-06-09 21:07 ` [PATCH net 04/13] net/mlx5: Fix root flow table update Saeed Mahameed
@ 2016-06-09 21:07 ` Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 06/13] net/mlx5: Fix E-Switch flow steering " Saeed Mahameed
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Saeed Mahameed @ 2016-06-09 21:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Maor Gottlieb, Saeed Mahameed
From: Maor Gottlieb <maorg@mellanox.com>
Flow steering infrastructure is currently used only on link layer
ethernet, therefore the driver should initialize the flow steering
when the device link layer is ethernet.
In addition, add missing capability check before initializing the
namespace of NIC RX flow tables.
Fixes: 2530236303d9 ('net/mlx5_core: Flow steering tree initialization')
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 10 +++++++++-
include/linux/mlx5/device.h | 6 ++++++
2 files changed, 15 insertions(+), 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 fa6fec1..c1efa55 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -1767,6 +1767,9 @@ static void cleanup_root_ns(struct mlx5_core_dev *dev)
void mlx5_cleanup_fs(struct mlx5_core_dev *dev)
{
+ if (MLX5_CAP_GEN(dev, port_type) != MLX5_CAP_PORT_TYPE_ETH)
+ return;
+
cleanup_root_ns(dev);
cleanup_single_prio_root_ns(dev, dev->priv.fdb_root_ns);
cleanup_single_prio_root_ns(dev, dev->priv.esw_egress_root_ns);
@@ -1828,15 +1831,20 @@ int mlx5_init_fs(struct mlx5_core_dev *dev)
{
int err = 0;
+ if (MLX5_CAP_GEN(dev, port_type) != MLX5_CAP_PORT_TYPE_ETH)
+ return 0;
+
err = mlx5_init_fc_stats(dev);
if (err)
return err;
- if (MLX5_CAP_GEN(dev, nic_flow_table)) {
+ if (MLX5_CAP_GEN(dev, nic_flow_table) &&
+ MLX5_CAP_FLOWTABLE_NIC_RX(dev, ft_support)) {
err = init_root_ns(dev);
if (err)
goto err;
}
+
if (MLX5_CAP_GEN(dev, eswitch_flow_table)) {
err = init_fdb_root_ns(dev);
if (err)
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 51f0caf..73a4847 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -1367,6 +1367,12 @@ enum mlx5_cap_type {
#define MLX5_CAP_FLOWTABLE_MAX(mdev, cap) \
MLX5_GET(flow_table_nic_cap, mdev->hca_caps_max[MLX5_CAP_FLOW_TABLE], cap)
+#define MLX5_CAP_FLOWTABLE_NIC_RX(mdev, cap) \
+ MLX5_CAP_FLOWTABLE(mdev, flow_table_properties_nic_receive.cap)
+
+#define MLX5_CAP_FLOWTABLE_NIC_RX_MAX(mdev, cap) \
+ MLX5_CAP_FLOWTABLE_MAX(mdev, flow_table_properties_nic_receive.cap)
+
#define MLX5_CAP_ESW_FLOWTABLE(mdev, cap) \
MLX5_GET(flow_table_eswitch_cap, \
mdev->hca_caps_cur[MLX5_CAP_ESWITCH_FLOW_TABLE], cap)
--
2.8.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net 06/13] net/mlx5: Fix E-Switch flow steering capabilities check
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
` (4 preceding siblings ...)
2016-06-09 21:07 ` [PATCH net 05/13] net/mlx5: Fix flow steering NIC capabilities check Saeed Mahameed
@ 2016-06-09 21:07 ` Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 07/13] net/mlx5: E-Switch, Use the correct free() function Saeed Mahameed
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Saeed Mahameed @ 2016-06-09 21:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Maor Gottlieb, Saeed Mahameed
From: Maor Gottlieb <maorg@mellanox.com>
Add missing capabilities check for E-Switch FDB and ACLs flow
tables before creating their namespace in flow steering.
Fixes: efdc810ba39d ('net/mlx5: Flow steering, Add vport ACL support')
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 28 ++++++++++++-----------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index c1efa55..e912a3d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -1846,19 +1846,21 @@ int mlx5_init_fs(struct mlx5_core_dev *dev)
}
if (MLX5_CAP_GEN(dev, eswitch_flow_table)) {
- err = init_fdb_root_ns(dev);
- if (err)
- goto err;
- }
- if (MLX5_CAP_ESW_EGRESS_ACL(dev, ft_support)) {
- err = init_egress_acl_root_ns(dev);
- if (err)
- goto err;
- }
- if (MLX5_CAP_ESW_INGRESS_ACL(dev, ft_support)) {
- err = init_ingress_acl_root_ns(dev);
- if (err)
- goto err;
+ if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev, ft_support)) {
+ err = init_fdb_root_ns(dev);
+ if (err)
+ goto err;
+ }
+ if (MLX5_CAP_ESW_EGRESS_ACL(dev, ft_support)) {
+ err = init_egress_acl_root_ns(dev);
+ if (err)
+ goto err;
+ }
+ if (MLX5_CAP_ESW_INGRESS_ACL(dev, ft_support)) {
+ err = init_ingress_acl_root_ns(dev);
+ if (err)
+ goto err;
+ }
}
return 0;
--
2.8.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net 07/13] net/mlx5: E-Switch, Use the correct free() function
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
` (5 preceding siblings ...)
2016-06-09 21:07 ` [PATCH net 06/13] net/mlx5: Fix E-Switch flow steering " Saeed Mahameed
@ 2016-06-09 21:07 ` Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 08/13] net/mlx5: E-Switch, Use the correct error check on returned pointers Saeed Mahameed
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Saeed Mahameed @ 2016-06-09 21:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Saeed Mahameed
From: Or Gerlitz <ogerlitz@mellanox.com>
We must use kvfree() for something that could have been allocated with vzalloc(),
do that.
Fixes: 5742df0f7dbe ('net/mlx5: E-Switch, Introduce VST vport ingress/egress ACLs')
Fixes: 86d722ad2c3b ('net/mlx5: Use flow steering infrastructure for mlx5_en')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Ilya Lesokhin <ilyal@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index b84a691..5374796 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -529,7 +529,7 @@ out:
}
}
- kfree(flow_group_in);
+ kvfree(flow_group_in);
return err;
}
@@ -1097,7 +1097,7 @@ static void esw_vport_enable_egress_acl(struct mlx5_eswitch *esw,
vport->egress.drop_grp = drop_grp;
vport->egress.allowed_vlans_grp = vlan_grp;
out:
- kfree(flow_group_in);
+ kvfree(flow_group_in);
if (err && !IS_ERR_OR_NULL(vlan_grp))
mlx5_destroy_flow_group(vlan_grp);
if (err && !IS_ERR_OR_NULL(acl))
@@ -1259,7 +1259,7 @@ out:
mlx5_destroy_flow_table(vport->ingress.acl);
}
- kfree(flow_group_in);
+ kvfree(flow_group_in);
}
static void esw_vport_cleanup_ingress_rules(struct mlx5_eswitch *esw,
--
2.8.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net 08/13] net/mlx5: E-Switch, Use the correct error check on returned pointers
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
` (6 preceding siblings ...)
2016-06-09 21:07 ` [PATCH net 07/13] net/mlx5: E-Switch, Use the correct free() function Saeed Mahameed
@ 2016-06-09 21:07 ` Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 09/13] net/mlx5: E-Switch, Fix vport enable flow Saeed Mahameed
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Saeed Mahameed @ 2016-06-09 21:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Saeed Mahameed
From: Or Gerlitz <ogerlitz@mellanox.com>
The mlx5 flow-steering API (mlx5_create_flow_table/group/rule) never
returns null pointer on error. Even if it was doing that, checking
for IS_ERR_OR_NULL(p) and then returning PTR_ERR(p) would have cause
bugs, since PTR_ERR(NULL) --> success, crash.
To make things more robust and protect against related future bugs,
convert all IS_ERR_OR_NULL checks on returned values to IS_ERR.
Fixes: 5742df0f7dbe ('net/mlx5: E-Switch, Introduce VST vport ingress/egress ACLs')
Fixes: 86d722ad2c3b ('net/mlx5: Use flow steering infrastructure for mlx5_en')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Ilya Lesokhin <ilyal@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 34 +++++++++++------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 5374796..a350af2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -383,7 +383,7 @@ __esw_fdb_set_vport_rule(struct mlx5_eswitch *esw, u32 vport, bool rx_rule,
match_v,
MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,
0, &dest);
- if (IS_ERR_OR_NULL(flow_rule)) {
+ if (IS_ERR(flow_rule)) {
pr_warn(
"FDB: Failed to add flow rule: dmac_v(%pM) dmac_c(%pM) -> vport(%d), err(%ld)\n",
dmac_v, dmac_c, vport, PTR_ERR(flow_rule));
@@ -457,7 +457,7 @@ static int esw_create_fdb_table(struct mlx5_eswitch *esw, int nvports)
table_size = BIT(MLX5_CAP_ESW_FLOWTABLE_FDB(dev, log_max_ft_size));
fdb = mlx5_create_flow_table(root_ns, 0, table_size, 0);
- if (IS_ERR_OR_NULL(fdb)) {
+ if (IS_ERR(fdb)) {
err = PTR_ERR(fdb);
esw_warn(dev, "Failed to create FDB Table err %d\n", err);
goto out;
@@ -474,7 +474,7 @@ static int esw_create_fdb_table(struct mlx5_eswitch *esw, int nvports)
MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, table_size - 3);
eth_broadcast_addr(dmac);
g = mlx5_create_flow_group(fdb, flow_group_in);
- if (IS_ERR_OR_NULL(g)) {
+ if (IS_ERR(g)) {
err = PTR_ERR(g);
esw_warn(dev, "Failed to create flow group err(%d)\n", err);
goto out;
@@ -489,7 +489,7 @@ static int esw_create_fdb_table(struct mlx5_eswitch *esw, int nvports)
eth_zero_addr(dmac);
dmac[0] = 0x01;
g = mlx5_create_flow_group(fdb, flow_group_in);
- if (IS_ERR_OR_NULL(g)) {
+ if (IS_ERR(g)) {
err = PTR_ERR(g);
esw_warn(dev, "Failed to create allmulti flow group err(%d)\n", err);
goto out;
@@ -506,7 +506,7 @@ static int esw_create_fdb_table(struct mlx5_eswitch *esw, int nvports)
MLX5_SET(create_flow_group_in, flow_group_in, start_flow_index, table_size - 1);
MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, table_size - 1);
g = mlx5_create_flow_group(fdb, flow_group_in);
- if (IS_ERR_OR_NULL(g)) {
+ if (IS_ERR(g)) {
err = PTR_ERR(g);
esw_warn(dev, "Failed to create promisc flow group err(%d)\n", err);
goto out;
@@ -1060,7 +1060,7 @@ static void esw_vport_enable_egress_acl(struct mlx5_eswitch *esw,
return;
acl = mlx5_create_vport_flow_table(root_ns, 0, table_size, 0, vport->vport);
- if (IS_ERR_OR_NULL(acl)) {
+ if (IS_ERR(acl)) {
err = PTR_ERR(acl);
esw_warn(dev, "Failed to create E-Switch vport[%d] egress flow Table, err(%d)\n",
vport->vport, err);
@@ -1075,7 +1075,7 @@ static void esw_vport_enable_egress_acl(struct mlx5_eswitch *esw,
MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, 0);
vlan_grp = mlx5_create_flow_group(acl, flow_group_in);
- if (IS_ERR_OR_NULL(vlan_grp)) {
+ if (IS_ERR(vlan_grp)) {
err = PTR_ERR(vlan_grp);
esw_warn(dev, "Failed to create E-Switch vport[%d] egress allowed vlans flow group, err(%d)\n",
vport->vport, err);
@@ -1086,7 +1086,7 @@ static void esw_vport_enable_egress_acl(struct mlx5_eswitch *esw,
MLX5_SET(create_flow_group_in, flow_group_in, start_flow_index, 1);
MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, 1);
drop_grp = mlx5_create_flow_group(acl, flow_group_in);
- if (IS_ERR_OR_NULL(drop_grp)) {
+ if (IS_ERR(drop_grp)) {
err = PTR_ERR(drop_grp);
esw_warn(dev, "Failed to create E-Switch vport[%d] egress drop flow group, err(%d)\n",
vport->vport, err);
@@ -1174,7 +1174,7 @@ static void esw_vport_enable_ingress_acl(struct mlx5_eswitch *esw,
return;
acl = mlx5_create_vport_flow_table(root_ns, 0, table_size, 0, vport->vport);
- if (IS_ERR_OR_NULL(acl)) {
+ if (IS_ERR(acl)) {
err = PTR_ERR(acl);
esw_warn(dev, "Failed to create E-Switch vport[%d] ingress flow Table, err(%d)\n",
vport->vport, err);
@@ -1192,7 +1192,7 @@ static void esw_vport_enable_ingress_acl(struct mlx5_eswitch *esw,
MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, 0);
g = mlx5_create_flow_group(acl, flow_group_in);
- if (IS_ERR_OR_NULL(g)) {
+ if (IS_ERR(g)) {
err = PTR_ERR(g);
esw_warn(dev, "Failed to create E-Switch vport[%d] ingress untagged spoofchk flow group, err(%d)\n",
vport->vport, err);
@@ -1207,7 +1207,7 @@ static void esw_vport_enable_ingress_acl(struct mlx5_eswitch *esw,
MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, 1);
g = mlx5_create_flow_group(acl, flow_group_in);
- if (IS_ERR_OR_NULL(g)) {
+ if (IS_ERR(g)) {
err = PTR_ERR(g);
esw_warn(dev, "Failed to create E-Switch vport[%d] ingress untagged flow group, err(%d)\n",
vport->vport, err);
@@ -1223,7 +1223,7 @@ static void esw_vport_enable_ingress_acl(struct mlx5_eswitch *esw,
MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, 2);
g = mlx5_create_flow_group(acl, flow_group_in);
- if (IS_ERR_OR_NULL(g)) {
+ if (IS_ERR(g)) {
err = PTR_ERR(g);
esw_warn(dev, "Failed to create E-Switch vport[%d] ingress spoofchk flow group, err(%d)\n",
vport->vport, err);
@@ -1236,7 +1236,7 @@ static void esw_vport_enable_ingress_acl(struct mlx5_eswitch *esw,
MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, 3);
g = mlx5_create_flow_group(acl, flow_group_in);
- if (IS_ERR_OR_NULL(g)) {
+ if (IS_ERR(g)) {
err = PTR_ERR(g);
esw_warn(dev, "Failed to create E-Switch vport[%d] ingress drop flow group, err(%d)\n",
vport->vport, err);
@@ -1363,7 +1363,7 @@ static int esw_vport_ingress_config(struct mlx5_eswitch *esw,
match_v,
MLX5_FLOW_CONTEXT_ACTION_ALLOW,
0, NULL);
- if (IS_ERR_OR_NULL(vport->ingress.allow_rule)) {
+ if (IS_ERR(vport->ingress.allow_rule)) {
err = PTR_ERR(vport->ingress.allow_rule);
pr_warn("vport[%d] configure ingress allow rule, err(%d)\n",
vport->vport, err);
@@ -1380,7 +1380,7 @@ static int esw_vport_ingress_config(struct mlx5_eswitch *esw,
match_v,
MLX5_FLOW_CONTEXT_ACTION_DROP,
0, NULL);
- if (IS_ERR_OR_NULL(vport->ingress.drop_rule)) {
+ if (IS_ERR(vport->ingress.drop_rule)) {
err = PTR_ERR(vport->ingress.drop_rule);
pr_warn("vport[%d] configure ingress drop rule, err(%d)\n",
vport->vport, err);
@@ -1439,7 +1439,7 @@ static int esw_vport_egress_config(struct mlx5_eswitch *esw,
match_v,
MLX5_FLOW_CONTEXT_ACTION_ALLOW,
0, NULL);
- if (IS_ERR_OR_NULL(vport->egress.allowed_vlan)) {
+ if (IS_ERR(vport->egress.allowed_vlan)) {
err = PTR_ERR(vport->egress.allowed_vlan);
pr_warn("vport[%d] configure egress allowed vlan rule failed, err(%d)\n",
vport->vport, err);
@@ -1457,7 +1457,7 @@ static int esw_vport_egress_config(struct mlx5_eswitch *esw,
match_v,
MLX5_FLOW_CONTEXT_ACTION_DROP,
0, NULL);
- if (IS_ERR_OR_NULL(vport->egress.drop_rule)) {
+ if (IS_ERR(vport->egress.drop_rule)) {
err = PTR_ERR(vport->egress.drop_rule);
pr_warn("vport[%d] configure egress drop rule failed, err(%d)\n",
vport->vport, err);
--
2.8.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net 09/13] net/mlx5: E-Switch, Fix vport enable flow
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
` (7 preceding siblings ...)
2016-06-09 21:07 ` [PATCH net 08/13] net/mlx5: E-Switch, Use the correct error check on returned pointers Saeed Mahameed
@ 2016-06-09 21:07 ` Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 10/13] net/mlx5: E-Switch, Modify node guid on vf set MAC Saeed Mahameed
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Saeed Mahameed @ 2016-06-09 21:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Mohamad Haj Yahia, Saeed Mahameed
From: Mohamad Haj Yahia <mohamad@mellanox.com>
Reorder vport enable flow to mark the vport as enabled before calling
the vport change handler which was modified to handle the case for
when vport is not enabled.
This fixes the case for when the PF netdev is open before sriov is
enabled, once sriov is enabled at esw_enable_vport,
esw_vport_change_handle_locked didn't read the PF context since it
thought the PF vport was not enabled.
When we enable the vport, arming for events is not required anymore,
since it's done on the vport change handle
Fixes: 586cfa7f1d58 ('net/mlx5: E-Switch, Use vport event handler for vport cleanup')
Signed-off-by: Mohamad Haj Yahia <mohamad@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index a350af2..cfec20c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1491,14 +1491,11 @@ static void esw_enable_vport(struct mlx5_eswitch *esw, int vport_num,
/* Sync with current vport context */
vport->enabled_events = enable_events;
- esw_vport_change_handle_locked(vport);
-
vport->enabled = true;
/* only PF is trusted by default */
vport->trusted = (vport_num) ? false : true;
-
- arm_vport_context_events_cmd(esw->dev, vport_num, enable_events);
+ esw_vport_change_handle_locked(vport);
esw->enabled_vports++;
esw_debug(esw->dev, "Enabled VPORT(%d)\n", vport_num);
--
2.8.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net 10/13] net/mlx5: E-Switch, Modify node guid on vf set MAC
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
` (8 preceding siblings ...)
2016-06-09 21:07 ` [PATCH net 09/13] net/mlx5: E-Switch, Fix vport enable flow Saeed Mahameed
@ 2016-06-09 21:07 ` Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 11/13] net/mlx5: E-Switch, always set mc_promisc for allmulti vports Saeed Mahameed
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Saeed Mahameed @ 2016-06-09 21:07 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Or Gerlitz, Noa Osherovich, Majd Dibbiny, Saeed Mahameed
From: Noa Osherovich <noaos@mellanox.com>
In RoCE, the RDMA-CM needs the node guid to establish connection
between nodes.
Today, the node guid exposed to mlx5 Ethernet VFs is zero, therefore
RDMA-CM on the VF is broken.
Whenever the administrator sets a MAC for a VF, derive the node guid
from it and set it as well in the following way:
MAC: e4:1d:2d:b3:f4:01 -> node_guid: e4:1d:2d:ff:fe:b3:f4:01
Fixes: 77256579c6b43 ('net/mlx5: E-Switch, Introduce Vport...')
Signed-off-by: Noa Osherovich <noaos@mellanox.com>
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 23 ++++++++++++--
drivers/net/ethernet/mellanox/mlx5/core/vport.c | 38 +++++++++++++++++++++++
include/linux/mlx5/mlx5_ifc.h | 9 ++++--
include/linux/mlx5/vport.h | 2 ++
4 files changed, 68 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index cfec20c..9b1855b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1725,11 +1725,24 @@ void mlx5_eswitch_vport_event(struct mlx5_eswitch *esw, struct mlx5_eqe *eqe)
(esw && MLX5_CAP_GEN(esw->dev, vport_group_manager) && mlx5_core_is_pf(esw->dev))
#define LEGAL_VPORT(esw, vport) (vport >= 0 && vport < esw->total_vports)
+static void node_guid_gen_from_mac(u64 *node_guid, u8 mac[ETH_ALEN])
+{
+ ((u8 *)node_guid)[7] = mac[0];
+ ((u8 *)node_guid)[6] = mac[1];
+ ((u8 *)node_guid)[5] = mac[2];
+ ((u8 *)node_guid)[4] = 0xff;
+ ((u8 *)node_guid)[3] = 0xfe;
+ ((u8 *)node_guid)[2] = mac[3];
+ ((u8 *)node_guid)[1] = mac[4];
+ ((u8 *)node_guid)[0] = mac[5];
+}
+
int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw,
int vport, u8 mac[ETH_ALEN])
{
- int err = 0;
struct mlx5_vport *evport;
+ u64 node_guid;
+ int err = 0;
if (!ESW_ALLOWED(esw))
return -EPERM;
@@ -1753,11 +1766,17 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw,
return err;
}
+ node_guid_gen_from_mac(&node_guid, mac);
+ err = mlx5_modify_nic_vport_node_guid(esw->dev, vport, node_guid);
+ if (err)
+ mlx5_core_warn(esw->dev,
+ "Failed to set vport %d node guid, err = %d. RDMA_CM will not function properly for this VF.\n",
+ vport, err);
+
mutex_lock(&esw->state_lock);
if (evport->enabled)
err = esw_vport_ingress_config(esw, evport);
mutex_unlock(&esw->state_lock);
-
return err;
}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/vport.c b/drivers/net/ethernet/mellanox/mlx5/core/vport.c
index b69dadc..daf44cd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/vport.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/vport.c
@@ -508,6 +508,44 @@ int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid)
}
EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_node_guid);
+int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev,
+ u32 vport, u64 node_guid)
+{
+ int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in);
+ void *nic_vport_context;
+ u8 *guid;
+ void *in;
+ int err;
+
+ if (!vport)
+ return -EINVAL;
+ if (!MLX5_CAP_GEN(mdev, vport_group_manager))
+ return -EACCES;
+ if (!MLX5_CAP_ESW(mdev, nic_vport_node_guid_modify))
+ return -ENOTSUPP;
+
+ in = mlx5_vzalloc(inlen);
+ if (!in)
+ return -ENOMEM;
+
+ MLX5_SET(modify_nic_vport_context_in, in,
+ field_select.node_guid, 1);
+ MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport);
+ MLX5_SET(modify_nic_vport_context_in, in, other_vport, !!vport);
+
+ nic_vport_context = MLX5_ADDR_OF(modify_nic_vport_context_in,
+ in, nic_vport_context);
+ guid = MLX5_ADDR_OF(nic_vport_context, nic_vport_context,
+ node_guid);
+ MLX5_SET64(nic_vport_context, nic_vport_context, node_guid, node_guid);
+
+ err = mlx5_modify_nic_vport_context(mdev, in, inlen);
+
+ kvfree(in);
+
+ return err;
+}
+
int mlx5_query_nic_vport_qkey_viol_cntr(struct mlx5_core_dev *mdev,
u16 *qkey_viol_cntr)
{
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 986a615..e955a28 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -501,7 +501,9 @@ struct mlx5_ifc_e_switch_cap_bits {
u8 vport_svlan_insert[0x1];
u8 vport_cvlan_insert_if_not_exist[0x1];
u8 vport_cvlan_insert_overwrite[0x1];
- u8 reserved_at_5[0x1b];
+ u8 reserved_at_5[0x19];
+ u8 nic_vport_node_guid_modify[0x1];
+ u8 nic_vport_port_guid_modify[0x1];
u8 reserved_at_20[0x7e0];
};
@@ -4584,7 +4586,10 @@ struct mlx5_ifc_modify_nic_vport_context_out_bits {
};
struct mlx5_ifc_modify_nic_vport_field_select_bits {
- u8 reserved_at_0[0x19];
+ u8 reserved_at_0[0x16];
+ u8 node_guid[0x1];
+ u8 port_guid[0x1];
+ u8 reserved_at_18[0x1];
u8 mtu[0x1];
u8 change_event[0x1];
u8 promisc[0x1];
diff --git a/include/linux/mlx5/vport.h b/include/linux/mlx5/vport.h
index 301da4a..6c16c19 100644
--- a/include/linux/mlx5/vport.h
+++ b/include/linux/mlx5/vport.h
@@ -50,6 +50,8 @@ int mlx5_modify_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 mtu);
int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev,
u64 *system_image_guid);
int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid);
+int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev,
+ u32 vport, u64 node_guid);
int mlx5_query_nic_vport_qkey_viol_cntr(struct mlx5_core_dev *mdev,
u16 *qkey_viol_cntr);
int mlx5_query_hca_vport_gid(struct mlx5_core_dev *dev, u8 other_vport,
--
2.8.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net 11/13] net/mlx5: E-Switch, always set mc_promisc for allmulti vports
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
` (9 preceding siblings ...)
2016-06-09 21:07 ` [PATCH net 10/13] net/mlx5: E-Switch, Modify node guid on vf set MAC Saeed Mahameed
@ 2016-06-09 21:07 ` Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 12/13] net/mlx5e: Use ndo_stop explicitly at shutdown flow Saeed Mahameed
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Saeed Mahameed @ 2016-06-09 21:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Mohamad Haj Yahia, Saeed Mahameed
From: Mohamad Haj Yahia <mohamad@mellanox.com>
Set the mc_promisc flag also in the case of adding new mc address to
existing allmulti vport.
Fixes: a35f71f27a61 ('net/mlx5: E-Switch, Implement promiscuous rx modes vf request handling')
Signed-off-by: Mohamad Haj Yahia <mohamad@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 9b1855b..aebbd6c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -651,6 +651,7 @@ static void update_allmulti_vports(struct mlx5_eswitch *esw,
esw_fdb_set_vport_rule(esw,
mac,
vport_idx);
+ iter_vaddr->mc_promisc = true;
break;
case MLX5_ACTION_DEL:
if (!iter_vaddr)
--
2.8.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net 12/13] net/mlx5e: Use ndo_stop explicitly at shutdown flow
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
` (10 preceding siblings ...)
2016-06-09 21:07 ` [PATCH net 11/13] net/mlx5: E-Switch, always set mc_promisc for allmulti vports Saeed Mahameed
@ 2016-06-09 21:07 ` Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 13/13] net/mlx5e: Fix blue flame quota logic Saeed Mahameed
2016-06-10 5:06 ` [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc David Miller
13 siblings, 0 replies; 15+ messages in thread
From: Saeed Mahameed @ 2016-06-09 21:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Eran Ben Elisha, Saeed Mahameed
From: Eran Ben Elisha <eranbe@mellanox.com>
The current implementation copies the flow of ndo_stop instead of
calling it explicitly, Fixed it.
Fixes: 5fc7197d3a25 ("net/mlx5: Add pci shutdown callback")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index fd43929..f5c8d5d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3192,10 +3192,7 @@ static void mlx5e_destroy_netdev(struct mlx5_core_dev *mdev, void *vpriv)
flush_workqueue(priv->wq);
if (test_bit(MLX5_INTERFACE_STATE_SHUTDOWN, &mdev->intf_state)) {
netif_device_detach(netdev);
- mutex_lock(&priv->state_lock);
- if (test_bit(MLX5E_STATE_OPENED, &priv->state))
- mlx5e_close_locked(netdev);
- mutex_unlock(&priv->state_lock);
+ mlx5e_close(netdev);
} else {
unregister_netdev(netdev);
}
--
2.8.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net 13/13] net/mlx5e: Fix blue flame quota logic
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
` (11 preceding siblings ...)
2016-06-09 21:07 ` [PATCH net 12/13] net/mlx5e: Use ndo_stop explicitly at shutdown flow Saeed Mahameed
@ 2016-06-09 21:07 ` Saeed Mahameed
2016-06-10 5:06 ` [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc David Miller
13 siblings, 0 replies; 15+ messages in thread
From: Saeed Mahameed @ 2016-06-09 21:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Eli Cohen, Saeed Mahameed
From: Eli Cohen <eli@mellanox.com>
Blue flame is a latency enhancement feature that allows the driver to
write the packet data directly to the NIC's registers thus making the
read of the packet data from host memory redundant.
We maintain a quota for the blue flame which is reloaded whenever we
identify that the hardware is processing send requests and processes
them fast enough so by the time we post the next send request it was
able to process all the pending ones. This indicates that the hardware
is capable of processing more blue flame requests efficiently. The blue
flame quota is decremented whenever we send using blue flame.
The current code erroneously clears the budget if we did not use blue
flame for the current post send operation and we fix it here.
Fixes: 88a85f99e51f ('net/mlx5e: TX latency optimization to save DMA reads')
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
index 229ab16..b000ddc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -317,7 +317,8 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb)
while ((sq->pc & wq->sz_m1) > sq->edge)
mlx5e_send_nop(sq, false);
- sq->bf_budget = bf ? sq->bf_budget - 1 : 0;
+ if (bf)
+ sq->bf_budget--;
sq->stats.packets++;
sq->stats.bytes += num_bytes;
--
2.8.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
` (12 preceding siblings ...)
2016-06-09 21:07 ` [PATCH net 13/13] net/mlx5e: Fix blue flame quota logic Saeed Mahameed
@ 2016-06-10 5:06 ` David Miller
13 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2016-06-10 5:06 UTC (permalink / raw)
To: saeedm; +Cc: netdev, ogerlitz
From: Saeed Mahameed <saeedm@mellanox.com>
Date: Fri, 10 Jun 2016 00:07:27 +0300
> The following series provides some small fixes for mlx5 driver.
>
> Two small fixes for the mlx5e netdev, the 1st is for the blue flame
> quota accounting and the 2nd is a small refactoring in shutdown flow.
>
> Five trivial fixes for mlx5 E-Switch.
> - Allmulti mc_promisc flag was not set in a specific flow.
> - Modify VF node guid when admin mac is changed.
> - Race in vport enable flow.
> - Misc code fixes (kvfree when needed and error pointers checking).
>
> Three in mlx5 steering area. Correct capabilities checking and root flow table update.
>
> Three misc fixes in mlx5 commands enum and layouts.
Series applied, thanks.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2016-06-10 5:06 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-09 21:07 [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 01/13] net/mlx5: Fix the size of modify QP mailbox Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 02/13] net/mlx5: Fix masking of reserved bits in XRCD number Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 03/13] net/mlx5: Fix MLX5_CMD_OP_MAX to be defined correctly Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 04/13] net/mlx5: Fix root flow table update Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 05/13] net/mlx5: Fix flow steering NIC capabilities check Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 06/13] net/mlx5: Fix E-Switch flow steering " Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 07/13] net/mlx5: E-Switch, Use the correct free() function Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 08/13] net/mlx5: E-Switch, Use the correct error check on returned pointers Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 09/13] net/mlx5: E-Switch, Fix vport enable flow Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 10/13] net/mlx5: E-Switch, Modify node guid on vf set MAC Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 11/13] net/mlx5: E-Switch, always set mc_promisc for allmulti vports Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 12/13] net/mlx5e: Use ndo_stop explicitly at shutdown flow Saeed Mahameed
2016-06-09 21:07 ` [PATCH net 13/13] net/mlx5e: Fix blue flame quota logic Saeed Mahameed
2016-06-10 5:06 ` [PATCH net 00/13] Mellanox 100G mlx5 fixes for 4.7-rc David Miller
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).