Skip to content

Commit b19c7bb

Browse files
committed
Merge tag 'mlx5e-updates-2018-07-18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
Saeed Mahameed says: ==================== mlx5e-updates-2018-07-18 This series includes update for mlx5e net device driver. 1) From Feras Daoud, Added the support for firmware log tracing, first by introducing the firmware API needed for the task and then For each PF do the following: 1- Allocate memory for the tracer strings database and read it from the FW to the SW. 2- Allocate and dma map tracer buffers. Traces that will be written into the buffer will be parsed as a group of one or more traces, referred to as trace message. The trace message represents a C-like printf string. Once a new trace is available FW will generate an event indicates new trace/s are available and the driver will parse them and dump them using tracepoints event tracing Enable mlx5 fw tracing by: echo 1 > /sys/kernel/debug/tracing/events/mlx5/mlx5_fw/enable Read traces by: cat /sys/kernel/debug/tracing/trace 2) From Roi Dayan, Remove redundant WARN when we cannot find neigh entry 3) From Jianbo Liu, TC double vlan support - Support offloading tc double vlan headers match - Support offloading double vlan push/pop tc actions 4) From Boris, re-visit UDP GSO, remove the splitting of UDP_GSO_L4 packets in the driver, and exposes UDP_GSO_L4 as a PARTIAL_GSO feature. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents c9eaaa1 + 3f44899 commit b19c7bb

File tree

28 files changed

+1654
-269
lines changed

28 files changed

+1654
-269
lines changed

drivers/infiniband/hw/mlx5/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
config MLX5_INFINIBAND
2-
tristate "Mellanox Connect-IB HCA support"
2+
tristate "Mellanox 5th generation network adapters (ConnectX series) support"
33
depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE
44
depends on INFINIBAND_USER_ACCESS || INFINIBAND_USER_ACCESS=n
55
---help---

drivers/infiniband/hw/mlx5/cmd.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@
3232

3333
#include "cmd.h"
3434

