Skip to content

Commit abc7a4e

Browse files
committed
Merge tag 'mlx5-update-2017-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux
Saeed Mahameed says: ==================== mlx5-update-2017-05-23 First patch from Leon, came to remove the redundant usage of mlx5_vzalloc, and directly use kvzalloc across all mlx5 drivers. 2nd patch from Noa, adds new device IDs into the supported devices list. 3rd and 4th patches from Ilan are adding the basic infrastructure and support for Mellanox's mlx5 FPGA. Last two patches from Tariq came to modify the outdated driver version reported in ethtool and in mlx5_ib to more reflect the current driver state and remove the redundant date string reported in the version. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents ce682ef + b359911 commit abc7a4e

40 files changed

+779
-164
lines changed

MAINTAINERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8311,6 +8311,16 @@ W: http://www.mellanox.com
83118311
Q: http://patchwork.ozlabs.org/project/netdev/list/
83128312
F: drivers/net/ethernet/mellanox/mlx5/core/en_*
83138313

8314+
MELLANOX ETHERNET INNOVA DRIVER
8315+
M: Ilan Tayari <[email protected]>
8316+
R: Boris Pismenny <[email protected]>
8317+
8318+
S: Supported
8319+
W: http://www.mellanox.com
8320+
Q: http://patchwork.ozlabs.org/project/netdev/list/
8321+
F: drivers/net/ethernet/mellanox/mlx5/core/fpga/*
8322+
F: include/linux/mlx5/mlx5_ifc_fpga.h
8323+
83148324
MELLANOX ETHERNET SWITCH DRIVERS
83158325
M: Jiri Pirko <[email protected]>
83168326
M: Ido Schimmel <[email protected]>

drivers/infiniband/hw/mlx5/cq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata,
788788

789789
*inlen = MLX5_ST_SZ_BYTES(create_cq_in) +
790790
MLX5_FLD_SZ_BYTES(create_cq_in, pas[0]) * ncont;
791-
*cqb = mlx5_vzalloc(*inlen);
791+
*cqb = kvzalloc(*inlen, GFP_KERNEL);
792792
if (!*cqb) {
793793
err = -ENOMEM;
794794
goto err_db;
@@ -884,7 +884,7 @@ static int create_cq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq,
884884

885885
*inlen = MLX5_ST_SZ_BYTES(create_cq_in) +
886886
MLX5_FLD_SZ_BYTES(create_cq_in, pas[0]) * cq->buf.buf.npages;
887-
*cqb = mlx5_vzalloc(*inlen);
887+
*cqb = kvzalloc(*inlen, GFP_KERNEL);
888888
if (!*cqb) {
889889
err = -ENOMEM;
890890
goto err_buf;
@@ -1314,7 +1314,7 @@ int mlx5_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata)
13141314
inlen = MLX5_ST_SZ_BYTES(modify_cq_in) +
13151315
MLX5_FLD_SZ_BYTES(modify_cq_in, pas[0]) * npas;
13161316

1317-
in = mlx5_vzalloc(inlen);
1317+
in = kvzalloc(inlen, GFP_KERNEL);
13181318
if (!in) {
13191319
err = -ENOMEM;
13201320
goto ex_resize;

drivers/infiniband/hw/mlx5/mad.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static int process_pma_cmd(struct ib_device *ibdev, u8 port_num,
218218
(struct ib_pma_portcounters_ext *)(out_mad->data + 40);
219219
int sz = MLX5_ST_SZ_BYTES(query_vport_counter_out);
220220

221-
out_cnt = mlx5_vzalloc(sz);
221+
out_cnt = kvzalloc(sz, GFP_KERNEL);
222222
if (!out_cnt)
223223
return IB_MAD_RESULT_FAILURE;
224224

@@ -231,7 +231,7 @@ static int process_pma_cmd(struct ib_device *ibdev, u8 port_num,
231231
(struct ib_pma_portcounters *)(out_mad->data + 40);
232232
int sz = MLX5_ST_SZ_BYTES(ppcnt_reg);
233233

234-
out_cnt = mlx5_vzalloc(sz);
234+
out_cnt = kvzalloc(sz, GFP_KERNEL);
235235
if (!out_cnt)
236236
return IB_MAD_RESULT_FAILURE;
237237

drivers/infiniband/hw/mlx5/main.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060
#include "cmd.h"
6161

6262
#define DRIVER_NAME "mlx5_ib"
63-
#define DRIVER_VERSION "2.2-1"
64-
#define DRIVER_RELDATE "Feb 2014"
63+
#define DRIVER_VERSION "5.0-0"
6564

6665
MODULE_AUTHOR("Eli Cohen <[email protected]>");
6766
MODULE_DESCRIPTION("Mellanox Connect-IB HCA IB driver");
@@ -70,7 +69,7 @@ MODULE_VERSION(DRIVER_VERSION);
7069

7170
static char mlx5_version[] =
7271
DRIVER_NAME ": Mellanox Connect-IB Infiniband driver v"
73-
DRIVER_VERSION " (" DRIVER_RELDATE ")\n";
72+
DRIVER_VERSION "\n";
7473

7574
enum {
7675
MLX5_ATOMIC_SIZE_QP_8BYTES = 1 << 3,
@@ -2263,7 +2262,7 @@ static struct mlx5_ib_flow_handler *create_flow_rule(struct mlx5_ib_dev *dev,
22632262
if (!is_valid_attr(dev->mdev, flow_attr))
22642263
return ERR_PTR(-EINVAL);
22652264

2266-
spec = mlx5_vzalloc(sizeof(*spec));
2265+
spec = kvzalloc(sizeof(*spec), GFP_KERNEL);
22672266
handler = kzalloc(sizeof(*handler), GFP_KERNEL);
22682267
if (!handler || !spec) {
22692268
err = -ENOMEM;
@@ -3456,7 +3455,7 @@ static int mlx5_ib_query_q_counters(struct mlx5_ib_dev *dev,
34563455
__be32 val;
34573456
int ret, i;
34583457

3459-
out = mlx5_vzalloc(outlen);
3458+
out = kvzalloc(outlen, GFP_KERNEL);
34603459
if (!out)
34613460
return -ENOMEM;
34623461

@@ -3485,7 +3484,7 @@ static int mlx5_ib_query_cong_counters(struct mlx5_ib_dev *dev,
34853484
int ret, i;
34863485
int offset = port->cnts.num_q_counters;
34873486

3488-
out = mlx5_vzalloc(outlen);
3487+
out = kvzalloc(outlen, GFP_KERNEL);
34893488
if (!out)
34903489
return -ENOMEM;
34913490

drivers/infiniband/hw/mlx5/mr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ static struct mlx5_ib_mr *reg_create(struct ib_mr *ibmr, struct ib_pd *pd,
11101110

11111111
inlen = MLX5_ST_SZ_BYTES(create_mkey_in) +
11121112
sizeof(*pas) * ((npages + 1) / 2) * 2;
1113-
in = mlx5_vzalloc(inlen);
1113+
in = kvzalloc(inlen, GFP_KERNEL);
11141114
if (!in) {
11151115
err = -ENOMEM;
11161116
goto err_1;

drivers/infiniband/hw/mlx5/qp.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
823823

824824
*inlen = MLX5_ST_SZ_BYTES(create_qp_in) +
825825
MLX5_FLD_SZ_BYTES(create_qp_in, pas[0]) * ncont;
826-
*in = mlx5_vzalloc(*inlen);
826+
*in = kvzalloc(*inlen, GFP_KERNEL);
827827
if (!*in) {
828828
err = -ENOMEM;
829829
goto err_umem;
@@ -931,7 +931,7 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev,
931931
qp->sq.qend = mlx5_get_send_wqe(qp, qp->sq.wqe_cnt);
932932
*inlen = MLX5_ST_SZ_BYTES(create_qp_in) +
933933
MLX5_FLD_SZ_BYTES(create_qp_in, pas[0]) * qp->buf.npages;
934-
*in = mlx5_vzalloc(*inlen);
934+
*in = kvzalloc(*inlen, GFP_KERNEL);
935935
if (!*in) {
936936
err = -ENOMEM;
937937
goto err_buf;
@@ -1060,7 +1060,7 @@ static int create_raw_packet_qp_sq(struct mlx5_ib_dev *dev,
10601060
return err;
10611061

10621062
inlen = MLX5_ST_SZ_BYTES(create_sq_in) + sizeof(u64) * ncont;
1063-
in = mlx5_vzalloc(inlen);
1063+
in = kvzalloc(inlen, GFP_KERNEL);
10641064
if (!in) {
10651065
err = -ENOMEM;
10661066
goto err_umem;
@@ -1140,7 +1140,7 @@ static int create_raw_packet_qp_rq(struct mlx5_ib_dev *dev,
11401140
u32 rq_pas_size = get_rq_pas_size(qpc);
11411141

11421142
inlen = MLX5_ST_SZ_BYTES(create_rq_in) + rq_pas_size;
1143-
in = mlx5_vzalloc(inlen);
1143+
in = kvzalloc(inlen, GFP_KERNEL);
11441144
if (!in)
11451145
return -ENOMEM;
11461146

@@ -1193,7 +1193,7 @@ static int create_raw_packet_qp_tir(struct mlx5_ib_dev *dev,
11931193
int err;
11941194

11951195
inlen = MLX5_ST_SZ_BYTES(create_tir_in);
1196-
in = mlx5_vzalloc(inlen);
1196+
in = kvzalloc(inlen, GFP_KERNEL);
11971197
if (!in)
11981198
return -ENOMEM;
11991199

@@ -1372,7 +1372,7 @@ static int create_rss_raw_qp_tir(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
13721372
}
13731373

13741374
inlen = MLX5_ST_SZ_BYTES(create_tir_in);
1375-
in = mlx5_vzalloc(inlen);
1375+
in = kvzalloc(inlen, GFP_KERNEL);
13761376
if (!in)
13771377
return -ENOMEM;
13781378

@@ -1633,7 +1633,7 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd,
16331633
if (err)
16341634
return err;
16351635
} else {
1636-
in = mlx5_vzalloc(inlen);
1636+
in = kvzalloc(inlen, GFP_KERNEL);
16371637
if (!in)
16381638
return -ENOMEM;
16391639

@@ -2164,7 +2164,7 @@ static int modify_raw_packet_eth_prio(struct mlx5_core_dev *dev,
21642164
int err;
21652165

21662166
inlen = MLX5_ST_SZ_BYTES(modify_tis_in);
2167-
in = mlx5_vzalloc(inlen);
2167+
in = kvzalloc(inlen, GFP_KERNEL);
21682168
if (!in)
21692169
return -ENOMEM;
21702170

@@ -2189,7 +2189,7 @@ static int modify_raw_packet_tx_affinity(struct mlx5_core_dev *dev,
21892189
int err;
21902190

21912191
inlen = MLX5_ST_SZ_BYTES(modify_tis_in);
2192-
in = mlx5_vzalloc(inlen);
2192+
in = kvzalloc(inlen, GFP_KERNEL);
21932193
if (!in)
21942194
return -ENOMEM;
21952195

@@ -2434,7 +2434,7 @@ static int modify_raw_packet_qp_rq(struct mlx5_ib_dev *dev,
24342434
int err;
24352435

24362436
inlen = MLX5_ST_SZ_BYTES(modify_rq_in);
2437-
in = mlx5_vzalloc(inlen);
2437+
in = kvzalloc(inlen, GFP_KERNEL);
24382438
if (!in)
24392439
return -ENOMEM;
24402440

@@ -2479,7 +2479,7 @@ static int modify_raw_packet_qp_sq(struct mlx5_core_dev *dev,
24792479
int err;
24802480

24812481
inlen = MLX5_ST_SZ_BYTES(modify_sq_in);
2482-
in = mlx5_vzalloc(inlen);
2482+
in = kvzalloc(inlen, GFP_KERNEL);
24832483
if (!in)
24842484
return -ENOMEM;
24852485

@@ -4294,7 +4294,7 @@ static int query_raw_packet_qp_sq_state(struct mlx5_ib_dev *dev,
42944294
int err;
42954295

42964296
inlen = MLX5_ST_SZ_BYTES(query_sq_out);
4297-
out = mlx5_vzalloc(inlen);
4297+
out = kvzalloc(inlen, GFP_KERNEL);
42984298
if (!out)
42994299
return -ENOMEM;
43004300

@@ -4321,7 +4321,7 @@ static int query_raw_packet_qp_rq_state(struct mlx5_ib_dev *dev,
43214321
int err;
43224322

43234323
inlen = MLX5_ST_SZ_BYTES(query_rq_out);
4324-
out = mlx5_vzalloc(inlen);
4324+
out = kvzalloc(inlen, GFP_KERNEL);
43254325
if (!out)
43264326
return -ENOMEM;
43274327

@@ -4625,7 +4625,7 @@ static int create_rq(struct mlx5_ib_rwq *rwq, struct ib_pd *pd,
46254625
dev = to_mdev(pd->device);
46264626

46274627
inlen = MLX5_ST_SZ_BYTES(create_rq_in) + sizeof(u64) * rwq->rq_num_pas;
4628-
in = mlx5_vzalloc(inlen);
4628+
in = kvzalloc(inlen, GFP_KERNEL);
46294629
if (!in)
46304630
return -ENOMEM;
46314631

@@ -4855,7 +4855,7 @@ struct ib_rwq_ind_table *mlx5_ib_create_rwq_ind_table(struct ib_device *device,
48554855
return ERR_PTR(-ENOMEM);
48564856

48574857
inlen = MLX5_ST_SZ_BYTES(create_rqt_in) + sizeof(u32) * sz;
4858-
in = mlx5_vzalloc(inlen);
4858+
in = kvzalloc(inlen, GFP_KERNEL);
48594859
if (!in) {
48604860
err = -ENOMEM;
48614861
goto err;
@@ -4934,7 +4934,7 @@ int mlx5_ib_modify_wq(struct ib_wq *wq, struct ib_wq_attr *wq_attr,
49344934
return -EOPNOTSUPP;
49354935

49364936
inlen = MLX5_ST_SZ_BYTES(modify_rq_in);
4937-
in = mlx5_vzalloc(inlen);
4937+
in = kvzalloc(inlen, GFP_KERNEL);
49384938
if (!in)
49394939
return -ENOMEM;
49404940

drivers/infiniband/hw/mlx5/srq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static int create_srq_user(struct ib_pd *pd, struct mlx5_ib_srq *srq,
127127
goto err_umem;
128128
}
129129

130-
in->pas = mlx5_vzalloc(sizeof(*in->pas) * ncont);
130+
in->pas = kvzalloc(sizeof(*in->pas) * ncont, GFP_KERNEL);
131131
if (!in->pas) {
132132
err = -ENOMEM;
133133
goto err_umem;
@@ -189,7 +189,7 @@ static int create_srq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_srq *srq,
189189
}
190190

191191
mlx5_ib_dbg(dev, "srq->buf.page_shift = %d\n", srq->buf.page_shift);
192-
in->pas = mlx5_vzalloc(sizeof(*in->pas) * srq->buf.npages);
192+
in->pas = kvzalloc(sizeof(*in->pas) * srq->buf.npages, GFP_KERNEL);
193193
if (!in->pas) {
194194
err = -ENOMEM;
195195
goto err_buf;

drivers/net/ethernet/mellanox/mlx5/core/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ config MLX5_CORE
1111
Core driver for low level functionality of the ConnectX-4 and
1212
Connect-IB cards by Mellanox Technologies.
1313

14+
config MLX5_FPGA
15+
bool "Mellanox Technologies Innova support"
16+
depends on MLX5_CORE
17+
---help---
18+
Build support for the Innova family of network cards by Mellanox
19+
Technologies. Innova network cards are comprised of a ConnectX chip
20+
and an FPGA chip on one board. If you select this option, the
21+
mlx5_core driver will include the Innova FPGA core and allow building
22+
sandbox-specific client drivers.
23+
1424
config MLX5_CORE_EN
1525
bool "Mellanox Technologies ConnectX-4 Ethernet support"
1626
depends on NETDEVICES && ETHERNET && INET && PCI && MLX5_CORE

drivers/net/ethernet/mellanox/mlx5/core/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
obj-$(CONFIG_MLX5_CORE) += mlx5_core.o
2+
subdir-ccflags-y += -I$(src)
23

34
mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
45
health.o mcg.o cq.o srq.o alloc.o qp.o port.o mr.o pd.o \
56
mad.o transobj.o vport.o sriov.o fs_cmd.o fs_core.o \
67
fs_counters.o rl.o lag.o dev.o
78

9+
mlx5_core-$(CONFIG_MLX5_FPGA) += fpga/cmd.o fpga/core.o
10+
811
mlx5_core-$(CONFIG_MLX5_CORE_EN) += wq.o eswitch.o eswitch_offloads.o \
912
en_main.o en_common.o en_fs.o en_ethtool.o en_tx.o \
1013
en_rx.o en_rx_am.o en_txrx.o en_clock.o vxlan.o \

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ static u64 cq_read_field(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
405405
u32 *out;
406406
int err;
407407

408-
out = mlx5_vzalloc(outlen);
408+
out = kvzalloc(outlen, GFP_KERNEL);
409409
if (!out)
410410
return param;
411411

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,8 @@ static int arfs_add_default_rule(struct mlx5e_priv *priv,
180180
struct mlx5_flow_spec *spec;
181181
int err = 0;
182182

183-
spec = mlx5_vzalloc(sizeof(*spec));
183+
spec = kvzalloc(sizeof(*spec), GFP_KERNEL);
184184
if (!spec) {
185-
netdev_err(priv->netdev, "%s: alloc failed\n", __func__);
186185
err = -ENOMEM;
187186
goto out;
188187
}
@@ -237,7 +236,7 @@ static int arfs_create_groups(struct mlx5e_flow_table *ft,
237236

238237
ft->g = kcalloc(MLX5E_ARFS_NUM_GROUPS,
239238
sizeof(*ft->g), GFP_KERNEL);
240-
in = mlx5_vzalloc(inlen);
239+
in = kvzalloc(inlen, GFP_KERNEL);
241240
if (!in || !ft->g) {
242241
kvfree(ft->g);
243242
kvfree(in);
@@ -481,9 +480,8 @@ static struct mlx5_flow_handle *arfs_add_rule(struct mlx5e_priv *priv,
481480
struct mlx5_flow_table *ft;
482481
int err = 0;
483482

484-
spec = mlx5_vzalloc(sizeof(*spec));
483+
spec = kvzalloc(sizeof(*spec), GFP_KERNEL);
485484
if (!spec) {
486-
netdev_err(priv->netdev, "%s: alloc failed\n", __func__);
487485
err = -ENOMEM;
488486
goto out;
489487
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static int mlx5e_create_mkey(struct mlx5_core_dev *mdev, u32 pdn,
6565
u32 *in;
6666
int err;
6767

68-
in = mlx5_vzalloc(inlen);
68+
in = kvzalloc(inlen, GFP_KERNEL);
6969
if (!in)
7070
return -ENOMEM;
7171

@@ -147,7 +147,7 @@ int mlx5e_refresh_tirs(struct mlx5e_priv *priv, bool enable_uc_lb)
147147

148148

149149
inlen = MLX5_ST_SZ_BYTES(modify_tir_in);
150-
in = mlx5_vzalloc(inlen);
150+
in = kvzalloc(inlen, GFP_KERNEL);
151151
if (!in)
152152
goto out;
153153

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static void mlx5e_get_drvinfo(struct net_device *dev,
3939
struct mlx5_core_dev *mdev = priv->mdev;
4040

4141
strlcpy(drvinfo->driver, DRIVER_NAME, sizeof(drvinfo->driver));
42-
strlcpy(drvinfo->version, DRIVER_VERSION " (" DRIVER_RELDATE ")",
42+
strlcpy(drvinfo->version, DRIVER_VERSION,
4343
sizeof(drvinfo->version));
4444
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
4545
"%d.%d.%04d (%.16s)",
@@ -1048,7 +1048,7 @@ static int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir,
10481048
(hfunc != ETH_RSS_HASH_TOP))
10491049
return -EINVAL;
10501050

1051-
in = mlx5_vzalloc(inlen);
1051+
in = kvzalloc(inlen, GFP_KERNEL);
10521052
if (!in)
10531053
return -ENOMEM;
10541054

0 commit comments

Comments
 (0)