Skip to content

Commit 9ba11ac

Browse files
committed
Merge branch 'mlx4-next'
Amir Vadai says: ==================== Mellanox drivers updates Feb-03-2015 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 ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents ce388ff + cfb53f3 commit 9ba11ac

File tree

7 files changed

+26
-19
lines changed

7 files changed

+26
-19
lines changed

drivers/net/ethernet/mellanox/mlx4/en_netdev.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,6 +2202,10 @@ static int mlx4_en_set_features(struct net_device *netdev,
22022202
return ret;
22032203
}
22042204

2205+
if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_HW_VLAN_CTAG_TX))
2206+
en_info(priv, "Turn %s TX vlan strip offload\n",
2207+
(features & NETIF_F_HW_VLAN_CTAG_TX) ? "ON" : "OFF");
2208+
22052209
if (features & NETIF_F_LOOPBACK)
22062210
priv->ctrl_flags |= cpu_to_be32(MLX4_WQE_CTRL_FORCE_LOOPBACK);
22072211
else

drivers/net/ethernet/mellanox/mlx4/en_rx.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ static int mlx4_en_init_allocator(struct mlx4_en_priv *priv,
162162
if (mlx4_alloc_pages(priv, &ring->page_alloc[i],
163163
frag_info, GFP_KERNEL | __GFP_COLD))
164164
goto out;
165+
166+
en_dbg(DRV, priv, " frag %d allocator: - size:%d frags:%d\n",
167+
i, ring->page_alloc[i].page_size,
168+
atomic_read(&ring->page_alloc[i].page->_count));
165169
}
166170
return 0;
167171

@@ -1059,8 +1063,9 @@ void mlx4_en_calc_rx_buf(struct net_device *dev)
10591063
(eff_mtu > buf_size + frag_sizes[i]) ?
10601064
frag_sizes[i] : eff_mtu - buf_size;
10611065
priv->frag_info[i].frag_prefix_size = buf_size;
1062-
priv->frag_info[i].frag_stride = ALIGN(frag_sizes[i],
1063-
SMP_CACHE_BYTES);
1066+
priv->frag_info[i].frag_stride =
1067+
ALIGN(priv->frag_info[i].frag_size,
1068+
SMP_CACHE_BYTES);
10641069
buf_size += priv->frag_info[i].frag_size;
10651070
i++;
10661071
}

drivers/net/ethernet/mellanox/mlx4/fw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2169,7 +2169,7 @@ static const u8 config_dev_csum_flags[] = {
21692169
int mlx4_config_dev_retrieval(struct mlx4_dev *dev,
21702170
struct mlx4_config_dev_params *params)
21712171
{
2172-
struct mlx4_config_dev config_dev;
2172+
struct mlx4_config_dev config_dev = {0};
21732173
int err;
21742174
u8 csum_mask;
21752175

drivers/net/ethernet/mellanox/mlx4/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ static void mlx4_enable_cqe_eqe_stride(struct mlx4_dev *dev)
251251
if (mlx4_is_master(dev))
252252
dev_cap->function_caps |= MLX4_FUNC_CAP_EQE_CQE_STRIDE;
253253
} else {
254-
mlx4_dbg(dev, "Disabling CQE stride cacheLine unsupported\n");
254+
if (cache_line_size() != 32 && cache_line_size() != 64)
255+
mlx4_dbg(dev, "Disabling CQE stride, cacheLine size unsupported\n");
255256
dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_CQE_STRIDE;
256257
dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_EQE_STRIDE;
257258
}

drivers/net/ethernet/mellanox/mlx4/mr.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -598,14 +598,11 @@ int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr,
598598
if (err)
599599
return err;
600600

601-
mpt_entry->start = cpu_to_be64(mr->iova);
602-
mpt_entry->length = cpu_to_be64(mr->size);
603-
mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift);
604-
605-
mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK |
606-
MLX4_MPT_PD_FLAG_EN_INV);
607-
mpt_entry->flags &= cpu_to_be32(MLX4_MPT_FLAG_FREE |
608-
MLX4_MPT_FLAG_SW_OWNS);
601+
mpt_entry->start = cpu_to_be64(iova);
602+
mpt_entry->length = cpu_to_be64(size);
603+
mpt_entry->entity_size = cpu_to_be32(page_shift);
604+
mpt_entry->flags &= ~(cpu_to_be32(MLX4_MPT_FLAG_FREE |
605+
MLX4_MPT_FLAG_SW_OWNS));
609606
if (mr->mtt.order < 0) {
610607
mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_PHYSICAL);
611608
mpt_entry->mtt_addr = 0;

drivers/net/ethernet/mellanox/mlx4/resource_tracker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2541,7 +2541,7 @@ int mlx4_SW2HW_MPT_wrapper(struct mlx4_dev *dev, int slave,
25412541
/* Make sure that the PD bits related to the slave id are zeros. */
25422542
pd = mr_get_pd(inbox->buf);
25432543
pd_slave = (pd >> 17) & 0x7f;
2544-
if (pd_slave != 0 && pd_slave != slave) {
2544+
if (pd_slave != 0 && --pd_slave != slave) {
25452545
err = -EPERM;
25462546
goto ex_abort;
25472547
}

drivers/net/ethernet/mellanox/mlx5/core/main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -903,12 +903,12 @@ static void remove_one(struct pci_dev *pdev)
903903
}
904904

905905
static const struct pci_device_id mlx5_core_pci_table[] = {
906-
{ PCI_VDEVICE(MELLANOX, 4113) }, /* Connect-IB */
907-
{ PCI_VDEVICE(MELLANOX, 4114) }, /* Connect-IB VF */
908-
{ PCI_VDEVICE(MELLANOX, 4115) }, /* ConnectX-4 */
909-
{ PCI_VDEVICE(MELLANOX, 4116) }, /* ConnectX-4 VF */
910-
{ PCI_VDEVICE(MELLANOX, 4117) }, /* ConnectX-4LX */
911-
{ PCI_VDEVICE(MELLANOX, 4118) }, /* ConnectX-4LX VF */
906+
{ PCI_VDEVICE(MELLANOX, 0x1011) }, /* Connect-IB */
907+
{ PCI_VDEVICE(MELLANOX, 0x1012) }, /* Connect-IB VF */
908+
{ PCI_VDEVICE(MELLANOX, 0x1013) }, /* ConnectX-4 */
909+
{ PCI_VDEVICE(MELLANOX, 0x1014) }, /* ConnectX-4 VF */
910+
{ PCI_VDEVICE(MELLANOX, 0x1015) }, /* ConnectX-4LX */
911+
{ PCI_VDEVICE(MELLANOX, 0x1016) }, /* ConnectX-4LX VF */
912912
{ 0, }
913913
};
914914

0 commit comments

Comments
 (0)