35+
int mlx5_cmd_dump_fill_mkey(struct mlx5_core_dev *dev, u32 *mkey)
36+
{
37+
u32 out[MLX5_ST_SZ_DW(query_special_contexts_out)] = {0};
38+
u32 in[MLX5_ST_SZ_DW(query_special_contexts_in)] = {0};
39+
int err;
40+
41+
MLX5_SET(query_special_contexts_in, in, opcode,
42+
MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS);
43+
err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
44+
if (!err)
45+
*mkey = MLX5_GET(query_special_contexts_out, out,
46+
dump_fill_mkey);
47+
return err;
48+
}
49+
3550
int mlx5_cmd_null_mkey(struct mlx5_core_dev *dev, u32 *null_mkey)
3651
{
3752
u32 out[MLX5_ST_SZ_DW(query_special_contexts_out)] = {};

drivers/infiniband/hw/mlx5/cmd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <linux/kernel.h>
3838
#include <linux/mlx5/driver.h>
3939

40+
int mlx5_cmd_dump_fill_mkey(struct mlx5_core_dev *dev, u32 *mkey);
4041
int mlx5_cmd_null_mkey(struct mlx5_core_dev *dev, u32 *null_mkey);
4142
int mlx5_cmd_query_cong_params(struct mlx5_core_dev *dev, int cong_point,
4243
void *out, int out_size);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
config MLX5_CORE
6-
tristate "Mellanox Technologies ConnectX-4 and Connect-IB core driver"
6+
tristate "Mellanox 5th generation network adapters (ConnectX series) core driver"
77
depends on MAY_USE_DEVLINK
88
depends on PCI
99
imply PTP_1588_CLOCK
@@ -27,7 +27,7 @@ config MLX5_FPGA
2727
sandbox-specific client drivers.
2828

2929
config MLX5_CORE_EN
30-
bool "Mellanox Technologies ConnectX-4 Ethernet support"
30+
bool "Mellanox 5th generation network adapters (ConnectX series) Ethernet support"
3131
depends on NETDEVICES && ETHERNET && INET && PCI && MLX5_CORE
3232
depends on IPV6=y || IPV6=n || MLX5_CORE=m
3333
select PAGE_POOL
@@ -69,7 +69,7 @@ config MLX5_CORE_EN_DCB
6969
If unsure, set to Y
7070

7171
config MLX5_CORE_IPOIB
72-
bool "Mellanox Technologies ConnectX-4 IPoIB offloads support"
72+
bool "Mellanox 5th generation network adapters (connectX series) IPoIB offloads support"
7373
depends on MLX5_CORE_EN
7474
default n
7575
---help---

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
66
health.o mcg.o cq.o srq.o alloc.o qp.o port.o mr.o pd.o \
77
mad.o transobj.o vport.o sriov.o fs_cmd.o fs_core.o \
88
fs_counters.o rl.o lag.o dev.o wq.o lib/gid.o lib/clock.o \
9-
diag/fs_tracepoint.o
9+
diag/fs_tracepoint.o diag/fw_tracer.o
1010

1111
mlx5_core-$(CONFIG_MLX5_ACCEL) += accel/ipsec.o accel/tls.o
1212

1313
mlx5_core-$(CONFIG_MLX5_FPGA) += fpga/cmd.o fpga/core.o fpga/conn.o fpga/sdk.o \
1414
fpga/ipsec.o fpga/tls.o
1515

1616
mlx5_core-$(CONFIG_MLX5_CORE_EN) += en_main.o en_common.o en_fs.o en_ethtool.o \
17-
en_tx.o en_rx.o en_dim.o en_txrx.o en_accel/rxtx.o en_stats.o \
18-
vxlan.o en_arfs.o en_fs_ethtool.o en_selftest.o en/port.o
17+
en_tx.o en_rx.o en_dim.o en_txrx.o en_stats.o vxlan.o \
18+
en_arfs.o en_fs_ethtool.o en_selftest.o en/port.o
1919

2020
mlx5_core-$(CONFIG_MLX5_MPFS) += lib/mpfs.o
2121

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

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
278278
case MLX5_CMD_OP_DESTROY_PSV:
279279
case MLX5_CMD_OP_DESTROY_SRQ:
280280
case MLX5_CMD_OP_DESTROY_XRC_SRQ:
281+
case MLX5_CMD_OP_DESTROY_XRQ:
281282
case MLX5_CMD_OP_DESTROY_DCT:
282283
case MLX5_CMD_OP_DEALLOC_Q_COUNTER:
283284
case MLX5_CMD_OP_DESTROY_SCHEDULING_ELEMENT:
@@ -310,6 +311,7 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
310311
case MLX5_CMD_OP_DEALLOC_ENCAP_HEADER:
311312
case MLX5_CMD_OP_DEALLOC_MODIFY_HEADER_CONTEXT:
312313
case MLX5_CMD_OP_FPGA_DESTROY_QP:
314+
case MLX5_CMD_OP_DESTROY_GENERAL_OBJECT:
313315
return MLX5_CMD_STAT_OK;
314316

315317
case MLX5_CMD_OP_QUERY_HCA_CAP:
@@ -346,6 +348,9 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
346348
case MLX5_CMD_OP_CREATE_XRC_SRQ:
347349
case MLX5_CMD_OP_QUERY_XRC_SRQ:
348350
case MLX5_CMD_OP_ARM_XRC_SRQ:
351+
case MLX5_CMD_OP_CREATE_XRQ:
352+
case MLX5_CMD_OP_QUERY_XRQ:
353+
case MLX5_CMD_OP_ARM_XRQ:
349354
case MLX5_CMD_OP_CREATE_DCT:
350355
case MLX5_CMD_OP_DRAIN_DCT:
351356
case MLX5_CMD_OP_QUERY_DCT:
@@ -427,6 +432,7 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
427432
case MLX5_CMD_OP_FPGA_MODIFY_QP:
428433
case MLX5_CMD_OP_FPGA_QUERY_QP:
429434
case MLX5_CMD_OP_FPGA_QUERY_QP_COUNTERS:
435+
case MLX5_CMD_OP_CREATE_GENERAL_OBJECT:
430436
*status = MLX5_DRIVER_STATUS_ABORTED;
431437
*synd = MLX5_DRIVER_SYND;
432438
return -EIO;
@@ -452,6 +458,7 @@ const char *mlx5_command_str(int command)
452458
MLX5_COMMAND_STR_CASE(SET_HCA_CAP);
453459
MLX5_COMMAND_STR_CASE(QUERY_ISSI);
454460
MLX5_COMMAND_STR_CASE(SET_ISSI);
461+
MLX5_COMMAND_STR_CASE(SET_DRIVER_VERSION);
455462
MLX5_COMMAND_STR_CASE(CREATE_MKEY);
456463
MLX5_COMMAND_STR_CASE(QUERY_MKEY);
457464
MLX5_COMMAND_STR_CASE(DESTROY_MKEY);
@@ -599,6 +606,12 @@ const char *mlx5_command_str(int command)
599606
MLX5_COMMAND_STR_CASE(FPGA_QUERY_QP);
600607
MLX5_COMMAND_STR_CASE(FPGA_QUERY_QP_COUNTERS);
601608
MLX5_COMMAND_STR_CASE(FPGA_DESTROY_QP);
609+
MLX5_COMMAND_STR_CASE(CREATE_XRQ);
610+
MLX5_COMMAND_STR_CASE(DESTROY_XRQ);
611+
MLX5_COMMAND_STR_CASE(QUERY_XRQ);
612+
MLX5_COMMAND_STR_CASE(ARM_XRQ);
613+
MLX5_COMMAND_STR_CASE(CREATE_GENERAL_OBJECT);
614+
MLX5_COMMAND_STR_CASE(DESTROY_GENERAL_OBJECT);
602615
default: return "unknown command opcode";
603616
}
604617
}
@@ -677,7 +690,7 @@ struct mlx5_ifc_mbox_out_bits {
677690

678691
struct mlx5_ifc_mbox_in_bits {
679692
u8 opcode[0x10];
680-
u8 reserved_at_10[0x10];
693+
u8 uid[0x10];
681694

682695
u8 reserved_at_20[0x10];
683696
u8 op_mod[0x10];
@@ -697,15 +710,23 @@ static int mlx5_cmd_check(struct mlx5_core_dev *dev, void *in, void *out)
697710
u8 status;
698711
u16 opcode;
699712
u16 op_mod;
713+
u16 uid;
700714

701715
mlx5_cmd_mbox_status(out, &status, &syndrome);
702716
if (!status)
703717
return 0;
704718

705719
opcode = MLX5_GET(mbox_in, in, opcode);
706720
op_mod = MLX5_GET(mbox_in, in, op_mod);
721+
uid = MLX5_GET(mbox_in, in, uid);
707722

708-
mlx5_core_err(dev,
723+
if (!uid && opcode != MLX5_CMD_OP_DESTROY_MKEY)
724+
mlx5_core_err_rl(dev,
725+
"%s(0x%x) op_mod(0x%x) failed, status %s(0x%x), syndrome (0x%x)\n",
726+
mlx5_command_str(opcode), opcode, op_mod,
727+
cmd_status_str(status), status, syndrome);
728+
else
729+
mlx5_core_dbg(dev,
709730
"%s(0x%x) op_mod(0x%x) failed, status %s(0x%x), syndrome (0x%x)\n",
710731
mlx5_command_str(opcode),
711732
opcode, op_mod,
@@ -1022,7 +1043,10 @@ static ssize_t dbg_write(struct file *filp, const char __user *buf,
10221043
if (!dbg->in_msg || !dbg->out_msg)
10231044
return -ENOMEM;
10241045

1025-
if (copy_from_user(lbuf, buf, sizeof(lbuf)))
1046+
if (count < sizeof(lbuf) - 1)
1047+
return -EINVAL;
1048+
1049+
if (copy_from_user(lbuf, buf, sizeof(lbuf) - 1))
10261050
return -EFAULT;
10271051

10281052
lbuf[sizeof(lbuf) - 1] = 0;
@@ -1226,21 +1250,12 @@ static ssize_t data_read(struct file *filp, char __user *buf, size_t count,
12261250
{
12271251
struct mlx5_core_dev *dev = filp->private_data;
12281252
struct mlx5_cmd_debug *dbg = &dev->cmd.dbg;
1229-
int copy;
1230-
1231-
if (*pos)
1232-
return 0;
12331253

12341254
if (!dbg->out_msg)
12351255
return -ENOMEM;
12361256

1237-
copy = min_t(int, count, dbg->outlen);
1238-
if (copy_to_user(buf, dbg->out_msg, copy))
1239-
return -EFAULT;
1240-
1241-
*pos += copy;
1242-
1243-
return copy;
1257+
return simple_read_from_buffer(buf, count, pos, dbg->out_msg,
1258+
dbg->outlen);
12441259
}
12451260

12461261
static const struct file_operations dfops = {
@@ -1258,19 +1273,11 @@ static ssize_t outlen_read(struct file *filp, char __user *buf, size_t count,
12581273
char outlen[8];
12591274
int err;
12601275

1261-
if (*pos)
1262-
return 0;
1263-
12641276
err = snprintf(outlen, sizeof(outlen), "%d", dbg->outlen);
12651277
if (err < 0)
12661278
return err;
12671279

1268-
if (copy_to_user(buf, &outlen, err))
1269-
return -EFAULT;
1270-
1271-
*pos += err;
1272-
1273-
return err;
1280+
return simple_read_from_buffer(buf, count, pos, outlen, err);
12741281
}
12751282

12761283
static ssize_t outlen_write(struct file *filp, const char __user *buf,

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

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -150,22 +150,13 @@ static ssize_t average_read(struct file *filp, char __user *buf, size_t count,
150150
int ret;
151151
char tbuf[22];
152152

153-
if (*pos)
154-
return 0;
155-
156153
stats = filp->private_data;
157154
spin_lock_irq(&stats->lock);
158155
if (stats->n)
159156
field = div64_u64(stats->sum, stats->n);
160157
spin_unlock_irq(&stats->lock);
161158
ret = snprintf(tbuf, sizeof(tbuf), "%llu\n", field);
162-
if (ret > 0) {
163-
if (copy_to_user(buf, tbuf, ret))
164-
return -EFAULT;
165-
}
166-
167-
*pos += ret;
168-
return ret;
159+
return simple_read_from_buffer(buf, count, pos, tbuf, ret);
169160
}
170161

171162
static ssize_t average_write(struct file *filp, const char __user *buf,
@@ -442,9 +433,6 @@ static ssize_t dbg_read(struct file *filp, char __user *buf, size_t count,
442433
u64 field;
443434
int ret;
444435

445-
if (*pos)
446-
return 0;
447-
448436
desc = filp->private_data;
449437
d = (void *)(desc - desc->i) - sizeof(*d);
450438
switch (d->type) {
@@ -470,13 +458,7 @@ static ssize_t dbg_read(struct file *filp, char __user *buf, size_t count,
470458
else
471459
ret = snprintf(tbuf, sizeof(tbuf), "0x%llx\n", field);
472460

473-
if (ret > 0) {
474-
if (copy_to_user(buf, tbuf, ret))
475-
return -EFAULT;
476-
}
477-
478-
*pos += ret;
479-
return ret;
461+
return simple_read_from_buffer(buf, count, pos, tbuf, ret);
480462
}
481463

482464
static const struct file_operations fops = {

drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ TRACE_EVENT(mlx5_fs_del_fg,
138138
{MLX5_FLOW_CONTEXT_ACTION_MOD_HDR, "MOD_HDR"},\
139139
{MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH, "VLAN_PUSH"},\
140140
{MLX5_FLOW_CONTEXT_ACTION_VLAN_POP, "VLAN_POP"},\
141+
{MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2, "VLAN_PUSH_2"},\
142+
{MLX5_FLOW_CONTEXT_ACTION_VLAN_POP_2, "VLAN_POP_2"},\
141143
{MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_PRIO, "NEXT_PRIO"}
142144

143145
TRACE_EVENT(mlx5_fs_set_fte,

0 commit comments

Comments
 (0)