From git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git This is required to resolve dependencies of the next series of RDMA patches. * branch 'mellanox/mlx5-next': net/mlx5: Add support for flow table destination number net/mlx5: Add forward compatible support for the FTE match data net/mlx5: Fix tristate and description for MLX5 module net/mlx5: Better return types for CQE API net/mlx5: Use ERR_CAST() instead of coding it net/mlx5: Add missing SET_DRIVER_VERSION command translation net/mlx5: Add XRQ commands definitions net/mlx5: Add core support for double vlan push/pop steering action net/mlx5: Expose MPEGC (Management PCIe General Configuration) structures net/mlx5: FW tracer, add hardware structures net/mlx5: fix uaccess beyond "count" in debugfs read/write handlers
Unified · Split
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | config MLX5_INFINIBAND |
| 2 | − tristate "Mellanox Connect-IB HCA support" | |
| 2 | + tristate "Mellanox 5th generation network adapters (ConnectX series) support" | |
| 3 | 3 | depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE |
| 4 | 4 | depends on INFINIBAND_USER_ACCESS || INFINIBAND_USER_ACCESS=n |
| 5 | 5 | ---help--- |
| @@ -3,7 +3,7 @@ · 2 unmodified lines | ||
| 3 | 3 | # |
| 4 | 4 | |
| 5 | 5 | 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" | |
| 7 | 7 | depends on MAY_USE_DEVLINK |
| 8 | 8 | depends on PCI |
| 9 | 9 | imply PTP_1588_CLOCK |
| @@ -27,7 +27,7 @@ config MLX5_FPGA · 17 unmodified lines | ||
| 27 | 27 | sandbox-specific client drivers. |
| 28 | 28 | |
| 29 | 29 | config MLX5_CORE_EN |
| 30 | − bool "Mellanox Technologies ConnectX-4 Ethernet support" | |
| 30 | + bool "Mellanox 5th generation network adapters (ConnectX series) Ethernet support" | |
| 31 | 31 | depends on NETDEVICES && ETHERNET && INET && PCI && MLX5_CORE |
| 32 | 32 | depends on IPV6=y || IPV6=n || MLX5_CORE=m |
| 33 | 33 | select PAGE_POOL |
| @@ -69,7 +69,7 @@ config MLX5_CORE_EN_DCB · 35 unmodified lines | ||
| 69 | 69 | If unsure, set to Y |
| 70 | 70 | |
| 71 | 71 | 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" | |
| 73 | 73 | depends on MLX5_CORE_EN |
| 74 | 74 | default n |
| 75 | 75 | ---help--- |
| @@ -278,6 +278,7 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op, · 277 unmodified lines | ||
| 278 | 278 | case MLX5_CMD_OP_DESTROY_PSV: |
| 279 | 279 | case MLX5_CMD_OP_DESTROY_SRQ: |
| 280 | 280 | case MLX5_CMD_OP_DESTROY_XRC_SRQ: |
| 281 | + case MLX5_CMD_OP_DESTROY_XRQ: | |
| 281 | 282 | case MLX5_CMD_OP_DESTROY_DCT: |
| 282 | 283 | case MLX5_CMD_OP_DEALLOC_Q_COUNTER: |
| 283 | 284 | case MLX5_CMD_OP_DESTROY_SCHEDULING_ELEMENT: |
| @@ -347,6 +348,9 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op, · 63 unmodified lines | ||
| 347 | 348 | case MLX5_CMD_OP_CREATE_XRC_SRQ: |
| 348 | 349 | case MLX5_CMD_OP_QUERY_XRC_SRQ: |
| 349 | 350 | 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: | |
| 350 | 354 | case MLX5_CMD_OP_CREATE_DCT: |
| 351 | 355 | case MLX5_CMD_OP_DRAIN_DCT: |
| 352 | 356 | case MLX5_CMD_OP_QUERY_DCT: |
| @@ -456,6 +460,7 @@ const char *mlx5_command_str(int command) · 103 unmodified lines | ||
| 456 | 460 | MLX5_COMMAND_STR_CASE(SET_HCA_CAP); |
| 457 | 461 | MLX5_COMMAND_STR_CASE(QUERY_ISSI); |
| 458 | 462 | MLX5_COMMAND_STR_CASE(SET_ISSI); |
| 463 | + MLX5_COMMAND_STR_CASE(SET_DRIVER_VERSION); | |
| 459 | 464 | MLX5_COMMAND_STR_CASE(CREATE_MKEY); |
| 460 | 465 | MLX5_COMMAND_STR_CASE(QUERY_MKEY); |
| 461 | 466 | MLX5_COMMAND_STR_CASE(DESTROY_MKEY); |
| @@ -603,6 +608,10 @@ const char *mlx5_command_str(int command) · 141 unmodified lines | ||
| 603 | 608 | MLX5_COMMAND_STR_CASE(FPGA_QUERY_QP); |
| 604 | 609 | MLX5_COMMAND_STR_CASE(FPGA_QUERY_QP_COUNTERS); |
| 605 | 610 | MLX5_COMMAND_STR_CASE(FPGA_DESTROY_QP); |
| 611 | + MLX5_COMMAND_STR_CASE(CREATE_XRQ); | |
| 612 | + MLX5_COMMAND_STR_CASE(DESTROY_XRQ); | |
| 613 | + MLX5_COMMAND_STR_CASE(QUERY_XRQ); | |
| 614 | + MLX5_COMMAND_STR_CASE(ARM_XRQ); | |
| 606 | 615 | MLX5_COMMAND_STR_CASE(CREATE_GENERAL_OBJECT); |
| 607 | 616 | MLX5_COMMAND_STR_CASE(DESTROY_GENERAL_OBJECT); |
| 608 | 617 | MLX5_COMMAND_STR_CASE(MODIFY_GENERAL_OBJECT); |
| @@ -1037,7 +1046,10 @@ static ssize_t dbg_write(struct file *filp, const char __user *buf, · 428 unmodified lines | ||
| 1037 | 1046 | if (!dbg->in_msg || !dbg->out_msg) |
| 1038 | 1047 | return -ENOMEM; |
| 1039 | 1048 | |
| 1040 | − if (copy_from_user(lbuf, buf, sizeof(lbuf))) | |
| 1049 | + if (count < sizeof(lbuf) - 1) | |
| 1050 | + return -EINVAL; | |
| 1051 | + | |
| 1052 | + if (copy_from_user(lbuf, buf, sizeof(lbuf) - 1)) | |
| 1041 | 1053 | return -EFAULT; |
| 1042 | 1054 | |
| 1043 | 1055 | lbuf[sizeof(lbuf) - 1] = 0; |
| @@ -1241,21 +1253,12 @@ static ssize_t data_read(struct file *filp, char __user *buf, size_t count, · 197 unmodified lines | ||
| 1241 | 1253 | { |
| 1242 | 1254 | struct mlx5_core_dev *dev = filp->private_data; |
| 1243 | 1255 | struct mlx5_cmd_debug *dbg = &dev->cmd.dbg; |
| 1244 | − int copy; | |
| 1245 | − | |
| 1246 | − if (*pos) | |
| 1247 | − return 0; | |
| 1248 | 1256 | |
| 1249 | 1257 | if (!dbg->out_msg) |
| 1250 | 1258 | return -ENOMEM; |
| 1251 | 1259 | |
| 1252 | − copy = min_t(int, count, dbg->outlen); | |
| 1253 | − if (copy_to_user(buf, dbg->out_msg, copy)) | |
| 1254 | − return -EFAULT; | |
| 1255 | − | |
| 1256 | − *pos += copy; | |
| 1257 | − | |
| 1258 | − return copy; | |
| 1260 | + return simple_read_from_buffer(buf, count, pos, dbg->out_msg, | |
| 1261 | + dbg->outlen); | |
| 1259 | 1262 | } |
| 1260 | 1263 | |
| 1261 | 1264 | static const struct file_operations dfops = { |
| @@ -1273,19 +1276,11 @@ static ssize_t outlen_read(struct file *filp, char __user *buf, size_t count, · 11 unmodified lines | ||
| 1273 | 1276 | char outlen[8]; |
| 1274 | 1277 | int err; |
| 1275 | 1278 | |
| 1276 | − if (*pos) | |
| 1277 | − return 0; | |
| 1278 | − | |
| 1279 | 1279 | err = snprintf(outlen, sizeof(outlen), "%d", dbg->outlen); |
| 1280 | 1280 | if (err < 0) |
| 1281 | 1281 | return err; |
| 1282 | 1282 | |
| 1283 | − if (copy_to_user(buf, &outlen, err)) | |
| 1284 | − return -EFAULT; | |
| 1285 | − | |
| 1286 | − *pos += err; | |
| 1287 | − | |
| 1288 | − return err; | |
| 1283 | + return simple_read_from_buffer(buf, count, pos, outlen, err); | |
| 1289 | 1284 | } |
| 1290 | 1285 | |
| 1291 | 1286 | static ssize_t outlen_write(struct file *filp, const char __user *buf, |
| @@ -150,22 +150,13 @@ static ssize_t average_read(struct file *filp, char __user *buf, size_t count, · 149 unmodified lines | ||
| 150 | 150 | int ret; |
| 151 | 151 | char tbuf[22]; |
| 152 | 152 | |
| 153 | − if (*pos) | |
| 154 | − return 0; | |
| 155 | − | |
| 156 | 153 | stats = filp->private_data; |
| 157 | 154 | spin_lock_irq(&stats->lock); |
| 158 | 155 | if (stats->n) |
| 159 | 156 | field = div64_u64(stats->sum, stats->n); |
| 160 | 157 | spin_unlock_irq(&stats->lock); |
| 161 | 158 | 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); | |
| 169 | 160 | } |
| 170 | 161 | |
| 171 | 162 | 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, · 270 unmodified lines | ||
| 442 | 433 | u64 field; |
| 443 | 434 | int ret; |
| 444 | 435 | |
| 445 | − if (*pos) | |
| 446 | − return 0; | |
| 447 | − | |
| 448 | 436 | desc = filp->private_data; |
| 449 | 437 | d = (void *)(desc - desc->i) - sizeof(*d); |
| 450 | 438 | switch (d->type) { |
| @@ -470,13 +458,7 @@ static ssize_t dbg_read(struct file *filp, char __user *buf, size_t count, · 19 unmodified lines | ||
| 470 | 458 | else |
| 471 | 459 | ret = snprintf(tbuf, sizeof(tbuf), "0x%llx\n", field); |
| 472 | 460 | |
| 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); | |
| 480 | 462 | } |
| 481 | 463 | |
| 482 | 464 | static const struct file_operations fops = { |
| @@ -240,6 +240,9 @@ const char *parse_fs_dst(struct trace_seq *p, · 239 unmodified lines | ||
| 240 | 240 | case MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE: |
| 241 | 241 | trace_seq_printf(p, "ft=%p\n", dst->ft); |
| 242 | 242 | break; |
| 243 | + case MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE_NUM: | |
| 244 | + trace_seq_printf(p, "ft_num=%u\n", dst->ft_num); | |
| 245 | + break; | |
| 243 | 246 | case MLX5_FLOW_DESTINATION_TYPE_TIR: |
| 244 | 247 | trace_seq_printf(p, "tir=%u\n", dst->tir_num); |
| 245 | 248 | break; |
| @@ -138,6 +138,8 @@ TRACE_EVENT(mlx5_fs_del_fg, · 137 unmodified lines | ||
| 138 | 138 | {MLX5_FLOW_CONTEXT_ACTION_MOD_HDR, "MOD_HDR"},\ |
| 139 | 139 | {MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH, "VLAN_PUSH"},\ |
| 140 | 140 | {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"},\ | |
| 141 | 143 | {MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_PRIO, "NEXT_PRIO"} |
| 142 | 144 | |
| 143 | 145 | TRACE_EVENT(mlx5_fs_set_fte, |
| @@ -70,9 +70,9 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, · 69 unmodified lines | ||
| 70 | 70 | flow_act.action &= ~(MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH | |
| 71 | 71 | MLX5_FLOW_CONTEXT_ACTION_VLAN_POP); |
| 72 | 72 | else if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH) { |
| 73 | − flow_act.vlan.ethtype = ntohs(attr->vlan_proto); | |
| 74 | − flow_act.vlan.vid = attr->vlan_vid; | |
| 75 | − flow_act.vlan.prio = attr->vlan_prio; | |
| 73 | + flow_act.vlan[0].ethtype = ntohs(attr->vlan_proto); | |
| 74 | + flow_act.vlan[0].vid = attr->vlan_vid; | |
| 75 | + flow_act.vlan[0].prio = attr->vlan_prio; | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) { |
| @@ -349,9 +349,15 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev, · 348 unmodified lines | ||
| 349 | 349 | |
| 350 | 350 | vlan = MLX5_ADDR_OF(flow_context, in_flow_context, push_vlan); |
| 351 | 351 | |
| 352 | − MLX5_SET(vlan, vlan, ethtype, fte->action.vlan.ethtype); | |
| 353 | − MLX5_SET(vlan, vlan, vid, fte->action.vlan.vid); | |
| 354 | − MLX5_SET(vlan, vlan, prio, fte->action.vlan.prio); | |
| 352 | + MLX5_SET(vlan, vlan, ethtype, fte->action.vlan[0].ethtype); | |
| 353 | + MLX5_SET(vlan, vlan, vid, fte->action.vlan[0].vid); | |
| 354 | + MLX5_SET(vlan, vlan, prio, fte->action.vlan[0].prio); | |
| 355 | + | |
| 356 | + vlan = MLX5_ADDR_OF(flow_context, in_flow_context, push_vlan_2); | |
| 357 | + | |
| 358 | + MLX5_SET(vlan, vlan, ethtype, fte->action.vlan[1].ethtype); | |
| 359 | + MLX5_SET(vlan, vlan, vid, fte->action.vlan[1].vid); | |
| 360 | + MLX5_SET(vlan, vlan, prio, fte->action.vlan[1].prio); | |
| 355 | 361 | |
| 356 | 362 | in_match_value = MLX5_ADDR_OF(flow_context, in_flow_context, |
| 357 | 363 | match_value); |
| @@ -362,18 +368,20 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev, · 4 unmodified lines | ||
| 362 | 368 | int list_size = 0; |
| 363 | 369 | |
| 364 | 370 | list_for_each_entry(dst, &fte->node.children, node.list) { |
| 365 | − unsigned int id; | |
| 371 | + unsigned int id, type = dst->dest_attr.type; | |
| 366 | 372 | |
| 367 | − if (dst->dest_attr.type == MLX5_FLOW_DESTINATION_TYPE_COUNTER) | |
| 373 | + if (type == MLX5_FLOW_DESTINATION_TYPE_COUNTER) | |
| 368 | 374 | continue; |
| 369 | 375 | |
| 370 | − MLX5_SET(dest_format_struct, in_dests, destination_type, | |
| 371 | − dst->dest_attr.type); | |
| 372 | − if (dst->dest_attr.type == | |
| 373 | − MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE) { | |
| 376 | + switch (type) { | |
| 377 | + case MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE_NUM: | |
| 378 | + id = dst->dest_attr.ft_num; | |
| 379 | + type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE; | |
| 380 | + break; | |
| 381 | + case MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE: | |
| 374 | 382 | id = dst->dest_attr.ft->id; |
| 375 | − } else if (dst->dest_attr.type == | |
| 376 | − MLX5_FLOW_DESTINATION_TYPE_VPORT) { | |
| 383 | + break; | |
| 384 | + case MLX5_FLOW_DESTINATION_TYPE_VPORT: | |
| 377 | 385 | id = dst->dest_attr.vport.num; |
| 378 | 386 | MLX5_SET(dest_format_struct, in_dests, |
| 379 | 387 | destination_eswitch_owner_vhca_id_valid, |
| @@ -381,9 +389,13 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev, · 1 unmodified line | ||
| 381 | 389 | MLX5_SET(dest_format_struct, in_dests, |
| 382 | 390 | destination_eswitch_owner_vhca_id, |
| 383 | 391 | dst->dest_attr.vport.vhca_id); |
| 384 | − } else { | |
| 392 | + break; | |
| 393 | + default: | |
| 385 | 394 | id = dst->dest_attr.tir_num; |
| 386 | 395 | } |
| 396 | + | |
| 397 | + MLX5_SET(dest_format_struct, in_dests, destination_type, | |
| 398 | + type); | |
| 387 | 399 | MLX5_SET(dest_format_struct, in_dests, destination_id, id); |
| 388 | 400 | in_dests += MLX5_ST_SZ_BYTES(dest_format_struct); |
| 389 | 401 | list_size++; |
| @@ -309,89 +309,17 @@ static struct fs_prio *find_prio(struct mlx5_flow_namespace *ns, · 308 unmodified lines | ||
| 309 | 309 | return NULL; |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | −static bool check_last_reserved(const u32 *match_criteria) | |
| 313 | −{ | |
| 314 | − char *match_criteria_reserved = | |
| 315 | − MLX5_ADDR_OF(fte_match_param, match_criteria, MLX5_FTE_MATCH_PARAM_RESERVED); | |
| 316 | − | |
| 317 | − return !match_criteria_reserved[0] && | |
| 318 | − !memcmp(match_criteria_reserved, match_criteria_reserved + 1, | |
| 319 | − MLX5_FLD_SZ_BYTES(fte_match_param, | |
| 320 | − MLX5_FTE_MATCH_PARAM_RESERVED) - 1); | |
| 321 | −} | |
| 322 | − | |
| 323 | −static bool check_valid_mask(u8 match_criteria_enable, const u32 *match_criteria) | |
| 324 | −{ | |
| 325 | − if (match_criteria_enable & ~( | |
| 326 | − (1 << MLX5_CREATE_FLOW_GROUP_IN_MATCH_CRITERIA_ENABLE_OUTER_HEADERS) | | |
| 327 | − (1 << MLX5_CREATE_FLOW_GROUP_IN_MATCH_CRITERIA_ENABLE_MISC_PARAMETERS) | | |
| 328 | − (1 << MLX5_CREATE_FLOW_GROUP_IN_MATCH_CRITERIA_ENABLE_INNER_HEADERS) | | |
| 329 | − (1 << MLX5_CREATE_FLOW_GROUP_IN_MATCH_CRITERIA_ENABLE_MISC_PARAMETERS_2))) | |
| 330 | − return false; | |
| 331 | − | |
| 332 | − if (!(match_criteria_enable & | |
| 333 | − 1 << MLX5_CREATE_FLOW_GROUP_IN_MATCH_CRITERIA_ENABLE_OUTER_HEADERS)) { | |
| 334 | − char *fg_type_mask = MLX5_ADDR_OF(fte_match_param, | |
| 335 | − match_criteria, outer_headers); | |
| 336 | − | |
| 337 | − if (fg_type_mask[0] || | |
| 338 | − memcmp(fg_type_mask, fg_type_mask + 1, | |
| 339 | − MLX5_ST_SZ_BYTES(fte_match_set_lyr_2_4) - 1)) | |
| 340 | − return false; | |
| 341 | − } | |
| 342 | − | |
| 343 | − if (!(match_criteria_enable & | |
| 344 | − 1 << MLX5_CREATE_FLOW_GROUP_IN_MATCH_CRITERIA_ENABLE_MISC_PARAMETERS)) { | |
| 345 | − char *fg_type_mask = MLX5_ADDR_OF(fte_match_param, | |
| 346 | − match_criteria, misc_parameters); | |
| 347 | − | |
| 348 | − if (fg_type_mask[0] || | |
| 349 | − memcmp(fg_type_mask, fg_type_mask + 1, | |
| 350 | − MLX5_ST_SZ_BYTES(fte_match_set_misc) - 1)) | |
| 351 | − return false; | |
| 352 | − } | |
| 353 | − | |
| 354 | − if (!(match_criteria_enable & | |
| 355 | − 1 << MLX5_CREATE_FLOW_GROUP_IN_MATCH_CRITERIA_ENABLE_INNER_HEADERS)) { | |
| 356 | − char *fg_type_mask = MLX5_ADDR_OF(fte_match_param, | |
| 357 | − match_criteria, inner_headers); | |
| 358 | − | |
| 359 | − if (fg_type_mask[0] || | |
| 360 | − memcmp(fg_type_mask, fg_type_mask + 1, | |
| 361 | − MLX5_ST_SZ_BYTES(fte_match_set_lyr_2_4) - 1)) | |
| 362 | − return false; | |
| 363 | − } | |
| 364 | − | |
| 365 | − if (!(match_criteria_enable & | |
| 366 | − 1 << MLX5_CREATE_FLOW_GROUP_IN_MATCH_CRITERIA_ENABLE_MISC_PARAMETERS_2)) { | |
| 367 | − char *fg_type_mask = MLX5_ADDR_OF(fte_match_param, | |
| 368 | − match_criteria, misc_parameters_2); | |
| 369 | − | |
| 370 | − if (fg_type_mask[0] || | |
| 371 | − memcmp(fg_type_mask, fg_type_mask + 1, | |
| 372 | − MLX5_ST_SZ_BYTES(fte_match_set_misc2) - 1)) | |
| 373 | − return false; | |
| 374 | − } | |
| 375 | − | |
| 376 | − return check_last_reserved(match_criteria); | |
| 377 | −} | |
| 378 | − | |
| 379 | 312 | static bool check_valid_spec(const struct mlx5_flow_spec *spec) |
| 380 | 313 | { |
| 381 | 314 | int i; |
| 382 | 315 | |
| 383 | − if (!check_valid_mask(spec->match_criteria_enable, spec->match_criteria)) { | |
| 384 | − pr_warn("mlx5_core: Match criteria given mismatches match_criteria_enable\n"); | |
| 385 | − return false; | |
| 386 | − } | |
| 387 | − | |
| 388 | 316 | for (i = 0; i < MLX5_ST_SZ_DW_MATCH_PARAM; i++) |
| 389 | 317 | if (spec->match_value[i] & ~spec->match_criteria[i]) { |
| 390 | 318 | pr_warn("mlx5_core: match_value differs from match_criteria\n"); |
| 391 | 319 | return false; |
| 392 | 320 | } |
| 393 | 321 | |
| 394 | − return check_last_reserved(spec->match_value); | |
| 322 | + return true; | |
| 395 | 323 | } |
| 396 | 324 | |
| 397 | 325 | static struct mlx5_flow_root_namespace *find_root(struct fs_node *node) |
| @@ -1158,9 +1086,6 @@ struct mlx5_flow_group *mlx5_create_flow_group(struct mlx5_flow_table *ft, · 760 unmodified lines | ||
| 1158 | 1086 | struct mlx5_flow_group *fg; |
| 1159 | 1087 | int err; |
| 1160 | 1088 | |
| 1161 | − if (!check_valid_mask(match_criteria_enable, match_criteria)) | |
| 1162 | − return ERR_PTR(-EINVAL); | |
| 1163 | − | |
| 1164 | 1089 | if (ft->autogroup.active) |
| 1165 | 1090 | return ERR_PTR(-EPERM); |
| 1166 | 1091 | |
| @@ -1431,7 +1356,9 @@ static bool mlx5_flow_dests_cmp(struct mlx5_flow_destination *d1, · 264 unmodified lines | ||
| 1431 | 1356 | (d1->type == MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE && |
| 1432 | 1357 | d1->ft == d2->ft) || |
| 1433 | 1358 | (d1->type == MLX5_FLOW_DESTINATION_TYPE_TIR && |
| 1434 | − d1->tir_num == d2->tir_num)) | |
| 1359 | + d1->tir_num == d2->tir_num) || | |
| 1360 | + (d1->type == MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE_NUM && | |
| 1361 | + d1->ft_num == d2->ft_num)) | |
| 1435 | 1362 | return true; |
| 1436 | 1363 | } |
| 1437 | 1364 | |
| @@ -1464,7 +1391,9 @@ static bool check_conflicting_actions(u32 action1, u32 action2) · 26 unmodified lines | ||
| 1464 | 1391 | MLX5_FLOW_CONTEXT_ACTION_DECAP | |
| 1465 | 1392 | MLX5_FLOW_CONTEXT_ACTION_MOD_HDR | |
| 1466 | 1393 | MLX5_FLOW_CONTEXT_ACTION_VLAN_POP | |
| 1467 | − MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH)) | |
| 1394 | + MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH | | |
| 1395 | + MLX5_FLOW_CONTEXT_ACTION_VLAN_POP_2 | | |
| 1396 | + MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2)) | |
| 1468 | 1397 | return true; |
| 1469 | 1398 | |
| 1470 | 1399 | return false; |
| @@ -1823,7 +1752,7 @@ search_again_locked: · 352 unmodified lines | ||
| 1823 | 1752 | |
| 1824 | 1753 | g = alloc_auto_flow_group(ft, spec); |
| 1825 | 1754 | if (IS_ERR(g)) { |
| 1826 | − rule = (void *)g; | |
| 1755 | + rule = ERR_CAST(g); | |
| 1827 | 1756 | up_write_ref_node(&ft->node); |
| 1828 | 1757 | return rule; |
| 1829 | 1758 | } |
| @@ -64,7 +64,7 @@ · 63 unmodified lines | ||
| 64 | 64 | #include "lib/clock.h" |
| 65 | 65 | |
| 66 | 66 | MODULE_AUTHOR("Eli Cohen <eli@mellanox.com>"); |
| 67 | −MODULE_DESCRIPTION("Mellanox Connect-IB, ConnectX-4 core driver"); | |
| 67 | +MODULE_DESCRIPTION("Mellanox 5th generation network adapters (ConnectX series) core driver"); | |
| 68 | 68 | MODULE_LICENSE("Dual BSD/GPL"); |
| 69 | 69 | MODULE_VERSION(DRIVER_VERSION); |
| 70 | 70 | |
| @@ -750,7 +750,7 @@ enum { · 749 unmodified lines | ||
| 750 | 750 | |
| 751 | 751 | #define MLX5_MINI_CQE_ARRAY_SIZE 8 |
| 752 | 752 | |
| 753 | −static inline int mlx5_get_cqe_format(struct mlx5_cqe64 *cqe) | |
| 753 | +static inline u8 mlx5_get_cqe_format(struct mlx5_cqe64 *cqe) | |
| 754 | 754 | { |
| 755 | 755 | return (cqe->op_own >> 2) & 0x3; |
| 756 | 756 | } |
| @@ -770,14 +770,14 @@ static inline u8 get_cqe_l3_hdr_type(struct mlx5_cqe64 *cqe) · 13 unmodified lines | ||
| 770 | 770 | return (cqe->l4_l3_hdr_type >> 2) & 0x3; |
| 771 | 771 | } |
| 772 | 772 | |
| 773 | −static inline u8 cqe_is_tunneled(struct mlx5_cqe64 *cqe) | |
| 773 | +static inline bool cqe_is_tunneled(struct mlx5_cqe64 *cqe) | |
| 774 | 774 | { |
| 775 | 775 | return cqe->outer_l3_tunneled & 0x1; |
| 776 | 776 | } |
| 777 | 777 | |
| 778 | −static inline int cqe_has_vlan(struct mlx5_cqe64 *cqe) | |
| 778 | +static inline bool cqe_has_vlan(struct mlx5_cqe64 *cqe) | |
| 779 | 779 | { |
| 780 | − return !!(cqe->l4_l3_hdr_type & 0x1); | |
| 780 | + return cqe->l4_l3_hdr_type & 0x1; | |
| 781 | 781 | } |
| 782 | 782 | |
| 783 | 783 | static inline u64 get_cqe_ts(struct mlx5_cqe64 *cqe) |
| @@ -138,9 +138,14 @@ enum { · 137 unmodified lines | ||
| 138 | 138 | MLX5_REG_HOST_ENDIANNESS = 0x7004, |
| 139 | 139 | MLX5_REG_MCIA = 0x9014, |
| 140 | 140 | MLX5_REG_MLCR = 0x902b, |
| 141 | + MLX5_REG_MTRC_CAP = 0x9040, | |
| 142 | + MLX5_REG_MTRC_CONF = 0x9041, | |
| 143 | + MLX5_REG_MTRC_STDB = 0x9042, | |
| 144 | + MLX5_REG_MTRC_CTRL = 0x9043, | |
| 141 | 145 | MLX5_REG_MPCNT = 0x9051, |
| 142 | 146 | MLX5_REG_MTPPS = 0x9053, |
| 143 | 147 | MLX5_REG_MTPPSE = 0x9054, |
| 148 | + MLX5_REG_MPEGC = 0x9056, | |
| 144 | 149 | MLX5_REG_MCQI = 0x9061, |
| 145 | 150 | MLX5_REG_MCC = 0x9062, |
| 146 | 151 | MLX5_REG_MCDA = 0x9063, |
| @@ -89,6 +89,7 @@ struct mlx5_flow_destination { · 88 unmodified lines | ||
| 89 | 89 | enum mlx5_flow_destination_type type; |
| 90 | 90 | union { |
| 91 | 91 | u32 tir_num; |
| 92 | + u32 ft_num; | |
| 92 | 93 | struct mlx5_flow_table *ft; |
| 93 | 94 | struct mlx5_fc *counter; |
| 94 | 95 | struct { |
| @@ -152,6 +153,8 @@ struct mlx5_fs_vlan { · 57 unmodified lines | ||
| 152 | 153 | u8 prio; |
| 153 | 154 | }; |
| 154 | 155 | |
| 156 | +#define MLX5_FS_VLAN_DEPTH 2 | |
| 157 | + | |
| 155 | 158 | struct mlx5_flow_act { |
| 156 | 159 | u32 action; |
| 157 | 160 | bool has_flow_tag; |
| @@ -159,7 +162,7 @@ struct mlx5_flow_act { · 1 unmodified line | ||
| 159 | 162 | u32 encap_id; |
| 160 | 163 | u32 modify_id; |
| 161 | 164 | uintptr_t esp_id; |
| 162 | − struct mlx5_fs_vlan vlan; | |
| 165 | + struct mlx5_fs_vlan vlan[MLX5_FS_VLAN_DEPTH]; | |
| 163 | 166 | struct ib_counters *counters; |
| 164 | 167 | }; |
| 165 | 168 | |
| @@ -341,7 +341,10 @@ struct mlx5_ifc_flow_table_prop_layout_bits { · 340 unmodified lines | ||
| 341 | 341 | u8 reserved_at_9[0x1]; |
| 342 | 342 | u8 pop_vlan[0x1]; |
| 343 | 343 | u8 push_vlan[0x1]; |
| 344 | − u8 reserved_at_c[0x14]; | |
| 344 | + u8 reserved_at_c[0x1]; | |
| 345 | + u8 pop_vlan_2[0x1]; | |
| 346 | + u8 push_vlan_2[0x1]; | |
| 347 | + u8 reserved_at_f[0x11]; | |
| 345 | 348 | |
| 346 | 349 | u8 reserved_at_20[0x2]; |
| 347 | 350 | u8 log_max_ft_size[0x6]; |
| @@ -1181,6 +1184,7 @@ enum mlx5_flow_destination_type { · 833 unmodified lines | ||
| 1181 | 1184 | |
| 1182 | 1185 | MLX5_FLOW_DESTINATION_TYPE_PORT = 0x99, |
| 1183 | 1186 | MLX5_FLOW_DESTINATION_TYPE_COUNTER = 0x100, |
| 1187 | + MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE_NUM = 0x101, | |
| 1184 | 1188 | }; |
| 1185 | 1189 | |
| 1186 | 1190 | struct mlx5_ifc_dest_format_struct_bits { |
| @@ -2390,6 +2394,8 @@ enum { · 1203 unmodified lines | ||
| 2390 | 2394 | MLX5_FLOW_CONTEXT_ACTION_MOD_HDR = 0x40, |
| 2391 | 2395 | MLX5_FLOW_CONTEXT_ACTION_VLAN_POP = 0x80, |
| 2392 | 2396 | MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH = 0x100, |
| 2397 | + MLX5_FLOW_CONTEXT_ACTION_VLAN_POP_2 = 0x400, | |
| 2398 | + MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2 = 0x800, | |
| 2393 | 2399 | }; |
| 2394 | 2400 | |
| 2395 | 2401 | struct mlx5_ifc_vlan_bits { |
| @@ -2420,7 +2426,9 @@ struct mlx5_ifc_flow_context_bits { · 24 unmodified lines | ||
| 2420 | 2426 | |
| 2421 | 2427 | u8 modify_header_id[0x20]; |
| 2422 | 2428 | |
| 2423 | − u8 reserved_at_100[0x100]; | |
| 2429 | + struct mlx5_ifc_vlan_bits push_vlan_2; | |
| 2430 | + | |
| 2431 | + u8 reserved_at_120[0xe0]; | |
| 2424 | 2432 | |
| 2425 | 2433 | struct mlx5_ifc_fte_match_param_bits match_value; |
| 2426 | 2434 | |
| @@ -8053,6 +8061,19 @@ struct mlx5_ifc_peir_reg_bits { · 5626 unmodified lines | ||
| 8053 | 8061 | u8 error_type[0x8]; |
| 8054 | 8062 | }; |
| 8055 | 8063 | |
| 8064 | +struct mlx5_ifc_mpegc_reg_bits { | |
| 8065 | + u8 reserved_at_0[0x30]; | |
| 8066 | + u8 field_select[0x10]; | |
| 8067 | + | |
| 8068 | + u8 tx_overflow_sense[0x1]; | |
| 8069 | + u8 mark_cqe[0x1]; | |
| 8070 | + u8 mark_cnp[0x1]; | |
| 8071 | + u8 reserved_at_43[0x1b]; | |
| 8072 | + u8 tx_lossy_overflow_oper[0x2]; | |
| 8073 | + | |
| 8074 | + u8 reserved_at_60[0x100]; | |
| 8075 | +}; | |
| 8076 | + | |
| 8056 | 8077 | struct mlx5_ifc_pcam_enhanced_features_bits { |
| 8057 | 8078 | u8 reserved_at_0[0x6d]; |
| 8058 | 8079 | u8 rx_icrc_encapsulated_counter[0x1]; |
| @@ -8101,7 +8122,11 @@ struct mlx5_ifc_pcam_reg_bits { · 42 unmodified lines | ||
| 8101 | 8122 | }; |
| 8102 | 8123 | |
| 8103 | 8124 | struct mlx5_ifc_mcam_enhanced_features_bits { |
| 8104 | − u8 reserved_at_0[0x7b]; | |
| 8125 | + u8 reserved_at_0[0x74]; | |
| 8126 | + u8 mark_tx_action_cnp[0x1]; | |
| 8127 | + u8 mark_tx_action_cqe[0x1]; | |
| 8128 | + u8 dynamic_tx_overflow[0x1]; | |
| 8129 | + u8 reserved_at_77[0x4]; | |
| 8105 | 8130 | u8 pcie_outbound_stalled[0x1]; |
| 8106 | 8131 | u8 tx_overflow_buffer_pkt[0x1]; |
| 8107 | 8132 | u8 mtpps_enh_out_per_adj[0x1]; |
| @@ -8116,7 +8141,11 @@ struct mlx5_ifc_mcam_access_reg_bits { · 8 unmodified lines | ||
| 8116 | 8141 | u8 mcqi[0x1]; |
| 8117 | 8142 | u8 reserved_at_1f[0x1]; |
| 8118 | 8143 | |
| 8119 | − u8 regs_95_to_64[0x20]; | |
| 8144 | + u8 regs_95_to_87[0x9]; | |
| 8145 | + u8 mpegc[0x1]; | |
| 8146 | + u8 regs_85_to_68[0x12]; | |
| 8147 | + u8 tracer_registers[0x4]; | |
| 8148 | + | |
| 8120 | 8149 | u8 regs_63_to_32[0x20]; |
| 8121 | 8150 | u8 regs_31_to_0[0x20]; |
| 8122 | 8151 | }; |
| @@ -9191,4 +9220,61 @@ struct mlx5_ifc_create_uctx_in_bits { · 1068 unmodified lines | ||
| 9191 | 9220 | struct mlx5_ifc_uctx_bits uctx; |
| 9192 | 9221 | }; |
| 9193 | 9222 | |
| 9223 | +struct mlx5_ifc_mtrc_string_db_param_bits { | |
| 9224 | + u8 string_db_base_address[0x20]; | |
| 9225 | + | |
| 9226 | + u8 reserved_at_20[0x8]; | |
| 9227 | + u8 string_db_size[0x18]; | |
| 9228 | +}; | |
| 9229 | + | |
| 9230 | +struct mlx5_ifc_mtrc_cap_bits { | |
| 9231 | + u8 trace_owner[0x1]; | |
| 9232 | + u8 trace_to_memory[0x1]; | |
| 9233 | + u8 reserved_at_2[0x4]; | |
| 9234 | + u8 trc_ver[0x2]; | |
| 9235 | + u8 reserved_at_8[0x14]; | |
| 9236 | + u8 num_string_db[0x4]; | |
| 9237 | + | |
| 9238 | + u8 first_string_trace[0x8]; | |
| 9239 | + u8 num_string_trace[0x8]; | |
| 9240 | + u8 reserved_at_30[0x28]; | |
| 9241 | + | |
| 9242 | + u8 log_max_trace_buffer_size[0x8]; | |
| 9243 | + | |
| 9244 | + u8 reserved_at_60[0x20]; | |
| 9245 | + | |
| 9246 | + struct mlx5_ifc_mtrc_string_db_param_bits string_db_param[8]; | |
| 9247 | + | |
| 9248 | + u8 reserved_at_280[0x180]; | |
| 9249 | +}; | |
| 9250 | + | |
| 9251 | +struct mlx5_ifc_mtrc_conf_bits { | |
| 9252 | + u8 reserved_at_0[0x1c]; | |
| 9253 | + u8 trace_mode[0x4]; | |
| 9254 | + u8 reserved_at_20[0x18]; | |
| 9255 | + u8 log_trace_buffer_size[0x8]; | |
| 9256 | + u8 trace_mkey[0x20]; | |
| 9257 | + u8 reserved_at_60[0x3a0]; | |
| 9258 | +}; | |
| 9259 | + | |
| 9260 | +struct mlx5_ifc_mtrc_stdb_bits { | |
| 9261 | + u8 string_db_index[0x4]; | |
| 9262 | + u8 reserved_at_4[0x4]; | |
| 9263 | + u8 read_size[0x18]; | |
| 9264 | + u8 start_offset[0x20]; | |
| 9265 | + u8 string_db_data[0]; | |
| 9266 | +}; | |
| 9267 | + | |
| 9268 | +struct mlx5_ifc_mtrc_ctrl_bits { | |
| 9269 | + u8 trace_status[0x2]; | |
| 9270 | + u8 reserved_at_2[0x2]; | |
| 9271 | + u8 arm_event[0x1]; | |
| 9272 | + u8 reserved_at_5[0xb]; | |
| 9273 | + u8 modify_field_select[0x10]; | |
| 9274 | + u8 reserved_at_20[0x2b]; | |
| 9275 | + u8 current_timestamp52_32[0x15]; | |
| 9276 | + u8 current_timestamp31_0[0x20]; | |
| 9277 | + u8 reserved_at_80[0x180]; | |
| 9278 | +}; | |
| 9279 | + | |
| 9194 | 9280 | #endif /* MLX5_IFC_H */ |