* [PATCH net-next 1/7] net/mlx4_core: Fix mpt_entry initialization in mlx4_mr_rereg_mem_write()
2015-02-03 15:57 [PATCH net-next 0/7] Mellanox drivers updates Feb-03-2015 Amir Vadai
@ 2015-02-03 15:57 ` Amir Vadai
2015-02-03 15:57 ` [PATCH net-next 2/7] net/mlx4: mlx4_config_dev_retrieval() - Initialize struct config_dev before using Amir Vadai
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin, Maor Gottlieb
From: Maor Gottlieb <maorg@mellanox.com>
a) Previously, mlx4_mr_rereg_write filled the MPT's start
and length with the old MPT's values.
Fixing the initialization to take the new start and length.
b) In addition access flags in mpt_status were initialized instead of
status due to bad boolean operation. Fixing the operation.
c) Initialization of pd_slave caused a protection error.
Fix - removing this initialization.
d) In resource_tracker.c: Fixing vf encoding to be one-based.
Fixes: e630664c ('mlx4_core: Add helper functions to support MR re-registration')
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/mr.c | 13 +++++--------
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 2 +-
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c
index d21e884..78f51e1 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mr.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mr.c
@@ -598,14 +598,11 @@ int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr,
if (err)
return err;
- mpt_entry->start = cpu_to_be64(mr->iova);
- mpt_entry->length = cpu_to_be64(mr->size);
- mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift);
-
- mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK |
- MLX4_MPT_PD_FLAG_EN_INV);
- mpt_entry->flags &= cpu_to_be32(MLX4_MPT_FLAG_FREE |
- MLX4_MPT_FLAG_SW_OWNS);
+ mpt_entry->start = cpu_to_be64(iova);
+ mpt_entry->length = cpu_to_be64(size);
+ mpt_entry->entity_size = cpu_to_be32(page_shift);
+ mpt_entry->flags &= ~(cpu_to_be32(MLX4_MPT_FLAG_FREE |
+ MLX4_MPT_FLAG_SW_OWNS));
if (mr->mtt.order < 0) {
mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_PHYSICAL);
mpt_entry->mtt_addr = 0;
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 79feeb6..628c2e8 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -2541,7 +2541,7 @@ int mlx4_SW2HW_MPT_wrapper(struct mlx4_dev *dev, int slave,
/* Make sure that the PD bits related to the slave id are zeros. */
pd = mr_get_pd(inbox->buf);
pd_slave = (pd >> 17) & 0x7f;
- if (pd_slave != 0 && pd_slave != slave) {
+ if (pd_slave != 0 && --pd_slave != slave) {
err = -EPERM;
goto ex_abort;
}
--
1.9.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH net-next 2/7] net/mlx4: mlx4_config_dev_retrieval() - Initialize struct config_dev before using
2015-02-03 15:57 [PATCH net-next 0/7] Mellanox drivers updates Feb-03-2015 Amir Vadai
2015-02-03 15:57 ` [PATCH net-next 1/7] net/mlx4_core: Fix mpt_entry initialization in mlx4_mr_rereg_mem_write() Amir Vadai
@ 2015-02-03 15:57 ` Amir Vadai
2015-02-03 15:57 ` [PATCH net-next 3/7] net/mlx4_core: Fix misleading debug print on CQE stride support Amir Vadai
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin, Maor Gottlieb
From: Maor Gottlieb <maorg@mellanox.com>
Add Initialization to struct config_dev before filling and using it.
Fix to warning:
warning: config_dev.rx_checksum_val may be used uninitialized in this function
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/fw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index dbabfae..241838f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -2162,7 +2162,7 @@ static const u8 config_dev_csum_flags[] = {
int mlx4_config_dev_retrieval(struct mlx4_dev *dev,
struct mlx4_config_dev_params *params)
{
- struct mlx4_config_dev config_dev;
+ struct mlx4_config_dev config_dev = {0};
int err;
u8 csum_mask;
--
1.9.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH net-next 3/7] net/mlx4_core: Fix misleading debug print on CQE stride support
2015-02-03 15:57 [PATCH net-next 0/7] Mellanox drivers updates Feb-03-2015 Amir Vadai
2015-02-03 15:57 ` [PATCH net-next 1/7] net/mlx4_core: Fix mpt_entry initialization in mlx4_mr_rereg_mem_write() Amir Vadai
2015-02-03 15:57 ` [PATCH net-next 2/7] net/mlx4: mlx4_config_dev_retrieval() - Initialize struct config_dev before using Amir Vadai
@ 2015-02-03 15:57 ` Amir Vadai
2015-02-03 15:57 ` [PATCH net-next 4/7] net/mlx5_core: Move to use hex PCI device IDs Amir Vadai
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin
From: Or Gerlitz <ogerlitz@mellanox.com>
We do support cache line sizes of 32 and 64 bytes without activating the
CQE stride feature. Fix a misleading print saying that these cache line
sizes aren't supported.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index cc9f484..e045562 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -251,7 +251,8 @@ static void mlx4_enable_cqe_eqe_stride(struct mlx4_dev *dev)
if (mlx4_is_master(dev))
dev_cap->function_caps |= MLX4_FUNC_CAP_EQE_CQE_STRIDE;
} else {
- mlx4_dbg(dev, "Disabling CQE stride cacheLine unsupported\n");
+ if (cache_line_size() != 32 && cache_line_size() != 64)
+ mlx4_dbg(dev, "Disabling CQE stride, cacheLine size unsupported\n");
dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_CQE_STRIDE;
dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_EQE_STRIDE;
}
--
1.9.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH net-next 4/7] net/mlx5_core: Move to use hex PCI device IDs
2015-02-03 15:57 [PATCH net-next 0/7] Mellanox drivers updates Feb-03-2015 Amir Vadai
` (2 preceding siblings ...)
2015-02-03 15:57 ` [PATCH net-next 3/7] net/mlx4_core: Fix misleading debug print on CQE stride support Amir Vadai
@ 2015-02-03 15:57 ` Amir Vadai
2015-02-03 15:57 ` [PATCH net-next 5/7] net/mlx4_en: Print page allocator information Amir Vadai
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin
From: Or Gerlitz <ogerlitz@mellanox.com>
Align the IDs in the code with the modinfo, lspci -n, etc tools outputs.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/main.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 3f45256..d665193 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -903,12 +903,12 @@ static void remove_one(struct pci_dev *pdev)
}
static const struct pci_device_id mlx5_core_pci_table[] = {
- { PCI_VDEVICE(MELLANOX, 4113) }, /* Connect-IB */
- { PCI_VDEVICE(MELLANOX, 4114) }, /* Connect-IB VF */
- { PCI_VDEVICE(MELLANOX, 4115) }, /* ConnectX-4 */
- { PCI_VDEVICE(MELLANOX, 4116) }, /* ConnectX-4 VF */
- { PCI_VDEVICE(MELLANOX, 4117) }, /* ConnectX-4LX */
- { PCI_VDEVICE(MELLANOX, 4118) }, /* ConnectX-4LX VF */
+ { PCI_VDEVICE(MELLANOX, 0x1011) }, /* Connect-IB */
+ { PCI_VDEVICE(MELLANOX, 0x1012) }, /* Connect-IB VF */
+ { PCI_VDEVICE(MELLANOX, 0x1013) }, /* ConnectX-4 */
+ { PCI_VDEVICE(MELLANOX, 0x1014) }, /* ConnectX-4 VF */
+ { PCI_VDEVICE(MELLANOX, 0x1015) }, /* ConnectX-4LX */
+ { PCI_VDEVICE(MELLANOX, 0x1016) }, /* ConnectX-4LX VF */
{ 0, }
};
--
1.9.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH net-next 5/7] net/mlx4_en: Print page allocator information
2015-02-03 15:57 [PATCH net-next 0/7] Mellanox drivers updates Feb-03-2015 Amir Vadai
` (3 preceding siblings ...)
2015-02-03 15:57 ` [PATCH net-next 4/7] net/mlx5_core: Move to use hex PCI device IDs Amir Vadai
@ 2015-02-03 15:57 ` Amir Vadai
2015-02-03 15:57 ` [PATCH net-next 6/7] net/mlx4_en: Adjust RX frag strides to frag sizes Amir Vadai
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin, Ido Shamay
From: Ido Shamay <idos@mellanox.com>
After Initialization of page_alloc, print actual allocated page
size and number of frags it contains. prints is done only when drv
message level is set on the interface.
Signed-off-by: Ido Shamay <idos@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 2ba5d36..30a2203 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -162,6 +162,10 @@ static int mlx4_en_init_allocator(struct mlx4_en_priv *priv,
if (mlx4_alloc_pages(priv, &ring->page_alloc[i],
frag_info, GFP_KERNEL | __GFP_COLD))
goto out;
+
+ en_dbg(DRV, priv, " frag %d allocator: - size:%d frags:%d\n",
+ i, ring->page_alloc[i].page_size,
+ atomic_read(&ring->page_alloc[i].page->_count));
}
return 0;
--
1.9.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH net-next 6/7] net/mlx4_en: Adjust RX frag strides to frag sizes
2015-02-03 15:57 [PATCH net-next 0/7] Mellanox drivers updates Feb-03-2015 Amir Vadai
` (4 preceding siblings ...)
2015-02-03 15:57 ` [PATCH net-next 5/7] net/mlx4_en: Print page allocator information Amir Vadai
@ 2015-02-03 15:57 ` Amir Vadai
2015-02-03 15:57 ` [PATCH net-next 7/7] net/mlx4_en: Notify TX Vlan offload change Amir Vadai
2015-02-05 0:18 ` [PATCH net-next 0/7] Mellanox drivers updates Feb-03-2015 David Miller
7 siblings, 0 replies; 9+ messages in thread
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin, Ido Shamay
From: Ido Shamay <idos@mellanox.com>
This patch improves memory utilization and therefore the packets rate
for special MTU's. Instead of setting the frag_stride to the maximal
hard coded frag_size, use the actual frag_size that is set according to
the MTU, when setting the stride of the last frag.
So, for example, for MTU 1600, where the frag_size of the 2nd frag is
86, the frag_size is set to 128 instead of 4096. See below:
Before:
frag:0 - size:1536 prefix:0 stride:1536
frag:1 - size:86 prefix:1536 stride:4096
frag 0 allocator: - size:32768 frags:21
frag 1 allocator: - size:32768 frags:8
After:
frag:0 - size:1536 prefix:0 stride:1536
frag:1 - size:86 prefix:1536 stride:128
frag 0 allocator: - size:32768 frags:21
frag 1 allocator: - size:32768 frags:256
Signed-off-by: Ido Shamay <idos@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 30a2203..698d60d 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -1063,8 +1063,9 @@ void mlx4_en_calc_rx_buf(struct net_device *dev)
(eff_mtu > buf_size + frag_sizes[i]) ?
frag_sizes[i] : eff_mtu - buf_size;
priv->frag_info[i].frag_prefix_size = buf_size;
- priv->frag_info[i].frag_stride = ALIGN(frag_sizes[i],
- SMP_CACHE_BYTES);
+ priv->frag_info[i].frag_stride =
+ ALIGN(priv->frag_info[i].frag_size,
+ SMP_CACHE_BYTES);
buf_size += priv->frag_info[i].frag_size;
i++;
}
--
1.9.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH net-next 7/7] net/mlx4_en: Notify TX Vlan offload change
2015-02-03 15:57 [PATCH net-next 0/7] Mellanox drivers updates Feb-03-2015 Amir Vadai
` (5 preceding siblings ...)
2015-02-03 15:57 ` [PATCH net-next 6/7] net/mlx4_en: Adjust RX frag strides to frag sizes Amir Vadai
@ 2015-02-03 15:57 ` Amir Vadai
2015-02-05 0:18 ` [PATCH net-next 0/7] Mellanox drivers updates Feb-03-2015 David Miller
7 siblings, 0 replies; 9+ messages in thread
From: Amir Vadai @ 2015-02-03 15:57 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin, Ido Shamay
From: Ido Shamay <idos@mellanox.com>
Notify users when TX vlan offload feature changed with ethtool.
Relevant command - ethtool -K <eth> txvlan on/off.
Signed-off-by: Ido Shamay <idos@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index e075ff1..0897274 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2201,6 +2201,10 @@ static int mlx4_en_set_features(struct net_device *netdev,
return ret;
}
+ if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_HW_VLAN_CTAG_TX))
+ en_info(priv, "Turn %s TX vlan strip offload\n",
+ (features & NETIF_F_HW_VLAN_CTAG_TX) ? "ON" : "OFF");
+
if (features & NETIF_F_LOOPBACK)
priv->ctrl_flags |= cpu_to_be32(MLX4_WQE_CTRL_FORCE_LOOPBACK);
else
--
1.9.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH net-next 0/7] Mellanox drivers updates Feb-03-2015
2015-02-03 15:57 [PATCH net-next 0/7] Mellanox drivers updates Feb-03-2015 Amir Vadai
` (6 preceding siblings ...)
2015-02-03 15:57 ` [PATCH net-next 7/7] net/mlx4_en: Notify TX Vlan offload change Amir Vadai
@ 2015-02-05 0:18 ` David Miller
7 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2015-02-05 0:18 UTC (permalink / raw)
To: amirv; +Cc: netdev, ogerlitz, yevgenyp
From: Amir Vadai <amirv@mellanox.com>
Date: Tue, 3 Feb 2015 17:57:14 +0200
> This patchset introduces some small bug fixes and code cleanups in mlx4_core,
> mlx4_en and mlx5_core.
> I am sending it in parallel to the patchset sent by Or Gerlitz today [1] because
> this is the end of the time frame for 3.20. I also checked that there are no
> conflicts between those two patchsets (Or's patchset is focused on the bonding
> area while this on Mellanox drivers).
>
> The patchset was applied on top of commit 7d37d0c ('net: sctp: Deletion of an
> unnecessary check before the function call "kfree"')
>
> [1] - [PATCH 00/10] Add HA and LAG support to mlx4 RoCE and SRIOV services
> http://marc.info/?l=linux-netdev&m=142297582610254&w=2
Series applied, thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread