History

Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux

Merge mlx5-next shared branched into net-next, From Bodong Wang: 1) Introduction of ECPF (Embedded CPU Physical Function), and low level bits for mlx5 SmartNic capabilities support. 2) Vport enumeration refactoring that affect mlx5_ib and mlx5_core From Aya Levin, 3) Add support for 50Gbps per lane link modes in the Port Type and Speed register (PTYS) 4) Refactor low level query functions for PTYS register 5) Add support for 50Gbps per lane link modes to mlx5_ib Note: due to a change in API in mlx5/core and a later patch from net-next, a fixup was squashed with this merge commit that replaces FDB_UPLINK_VPORT with MLX5_VPORT_UPLINK which exists only in upstream net-next.

Saeed Mahameed committed 7 years ago

Commit 259fae52 parents 50f444a 08e867636 files · +848 −474Browse files

Unified · Split

36 files
  1. drivers/infiniband/hw/mlx5/cmd.c +37 −0
  2. drivers/infiniband/hw/mlx5/cmd.h +2 −0
  3. drivers/infiniband/hw/mlx5/ib_rep.c +18 −55
  4. drivers/infiniband/hw/mlx5/ib_rep.h +6 −4
  5. drivers/infiniband/hw/mlx5/mad.c +7 −4
  6. drivers/infiniband/hw/mlx5/main.c +77 −18
  7. drivers/infiniband/hw/mlx5/mlx5_ib.h +2 −3
  8. drivers/infiniband/hw/mlx5/mr.c +7 −32
  9. drivers/net/ethernet/mellanox/mlx5/core/Makefile +2 −2
  10. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +52 −5
  11. drivers/net/ethernet/mellanox/mlx5/core/ecpf.c +112 −0
  12. drivers/net/ethernet/mellanox/mlx5/core/ecpf.h +33 −0
  13. drivers/net/ethernet/mellanox/mlx5/core/en/port.c +122 −20
  14. drivers/net/ethernet/mellanox/mlx5/core/en/port.h +14 −2
  15. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +11 −17
  16. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +12 −12
  17. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +3 −3
  18. drivers/net/ethernet/mellanox/mlx5/core/eq.c +10 −6
  19. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +20 −22
  20. drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +0 −2
  21. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +22 −17
  22. drivers/net/ethernet/mellanox/mlx5/core/events.c +2 −0
  23. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +1 −0
  24. drivers/net/ethernet/mellanox/mlx5/core/mad.c +0 −75
  25. drivers/net/ethernet/mellanox/mlx5/core/main.c +71 −0
  26. drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +1 −1
  27. drivers/net/ethernet/mellanox/mlx5/core/mr.c +6 −5
  28. drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +38 −16
  29. drivers/net/ethernet/mellanox/mlx5/core/port.c +0 −106
  30. drivers/net/ethernet/mellanox/mlx5/core/sriov.c +1 −1
  31. drivers/net/ethernet/mellanox/mlx5/core/vport.c +4 −4
  32. include/linux/mlx5/device.h +7 −2
  33. include/linux/mlx5/driver.h +47 −14
  34. include/linux/mlx5/mlx5_ifc.h +65 −11
  35. include/linux/mlx5/port.h +19 −11
  36. include/linux/mlx5/vport.h +17 −4
drivers/infiniband/hw/mlx5/cmd.c+37−0
@@ -345,3 +345,40 @@ int mlx5_cmd_alloc_q_counter(struct mlx5_core_dev *dev, u16 *counter_id, · 344 unmodified lines
345345 counter_set_id);
346346 return err;
347347 }
348+
349+int mlx5_cmd_mad_ifc(struct mlx5_core_dev *dev, const void *inb, void *outb,
350+ u16 opmod, u8 port)
351+{
352+ int outlen = MLX5_ST_SZ_BYTES(mad_ifc_out);
353+ int inlen = MLX5_ST_SZ_BYTES(mad_ifc_in);
354+ int err = -ENOMEM;
355+ void *data;
356+ void *resp;
357+ u32 *out;
358+ u32 *in;
359+
360+ in = kzalloc(inlen, GFP_KERNEL);
361+ out = kzalloc(outlen, GFP_KERNEL);
362+ if (!in || !out)
363+ goto out;
364+
365+ MLX5_SET(mad_ifc_in, in, opcode, MLX5_CMD_OP_MAD_IFC);
366+ MLX5_SET(mad_ifc_in, in, op_mod, opmod);
367+ MLX5_SET(mad_ifc_in, in, port, port);
368+
369+ data = MLX5_ADDR_OF(mad_ifc_in, in, mad);
370+ memcpy(data, inb, MLX5_FLD_SZ_BYTES(mad_ifc_in, mad));
371+
372+ err = mlx5_cmd_exec(dev, in, inlen, out, outlen);
373+ if (err)
374+ goto out;
375+
376+ resp = MLX5_ADDR_OF(mad_ifc_out, out, response_mad_packet);
377+ memcpy(outb, resp,
378+ MLX5_FLD_SZ_BYTES(mad_ifc_out, response_mad_packet));
379+
380+out:
381+ kfree(out);
382+ kfree(in);
383+ return err;
384+}
drivers/infiniband/hw/mlx5/cmd.h+2−0
@@ -63,4 +63,6 @@ int mlx5_cmd_xrcd_alloc(struct mlx5_core_dev *dev, u32 *xrcdn, u16 uid); · 62 unmodified lines
6363 int mlx5_cmd_xrcd_dealloc(struct mlx5_core_dev *dev, u32 xrcdn, u16 uid);
6464 int mlx5_cmd_alloc_q_counter(struct mlx5_core_dev *dev, u16 *counter_id,
6565 u16 uid);
66+int mlx5_cmd_mad_ifc(struct mlx5_core_dev *dev, const void *inb, void *outb,
67+ u16 opmod, u8 port);
6668 #endif /* MLX5_IB_CMD_H */
drivers/infiniband/hw/mlx5/ib_rep.c+18−55
@@ -3,10 +3,11 @@ · 2 unmodified lines
33 * Copyright (c) 2018 Mellanox Technologies. All rights reserved.
44 */
55
6+#include <linux/mlx5/vport.h>
67 #include "ib_rep.h"
78 #include "srq.h"
89
9−static const struct mlx5_ib_profile rep_profile = {
10+static const struct mlx5_ib_profile vf_rep_profile = {
1011 STAGE_CREATE(MLX5_IB_STAGE_INIT,
1112 mlx5_ib_stage_init_init,
1213 mlx5_ib_stage_init_cleanup),
@@ -45,31 +46,17 @@ static const struct mlx5_ib_profile rep_profile = { · 32 unmodified lines
4546 NULL),
4647 };
4748
48−static int
49−mlx5_ib_nic_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
50−{
51− struct mlx5_ib_dev *ibdev;
52−
53− ibdev = mlx5_ib_rep_to_dev(rep);
54− if (!__mlx5_ib_add(ibdev, ibdev->profile))
55− return -EINVAL;
56− return 0;
57−}
58−
59−static void
60−mlx5_ib_nic_rep_unload(struct mlx5_eswitch_rep *rep)
61−{
62− struct mlx5_ib_dev *ibdev;
63−
64− ibdev = mlx5_ib_rep_to_dev(rep);
65− __mlx5_ib_remove(ibdev, ibdev->profile, MLX5_IB_STAGE_MAX);
66−}
67−
6849 static int
6950 mlx5_ib_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
7051 {
52+ const struct mlx5_ib_profile *profile;
7153 struct mlx5_ib_dev *ibdev;
7254
55+ if (rep->vport == MLX5_VPORT_UPLINK)
56+ profile = &uplink_rep_profile;
57+ else
58+ profile = &vf_rep_profile;
59+
7360 ibdev = (struct mlx5_ib_dev *)ib_alloc_device(sizeof(*ibdev));
7461 if (!ibdev)
7562 return -ENOMEM;
@@ -78,7 +65,7 @@ mlx5_ib_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) · 2 unmodified lines
7865 ibdev->mdev = dev;
7966 ibdev->num_ports = max(MLX5_CAP_GEN(dev, num_ports),
8067 MLX5_CAP_GEN(dev, num_vhca_ports));
81− if (!__mlx5_ib_add(ibdev, &rep_profile))
68+ if (!__mlx5_ib_add(ibdev, profile))
8269 return -EINVAL;
8370
8471 rep->rep_if[REP_IB].priv = ibdev;
@@ -105,15 +92,14 @@ static void *mlx5_ib_vport_get_proto_dev(struct mlx5_eswitch_rep *rep) · 20 unmodified lines
10592 return mlx5_ib_rep_to_dev(rep);
10693 }
10794
108−static void mlx5_ib_rep_register_vf_vports(struct mlx5_ib_dev *dev)
95+void mlx5_ib_register_vport_reps(struct mlx5_core_dev *mdev)
10996 {
110− struct mlx5_eswitch *esw = dev->mdev->priv.eswitch;
111− int total_vfs = MLX5_TOTAL_VPORTS(dev->mdev);
97+ struct mlx5_eswitch *esw = mdev->priv.eswitch;
98+ int total_vports = MLX5_TOTAL_VPORTS(mdev);
99+ struct mlx5_eswitch_rep_if rep_if = {};
112100 int vport;
113101
114− for (vport = 1; vport < total_vfs; vport++) {
115− struct mlx5_eswitch_rep_if rep_if = {};
116−
102+ for (vport = 0; vport < total_vports; vport++) {
117103 rep_if.load = mlx5_ib_vport_rep_load;
118104 rep_if.unload = mlx5_ib_vport_rep_unload;
119105 rep_if.get_proto_dev = mlx5_ib_vport_get_proto_dev;
@@ -121,39 +107,16 @@ static void mlx5_ib_rep_register_vf_vports(struct mlx5_ib_dev *dev) · 1 unmodified line
121107 }
122108 }
123109
124−static void mlx5_ib_rep_unregister_vf_vports(struct mlx5_ib_dev *dev)
110+void mlx5_ib_unregister_vport_reps(struct mlx5_core_dev *mdev)
125111 {
126− struct mlx5_eswitch *esw = dev->mdev->priv.eswitch;
127− int total_vfs = MLX5_TOTAL_VPORTS(dev->mdev);
112+ struct mlx5_eswitch *esw = mdev->priv.eswitch;
113+ int total_vports = MLX5_TOTAL_VPORTS(mdev);
128114 int vport;
129115
130− for (vport = 1; vport < total_vfs; vport++)
116+ for (vport = total_vports - 1; vport >= 0; vport--)
131117 mlx5_eswitch_unregister_vport_rep(esw, vport, REP_IB);
132118 }
133119
134−void mlx5_ib_register_vport_reps(struct mlx5_ib_dev *dev)
135−{
136− struct mlx5_eswitch *esw = dev->mdev->priv.eswitch;
137− struct mlx5_eswitch_rep_if rep_if = {};
138−
139− rep_if.load = mlx5_ib_nic_rep_load;
140− rep_if.unload = mlx5_ib_nic_rep_unload;
141− rep_if.get_proto_dev = mlx5_ib_vport_get_proto_dev;
142− rep_if.priv = dev;
143−
144− mlx5_eswitch_register_vport_rep(esw, 0, &rep_if, REP_IB);
145−
146− mlx5_ib_rep_register_vf_vports(dev);
147−}
148−
149−void mlx5_ib_unregister_vport_reps(struct mlx5_ib_dev *dev)
150−{
151− struct mlx5_eswitch *esw = dev->mdev->priv.eswitch;
152−
153− mlx5_ib_rep_unregister_vf_vports(dev); /* VFs vports */
154− mlx5_eswitch_unregister_vport_rep(esw, 0, REP_IB); /* UPLINK PF*/
155−}
156−
157120 u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw)
158121 {
159122 return mlx5_eswitch_mode(esw);
drivers/infiniband/hw/mlx5/ib_rep.h+6−4
@@ -10,14 +10,16 @@ · 9 unmodified lines
1010 #include "mlx5_ib.h"
1111
1212 #ifdef CONFIG_MLX5_ESWITCH
13+extern const struct mlx5_ib_profile uplink_rep_profile;
14+
1315 u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw);
1416 struct mlx5_ib_dev *mlx5_ib_get_rep_ibdev(struct mlx5_eswitch *esw,
1517 int vport_index);
1618 struct mlx5_ib_dev *mlx5_ib_get_uplink_ibdev(struct mlx5_eswitch *esw);
1719 struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw,
1820 int vport_index);
19−void mlx5_ib_register_vport_reps(struct mlx5_ib_dev *dev);
20−void mlx5_ib_unregister_vport_reps(struct mlx5_ib_dev *dev);
21+void mlx5_ib_register_vport_reps(struct mlx5_core_dev *mdev);
22+void mlx5_ib_unregister_vport_reps(struct mlx5_core_dev *mdev);
2123 int create_flow_rule_vport_sq(struct mlx5_ib_dev *dev,
2224 struct mlx5_ib_sq *sq);
2325 struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw,
@@ -48,8 +50,8 @@ struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, · 24 unmodified lines
4850 return NULL;
4951 }
5052
51−static inline void mlx5_ib_register_vport_reps(struct mlx5_ib_dev *dev) {}
52−static inline void mlx5_ib_unregister_vport_reps(struct mlx5_ib_dev *dev) {}
53+static inline void mlx5_ib_register_vport_reps(struct mlx5_core_dev *mdev) {}
54+static inline void mlx5_ib_unregister_vport_reps(struct mlx5_core_dev *mdev) {}
5355 static inline int create_flow_rule_vport_sq(struct mlx5_ib_dev *dev,
5456 struct mlx5_ib_sq *sq)
5557 {
drivers/infiniband/hw/mlx5/mad.c+7−4
@@ -36,6 +36,7 @@ · 35 unmodified lines
3636 #include <rdma/ib_smi.h>
3737 #include <rdma/ib_pma.h>
3838 #include "mlx5_ib.h"
39+#include "cmd.h"
3940
4041 enum {
4142 MLX5_IB_VENDOR_CLASS1 = 0x9,
@@ -51,9 +52,10 @@ static bool can_do_mad_ifc(struct mlx5_ib_dev *dev, u8 port_num, · 9 unmodified lines
5152 return dev->mdev->port_caps[port_num - 1].has_smi;
5253 }
5354
54−int mlx5_MAD_IFC(struct mlx5_ib_dev *dev, int ignore_mkey, int ignore_bkey,
55− u8 port, const struct ib_wc *in_wc, const struct ib_grh *in_grh,
56− const void *in_mad, void *response_mad)
55+static int mlx5_MAD_IFC(struct mlx5_ib_dev *dev, int ignore_mkey,
56+ int ignore_bkey, u8 port, const struct ib_wc *in_wc,
57+ const struct ib_grh *in_grh, const void *in_mad,
58+ void *response_mad)
5759 {
5860 u8 op_modifier = 0;
5961
@@ -68,7 +70,8 @@ int mlx5_MAD_IFC(struct mlx5_ib_dev *dev, int ignore_mkey, int ignore_bkey, · 8 unmodified lines
6870 if (ignore_bkey || !in_wc)
6971 op_modifier |= 0x2;
7072
71− return mlx5_core_mad_ifc(dev->mdev, in_mad, response_mad, op_modifier, port);
73+ return mlx5_cmd_mad_ifc(dev->mdev, in_mad, response_mad, op_modifier,
74+ port);
7275 }
7376
7477 static int process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
drivers/infiniband/hw/mlx5/main.c+77−18
@@ -331,8 +331,8 @@ out: · 330 unmodified lines
331331 spin_unlock(&port->mp.mpi_lock);
332332 }
333333
334−static int translate_eth_proto_oper(u32 eth_proto_oper, u8 *active_speed,
335− u8 *active_width)
334+static int translate_eth_legacy_proto_oper(u32 eth_proto_oper, u8 *active_speed,
335+ u8 *active_width)
336336 {
337337 switch (eth_proto_oper) {
338338 case MLX5E_PROT_MASK(MLX5E_1000BASE_CX_SGMII):
@@ -389,10 +389,66 @@ static int translate_eth_proto_oper(u32 eth_proto_oper, u8 *active_speed, · 50 unmodified lines
389389 return 0;
390390 }
391391
392+static int translate_eth_ext_proto_oper(u32 eth_proto_oper, u8 *active_speed,
393+ u8 *active_width)
394+{
395+ switch (eth_proto_oper) {
396+ case MLX5E_PROT_MASK(MLX5E_SGMII_100M):
397+ case MLX5E_PROT_MASK(MLX5E_1000BASE_X_SGMII):
398+ *active_width = IB_WIDTH_1X;
399+ *active_speed = IB_SPEED_SDR;
400+ break;
401+ case MLX5E_PROT_MASK(MLX5E_5GBASE_R):
402+ *active_width = IB_WIDTH_1X;
403+ *active_speed = IB_SPEED_DDR;
404+ break;
405+ case MLX5E_PROT_MASK(MLX5E_10GBASE_XFI_XAUI_1):
406+ *active_width = IB_WIDTH_1X;
407+ *active_speed = IB_SPEED_QDR;
408+ break;
409+ case MLX5E_PROT_MASK(MLX5E_40GBASE_XLAUI_4_XLPPI_4):
410+ *active_width = IB_WIDTH_4X;
411+ *active_speed = IB_SPEED_QDR;
412+ break;
413+ case MLX5E_PROT_MASK(MLX5E_25GAUI_1_25GBASE_CR_KR):
414+ *active_width = IB_WIDTH_1X;
415+ *active_speed = IB_SPEED_EDR;
416+ break;
417+ case MLX5E_PROT_MASK(MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2):
418+ case MLX5E_PROT_MASK(MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR):
419+ *active_width = IB_WIDTH_1X;
420+ *active_speed = IB_SPEED_HDR;
421+ break;
422+ case MLX5E_PROT_MASK(MLX5E_100GAUI_2_100GBASE_CR2_KR2):
423+ *active_width = IB_WIDTH_2X;
424+ *active_speed = IB_SPEED_HDR;
425+ break;
426+ case MLX5E_PROT_MASK(MLX5E_200GAUI_4_200GBASE_CR4_KR4):
427+ *active_width = IB_WIDTH_4X;
428+ *active_speed = IB_SPEED_HDR;
429+ break;
430+ default:
431+ return -EINVAL;
432+ }
433+
434+ return 0;
435+}
436+
437+static int translate_eth_proto_oper(u32 eth_proto_oper, u8 *active_speed,
438+ u8 *active_width, bool ext)
439+{
440+ return ext ?
441+ translate_eth_ext_proto_oper(eth_proto_oper, active_speed,
442+ active_width) :
443+ translate_eth_legacy_proto_oper(eth_proto_oper, active_speed,
444+ active_width);
445+}
446+
392447 static int mlx5_query_port_roce(struct ib_device *device, u8 port_num,
393448 struct ib_port_attr *props)
394449 {
395450 struct mlx5_ib_dev *dev = to_mdev(device);
451+ u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {0};
396452 struct mlx5_core_dev *mdev;
397453 struct net_device *ndev, *upper;
398454 enum ib_mtu ndev_ib_mtu;
@@ -400,6 +456,7 @@ static int mlx5_query_port_roce(struct ib_device *device, u8 port_num, · 1 unmodified line
400456 u16 qkey_viol_cntr;
401457 u32 eth_prot_oper;
402458 u8 mdev_port_num;
459+ bool ext;
403460 int err;
404461
405462 mdev = mlx5_ib_get_native_port_mdev(dev, port_num, &mdev_port_num);
@@ -416,16 +473,18 @@ static int mlx5_query_port_roce(struct ib_device *device, u8 port_num, · 10 unmodified lines
416473 /* Possible bad flows are checked before filling out props so in case
417474 * of an error it will still be zeroed out.
418475 */
419− err = mlx5_query_port_eth_proto_oper(mdev, &eth_prot_oper,
420− mdev_port_num);
476+ err = mlx5_query_port_ptys(mdev, out, sizeof(out), MLX5_PTYS_EN,
477+ mdev_port_num);
421478 if (err)
422479 goto out;
480+ ext = MLX5_CAP_PCAM_FEATURE(dev->mdev, ptys_extended_ethernet);
481+ eth_prot_oper = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, eth_proto_oper);
423482
424483 props->active_width = IB_WIDTH_4X;
425484 props->active_speed = IB_SPEED_QDR;
426485
427486 translate_eth_proto_oper(eth_prot_oper, &props->active_speed,
428− &props->active_width);
487+ &props->active_width, ext);
429488
430489 props->port_cap_flags |= IB_PORT_CM_SUP;
431490 props->ip_gids = true;
@@ -6386,7 +6445,7 @@ static const struct mlx5_ib_profile pf_profile = { · 5954 unmodified lines
63866445 mlx5_ib_stage_delay_drop_cleanup),
63876446 };
63886447
6389−static const struct mlx5_ib_profile nic_rep_profile = {
6448+const struct mlx5_ib_profile uplink_rep_profile = {
63906449 STAGE_CREATE(MLX5_IB_STAGE_INIT,
63916450 mlx5_ib_stage_init_init,
63926451 mlx5_ib_stage_init_cleanup),
@@ -6479,6 +6538,12 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) · 86 unmodified lines
64796538
64806539 printk_once(KERN_INFO "%s", mlx5_version);
64816540
6541+ if (MLX5_ESWITCH_MANAGER(mdev) &&
6542+ mlx5_ib_eswitch_mode(mdev->priv.eswitch) == SRIOV_OFFLOADS) {
6543+ mlx5_ib_register_vport_reps(mdev);
6544+ return mdev;
6545+ }
6546+
64826547 port_type_cap = MLX5_CAP_GEN(mdev, port_type);
64836548 ll = mlx5_port_type_cap_to_rdma_ll(port_type_cap);
64846549
@@ -6493,14 +6558,6 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) · 8 unmodified lines
64936558 dev->num_ports = max(MLX5_CAP_GEN(mdev, num_ports),
64946559 MLX5_CAP_GEN(mdev, num_vhca_ports));
64956560
6496− if (MLX5_ESWITCH_MANAGER(mdev) &&
6497− mlx5_ib_eswitch_mode(mdev->priv.eswitch) == SRIOV_OFFLOADS) {
6498− dev->rep = mlx5_ib_vport_rep(mdev->priv.eswitch, 0);
6499− dev->profile = &nic_rep_profile;
6500− mlx5_ib_register_vport_reps(dev);
6501− return dev;
6502− }
6503−
65046561 return __mlx5_ib_add(dev, &pf_profile);
65056562 }
65066563
@@ -6509,6 +6566,11 @@ static void mlx5_ib_remove(struct mlx5_core_dev *mdev, void *context) · 2 unmodified lines
65096566 struct mlx5_ib_multiport_info *mpi;
65106567 struct mlx5_ib_dev *dev;
65116568
6569+ if (MLX5_ESWITCH_MANAGER(mdev) && context == mdev) {
6570+ mlx5_ib_unregister_vport_reps(mdev);
6571+ return;
6572+ }
6573+
65126574 if (mlx5_core_is_mp_slave(mdev)) {
65136575 mpi = context;
65146576 mutex_lock(&mlx5_ib_multiport_mutex);
@@ -6520,10 +6582,7 @@ static void mlx5_ib_remove(struct mlx5_core_dev *mdev, void *context) · 5 unmodified lines
65206582 }
65216583
65226584 dev = context;
6523− if (dev->profile == &nic_rep_profile)
6524− mlx5_ib_unregister_vport_reps(dev);
6525− else
6526− __mlx5_ib_remove(dev, dev->profile, MLX5_IB_STAGE_MAX);
6585+ __mlx5_ib_remove(dev, dev->profile, MLX5_IB_STAGE_MAX);
65276586
65286587 ib_dealloc_device((struct ib_device *)dev);
65296588 }
drivers/infiniband/hw/mlx5/mlx5_ib.h+2−3
@@ -587,6 +587,7 @@ struct mlx5_ib_mr { · 586 unmodified lines
587587 struct mlx5_ib_mr *parent;
588588 atomic_t num_leaf_free;
589589 wait_queue_head_t q_leaf_free;
590+ struct mlx5_async_work cb_work;
590591 };
591592
592593 struct mlx5_ib_mw {
@@ -944,6 +945,7 @@ struct mlx5_ib_dev { · 351 unmodified lines
944945 struct mlx5_memic memic;
945946 u16 devx_whitelist_uid;
946947 struct mlx5_srq_table srq_table;
948+ struct mlx5_async_ctx async_ctx;
947949 };
948950
949951 static inline struct mlx5_ib_cq *to_mibcq(struct mlx5_core_cq *mcq)
@@ -1038,9 +1040,6 @@ void mlx5_ib_db_unmap_user(struct mlx5_ib_ucontext *context, struct mlx5_db *db) · 88 unmodified lines
10381040 void __mlx5_ib_cq_clean(struct mlx5_ib_cq *cq, u32 qpn, struct mlx5_ib_srq *srq);
10391041 void mlx5_ib_cq_clean(struct mlx5_ib_cq *cq, u32 qpn, struct mlx5_ib_srq *srq);
10401042 void mlx5_ib_free_srq_wqe(struct mlx5_ib_srq *srq, int wqe_index);
1041−int mlx5_MAD_IFC(struct mlx5_ib_dev *dev, int ignore_mkey, int ignore_bkey,
1042− u8 port, const struct ib_wc *in_wc, const struct ib_grh *in_grh,
1043− const void *in_mad, void *response_mad);
10441043 struct ib_ah *mlx5_ib_create_ah(struct ib_pd *pd, struct rdma_ah_attr *ah_attr,
10451044 u32 flags, struct ib_udata *udata);
10461045 int mlx5_ib_query_ah(struct ib_ah *ibah, struct rdma_ah_attr *ah_attr);
drivers/infiniband/hw/mlx5/mr.c+7−32
@@ -123,9 +123,10 @@ static void update_odp_mr(struct mlx5_ib_mr *mr) · 122 unmodified lines
123123 }
124124 #endif
125125
126−static void reg_mr_callback(int status, void *context)
126+static void reg_mr_callback(int status, struct mlx5_async_work *context)
127127 {
128− struct mlx5_ib_mr *mr = context;
128+ struct mlx5_ib_mr *mr =
129+ container_of(context, struct mlx5_ib_mr, cb_work);
129130 struct mlx5_ib_dev *dev = mr->dev;
130131 struct mlx5_mr_cache *cache = &dev->cache;
131132 int c = order2idx(dev, mr->order);
@@ -216,9 +217,9 @@ static int add_keys(struct mlx5_ib_dev *dev, int c, int num) · 84 unmodified lines
216217 ent->pending++;
217218 spin_unlock_irq(&ent->lock);
218219 err = mlx5_core_create_mkey_cb(dev->mdev, &mr->mmkey,
219− in, inlen,
220+ &dev->async_ctx, in, inlen,
220221 mr->out, sizeof(mr->out),
221− reg_mr_callback, mr);
222+ reg_mr_callback, &mr->cb_work);
222223 if (err) {
223224 spin_lock_irq(&ent->lock);
224225 ent->pending--;
@@ -679,6 +680,7 @@ int mlx5_mr_cache_init(struct mlx5_ib_dev *dev) · 454 unmodified lines
679680 return -ENOMEM;
680681 }
681682
683+ mlx5_cmd_init_async_ctx(dev->mdev, &dev->async_ctx);
682684 timer_setup(&dev->delay_timer, delay_time_func, 0);
683685 for (i = 0; i < MAX_MR_CACHE_ENTRIES; i++) {
684686 ent = &cache->ent[i];
@@ -725,33 +727,6 @@ int mlx5_mr_cache_init(struct mlx5_ib_dev *dev) · 40 unmodified lines
725727 return 0;
726728 }
727729
728−static void wait_for_async_commands(struct mlx5_ib_dev *dev)
729−{
730− struct mlx5_mr_cache *cache = &dev->cache;
731− struct mlx5_cache_ent *ent;
732− int total = 0;
733− int i;
734− int j;
735−
736− for (i = 0; i < MAX_MR_CACHE_ENTRIES; i++) {
737− ent = &cache->ent[i];
738− for (j = 0 ; j < 1000; j++) {
739− if (!ent->pending)
740− break;
741− msleep(50);
742− }
743− }
744− for (i = 0; i < MAX_MR_CACHE_ENTRIES; i++) {
745− ent = &cache->ent[i];
746− total += ent->pending;
747− }
748−
749− if (total)
750− mlx5_ib_warn(dev, "aborted while there are %d pending mr requests\n", total);
751− else
752− mlx5_ib_warn(dev, "done with all pending requests\n");
753−}
754−
755730 int mlx5_mr_cache_cleanup(struct mlx5_ib_dev *dev)
756731 {
757732 int i;
@@ -763,12 +738,12 @@ int mlx5_mr_cache_cleanup(struct mlx5_ib_dev *dev) · 5 unmodified lines
763738 flush_workqueue(dev->cache.wq);
764739
765740 mlx5_mr_cache_debugfs_cleanup(dev);
741+ mlx5_cmd_cleanup_async_ctx(&dev->async_ctx);
766742
767743 for (i = 0; i < MAX_MR_CACHE_ENTRIES; i++)
768744 clean_keys(dev, i);
769745
770746 destroy_workqueue(dev->cache.wq);
771− wait_for_async_commands(dev);
772747 del_timer_sync(&dev->delay_timer);
773748
774749 return 0;
drivers/net/ethernet/mellanox/mlx5/core/Makefile+2−2
@@ -13,7 +13,7 @@ obj-$(CONFIG_MLX5_CORE) += mlx5_core.o · 12 unmodified lines
1313 #
1414 mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
1515 health.o mcg.o cq.o alloc.o qp.o port.o mr.o pd.o \
16− mad.o transobj.o vport.o sriov.o fs_cmd.o fs_core.o \
16+ transobj.o vport.o sriov.o fs_cmd.o fs_core.o \
1717 fs_counters.o rl.o lag.o dev.o events.o wq.o lib/gid.o \
1818 lib/devcom.o diag/fs_tracepoint.o diag/fw_tracer.o
1919
@@ -35,7 +35,7 @@ mlx5_core-$(CONFIG_MLX5_ESWITCH) += en_rep.o en_tc.o en/tc_tun.o · 15 unmodified lines
3535 #
3636 # Core extra
3737 #
38−mlx5_core-$(CONFIG_MLX5_ESWITCH) += eswitch.o eswitch_offloads.o
38+mlx5_core-$(CONFIG_MLX5_ESWITCH) += eswitch.o eswitch_offloads.o ecpf.o
3939 mlx5_core-$(CONFIG_MLX5_MPFS) += lib/mpfs.o
4040 mlx5_core-$(CONFIG_VXLAN) += lib/vxlan.o
4141 mlx5_core-$(CONFIG_PTP_1588_CLOCK) += lib/clock.o
drivers/net/ethernet/mellanox/mlx5/core/cmd.c+52−5
@@ -316,6 +316,7 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op, · 315 unmodified lines
316316 case MLX5_CMD_OP_DESTROY_GENERAL_OBJECT:
317317 case MLX5_CMD_OP_DEALLOC_MEMIC:
318318 case MLX5_CMD_OP_PAGE_FAULT_RESUME:
319+ case MLX5_CMD_OP_QUERY_HOST_PARAMS:
319320 return MLX5_CMD_STAT_OK;
320321
321322 case MLX5_CMD_OP_QUERY_HCA_CAP:
@@ -627,6 +628,7 @@ const char *mlx5_command_str(int command) · 305 unmodified lines
627628 MLX5_COMMAND_STR_CASE(QUERY_MODIFY_HEADER_CONTEXT);
628629 MLX5_COMMAND_STR_CASE(ALLOC_MEMIC);
629630 MLX5_COMMAND_STR_CASE(DEALLOC_MEMIC);
631+ MLX5_COMMAND_STR_CASE(QUERY_HOST_PARAMS);
630632 default: return "unknown command opcode";
631633 }
632634 }
@@ -1711,12 +1713,57 @@ int mlx5_cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out, · 1078 unmodified lines
17111713 }
17121714 EXPORT_SYMBOL(mlx5_cmd_exec);
17131715
1714−int mlx5_cmd_exec_cb(struct mlx5_core_dev *dev, void *in, int in_size,
1715− void *out, int out_size, mlx5_cmd_cbk_t callback,
1716− void *context)
1716+void mlx5_cmd_init_async_ctx(struct mlx5_core_dev *dev,
1717+ struct mlx5_async_ctx *ctx)
17171718 {
1718− return cmd_exec(dev, in, in_size, out, out_size, callback, context,
1719− false);
1719+ ctx->dev = dev;
1720+ /* Starts at 1 to avoid doing wake_up if we are not cleaning up */
1721+ atomic_set(&ctx->num_inflight, 1);
1722+ init_waitqueue_head(&ctx->wait);
1723+}
1724+EXPORT_SYMBOL(mlx5_cmd_init_async_ctx);
1725+
1726+/**
1727+ * mlx5_cmd_cleanup_async_ctx - Clean up an async_ctx
1728+ * @ctx: The ctx to clean
1729+ *
1730+ * Upon return all callbacks given to mlx5_cmd_exec_cb() have been called. The
1731+ * caller must ensure that mlx5_cmd_exec_cb() is not called during or after
1732+ * the call mlx5_cleanup_async_ctx().
1733+ */
1734+void mlx5_cmd_cleanup_async_ctx(struct mlx5_async_ctx *ctx)
1735+{
1736+ atomic_dec(&ctx->num_inflight);
1737+ wait_event(ctx->wait, atomic_read(&ctx->num_inflight) == 0);
1738+}
1739+EXPORT_SYMBOL(mlx5_cmd_cleanup_async_ctx);
1740+
1741+static void mlx5_cmd_exec_cb_handler(int status, void *_work)
1742+{
1743+ struct mlx5_async_work *work = _work;
1744+ struct mlx5_async_ctx *ctx = work->ctx;
1745+
1746+ work->user_callback(status, work);
1747+ if (atomic_dec_and_test(&ctx->num_inflight))
1748+ wake_up(&ctx->wait);
1749+}
1750+
1751+int mlx5_cmd_exec_cb(struct mlx5_async_ctx *ctx, void *in, int in_size,
1752+ void *out, int out_size, mlx5_async_cbk_t callback,
1753+ struct mlx5_async_work *work)
1754+{
1755+ int ret;
1756+
1757+ work->ctx = ctx;
1758+ work->user_callback = callback;
1759+ if (WARN_ON(!atomic_inc_not_zero(&ctx->num_inflight)))
1760+ return -EIO;
1761+ ret = cmd_exec(ctx->dev, in, in_size, out, out_size,
1762+ mlx5_cmd_exec_cb_handler, work, false);
1763+ if (ret && atomic_dec_and_test(&ctx->num_inflight))
1764+ wake_up(&ctx->wait);
1765+
1766+ return ret;
17201767 }
17211768 EXPORT_SYMBOL(mlx5_cmd_exec_cb);
17221769
drivers/net/ethernet/mellanox/mlx5/core/ecpf.c+112−0
@@ -0,0 +1,112 @@
1+/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2+/* Copyright (c) 2019 Mellanox Technologies. */
3+
4+#include "ecpf.h"
5+
6+bool mlx5_read_embedded_cpu(struct mlx5_core_dev *dev)
7+{
8+ return (ioread32be(&dev->iseg->initializing) >> MLX5_ECPU_BIT_NUM) & 1;
9+}
10+
11+static int mlx5_peer_pf_enable_hca(struct mlx5_core_dev *dev)
12+{
13+ u32 out[MLX5_ST_SZ_DW(enable_hca_out)] = {};
14+ u32 in[MLX5_ST_SZ_DW(enable_hca_in)] = {};
15+
16+ MLX5_SET(enable_hca_in, in, opcode, MLX5_CMD_OP_ENABLE_HCA);
17+ MLX5_SET(enable_hca_in, in, function_id, 0);
18+ MLX5_SET(enable_hca_in, in, embedded_cpu_function, 0);
19+ return mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out));
20+}
21+
22+static int mlx5_peer_pf_disable_hca(struct mlx5_core_dev *dev)
23+{
24+ u32 out[MLX5_ST_SZ_DW(disable_hca_out)] = {};
25+ u32 in[MLX5_ST_SZ_DW(disable_hca_in)] = {};
26+
27+ MLX5_SET(disable_hca_in, in, opcode, MLX5_CMD_OP_DISABLE_HCA);
28+ MLX5_SET(disable_hca_in, in, function_id, 0);
29+ MLX5_SET(enable_hca_in, in, embedded_cpu_function, 0);
30+ return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
31+}
32+
33+static int mlx5_peer_pf_init(struct mlx5_core_dev *dev)
34+{
35+ int err;
36+
37+ err = mlx5_peer_pf_enable_hca(dev);
38+ if (err)
39+ mlx5_core_err(dev, "Failed to enable peer PF HCA err(%d)\n",
40+ err);
41+
42+ return err;
43+}
44+
45+static void mlx5_peer_pf_cleanup(struct mlx5_core_dev *dev)
46+{
47+ int err;
48+
49+ err = mlx5_peer_pf_disable_hca(dev);
50+ if (err) {
51+ mlx5_core_err(dev, "Failed to disable peer PF HCA err(%d)\n",
52+ err);
53+ return;
54+ }
55+
56+ err = mlx5_wait_for_pages(dev, &dev->priv.peer_pf_pages);
57+ if (err)
58+ mlx5_core_warn(dev, "Timeout reclaiming peer PF pages err(%d)\n",
59+ err);
60+}
61+
62+int mlx5_ec_init(struct mlx5_core_dev *dev)
63+{
64+ int err = 0;
65+
66+ if (!mlx5_core_is_ecpf(dev))
67+ return 0;
68+
69+ /* ECPF shall enable HCA for peer PF in the same way a PF
70+ * does this for its VFs.
71+ */
72+ err = mlx5_peer_pf_init(dev);
73+ if (err)
74+ return err;
75+
76+ return 0;
77+}
78+
79+void mlx5_ec_cleanup(struct mlx5_core_dev *dev)
80+{
81+ if (!mlx5_core_is_ecpf(dev))
82+ return;
83+
84+ mlx5_peer_pf_cleanup(dev);
85+}
86+
87+static int mlx5_query_host_params_context(struct mlx5_core_dev *dev,
88+ u32 *out, int outlen)
89+{
90+ u32 in[MLX5_ST_SZ_DW(query_host_params_in)] = {};
91+
92+ MLX5_SET(query_host_params_in, in, opcode,
93+ MLX5_CMD_OP_QUERY_HOST_PARAMS);
94+
95+ return mlx5_cmd_exec(dev, in, sizeof(in), out, outlen);
96+}
97+
98+int mlx5_query_host_params_num_vfs(struct mlx5_core_dev *dev, int *num_vf)
99+{
100+ u32 out[MLX5_ST_SZ_DW(query_host_params_out)] = {};
101+ int err;
102+
103+ err = mlx5_query_host_params_context(dev, out, sizeof(out));
104+ if (err)
105+ return err;
106+
107+ *num_vf = MLX5_GET(query_host_params_out, out,
108+ host_params_context.host_num_of_vfs);
109+ mlx5_core_dbg(dev, "host_num_of_vfs %d\n", *num_vf);
110+
111+ return 0;
112+}
drivers/net/ethernet/mellanox/mlx5/core/ecpf.h+33−0
@@ -0,0 +1,33 @@
1+/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2+/* Copyright (c) 2019 Mellanox Technologies. */
3+
4+#ifndef __MLX5_ECPF_H__
5+#define __MLX5_ECPF_H__
6+
7+#include <linux/mlx5/driver.h>
8+#include "mlx5_core.h"
9+
10+#ifdef CONFIG_MLX5_ESWITCH
11+
12+enum {
13+ MLX5_ECPU_BIT_NUM = 23,
14+};
15+
16+bool mlx5_read_embedded_cpu(struct mlx5_core_dev *dev);
17+int mlx5_ec_init(struct mlx5_core_dev *dev);
18+void mlx5_ec_cleanup(struct mlx5_core_dev *dev);
19+int mlx5_query_host_params_num_vfs(struct mlx5_core_dev *dev, int *num_vf);
20+
21+#else /* CONFIG_MLX5_ESWITCH */
22+
23+static inline bool
24+mlx5_read_embedded_cpu(struct mlx5_core_dev *dev) { return false; }
25+static inline int mlx5_ec_init(struct mlx5_core_dev *dev) { return 0; }
26+static inline void mlx5_ec_cleanup(struct mlx5_core_dev *dev) {}
27+static inline int
28+mlx5_query_host_params_num_vfs(struct mlx5_core_dev *dev, int *num_vf)
29+{ return -EOPNOTSUPP; }
30+
31+#endif /* CONFIG_MLX5_ESWITCH */
32+
33+#endif /* __MLX5_ECPF_H__ */
drivers/net/ethernet/mellanox/mlx5/core/en/port.c+122−20
@@ -63,66 +63,168 @@ static const u32 mlx5e_link_speed[MLX5E_LINK_MODES_NUMBER] = { · 62 unmodified lines
6363 [MLX5E_50GBASE_KR2] = 50000,
6464 };
6565
66−u32 mlx5e_port_ptys2speed(u32 eth_proto_oper)
66+static const u32 mlx5e_ext_link_speed[MLX5E_EXT_LINK_MODES_NUMBER] = {
67+ [MLX5E_SGMII_100M] = 100,
68+ [MLX5E_1000BASE_X_SGMII] = 1000,
69+ [MLX5E_5GBASE_R] = 5000,
70+ [MLX5E_10GBASE_XFI_XAUI_1] = 10000,
71+ [MLX5E_40GBASE_XLAUI_4_XLPPI_4] = 40000,
72+ [MLX5E_25GAUI_1_25GBASE_CR_KR] = 25000,
73+ [MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2] = 50000,
74+ [MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR] = 50000,
75+ [MLX5E_CAUI_4_100GBASE_CR4_KR4] = 100000,
76+ [MLX5E_200GAUI_4_200GBASE_CR4_KR4] = 200000,
77+ [MLX5E_400GAUI_8] = 400000,
78+};
79+
80+static void mlx5e_port_get_speed_arr(struct mlx5_core_dev *mdev,
81+ const u32 **arr, u32 *size)
82+{
83+ bool ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
84+
85+ *size = ext ? ARRAY_SIZE(mlx5e_ext_link_speed) :
86+ ARRAY_SIZE(mlx5e_link_speed);
87+ *arr = ext ? mlx5e_ext_link_speed : mlx5e_link_speed;
88+}
89+
90+int mlx5_port_query_eth_proto(struct mlx5_core_dev *dev, u8 port, bool ext,
91+ struct mlx5e_port_eth_proto *eproto)
92+{
93+ u32 out[MLX5_ST_SZ_DW(ptys_reg)];
94+ int err;
95+
96+ if (!eproto)
97+ return -EINVAL;
98+
99+ if (ext != MLX5_CAP_PCAM_FEATURE(dev, ptys_extended_ethernet))
100+ return -EOPNOTSUPP;
101+
102+ err = mlx5_query_port_ptys(dev, out, sizeof(out), MLX5_PTYS_EN, port);
103+ if (err)
104+ return err;
105+
106+ eproto->cap = MLX5_GET_ETH_PROTO(ptys_reg, out, ext,
107+ eth_proto_capability);
108+ eproto->admin = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, eth_proto_admin);
109+ eproto->oper = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, eth_proto_oper);
110+ return 0;
111+}
112+
113+void mlx5_port_query_eth_autoneg(struct mlx5_core_dev *dev, u8 *an_status,
114+ u8 *an_disable_cap, u8 *an_disable_admin)
115+{
116+ u32 out[MLX5_ST_SZ_DW(ptys_reg)];
117+
118+ *an_status = 0;
119+ *an_disable_cap = 0;
120+ *an_disable_admin = 0;
121+
122+ if (mlx5_query_port_ptys(dev, out, sizeof(out), MLX5_PTYS_EN, 1))
123+ return;
124+
125+ *an_status = MLX5_GET(ptys_reg, out, an_status);
126+ *an_disable_cap = MLX5_GET(ptys_reg, out, an_disable_cap);
127+ *an_disable_admin = MLX5_GET(ptys_reg, out, an_disable_admin);
128+}
129+
130+int mlx5_port_set_eth_ptys(struct mlx5_core_dev *dev, bool an_disable,
131+ u32 proto_admin, bool ext)
132+{
133+ u32 out[MLX5_ST_SZ_DW(ptys_reg)];
134+ u32 in[MLX5_ST_SZ_DW(ptys_reg)];
135+ u8 an_disable_admin;
136+ u8 an_disable_cap;
137+ u8 an_status;
138+
139+ mlx5_port_query_eth_autoneg(dev, &an_status, &an_disable_cap,
140+ &an_disable_admin);
141+ if (!an_disable_cap && an_disable)
142+ return -EPERM;
143+
144+ memset(in, 0, sizeof(in));
145+
146+ MLX5_SET(ptys_reg, in, local_port, 1);
147+ MLX5_SET(ptys_reg, in, an_disable_admin, an_disable);
148+ MLX5_SET(ptys_reg, in, proto_mask, MLX5_PTYS_EN);
149+ if (ext)
150+ MLX5_SET(ptys_reg, in, ext_eth_proto_admin, proto_admin);
151+ else
152+ MLX5_SET(ptys_reg, in, eth_proto_admin, proto_admin);
153+
154+ return mlx5_core_access_reg(dev, in, sizeof(in), out,
155+ sizeof(out), MLX5_REG_PTYS, 0, 1);
156+}
157+
158+u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper)
67159 {
68160 unsigned long temp = eth_proto_oper;
161+ const u32 *table;
69162 u32 speed = 0;
163+ u32 max_size;
70164 int i;
71165
72− i = find_first_bit(&temp, MLX5E_LINK_MODES_NUMBER);
73− if (i < MLX5E_LINK_MODES_NUMBER)
74− speed = mlx5e_link_speed[i];
75−
166+ mlx5e_port_get_speed_arr(mdev, &table, &max_size);
167+ i = find_first_bit(&temp, max_size);
168+ if (i < max_size)
169+ speed = table[i];
76170 return speed;
77171 }
78172
79173 int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed)
80174 {
81− u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {};
82− u32 eth_proto_oper;
175+ struct mlx5e_port_eth_proto eproto;
176+ bool ext;
83177 int err;
84178
85− err = mlx5_query_port_ptys(mdev, out, sizeof(out), MLX5_PTYS_EN, 1);
179+ ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
180+ err = mlx5_port_query_eth_proto(mdev, 1, ext, &eproto);
86181 if (err)
87− return err;
182+ goto out;
88183
89− eth_proto_oper = MLX5_GET(ptys_reg, out, eth_proto_oper);
90− *speed = mlx5e_port_ptys2speed(eth_proto_oper);
184+ *speed = mlx5e_port_ptys2speed(mdev, eproto.oper);
91185 if (!(*speed))
92186 err = -EINVAL;
93187
188+out:
94189 return err;
95190 }
96191
97192 int mlx5e_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed)
98193 {
194+ struct mlx5e_port_eth_proto eproto;
99195 u32 max_speed = 0;
100− u32 proto_cap;
196+ const u32 *table;
197+ u32 max_size;
198+ bool ext;
101199 int err;
102200 int i;
103201
104− err = mlx5_query_port_proto_cap(mdev, &proto_cap, MLX5_PTYS_EN);
202+ ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
203+ err = mlx5_port_query_eth_proto(mdev, 1, ext, &eproto);
105204 if (err)
106205 return err;
107206
108− for (i = 0; i < MLX5E_LINK_MODES_NUMBER; ++i)
109− if (proto_cap & MLX5E_PROT_MASK(i))
110− max_speed = max(max_speed, mlx5e_link_speed[i]);
207+ mlx5e_port_get_speed_arr(mdev, &table, &max_size);
208+ for (i = 0; i < max_size; ++i)
209+ if (eproto.cap & MLX5E_PROT_MASK(i))
210+ max_speed = max(max_speed, table[i]);
111211
112212 *speed = max_speed;
113213 return 0;
114214 }
115215
116−u32 mlx5e_port_speed2linkmodes(u32 speed)
216+u32 mlx5e_port_speed2linkmodes(struct mlx5_core_dev *mdev, u32 speed)
117217 {
118218 u32 link_modes = 0;
219+ const u32 *table;
220+ u32 max_size;
119221 int i;
120222
121− for (i = 0; i < MLX5E_LINK_MODES_NUMBER; ++i) {
122− if (mlx5e_link_speed[i] == speed)
223+ mlx5e_port_get_speed_arr(mdev, &table, &max_size);
224+ for (i = 0; i < max_size; ++i) {
225+ if (table[i] == speed)
123226 link_modes |= MLX5E_PROT_MASK(i);
124227 }
125−
126228 return link_modes;
127229 }
128230
drivers/net/ethernet/mellanox/mlx5/core/en/port.h+14−2
@@ -36,10 +36,22 @@ · 35 unmodified lines
3636 #include <linux/mlx5/driver.h>
3737 #include "en.h"
3838
39−u32 mlx5e_port_ptys2speed(u32 eth_proto_oper);
39+struct mlx5e_port_eth_proto {
40+ u32 cap;
41+ u32 admin;
42+ u32 oper;
43+};
44+
45+int mlx5_port_query_eth_proto(struct mlx5_core_dev *dev, u8 port, bool ext,
46+ struct mlx5e_port_eth_proto *eproto);
47+void mlx5_port_query_eth_autoneg(struct mlx5_core_dev *dev, u8 *an_status,
48+ u8 *an_disable_cap, u8 *an_disable_admin);
49+int mlx5_port_set_eth_ptys(struct mlx5_core_dev *dev, bool an_disable,
50+ u32 proto_admin, bool ext);
51+u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper);
4052 int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed);
4153 int mlx5e_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed);
42−u32 mlx5e_port_speed2linkmodes(u32 speed);
54+u32 mlx5e_port_speed2linkmodes(struct mlx5_core_dev *mdev, u32 speed);
4355
4456 int mlx5e_port_query_pbmc(struct mlx5_core_dev *mdev, void *out);
4557 int mlx5e_port_set_pbmc(struct mlx5_core_dev *mdev, void *in);
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+11−17
@@ -695,13 +695,14 @@ static void get_speed_duplex(struct net_device *netdev, · 694 unmodified lines
695695 u32 eth_proto_oper,
696696 struct ethtool_link_ksettings *link_ksettings)
697697 {
698+ struct mlx5e_priv *priv = netdev_priv(netdev);
698699 u32 speed = SPEED_UNKNOWN;
699700 u8 duplex = DUPLEX_UNKNOWN;
700701
701702 if (!netif_carrier_ok(netdev))
702703 goto out;
703704
704− speed = mlx5e_port_ptys2speed(eth_proto_oper);
705+ speed = mlx5e_port_ptys2speed(priv->mdev, eth_proto_oper);
705706 if (!speed) {
706707 speed = SPEED_UNKNOWN;
707708 goto out;
@@ -885,7 +886,7 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, · 177 unmodified lines
885886 const struct ethtool_link_ksettings *link_ksettings)
886887 {
887888 struct mlx5_core_dev *mdev = priv->mdev;
888− u32 eth_proto_cap, eth_proto_admin;
889+ struct mlx5e_port_eth_proto eproto;
889890 bool an_changes = false;
890891 u8 an_disable_admin;
891892 u8 an_disable_cap;
@@ -899,16 +900,16 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, · 7 unmodified lines
899900
900901 link_modes = link_ksettings->base.autoneg == AUTONEG_ENABLE ?
901902 mlx5e_ethtool2ptys_adver_link(link_ksettings->link_modes.advertising) :
902− mlx5e_port_speed2linkmodes(speed);
903+ mlx5e_port_speed2linkmodes(mdev, speed);
903904
904− err = mlx5_query_port_proto_cap(mdev, &eth_proto_cap, MLX5_PTYS_EN);
905+ err = mlx5_port_query_eth_proto(mdev, 1, false, &eproto);
905906 if (err) {
906− netdev_err(priv->netdev, "%s: query port eth proto cap failed: %d\n",
907+ netdev_err(priv->netdev, "%s: query port eth proto failed: %d\n",
907908 __func__, err);
908909 goto out;
909910 }
910911
911− link_modes = link_modes & eth_proto_cap;
912+ link_modes = link_modes & eproto.cap;
912913 if (!link_modes) {
913914 netdev_err(priv->netdev, "%s: Not supported link mode(s) requested",
914915 __func__);
@@ -916,24 +917,17 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, · 1 unmodified line
916917 goto out;
917918 }
918919
919− err = mlx5_query_port_proto_admin(mdev, &eth_proto_admin, MLX5_PTYS_EN);
920− if (err) {
921− netdev_err(priv->netdev, "%s: query port eth proto admin failed: %d\n",
922− __func__, err);
923− goto out;
924− }
925−
926− mlx5_query_port_autoneg(mdev, MLX5_PTYS_EN, &an_status,
927− &an_disable_cap, &an_disable_admin);
920+ mlx5_port_query_eth_autoneg(mdev, &an_status, &an_disable_cap,
921+ &an_disable_admin);
928922
929923 an_disable = link_ksettings->base.autoneg == AUTONEG_DISABLE;
930924 an_changes = ((!an_disable && an_disable_admin) ||
931925 (an_disable && !an_disable_admin));
932926
933− if (!an_changes && link_modes == eth_proto_admin)
927+ if (!an_changes && link_modes == eproto.admin)
934928 goto out;
935929
936− mlx5_set_port_ptys(mdev, an_disable, link_modes, MLX5_PTYS_EN);
930+ mlx5_port_set_eth_ptys(mdev, an_disable, link_modes, false);
937931 mlx5_toggle_port_link(mdev);
938932
939933 out:
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+12−12
@@ -153,7 +153,7 @@ static void mlx5e_rep_update_hw_counters(struct mlx5e_priv *priv) · 152 unmodified lines
153153 struct mlx5e_rep_priv *rpriv = priv->ppriv;
154154 struct mlx5_eswitch_rep *rep = rpriv->rep;
155155
156− if (rep->vport == FDB_UPLINK_VPORT)
156+ if (rep->vport == MLX5_VPORT_UPLINK)
157157 mlx5e_uplink_rep_update_hw_counters(priv);
158158 else
159159 mlx5e_vf_rep_update_hw_counters(priv);
@@ -1119,7 +1119,7 @@ static int mlx5e_rep_get_phys_port_name(struct net_device *dev, · 959 unmodified lines
11191119 if (ret)
11201120 return ret;
11211121
1122− if (rep->vport == FDB_UPLINK_VPORT)
1122+ if (rep->vport == MLX5_VPORT_UPLINK)
11231123 ret = snprintf(buf, len, "p%d", pf_num);
11241124 else
11251125 ret = snprintf(buf, len, "pf%dvf%d", pf_num, rep->vport - 1);
@@ -1206,7 +1206,7 @@ bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv) · 80 unmodified lines
12061206 return false;
12071207
12081208 rep = rpriv->rep;
1209− return (rep->vport == FDB_UPLINK_VPORT);
1209+ return (rep->vport == MLX5_VPORT_UPLINK);
12101210 }
12111211
12121212 static bool mlx5e_rep_has_offload_stats(const struct net_device *dev, int attr_id)
@@ -1344,7 +1344,7 @@ static void mlx5e_build_rep_params(struct net_device *netdev) · 131 unmodified lines
13441344 params->sw_mtu = netdev->mtu;
13451345
13461346 /* SQ */
1347− if (rep->vport == FDB_UPLINK_VPORT)
1347+ if (rep->vport == MLX5_VPORT_UPLINK)
13481348 params->log_sq_size = MLX5E_PARAMS_DEFAULT_LOG_SQ_SIZE;
13491349 else
13501350 params->log_sq_size = MLX5E_REP_PARAMS_DEF_LOG_SQ_SIZE;
@@ -1371,7 +1371,7 @@ static void mlx5e_build_rep_netdev(struct net_device *netdev) · 20 unmodified lines
13711371 struct mlx5_eswitch_rep *rep = rpriv->rep;
13721372 struct mlx5_core_dev *mdev = priv->mdev;
13731373
1374− if (rep->vport == FDB_UPLINK_VPORT) {
1374+ if (rep->vport == MLX5_VPORT_UPLINK) {
13751375 SET_NETDEV_DEV(netdev, &priv->mdev->pdev->dev);
13761376 netdev->netdev_ops = &mlx5e_netdev_ops_uplink_rep;
13771377 /* we want a persistent mac for the uplink rep */
@@ -1401,7 +1401,7 @@ static void mlx5e_build_rep_netdev(struct net_device *netdev) · 23 unmodified lines
14011401 netdev->hw_features |= NETIF_F_TSO6;
14021402 netdev->hw_features |= NETIF_F_RXCSUM;
14031403
1404− if (rep->vport != FDB_UPLINK_VPORT)
1404+ if (rep->vport != MLX5_VPORT_UPLINK)
14051405 netdev->features |= NETIF_F_VLAN_CHALLENGED;
14061406
14071407 netdev->features |= netdev->hw_features;
@@ -1554,7 +1554,7 @@ static int mlx5e_init_rep_tx(struct mlx5e_priv *priv) · 146 unmodified lines
15541554 return err;
15551555 }
15561556
1557− if (rpriv->rep->vport == FDB_UPLINK_VPORT) {
1557+ if (rpriv->rep->vport == MLX5_VPORT_UPLINK) {
15581558 uplink_priv = &rpriv->uplink_priv;
15591559
15601560 /* init shared tc flow table */
@@ -1590,7 +1590,7 @@ static void mlx5e_cleanup_rep_tx(struct mlx5e_priv *priv) · 29 unmodified lines
15901590 for (tc = 0; tc < priv->profile->max_tc; tc++)
15911591 mlx5e_destroy_tis(priv->mdev, priv->tisn[tc]);
15921592
1593− if (rpriv->rep->vport == FDB_UPLINK_VPORT) {
1593+ if (rpriv->rep->vport == MLX5_VPORT_UPLINK) {
15941594 /* clean indirect TC block notifications */
15951595 unregister_netdevice_notifier(&rpriv->uplink_priv.netdevice_nb);
15961596 mlx5e_rep_indr_clean_block_privs(rpriv);
@@ -1709,7 +1709,7 @@ mlx5e_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) · 112 unmodified lines
17091709 rpriv->rep = rep;
17101710
17111711 nch = mlx5e_get_max_num_channels(dev);
1712− profile = (rep->vport == FDB_UPLINK_VPORT) ? &mlx5e_uplink_rep_profile : &mlx5e_vf_rep_profile;
1712+ profile = (rep->vport == MLX5_VPORT_UPLINK) ? &mlx5e_uplink_rep_profile : &mlx5e_vf_rep_profile;
17131713 netdev = mlx5e_create_netdev(dev, profile, nch, rpriv);
17141714 if (!netdev) {
17151715 pr_warn("Failed to create representor netdev for vport %d\n",
@@ -1722,7 +1722,7 @@ mlx5e_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) · 6 unmodified lines
17221722 rep->rep_if[REP_ETH].priv = rpriv;
17231723 INIT_LIST_HEAD(&rpriv->vport_sqs_list);
17241724
1725− if (rep->vport == FDB_UPLINK_VPORT) {
1725+ if (rep->vport == MLX5_VPORT_UPLINK) {
17261726 err = mlx5e_create_mdev_resources(dev);
17271727 if (err)
17281728 goto err_destroy_netdev;
@@ -1758,7 +1758,7 @@ err_detach_netdev: · 29 unmodified lines
17581758 mlx5e_detach_netdev(netdev_priv(netdev));
17591759
17601760 err_destroy_mdev_resources:
1761− if (rep->vport == FDB_UPLINK_VPORT)
1761+ if (rep->vport == MLX5_VPORT_UPLINK)
17621762 mlx5e_destroy_mdev_resources(dev);
17631763
17641764 err_destroy_netdev:
@@ -1778,7 +1778,7 @@ mlx5e_vport_rep_unload(struct mlx5_eswitch_rep *rep) · 13 unmodified lines
17781778 unregister_netdev(netdev);
17791779 mlx5e_rep_neigh_cleanup(rpriv);
17801780 mlx5e_detach_netdev(priv);
1781− if (rep->vport == FDB_UPLINK_VPORT)
1781+ if (rep->vport == MLX5_VPORT_UPLINK)
17821782 mlx5e_destroy_mdev_resources(priv->mdev);
17831783 mlx5e_destroy_netdev(priv);
17841784 kfree(ppriv); /* mlx5e_rep_priv */
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+3−3
@@ -1776,7 +1776,7 @@ static int parse_cls_flower(struct mlx5e_priv *priv, · 1775 unmodified lines
17761776
17771777 if (!err && (flow->flags & MLX5E_TC_FLOW_ESWITCH)) {
17781778 rep = rpriv->rep;
1779− if (rep->vport != FDB_UPLINK_VPORT &&
1779+ if (rep->vport != MLX5_VPORT_UPLINK &&
17801780 (esw->offloads.inline_mode != MLX5_INLINE_MODE_NONE &&
17811781 esw->offloads.inline_mode < match_level)) {
17821782 NL_SET_ERR_MSG_MOD(extack,
@@ -2693,7 +2693,7 @@ static struct rhashtable *get_tc_ht(struct mlx5e_priv *priv, int flags) · 910 unmodified lines
26932693 static bool is_peer_flow_needed(struct mlx5e_tc_flow *flow)
26942694 {
26952695 struct mlx5_esw_flow_attr *attr = flow->esw_attr;
2696− bool is_rep_ingress = attr->in_rep->vport != FDB_UPLINK_VPORT &&
2696+ bool is_rep_ingress = attr->in_rep->vport != MLX5_VPORT_UPLINK &&
26972697 flow->flags & MLX5E_TC_FLOW_INGRESS;
26982698 bool act_is_encap = !!(attr->action &
26992699 MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT);
@@ -2816,7 +2816,7 @@ static int mlx5e_tc_add_fdb_peer_flow(struct tc_cls_flower_offload *f, · 116 unmodified lines
28162816 * original flow and packets redirected from uplink use the
28172817 * peer mdev.
28182818 */
2819− if (flow->esw_attr->in_rep->vport == FDB_UPLINK_VPORT)
2819+ if (flow->esw_attr->in_rep->vport == MLX5_VPORT_UPLINK)
28202820 in_mdev = peer_priv->mdev;
28212821 else
28222822 in_mdev = priv->mdev;
drivers/net/ethernet/mellanox/mlx5/core/eq.c+10−6
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 #include <linux/notifier.h>
3535 #include <linux/module.h>
3636 #include <linux/mlx5/driver.h>
37+#include <linux/mlx5/vport.h>
3738 #include <linux/mlx5/eq.h>
3839 #include <linux/mlx5/cmd.h>
3940 #ifdef CONFIG_RFS_ACCEL
@@ -114,11 +115,11 @@ static struct mlx5_core_cq *mlx5_eq_cq_get(struct mlx5_eq *eq, u32 cqn) · 74 unmodified lines
114115 struct mlx5_cq_table *table = &eq->cq_table;
115116 struct mlx5_core_cq *cq = NULL;
116117
117− spin_lock(&table->lock);
118+ rcu_read_lock();
118119 cq = radix_tree_lookup(&table->tree, cqn);
119120 if (likely(cq))
120121 mlx5_cq_hold(cq);
121− spin_unlock(&table->lock);
122+ rcu_read_unlock();
122123
123124 return cq;
124125 }
@@ -371,9 +372,9 @@ int mlx5_eq_add_cq(struct mlx5_eq *eq, struct mlx5_core_cq *cq) · 246 unmodified lines
371372 struct mlx5_cq_table *table = &eq->cq_table;
372373 int err;
373374
374− spin_lock_irq(&table->lock);
375+ spin_lock(&table->lock);
375376 err = radix_tree_insert(&table->tree, cq->cqn, cq);
376− spin_unlock_irq(&table->lock);
377+ spin_unlock(&table->lock);
377378
378379 return err;
379380 }
@@ -383,9 +384,9 @@ int mlx5_eq_del_cq(struct mlx5_eq *eq, struct mlx5_core_cq *cq) · 3 unmodified lines
383384 struct mlx5_cq_table *table = &eq->cq_table;
384385 struct mlx5_core_cq *tmp;
385386
386− spin_lock_irq(&table->lock);
387+ spin_lock(&table->lock);
387388 tmp = radix_tree_delete(&table->tree, cq->cqn);
388− spin_unlock_irq(&table->lock);
389+ spin_unlock(&table->lock);
389390
390391 if (!tmp) {
391392 mlx5_core_warn(eq->dev, "cq 0x%x not found in eq 0x%x tree\n", eq->eqn, cq->cqn);
@@ -530,6 +531,9 @@ static u64 gather_async_events_mask(struct mlx5_core_dev *dev) · 138 unmodified lines
530531 if (MLX5_CAP_GEN(dev, max_num_of_monitor_counters))
531532 async_event_mask |= (1ull << MLX5_EVENT_TYPE_MONITOR_COUNTER);
532533
534+ if (mlx5_core_is_ecpf_esw_manager(dev))
535+ async_event_mask |= (1ull << MLX5_EVENT_TYPE_HOST_PARAMS_CHANGE);
536+
533537 return async_event_mask;
534538 }
535539
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c+20−22
@@ -40,8 +40,6 @@ · 39 unmodified lines
4040 #include "eswitch.h"
4141 #include "fs_core.h"
4242
43−#define UPLINK_VPORT 0xFFFF
44−
4543 enum {
4644 MLX5_ACTION_NONE = 0,
4745 MLX5_ACTION_ADD = 1,
@@ -52,7 +50,7 @@ enum { · 4 unmodified lines
5250 struct vport_addr {
5351 struct l2addr_node node;
5452 u8 action;
55− u32 vport;
53+ u16 vport;
5654 struct mlx5_flow_handle *flow_rule;
5755 bool mpfs; /* UC MAC was added to MPFs */
5856 /* A flag indicating that mac was added due to mc promiscuous vport */
@@ -115,7 +113,7 @@ static int modify_esw_vport_context_cmd(struct mlx5_core_dev *dev, u16 vport, · 56 unmodified lines
115113 return mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
116114 }
117115
118−static int modify_esw_vport_cvlan(struct mlx5_core_dev *dev, u32 vport,
116+static int modify_esw_vport_cvlan(struct mlx5_core_dev *dev, u16 vport,
119117 u16 vlan, u8 qos, u8 set_flags)
120118 {
121119 u32 in[MLX5_ST_SZ_DW(modify_esw_vport_context_in)] = {0};
@@ -152,7 +150,7 @@ static int modify_esw_vport_cvlan(struct mlx5_core_dev *dev, u32 vport, · 30 unmodified lines
152150
153151 /* E-Switch FDB */
154152 static struct mlx5_flow_handle *
155−__esw_fdb_set_vport_rule(struct mlx5_eswitch *esw, u32 vport, bool rx_rule,
153+__esw_fdb_set_vport_rule(struct mlx5_eswitch *esw, u16 vport, bool rx_rule,
156154 u8 mac_c[ETH_ALEN], u8 mac_v[ETH_ALEN])
157155 {
158156 int match_header = (is_zero_ether_addr(mac_c) ? 0 :
@@ -188,7 +186,7 @@ __esw_fdb_set_vport_rule(struct mlx5_eswitch *esw, u32 vport, bool rx_rule, · 29 unmodified lines
188186 misc_parameters);
189187 mc_misc = MLX5_ADDR_OF(fte_match_param, spec->match_criteria,
190188 misc_parameters);
191− MLX5_SET(fte_match_set_misc, mv_misc, source_port, UPLINK_VPORT);
189+ MLX5_SET(fte_match_set_misc, mv_misc, source_port, MLX5_VPORT_UPLINK);
192190 MLX5_SET_TO_ONES(fte_match_set_misc, mc_misc, source_port);
193191 }
194192
@@ -215,7 +213,7 @@ __esw_fdb_set_vport_rule(struct mlx5_eswitch *esw, u32 vport, bool rx_rule, · 20 unmodified lines
215213 }
216214
217215 static struct mlx5_flow_handle *
218−esw_fdb_set_vport_rule(struct mlx5_eswitch *esw, u8 mac[ETH_ALEN], u32 vport)
216+esw_fdb_set_vport_rule(struct mlx5_eswitch *esw, u8 mac[ETH_ALEN], u16 vport)
219217 {
220218 u8 mac_c[ETH_ALEN];
221219
@@ -224,7 +222,7 @@ esw_fdb_set_vport_rule(struct mlx5_eswitch *esw, u8 mac[ETH_ALEN], u32 vport) · 2 unmodified lines
224222 }
225223
226224 static struct mlx5_flow_handle *
227−esw_fdb_set_vport_allmulti_rule(struct mlx5_eswitch *esw, u32 vport)
225+esw_fdb_set_vport_allmulti_rule(struct mlx5_eswitch *esw, u16 vport)
228226 {
229227 u8 mac_c[ETH_ALEN];
230228 u8 mac_v[ETH_ALEN];
@@ -237,7 +235,7 @@ esw_fdb_set_vport_allmulti_rule(struct mlx5_eswitch *esw, u32 vport) · 6 unmodified lines
237235 }
238236
239237 static struct mlx5_flow_handle *
240−esw_fdb_set_vport_promisc_rule(struct mlx5_eswitch *esw, u32 vport)
238+esw_fdb_set_vport_promisc_rule(struct mlx5_eswitch *esw, u16 vport)
241239 {
242240 u8 mac_c[ETH_ALEN];
243241 u8 mac_v[ETH_ALEN];
@@ -377,7 +375,7 @@ typedef int (*vport_addr_action)(struct mlx5_eswitch *esw, · 133 unmodified lines
377375 static int esw_add_uc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr)
378376 {
379377 u8 *mac = vaddr->node.addr;
380− u32 vport = vaddr->vport;
378+ u16 vport = vaddr->vport;
381379 int err;
382380
383381 /* Skip mlx5_mpfs_add_mac for PFs,
@@ -409,7 +407,7 @@ fdb_add: · 25 unmodified lines
409407 static int esw_del_uc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr)
410408 {
411409 u8 *mac = vaddr->node.addr;
412− u32 vport = vaddr->vport;
410+ u16 vport = vaddr->vport;
413411 int err = 0;
414412
415413 /* Skip mlx5_mpfs_del_mac for PFs,
@@ -438,7 +436,7 @@ static void update_allmulti_vports(struct mlx5_eswitch *esw, · 22 unmodified lines
438436 struct esw_mc_addr *esw_mc)
439437 {
440438 u8 *mac = vaddr->node.addr;
441− u32 vport_idx = 0;
439+ u16 vport_idx = 0;
442440
443441 for (vport_idx = 0; vport_idx < esw->total_vports; vport_idx++) {
444442 struct mlx5_vport *vport = &esw->vports[vport_idx];
@@ -485,7 +483,7 @@ static int esw_add_mc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr) · 40 unmodified lines
485483 struct hlist_head *hash = esw->mc_table;
486484 struct esw_mc_addr *esw_mc;
487485 u8 *mac = vaddr->node.addr;
488− u32 vport = vaddr->vport;
486+ u16 vport = vaddr->vport;
489487
490488 if (!esw->fdb_table.legacy.fdb)
491489 return 0;
@@ -499,7 +497,7 @@ static int esw_add_mc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr) · 7 unmodified lines
499497 return -ENOMEM;
500498
501499 esw_mc->uplink_rule = /* Forward MC MAC to Uplink */
502− esw_fdb_set_vport_rule(esw, mac, UPLINK_VPORT);
500+ esw_fdb_set_vport_rule(esw, mac, MLX5_VPORT_UPLINK);
503501
504502 /* Add this multicast mac to all the mc promiscuous vports */
505503 update_allmulti_vports(esw, vaddr, esw_mc);
@@ -525,7 +523,7 @@ static int esw_del_mc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr) · 19 unmodified lines
525523 struct hlist_head *hash = esw->mc_table;
526524 struct esw_mc_addr *esw_mc;
527525 u8 *mac = vaddr->node.addr;
528− u32 vport = vaddr->vport;
526+ u16 vport = vaddr->vport;
529527
530528 if (!esw->fdb_table.legacy.fdb)
531529 return 0;
@@ -564,7 +562,7 @@ static int esw_del_mc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr) · 32 unmodified lines
564562
565563 /* Apply vport UC/MC list to HW l2 table and FDB table */
566564 static void esw_apply_vport_addr_list(struct mlx5_eswitch *esw,
567− u32 vport_num, int list_type)
565+ u16 vport_num, int list_type)
568566 {
569567 struct mlx5_vport *vport = &esw->vports[vport_num];
570568 bool is_uc = list_type == MLX5_NVPRT_LIST_TYPE_UC;
@@ -599,7 +597,7 @@ static void esw_apply_vport_addr_list(struct mlx5_eswitch *esw, · 28 unmodified lines
599597
600598 /* Sync vport UC/MC list from vport context */
601599 static void esw_update_vport_addr_list(struct mlx5_eswitch *esw,
602− u32 vport_num, int list_type)
600+ u16 vport_num, int list_type)
603601 {
604602 struct mlx5_vport *vport = &esw->vports[vport_num];
605603 bool is_uc = list_type == MLX5_NVPRT_LIST_TYPE_UC;
@@ -686,7 +684,7 @@ out: · 80 unmodified lines
686684 /* Sync vport UC/MC list from vport context
687685 * Must be called after esw_update_vport_addr_list
688686 */
689−static void esw_update_vport_mc_promisc(struct mlx5_eswitch *esw, u32 vport_num)
687+static void esw_update_vport_mc_promisc(struct mlx5_eswitch *esw, u16 vport_num)
690688 {
691689 struct mlx5_vport *vport = &esw->vports[vport_num];
692690 struct l2addr_node *node;
@@ -721,7 +719,7 @@ static void esw_update_vport_mc_promisc(struct mlx5_eswitch *esw, u32 vport_num) · 28 unmodified lines
721719 }
722720
723721 /* Apply vport rx mode to HW FDB table */
724−static void esw_apply_vport_rx_mode(struct mlx5_eswitch *esw, u32 vport_num,
722+static void esw_apply_vport_rx_mode(struct mlx5_eswitch *esw, u16 vport_num,
725723 bool promisc, bool mc_promisc)
726724 {
727725 struct esw_mc_addr *allmulti_addr = &esw->mc_promisc;
@@ -736,7 +734,7 @@ static void esw_apply_vport_rx_mode(struct mlx5_eswitch *esw, u32 vport_num, · 8 unmodified lines
736734 if (!allmulti_addr->uplink_rule)
737735 allmulti_addr->uplink_rule =
738736 esw_fdb_set_vport_allmulti_rule(esw,
739− UPLINK_VPORT);
737+ MLX5_VPORT_UPLINK);
740738 allmulti_addr->refcnt++;
741739 } else if (vport->allmulti_rule) {
742740 mlx5_del_flow_rules(vport->allmulti_rule);
@@ -764,7 +762,7 @@ promisc: · 21 unmodified lines
764762 }
765763
766764 /* Sync vport rx mode from vport context */
767−static void esw_update_vport_rx_mode(struct mlx5_eswitch *esw, u32 vport_num)
765+static void esw_update_vport_rx_mode(struct mlx5_eswitch *esw, u16 vport_num)
768766 {
769767 struct mlx5_vport *vport = &esw->vports[vport_num];
770768 int promisc_all = 0;
@@ -1633,7 +1631,7 @@ int mlx5_eswitch_enable_sriov(struct mlx5_eswitch *esw, int nvfs, int mode) · 862 unmodified lines
16331631 } else {
16341632 mlx5_reload_interface(esw->dev, MLX5_INTERFACE_PROTOCOL_ETH);
16351633 mlx5_reload_interface(esw->dev, MLX5_INTERFACE_PROTOCOL_IB);
1636− err = esw_offloads_init(esw, nvfs + 1);
1634+ err = esw_offloads_init(esw, nvfs + MLX5_SPECIAL_VPORTS);
16371635 }
16381636
16391637 if (err)
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h+0−2
@@ -49,8 +49,6 @@ · 48 unmodified lines
4949 #define MLX5_MAX_MC_PER_VPORT(dev) \
5050 (1 << MLX5_CAP_GEN(dev, log_max_current_mc_list))
5151
52−#define FDB_UPLINK_VPORT 0xffff
53−
5452 #define MLX5_MIN_BW_SHARE 1
5553
5654 #define MLX5_RATE_TO_BW_SHARE(rate, divider, limit) \
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+22−17
@@ -46,6 +46,11 @@ enum { · 45 unmodified lines
4646 FDB_SLOW_PATH
4747 };
4848
49+/* There are two match-all miss flows, one for unicast dst mac and
50+ * one for multicast.
51+ */
52+#define MLX5_ESW_MISS_FLOWS (2)
53+
4954 #define fdb_prio_table(esw, chain, prio, level) \
5055 (esw)->fdb_table.offloads.fdb_prio[(chain)][(prio)][(level)]
5156
@@ -360,15 +365,15 @@ static int esw_add_vlan_action_check(struct mlx5_esw_flow_attr *attr, · 308 unmodified lines
360365 in_rep = attr->in_rep;
361366 out_rep = attr->dests[0].rep;
362367
363− if (push && in_rep->vport == FDB_UPLINK_VPORT)
368+ if (push && in_rep->vport == MLX5_VPORT_UPLINK)
364369 goto out_notsupp;
365370
366− if (pop && out_rep->vport == FDB_UPLINK_VPORT)
371+ if (pop && out_rep->vport == MLX5_VPORT_UPLINK)
367372 goto out_notsupp;
368373
369374 /* vport has vlan push configured, can't offload VF --> wire rules w.o it */
370375 if (!push && !pop && fwd)
371− if (in_rep->vlan && out_rep->vport == FDB_UPLINK_VPORT)
376+ if (in_rep->vlan && out_rep->vport == MLX5_VPORT_UPLINK)
372377 goto out_notsupp;
373378
374379 /* protects against (1) setting rules with different vlans to push and
@@ -410,7 +415,7 @@ int mlx5_eswitch_add_vlan_action(struct mlx5_eswitch *esw, · 35 unmodified lines
410415
411416 if (!push && !pop && fwd) {
412417 /* tracks VF --> wire rules without vlan push action */
413− if (attr->dests[0].rep->vport == FDB_UPLINK_VPORT) {
418+ if (attr->dests[0].rep->vport == MLX5_VPORT_UPLINK) {
414419 vport->vlan_refcount++;
415420 attr->vlan_handled = true;
416421 }
@@ -470,7 +475,7 @@ int mlx5_eswitch_del_vlan_action(struct mlx5_eswitch *esw, · 53 unmodified lines
470475
471476 if (!push && !pop && fwd) {
472477 /* tracks VF --> wire rules without vlan push action */
473− if (attr->dests[0].rep->vport == FDB_UPLINK_VPORT)
478+ if (attr->dests[0].rep->vport == MLX5_VPORT_UPLINK)
474479 vport->vlan_refcount--;
475480
476481 return 0;
@@ -905,8 +910,8 @@ static int esw_create_offloads_fdb_tables(struct mlx5_eswitch *esw, int nvports) · 428 unmodified lines
905910 esw->fdb_table.offloads.fdb_left[i] =
906911 ESW_POOLS[i] <= fdb_max ? ESW_SIZE / ESW_POOLS[i] : 0;
907912
908− table_size = nvports * MAX_SQ_NVPORTS + MAX_PF_SQ + 2 +
909− esw->total_vports;
913+ table_size = nvports * MAX_SQ_NVPORTS + MAX_PF_SQ +
914+ MLX5_ESW_MISS_FLOWS + esw->total_vports;
910915
911916 /* create the slow path fdb with encap set, so further table instances
912917 * can be created at run time while VFs are probed if the FW allows that.
@@ -1000,7 +1005,8 @@ static int esw_create_offloads_fdb_tables(struct mlx5_eswitch *esw, int nvports) · 87 unmodified lines
10001005 dmac[0] = 0x01;
10011006
10021007 MLX5_SET(create_flow_group_in, flow_group_in, start_flow_index, ix);
1003− MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, ix + 2);
1008+ MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index,
1009+ ix + MLX5_ESW_MISS_FLOWS);
10041010
10051011 g = mlx5_create_flow_group(fdb, flow_group_in);
10061012 if (IS_ERR(g)) {
@@ -1049,7 +1055,7 @@ static void esw_destroy_offloads_fdb_tables(struct mlx5_eswitch *esw) · 42 unmodified lines
10491055 esw_destroy_offloads_fast_fdb_tables(esw);
10501056 }
10511057
1052−static int esw_create_offloads_table(struct mlx5_eswitch *esw)
1058+static int esw_create_offloads_table(struct mlx5_eswitch *esw, int nvports)
10531059 {
10541060 struct mlx5_flow_table_attr ft_attr = {};
10551061 struct mlx5_core_dev *dev = esw->dev;
@@ -1063,7 +1069,7 @@ static int esw_create_offloads_table(struct mlx5_eswitch *esw) · 7 unmodified lines
10631069 return -EOPNOTSUPP;
10641070 }
10651071
1066− ft_attr.max_fte = dev->priv.sriov.num_vfs + 2;
1072+ ft_attr.max_fte = nvports + MLX5_ESW_MISS_FLOWS;
10671073
10681074 ft_offloads = mlx5_create_flow_table(ns, &ft_attr);
10691075 if (IS_ERR(ft_offloads)) {
@@ -1083,16 +1089,15 @@ static void esw_destroy_offloads_table(struct mlx5_eswitch *esw) · 13 unmodified lines
10831089 mlx5_destroy_flow_table(offloads->ft_offloads);
10841090 }
10851091
1086−static int esw_create_vport_rx_group(struct mlx5_eswitch *esw)
1092+static int esw_create_vport_rx_group(struct mlx5_eswitch *esw, int nvports)
10871093 {
10881094 int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in);
10891095 struct mlx5_flow_group *g;
1090− struct mlx5_priv *priv = &esw->dev->priv;
10911096 u32 *flow_group_in;
10921097 void *match_criteria, *misc;
10931098 int err = 0;
1094− int nvports = priv->sriov.num_vfs + 2;
10951099
1100+ nvports = nvports + MLX5_ESW_MISS_FLOWS;
10961101 flow_group_in = kvzalloc(inlen, GFP_KERNEL);
10971102 if (!flow_group_in)
10981103 return -ENOMEM;
@@ -1228,7 +1233,7 @@ int esw_offloads_init_reps(struct mlx5_eswitch *esw) · 129 unmodified lines
12281233 ether_addr_copy(rep->hw_id, hw_id);
12291234 }
12301235
1231− offloads->vport_reps[0].vport = FDB_UPLINK_VPORT;
1236+ offloads->vport_reps[0].vport = MLX5_VPORT_UPLINK;
12321237
12331238 return 0;
12341239 }
@@ -1408,11 +1413,11 @@ int esw_offloads_init(struct mlx5_eswitch *esw, int nvports) · 173 unmodified lines
14081413 if (err)
14091414 return err;
14101415
1411− err = esw_create_offloads_table(esw);
1416+ err = esw_create_offloads_table(esw, nvports);
14121417 if (err)
14131418 goto create_ft_err;
14141419
1415− err = esw_create_vport_rx_group(esw);
1420+ err = esw_create_vport_rx_group(esw, nvports);
14161421 if (err)
14171422 goto create_fg_err;
14181423
@@ -1812,7 +1817,7 @@ void *mlx5_eswitch_get_proto_dev(struct mlx5_eswitch *esw, · 393 unmodified lines
18121817 struct mlx5_esw_offload *offloads = &esw->offloads;
18131818 struct mlx5_eswitch_rep *rep;
18141819
1815− if (vport == FDB_UPLINK_VPORT)
1820+ if (vport == MLX5_VPORT_UPLINK)
18161821 vport = UPLINK_REP_INDEX;
18171822
18181823 rep = &offloads->vport_reps[vport];
drivers/net/ethernet/mellanox/mlx5/core/events.c+2−0
@@ -103,6 +103,8 @@ static const char *eqe_type_str(u8 type) · 102 unmodified lines
103103 return "MLX5_EVENT_TYPE_STALL_EVENT";
104104 case MLX5_EVENT_TYPE_CMD:
105105 return "MLX5_EVENT_TYPE_CMD";
106+ case MLX5_EVENT_TYPE_HOST_PARAMS_CHANGE:
107+ return "MLX5_EVENT_TYPE_HOST_PARAMS_CHANGE";
106108 case MLX5_EVENT_TYPE_PAGE_REQUEST:
107109 return "MLX5_EVENT_TYPE_PAGE_REQUEST";
108110 case MLX5_EVENT_TYPE_PAGE_FAULT:
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+1−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232
3333 #include <linux/mutex.h>
3434 #include <linux/mlx5/driver.h>
35+#include <linux/mlx5/vport.h>
3536 #include <linux/mlx5/eswitch.h>
3637
3738 #include "mlx5_core.h"
drivers/net/ethernet/mellanox/mlx5/core/mad.c+0−75
@@ -1,75 +0,0 @@
1−/*
2− * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved.
3− *
4− * This software is available to you under a choice of one of two
5− * licenses. You may choose to be licensed under the terms of the GNU
6− * General Public License (GPL) Version 2, available from the file
7− * COPYING in the main directory of this source tree, or the
8− * OpenIB.org BSD license below:
9− *
10− * Redistribution and use in source and binary forms, with or
11− * without modification, are permitted provided that the following
12− * conditions are met:
13− *
14− * - Redistributions of source code must retain the above
15− * copyright notice, this list of conditions and the following
16− * disclaimer.
17− *
18− * - Redistributions in binary form must reproduce the above
19− * copyright notice, this list of conditions and the following
20− * disclaimer in the documentation and/or other materials
21− * provided with the distribution.
22− *
23− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24− * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25− * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26− * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27− * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28− * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29− * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30− * SOFTWARE.
31− */
32−
33−#include <linux/kernel.h>
34−#include <linux/module.h>
35−#include <linux/mlx5/driver.h>
36−#include <linux/mlx5/cmd.h>
37−#include "mlx5_core.h"
38−
39−int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, const void *inb, void *outb,
40− u16 opmod, u8 port)
41−{
42− int outlen = MLX5_ST_SZ_BYTES(mad_ifc_out);
43− int inlen = MLX5_ST_SZ_BYTES(mad_ifc_in);
44− int err = -ENOMEM;
45− void *data;
46− void *resp;
47− u32 *out;
48− u32 *in;
49−
50− in = kzalloc(inlen, GFP_KERNEL);
51− out = kzalloc(outlen, GFP_KERNEL);
52− if (!in || !out)
53− goto out;
54−
55− MLX5_SET(mad_ifc_in, in, opcode, MLX5_CMD_OP_MAD_IFC);
56− MLX5_SET(mad_ifc_in, in, op_mod, opmod);
57− MLX5_SET(mad_ifc_in, in, port, port);
58−
59− data = MLX5_ADDR_OF(mad_ifc_in, in, mad);
60− memcpy(data, inb, MLX5_FLD_SZ_BYTES(mad_ifc_in, mad));
61−
62− err = mlx5_cmd_exec(dev, in, inlen, out, outlen);
63− if (err)
64− goto out;
65−
66− resp = MLX5_ADDR_OF(mad_ifc_out, out, response_mad_packet);
67− memcpy(outb, resp,
68− MLX5_FLD_SZ_BYTES(mad_ifc_out, response_mad_packet));
69−
70−out:
71− kfree(out);
72− kfree(in);
73− return err;
74−}
75−EXPORT_SYMBOL_GPL(mlx5_core_mad_ifc);
drivers/net/ethernet/mellanox/mlx5/core/main.c+71−0
@@ -65,6 +65,7 @@ · 64 unmodified lines
6565 #include "lib/vxlan.h"
6666 #include "lib/devcom.h"
6767 #include "diag/fw_tracer.h"
68+#include "ecpf.h"
6869
6970 MODULE_AUTHOR("Eli Cohen <eli@mellanox.com>");
7071 MODULE_DESCRIPTION("Mellanox 5th generation network adapters (ConnectX series) core driver");
@@ -459,6 +460,50 @@ static int handle_hca_cap_atomic(struct mlx5_core_dev *dev) · 388 unmodified lines
459460 return err;
460461 }
461462
463+static int handle_hca_cap_odp(struct mlx5_core_dev *dev)
464+{
465+ void *set_hca_cap;
466+ void *set_ctx;
467+ int set_sz;
468+ int err;
469+
470+ if (!MLX5_CAP_GEN(dev, pg))
471+ return 0;
472+
473+ err = mlx5_core_get_caps(dev, MLX5_CAP_ODP);
474+ if (err)
475+ return err;
476+
477+ if (!(MLX5_CAP_ODP_MAX(dev, ud_odp_caps.srq_receive) ||
478+ MLX5_CAP_ODP_MAX(dev, rc_odp_caps.srq_receive) ||
479+ MLX5_CAP_ODP_MAX(dev, xrc_odp_caps.srq_receive)))
480+ return 0;
481+
482+ set_sz = MLX5_ST_SZ_BYTES(set_hca_cap_in);
483+ set_ctx = kzalloc(set_sz, GFP_KERNEL);
484+ if (!set_ctx)
485+ return -ENOMEM;
486+
487+ set_hca_cap = MLX5_ADDR_OF(set_hca_cap_in, set_ctx, capability);
488+ memcpy(set_hca_cap, dev->caps.hca_cur[MLX5_CAP_ODP],
489+ MLX5_ST_SZ_BYTES(odp_cap));
490+
491+ /* set ODP SRQ support for RC/UD and XRC transports */
492+ MLX5_SET(odp_cap, set_hca_cap, ud_odp_caps.srq_receive,
493+ MLX5_CAP_ODP_MAX(dev, ud_odp_caps.srq_receive));
494+
495+ MLX5_SET(odp_cap, set_hca_cap, rc_odp_caps.srq_receive,
496+ MLX5_CAP_ODP_MAX(dev, rc_odp_caps.srq_receive));
497+
498+ MLX5_SET(odp_cap, set_hca_cap, xrc_odp_caps.srq_receive,
499+ MLX5_CAP_ODP_MAX(dev, xrc_odp_caps.srq_receive));
500+
501+ err = set_caps(dev, set_ctx, set_sz, MLX5_SET_HCA_CAP_OP_MOD_ODP);
502+
503+ kfree(set_ctx);
504+ return err;
505+}
506+
462507 static int handle_hca_cap(struct mlx5_core_dev *dev)
463508 {
464509 void *set_ctx = NULL;
@@ -567,6 +612,8 @@ int mlx5_core_enable_hca(struct mlx5_core_dev *dev, u16 func_id) · 102 unmodified lines
567612
568613 MLX5_SET(enable_hca_in, in, opcode, MLX5_CMD_OP_ENABLE_HCA);
569614 MLX5_SET(enable_hca_in, in, function_id, func_id);
615+ MLX5_SET(enable_hca_in, in, embedded_cpu_function,
616+ dev->caps.embedded_cpu);
570617 return mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out));
571618 }
572619
@@ -577,6 +624,8 @@ int mlx5_core_disable_hca(struct mlx5_core_dev *dev, u16 func_id) · 4 unmodified lines
577624
578625 MLX5_SET(disable_hca_in, in, opcode, MLX5_CMD_OP_DISABLE_HCA);
579626 MLX5_SET(disable_hca_in, in, function_id, func_id);
627+ MLX5_SET(enable_hca_in, in, embedded_cpu_function,
628+ dev->caps.embedded_cpu);
580629 return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
581630 }
582631
@@ -693,6 +742,11 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, struct mlx5_priv *priv) · 110 unmodified lines
693742 goto err_clr_master;
694743 }
695744
745+ if (pci_enable_atomic_ops_to_root(pdev, PCI_EXP_DEVCAP2_ATOMIC_COMP32) &&
746+ pci_enable_atomic_ops_to_root(pdev, PCI_EXP_DEVCAP2_ATOMIC_COMP64) &&
747+ pci_enable_atomic_ops_to_root(pdev, PCI_EXP_DEVCAP2_ATOMIC_COMP128))
748+ mlx5_core_dbg(dev, "Enabling pci atomics failed\n");
749+
696750 dev->iseg_base = pci_resource_start(dev->pdev, 0);
697751 dev->iseg = ioremap(dev->iseg_base, sizeof(*dev->iseg));
698752 if (!dev->iseg) {
@@ -849,6 +903,7 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv, · 150 unmodified lines
849903 struct pci_dev *pdev = dev->pdev;
850904 int err;
851905
906+ dev->caps.embedded_cpu = mlx5_read_embedded_cpu(dev);
852907 mutex_lock(&dev->intf_state_mutex);
853908 if (test_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state)) {
854909 dev_warn(&dev->pdev->dev, "%s: interface is up, NOP\n",
@@ -926,6 +981,12 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv, · 71 unmodified lines
926981 goto reclaim_boot_pages;
927982 }
928983
984+ err = handle_hca_cap_odp(dev);
985+ if (err) {
986+ dev_err(&pdev->dev, "handle_hca_cap_odp failed\n");
987+ goto reclaim_boot_pages;
988+ }
989+
929990 err = mlx5_satisfy_startup_pages(dev, 0);
930991 if (err) {
931992 dev_err(&pdev->dev, "failed to allocate init pages\n");
@@ -1014,6 +1075,12 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv, · 82 unmodified lines
10141075 goto err_sriov;
10151076 }
10161077
1078+ err = mlx5_ec_init(dev);
1079+ if (err) {
1080+ dev_err(&pdev->dev, "Failed to init embedded CPU\n");
1081+ goto err_ec;
1082+ }
1083+
10171084 if (mlx5_device_registered(dev)) {
10181085 mlx5_attach_device(dev);
10191086 } else {
@@ -1031,6 +1098,9 @@ out: · 11 unmodified lines
10311098 return 0;
10321099
10331100 err_reg_dev:
1101+ mlx5_ec_cleanup(dev);
1102+
1103+err_ec:
10341104 mlx5_sriov_detach(dev);
10351105
10361106 err_sriov:
@@ -1105,6 +1175,7 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv, · 68 unmodified lines
11051175 if (mlx5_device_registered(dev))
11061176 mlx5_detach_device(dev);
11071177
1178+ mlx5_ec_cleanup(dev);
11081179 mlx5_sriov_detach(dev);
11091180 mlx5_cleanup_fs(dev);
11101181 mlx5_accel_ipsec_cleanup(dev);
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h+1−1
@@ -121,7 +121,7 @@ int mlx5_modify_scheduling_element_cmd(struct mlx5_core_dev *dev, u8 hierarchy, · 120 unmodified lines
121121 u32 modify_bitmask);
122122 int mlx5_destroy_scheduling_element_cmd(struct mlx5_core_dev *dev, u8 hierarchy,
123123 u32 element_id);
124−int mlx5_wait_for_vf_pages(struct mlx5_core_dev *dev);
124+int mlx5_wait_for_pages(struct mlx5_core_dev *dev, int *pages);
125125 u64 mlx5_read_internal_timer(struct mlx5_core_dev *dev,
126126 struct ptp_system_timestamp *sts);
127127
drivers/net/ethernet/mellanox/mlx5/core/mr.c+6−5
@@ -51,9 +51,10 @@ void mlx5_cleanup_mkey_table(struct mlx5_core_dev *dev) · 50 unmodified lines
5151
5252 int mlx5_core_create_mkey_cb(struct mlx5_core_dev *dev,
5353 struct mlx5_core_mkey *mkey,
54− u32 *in, int inlen,
55− u32 *out, int outlen,
56− mlx5_cmd_cbk_t callback, void *context)
54+ struct mlx5_async_ctx *async_ctx, u32 *in,
55+ int inlen, u32 *out, int outlen,
56+ mlx5_async_cbk_t callback,
57+ struct mlx5_async_work *context)
5758 {
5859 struct mlx5_mkey_table *table = &dev->priv.mkey_table;
5960 u32 lout[MLX5_ST_SZ_DW(create_mkey_out)] = {0};
@@ -71,7 +72,7 @@ int mlx5_core_create_mkey_cb(struct mlx5_core_dev *dev, · 11 unmodified lines
7172 MLX5_SET(mkc, mkc, mkey_7_0, key);
7273
7374 if (callback)
74− return mlx5_cmd_exec_cb(dev, in, inlen, out, outlen,
75+ return mlx5_cmd_exec_cb(async_ctx, in, inlen, out, outlen,
7576 callback, context);
7677
7778 err = mlx5_cmd_exec(dev, in, inlen, lout, sizeof(lout));
@@ -105,7 +106,7 @@ int mlx5_core_create_mkey(struct mlx5_core_dev *dev, · 27 unmodified lines
105106 struct mlx5_core_mkey *mkey,
106107 u32 *in, int inlen)
107108 {
108− return mlx5_core_create_mkey_cb(dev, mkey, in, inlen,
109+ return mlx5_core_create_mkey_cb(dev, mkey, NULL, in, inlen,
109110 NULL, 0, NULL, NULL);
110111 }
111112 EXPORT_SYMBOL(mlx5_core_create_mkey);
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c+38−16
@@ -48,6 +48,7 @@ enum { · 47 unmodified lines
4848 struct mlx5_pages_req {
4949 struct mlx5_core_dev *dev;
5050 u16 func_id;
51+ u8 ec_function;
5152 s32 npages;
5253 struct work_struct work;
5354 };
@@ -143,6 +144,7 @@ static int mlx5_cmd_query_pages(struct mlx5_core_dev *dev, u16 *func_id, · 89 unmodified lines
143144 MLX5_SET(query_pages_in, in, op_mod, boot ?
144145 MLX5_QUERY_PAGES_IN_OP_MOD_BOOT_PAGES :
145146 MLX5_QUERY_PAGES_IN_OP_MOD_INIT_PAGES);
147+ MLX5_SET(query_pages_in, in, embedded_cpu_function, mlx5_core_is_ecpf(dev));
146148
147149 err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
148150 if (err)
@@ -253,7 +255,8 @@ err_mapping: · 104 unmodified lines
253255 return err;
254256 }
255257
256−static void page_notify_fail(struct mlx5_core_dev *dev, u16 func_id)
258+static void page_notify_fail(struct mlx5_core_dev *dev, u16 func_id,
259+ bool ec_function)
257260 {
258261 u32 out[MLX5_ST_SZ_DW(manage_pages_out)] = {0};
259262 u32 in[MLX5_ST_SZ_DW(manage_pages_in)] = {0};
@@ -262,6 +265,7 @@ static void page_notify_fail(struct mlx5_core_dev *dev, u16 func_id) · 2 unmodified lines
262265 MLX5_SET(manage_pages_in, in, opcode, MLX5_CMD_OP_MANAGE_PAGES);
263266 MLX5_SET(manage_pages_in, in, op_mod, MLX5_PAGES_CANT_GIVE);
264267 MLX5_SET(manage_pages_in, in, function_id, func_id);
268+ MLX5_SET(manage_pages_in, in, embedded_cpu_function, ec_function);
265269
266270 err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
267271 if (err)
@@ -270,7 +274,7 @@ static void page_notify_fail(struct mlx5_core_dev *dev, u16 func_id) · 2 unmodified lines
270274 }
271275
272276 static int give_pages(struct mlx5_core_dev *dev, u16 func_id, int npages,
273− int notify_fail)
277+ int notify_fail, bool ec_function)
274278 {
275279 u32 out[MLX5_ST_SZ_DW(manage_pages_out)] = {0};
276280 int inlen = MLX5_ST_SZ_BYTES(manage_pages_in);
@@ -305,6 +309,7 @@ retry: · 28 unmodified lines
305309 MLX5_SET(manage_pages_in, in, op_mod, MLX5_PAGES_GIVE);
306310 MLX5_SET(manage_pages_in, in, function_id, func_id);
307311 MLX5_SET(manage_pages_in, in, input_num_entries, npages);
312+ MLX5_SET(manage_pages_in, in, embedded_cpu_function, ec_function);
308313
309314 err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
310315 if (err) {
@@ -316,8 +321,11 @@ retry: · 5 unmodified lines
316321 dev->priv.fw_pages += npages;
317322 if (func_id)
318323 dev->priv.vfs_pages += npages;
324+ else if (mlx5_core_is_ecpf(dev) && !ec_function)
325+ dev->priv.peer_pf_pages += npages;
319326
320− mlx5_core_dbg(dev, "err %d\n", err);
327+ mlx5_core_dbg(dev, "npages %d, ec_function %d, func_id 0x%x, err %d\n",
328+ npages, ec_function, func_id, err);
321329
322330 kvfree(in);
323331 return 0;
@@ -328,7 +336,7 @@ out_4k: · 4 unmodified lines
328336 out_free:
329337 kvfree(in);
330338 if (notify_fail)
331− page_notify_fail(dev, func_id);
339+ page_notify_fail(dev, func_id, ec_function);
332340 return err;
333341 }
334342
@@ -364,7 +372,7 @@ static int reclaim_pages_cmd(struct mlx5_core_dev *dev, · 29 unmodified lines
364372 }
365373
366374 static int reclaim_pages(struct mlx5_core_dev *dev, u32 func_id, int npages,
367− int *nclaimed)
375+ int *nclaimed, bool ec_function)
368376 {
369377 int outlen = MLX5_ST_SZ_BYTES(manage_pages_out);
370378 u32 in[MLX5_ST_SZ_DW(manage_pages_in)] = {0};
@@ -385,6 +393,7 @@ static int reclaim_pages(struct mlx5_core_dev *dev, u32 func_id, int npages, · 14 unmodified lines
385393 MLX5_SET(manage_pages_in, in, op_mod, MLX5_PAGES_TAKE);
386394 MLX5_SET(manage_pages_in, in, function_id, func_id);
387395 MLX5_SET(manage_pages_in, in, input_num_entries, npages);
396+ MLX5_SET(manage_pages_in, in, embedded_cpu_function, ec_function);
388397
389398 mlx5_core_dbg(dev, "npages %d, outlen %d\n", npages, outlen);
390399 err = reclaim_pages_cmd(dev, in, sizeof(in), out, outlen);
@@ -410,6 +419,8 @@ static int reclaim_pages(struct mlx5_core_dev *dev, u32 func_id, int npages, · 19 unmodified lines
410419 dev->priv.fw_pages -= num_claimed;
411420 if (func_id)
412421 dev->priv.vfs_pages -= num_claimed;
422+ else if (mlx5_core_is_ecpf(dev) && !ec_function)
423+ dev->priv.peer_pf_pages -= num_claimed;
413424
414425 out_free:
415426 kvfree(out);
@@ -423,9 +434,10 @@ static void pages_work_handler(struct work_struct *work) · 7 unmodified lines
423434 int err = 0;
424435
425436 if (req->npages < 0)
426− err = reclaim_pages(dev, req->func_id, -1 * req->npages, NULL);
437+ err = reclaim_pages(dev, req->func_id, -1 * req->npages, NULL,
438+ req->ec_function);
427439 else if (req->npages > 0)
428− err = give_pages(dev, req->func_id, req->npages, 1);
440+ err = give_pages(dev, req->func_id, req->npages, 1, req->ec_function);
429441
430442 if (err)
431443 mlx5_core_warn(dev, "%s fail %d\n",
@@ -434,6 +446,10 @@ static void pages_work_handler(struct work_struct *work) · 2 unmodified lines
434446 kfree(req);
435447 }
436448
449+enum {
450+ EC_FUNCTION_MASK = 0x8000,
451+};
452+
437453 static int req_pages_handler(struct notifier_block *nb,
438454 unsigned long type, void *data)
439455 {
@@ -441,6 +457,7 @@ static int req_pages_handler(struct notifier_block *nb, · 1 unmodified line
441457 struct mlx5_core_dev *dev;
442458 struct mlx5_priv *priv;
443459 struct mlx5_eqe *eqe;
460+ bool ec_function;
444461 u16 func_id;
445462 s32 npages;
446463
@@ -450,6 +467,7 @@ static int req_pages_handler(struct notifier_block *nb, · 3 unmodified lines
450467
451468 func_id = be16_to_cpu(eqe->data.req_pages.func_id);
452469 npages = be32_to_cpu(eqe->data.req_pages.num_pages);
470+ ec_function = be16_to_cpu(eqe->data.req_pages.ec_function) & EC_FUNCTION_MASK;
453471 mlx5_core_dbg(dev, "page request for func 0x%x, npages %d\n",
454472 func_id, npages);
455473 req = kzalloc(sizeof(*req), GFP_ATOMIC);
@@ -461,6 +479,7 @@ static int req_pages_handler(struct notifier_block *nb, · 5 unmodified lines
461479 req->dev = dev;
462480 req->func_id = func_id;
463481 req->npages = npages;
482+ req->ec_function = ec_function;
464483 INIT_WORK(&req->work, pages_work_handler);
465484 queue_work(dev->priv.pg_wq, &req->work);
466485 return NOTIFY_OK;
@@ -479,7 +498,7 @@ int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot) · 12 unmodified lines
479498 mlx5_core_dbg(dev, "requested %d %s pages for func_id 0x%x\n",
480499 npages, boot ? "boot" : "init", func_id);
481500
482− return give_pages(dev, func_id, npages, 0);
501+ return give_pages(dev, func_id, npages, 0, mlx5_core_is_ecpf(dev));
483502 }
484503
485504 enum {
@@ -513,7 +532,7 @@ int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev) · 27 unmodified lines
513532 fwp = rb_entry(p, struct fw_page, rb_node);
514533 err = reclaim_pages(dev, fwp->func_id,
515534 optimal_reclaimed_pages(),
516− &nclaimed);
535+ &nclaimed, mlx5_core_is_ecpf(dev));
517536
518537 if (err) {
519538 mlx5_core_warn(dev, "failed reclaiming pages (%d)\n",
@@ -535,6 +554,9 @@ int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev) · 15 unmodified lines
535554 WARN(dev->priv.vfs_pages,
536555 "VFs FW pages counter is %d after reclaiming all pages\n",
537556 dev->priv.vfs_pages);
557+ WARN(dev->priv.peer_pf_pages,
558+ "Peer PF FW pages counter is %d after reclaiming all pages\n",
559+ dev->priv.peer_pf_pages);
538560
539561 return 0;
540562 }
@@ -567,10 +589,10 @@ void mlx5_pagealloc_stop(struct mlx5_core_dev *dev) · 26 unmodified lines
567589 flush_workqueue(dev->priv.pg_wq);
568590 }
569591
570−int mlx5_wait_for_vf_pages(struct mlx5_core_dev *dev)
592+int mlx5_wait_for_pages(struct mlx5_core_dev *dev, int *pages)
571593 {
572594 unsigned long end = jiffies + msecs_to_jiffies(MAX_RECLAIM_VFS_PAGES_TIME_MSECS);
573− int prev_vfs_pages = dev->priv.vfs_pages;
595+ int prev_pages = *pages;
574596
575597 /* In case of internal error we will free the pages manually later */
576598 if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) {
@@ -578,16 +600,16 @@ int mlx5_wait_for_vf_pages(struct mlx5_core_dev *dev) · 1 unmodified line
578600 return 0;
579601 }
580602
581− mlx5_core_dbg(dev, "Waiting for %d pages from %s\n", prev_vfs_pages,
603+ mlx5_core_dbg(dev, "Waiting for %d pages from %s\n", prev_pages,
582604 dev->priv.name);
583− while (dev->priv.vfs_pages) {
605+ while (*pages) {
584606 if (time_after(jiffies, end)) {
585− mlx5_core_warn(dev, "aborting while there are %d pending pages\n", dev->priv.vfs_pages);
607+ mlx5_core_warn(dev, "aborting while there are %d pending pages\n", *pages);
586608 return -ETIMEDOUT;
587609 }
588− if (dev->priv.vfs_pages < prev_vfs_pages) {
610+ if (*pages < prev_pages) {
589611 end = jiffies + msecs_to_jiffies(MAX_RECLAIM_VFS_PAGES_TIME_MSECS);
590− prev_vfs_pages = dev->priv.vfs_pages;
612+ prev_pages = *pages;
591613 }
592614 msleep(50);
593615 }
drivers/net/ethernet/mellanox/mlx5/core/port.c+0−106
@@ -30,10 +30,7 @@ · 29 unmodified lines
3030 * SOFTWARE.
3131 */
3232
33−#include <linux/module.h>
34−#include <linux/mlx5/driver.h>
3533 #include <linux/mlx5/port.h>
36−#include <linux/mlx5/cmd.h>
3734 #include "mlx5_core.h"
3835
3936 int mlx5_core_access_reg(struct mlx5_core_dev *dev, void *data_in,
@@ -157,44 +154,6 @@ int mlx5_set_port_beacon(struct mlx5_core_dev *dev, u16 beacon_duration) · 117 unmodified lines
157154 sizeof(out), MLX5_REG_MLCR, 0, 1);
158155 }
159156
160−int mlx5_query_port_proto_cap(struct mlx5_core_dev *dev,
161− u32 *proto_cap, int proto_mask)
162−{
163− u32 out[MLX5_ST_SZ_DW(ptys_reg)];
164− int err;
165−
166− err = mlx5_query_port_ptys(dev, out, sizeof(out), proto_mask, 1);
167− if (err)
168− return err;
169−
170− if (proto_mask == MLX5_PTYS_EN)
171− *proto_cap = MLX5_GET(ptys_reg, out, eth_proto_capability);
172− else
173− *proto_cap = MLX5_GET(ptys_reg, out, ib_proto_capability);
174−
175− return 0;
176−}
177−EXPORT_SYMBOL_GPL(mlx5_query_port_proto_cap);
178−
179−int mlx5_query_port_proto_admin(struct mlx5_core_dev *dev,
180− u32 *proto_admin, int proto_mask)
181−{
182− u32 out[MLX5_ST_SZ_DW(ptys_reg)];
183− int err;
184−
185− err = mlx5_query_port_ptys(dev, out, sizeof(out), proto_mask, 1);
186− if (err)
187− return err;
188−
189− if (proto_mask == MLX5_PTYS_EN)
190− *proto_admin = MLX5_GET(ptys_reg, out, eth_proto_admin);
191− else
192− *proto_admin = MLX5_GET(ptys_reg, out, ib_proto_admin);
193−
194− return 0;
195−}
196−EXPORT_SYMBOL_GPL(mlx5_query_port_proto_admin);
197−
198157 int mlx5_query_port_link_width_oper(struct mlx5_core_dev *dev,
199158 u8 *link_width_oper, u8 local_port)
200159 {
@@ -211,23 +170,6 @@ int mlx5_query_port_link_width_oper(struct mlx5_core_dev *dev, · 10 unmodified lines
211170 }
212171 EXPORT_SYMBOL_GPL(mlx5_query_port_link_width_oper);
213172
214−int mlx5_query_port_eth_proto_oper(struct mlx5_core_dev *dev,
215− u32 *proto_oper, u8 local_port)
216−{
217− u32 out[MLX5_ST_SZ_DW(ptys_reg)];
218− int err;
219−
220− err = mlx5_query_port_ptys(dev, out, sizeof(out), MLX5_PTYS_EN,
221− local_port);
222− if (err)
223− return err;
224−
225− *proto_oper = MLX5_GET(ptys_reg, out, eth_proto_oper);
226−
227− return 0;
228−}
229−EXPORT_SYMBOL(mlx5_query_port_eth_proto_oper);
230−
231173 int mlx5_query_port_ib_proto_oper(struct mlx5_core_dev *dev,
232174 u8 *proto_oper, u8 local_port)
233175 {
@@ -245,35 +187,6 @@ int mlx5_query_port_ib_proto_oper(struct mlx5_core_dev *dev, · 11 unmodified lines
245187 }
246188 EXPORT_SYMBOL(mlx5_query_port_ib_proto_oper);
247189
248−int mlx5_set_port_ptys(struct mlx5_core_dev *dev, bool an_disable,
249− u32 proto_admin, int proto_mask)
250−{
251− u32 out[MLX5_ST_SZ_DW(ptys_reg)];
252− u32 in[MLX5_ST_SZ_DW(ptys_reg)];
253− u8 an_disable_admin;
254− u8 an_disable_cap;
255− u8 an_status;
256−
257− mlx5_query_port_autoneg(dev, proto_mask, &an_status,
258− &an_disable_cap, &an_disable_admin);
259− if (!an_disable_cap && an_disable)
260− return -EPERM;
261−
262− memset(in, 0, sizeof(in));
263−
264− MLX5_SET(ptys_reg, in, local_port, 1);
265− MLX5_SET(ptys_reg, in, an_disable_admin, an_disable);
266− MLX5_SET(ptys_reg, in, proto_mask, proto_mask);
267− if (proto_mask == MLX5_PTYS_EN)
268− MLX5_SET(ptys_reg, in, eth_proto_admin, proto_admin);
269− else
270− MLX5_SET(ptys_reg, in, ib_proto_admin, proto_admin);
271−
272− return mlx5_core_access_reg(dev, in, sizeof(in), out,
273− sizeof(out), MLX5_REG_PTYS, 0, 1);
274−}
275−EXPORT_SYMBOL_GPL(mlx5_set_port_ptys);
276−
277190 /* This function should be used after setting a port register only */
278191 void mlx5_toggle_port_link(struct mlx5_core_dev *dev)
279192 {
@@ -606,25 +519,6 @@ int mlx5_query_port_pfc(struct mlx5_core_dev *dev, u8 *pfc_en_tx, u8 *pfc_en_rx) · 326 unmodified lines
606519 }
607520 EXPORT_SYMBOL_GPL(mlx5_query_port_pfc);
608521
609−void mlx5_query_port_autoneg(struct mlx5_core_dev *dev, int proto_mask,
610− u8 *an_status,
611− u8 *an_disable_cap, u8 *an_disable_admin)
612−{
613− u32 out[MLX5_ST_SZ_DW(ptys_reg)];
614−
615− *an_status = 0;
616− *an_disable_cap = 0;
617− *an_disable_admin = 0;
618−
619− if (mlx5_query_port_ptys(dev, out, sizeof(out), proto_mask, 1))
620− return;
621−
622− *an_status = MLX5_GET(ptys_reg, out, an_status);
623− *an_disable_cap = MLX5_GET(ptys_reg, out, an_disable_cap);
624− *an_disable_admin = MLX5_GET(ptys_reg, out, an_disable_admin);
625−}
626−EXPORT_SYMBOL_GPL(mlx5_query_port_autoneg);
627−
628522 int mlx5_max_tc(struct mlx5_core_dev *mdev)
629523 {
630524 u8 num_tc = MLX5_CAP_GEN(mdev, max_tc) ? : 8;
drivers/net/ethernet/mellanox/mlx5/core/sriov.c+1−1
@@ -147,7 +147,7 @@ out: · 146 unmodified lines
147147 if (MLX5_ESWITCH_MANAGER(dev))
148148 mlx5_eswitch_disable_sriov(dev->priv.eswitch);
149149
150− if (mlx5_wait_for_vf_pages(dev))
150+ if (mlx5_wait_for_pages(dev, &dev->priv.vfs_pages))
151151 mlx5_core_warn(dev, "timeout reclaiming VFs pages\n");
152152 }
153153
drivers/net/ethernet/mellanox/mlx5/core/vport.c+4−4
@@ -255,7 +255,7 @@ int mlx5_modify_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 mtu) · 254 unmodified lines
255255 EXPORT_SYMBOL_GPL(mlx5_modify_nic_vport_mtu);
256256
257257 int mlx5_query_nic_vport_mac_list(struct mlx5_core_dev *dev,
258− u32 vport,
258+ u16 vport,
259259 enum mlx5_list_type list_type,
260260 u8 addr_list[][ETH_ALEN],
261261 int *list_size)
@@ -373,7 +373,7 @@ int mlx5_modify_nic_vport_mac_list(struct mlx5_core_dev *dev, · 111 unmodified lines
373373 EXPORT_SYMBOL_GPL(mlx5_modify_nic_vport_mac_list);
374374
375375 int mlx5_query_nic_vport_vlans(struct mlx5_core_dev *dev,
376− u32 vport,
376+ u16 vport,
377377 u16 vlans[],
378378 int *size)
379379 {
@@ -526,7 +526,7 @@ int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid) · 146 unmodified lines
526526 EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_node_guid);
527527
528528 int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev,
529− u32 vport, u64 node_guid)
529+ u16 vport, u64 node_guid)
530530 {
531531 int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in);
532532 void *nic_vport_context;
@@ -827,7 +827,7 @@ int mlx5_query_hca_vport_node_guid(struct mlx5_core_dev *dev, · 294 unmodified lines
827827 EXPORT_SYMBOL_GPL(mlx5_query_hca_vport_node_guid);
828828
829829 int mlx5_query_nic_vport_promisc(struct mlx5_core_dev *mdev,
830− u32 vport,
830+ u16 vport,
831831 int *promisc_uc,
832832 int *promisc_mc,
833833 int *promisc_all)
include/linux/mlx5/device.h+7−2
@@ -67,7 +67,7 @@ · 66 unmodified lines
6767 #define MLX5_UN_SZ_BYTES(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 8)
6868 #define MLX5_UN_SZ_DW(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 32)
6969 #define MLX5_BYTE_OFF(typ, fld) (__mlx5_bit_off(typ, fld) / 8)
70−#define MLX5_ADDR_OF(typ, p, fld) ((char *)(p) + MLX5_BYTE_OFF(typ, fld))
70+#define MLX5_ADDR_OF(typ, p, fld) ((void *)((uint8_t *)(p) + MLX5_BYTE_OFF(typ, fld)))
7171
7272 /* insert a value to a struct */
7373 #define MLX5_SET(typ, p, fld, v) do { \
@@ -342,6 +342,8 @@ enum mlx5_event { · 268 unmodified lines
342342 MLX5_EVENT_TYPE_PAGE_FAULT = 0xc,
343343 MLX5_EVENT_TYPE_NIC_VPORT_CHANGE = 0xd,
344344
345+ MLX5_EVENT_TYPE_HOST_PARAMS_CHANGE = 0xe,
346+
345347 MLX5_EVENT_TYPE_DCT_DRAINED = 0x1c,
346348
347349 MLX5_EVENT_TYPE_FPGA_ERROR = 0x20,
@@ -591,7 +593,7 @@ struct mlx5_eqe_cmd { · 243 unmodified lines
591593 };
592594
593595 struct mlx5_eqe_page_req {
594− u8 rsvd0[2];
596+ __be16 ec_function;
595597 __be16 func_id;
596598 __be32 num_pages;
597599 __be32 rsvd1[5];
@@ -1201,6 +1203,9 @@ enum mlx5_qcam_feature_groups { · 603 unmodified lines
12011203 #define MLX5_CAP_ODP(mdev, cap)\
12021204 MLX5_GET(odp_cap, mdev->caps.hca_cur[MLX5_CAP_ODP], cap)
12031205
1206+#define MLX5_CAP_ODP_MAX(mdev, cap)\
1207+ MLX5_GET(odp_cap, mdev->caps.hca_max[MLX5_CAP_ODP], cap)
1208+
12041209 #define MLX5_CAP_VECTOR_CALC(mdev, cap) \
12051210 MLX5_GET(vector_calc_cap, \
12061211 mdev->caps.hca_cur[MLX5_CAP_VECTOR_CALC], cap)
include/linux/mlx5/driver.h+47−14
@@ -522,6 +522,7 @@ struct mlx5_priv { · 521 unmodified lines
522522 atomic_t reg_pages;
523523 struct list_head free_list;
524524 int vfs_pages;
525+ int peer_pf_pages;
525526
526527 struct mlx5_core_health health;
527528
@@ -652,6 +653,7 @@ struct mlx5_core_dev { · 124 unmodified lines
652653 u32 mcam[MLX5_ST_SZ_DW(mcam_reg)];
653654 u32 fpga[MLX5_ST_SZ_DW(fpga_cap)];
654655 u32 qcam[MLX5_ST_SZ_DW(qcam_reg)];
656+ u8 embedded_cpu;
655657 } caps;
656658 u64 sys_image_guid;
657659 phys_addr_t iseg_base;
@@ -850,11 +852,30 @@ void mlx5_cmd_cleanup(struct mlx5_core_dev *dev); · 192 unmodified lines
850852 void mlx5_cmd_use_events(struct mlx5_core_dev *dev);
851853 void mlx5_cmd_use_polling(struct mlx5_core_dev *dev);
852854
855+struct mlx5_async_ctx {
856+ struct mlx5_core_dev *dev;
857+ atomic_t num_inflight;
858+ struct wait_queue_head wait;
859+};
860+
861+struct mlx5_async_work;
862+
863+typedef void (*mlx5_async_cbk_t)(int status, struct mlx5_async_work *context);
864+
865+struct mlx5_async_work {
866+ struct mlx5_async_ctx *ctx;
867+ mlx5_async_cbk_t user_callback;
868+};
869+
870+void mlx5_cmd_init_async_ctx(struct mlx5_core_dev *dev,
871+ struct mlx5_async_ctx *ctx);
872+void mlx5_cmd_cleanup_async_ctx(struct mlx5_async_ctx *ctx);
873+int mlx5_cmd_exec_cb(struct mlx5_async_ctx *ctx, void *in, int in_size,
874+ void *out, int out_size, mlx5_async_cbk_t callback,
875+ struct mlx5_async_work *work);
876+
853877 int mlx5_cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out,
854878 int out_size);
855−int mlx5_cmd_exec_cb(struct mlx5_core_dev *dev, void *in, int in_size,
856− void *out, int out_size, mlx5_cmd_cbk_t callback,
857− void *context);
858879 int mlx5_cmd_exec_polling(struct mlx5_core_dev *dev, void *in, int in_size,
859880 void *out, int out_size);
860881 void mlx5_cmd_mbox_status(void *out, u8 *status, u32 *syndrome);
@@ -885,9 +906,10 @@ void mlx5_init_mkey_table(struct mlx5_core_dev *dev); · 24 unmodified lines
885906 void mlx5_cleanup_mkey_table(struct mlx5_core_dev *dev);
886907 int mlx5_core_create_mkey_cb(struct mlx5_core_dev *dev,
887908 struct mlx5_core_mkey *mkey,
888− u32 *in, int inlen,
889− u32 *out, int outlen,
890− mlx5_cmd_cbk_t callback, void *context);
909+ struct mlx5_async_ctx *async_ctx, u32 *in,
910+ int inlen, u32 *out, int outlen,
911+ mlx5_async_cbk_t callback,
912+ struct mlx5_async_work *context);
891913 int mlx5_core_create_mkey(struct mlx5_core_dev *dev,
892914 struct mlx5_core_mkey *mkey,
893915 u32 *in, int inlen);
@@ -897,14 +919,12 @@ int mlx5_core_query_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mkey *mkey, · 3 unmodified lines
897919 u32 *out, int outlen);
898920 int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 *pdn);
899921 int mlx5_core_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn);
900−int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, const void *inb, void *outb,
901− u16 opmod, u8 port);
902922 int mlx5_pagealloc_init(struct mlx5_core_dev *dev);
903923 void mlx5_pagealloc_cleanup(struct mlx5_core_dev *dev);
904924 void mlx5_pagealloc_start(struct mlx5_core_dev *dev);
905925 void mlx5_pagealloc_stop(struct mlx5_core_dev *dev);
906926 void mlx5_core_req_pages_handler(struct mlx5_core_dev *dev, u16 func_id,
907− s32 npages);
927+ s32 npages, bool ec_function);
908928 int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot);
909929 int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev);
910930 void mlx5_register_debugfs(void);
@@ -1058,11 +1078,24 @@ static inline int mlx5_core_is_pf(struct mlx5_core_dev *dev) · 147 unmodified lines
10581078 return !(dev->priv.pci_dev_data & MLX5_PCI_DEV_IS_VF);
10591079 }
10601080
1061−#define MLX5_TOTAL_VPORTS(mdev) (1 + pci_sriov_get_totalvfs((mdev)->pdev))
1062−#define MLX5_VPORT_MANAGER(mdev) \
1063− (MLX5_CAP_GEN(mdev, vport_group_manager) && \
1064− (MLX5_CAP_GEN(mdev, port_type) == MLX5_CAP_PORT_TYPE_ETH) && \
1065− mlx5_core_is_pf(mdev))
1081+static inline bool mlx5_core_is_ecpf(struct mlx5_core_dev *dev)
1082+{
1083+ return dev->caps.embedded_cpu;
1084+}
1085+
1086+static inline bool mlx5_core_is_ecpf_esw_manager(struct mlx5_core_dev *dev)
1087+{
1088+ return dev->caps.embedded_cpu && MLX5_CAP_GEN(dev, eswitch_manager);
1089+}
1090+
1091+#define MLX5_HOST_PF_MAX_VFS (127u)
1092+static inline u16 mlx5_core_max_vfs(struct mlx5_core_dev *dev)
1093+{
1094+ if (mlx5_core_is_ecpf_esw_manager(dev))
1095+ return MLX5_HOST_PF_MAX_VFS;
1096+ else
1097+ return pci_sriov_get_totalvfs(dev->pdev);
1098+}
10661099
10671100 static inline int mlx5_get_gid_table_len(u16 param)
10681101 {
include/linux/mlx5/mlx5_ifc.h+65−11
@@ -72,6 +72,7 @@ enum { · 71 unmodified lines
7272
7373 enum {
7474 MLX5_SET_HCA_CAP_OP_MOD_GENERAL_DEVICE = 0x0,
75+ MLX5_SET_HCA_CAP_OP_MOD_ODP = 0x2,
7576 MLX5_SET_HCA_CAP_OP_MOD_ATOMIC = 0x3,
7677 };
7778
@@ -141,6 +142,7 @@ enum { · 63 unmodified lines
141142 MLX5_CMD_OP_QUERY_XRQ_DC_PARAMS_ENTRY = 0x725,
142143 MLX5_CMD_OP_SET_XRQ_DC_PARAMS_ENTRY = 0x726,
143144 MLX5_CMD_OP_QUERY_XRQ_ERROR_PARAMS = 0x727,
145+ MLX5_CMD_OP_QUERY_HOST_PARAMS = 0x740,
144146 MLX5_CMD_OP_QUERY_VPORT_STATE = 0x750,
145147 MLX5_CMD_OP_MODIFY_VPORT_STATE = 0x751,
146148 MLX5_CMD_OP_QUERY_ESW_VPORT_CONTEXT = 0x752,
@@ -831,7 +833,9 @@ struct mlx5_ifc_odp_cap_bits { · 684 unmodified lines
831833
832834 struct mlx5_ifc_odp_per_transport_service_cap_bits ud_odp_caps;
833835
834− u8 reserved_at_e0[0x720];
836+ struct mlx5_ifc_odp_per_transport_service_cap_bits xrc_odp_caps;
837+
838+ u8 reserved_at_100[0x700];
835839 };
836840
837841 struct mlx5_ifc_calc_op {
@@ -4438,7 +4442,8 @@ struct mlx5_ifc_query_pages_out_bits { · 3600 unmodified lines
44384442
44394443 u8 syndrome[0x20];
44404444
4441− u8 reserved_at_40[0x10];
4445+ u8 embedded_cpu_function[0x1];
4446+ u8 reserved_at_41[0xf];
44424447 u8 function_id[0x10];
44434448
44444449 u8 num_pages[0x20];
@@ -4457,7 +4462,8 @@ struct mlx5_ifc_query_pages_in_bits { · 12 unmodified lines
44574462 u8 reserved_at_20[0x10];
44584463 u8 op_mod[0x10];
44594464
4460− u8 reserved_at_40[0x10];
4465+ u8 embedded_cpu_function[0x1];
4466+ u8 reserved_at_41[0xf];
44614467 u8 function_id[0x10];
44624468
44634469 u8 reserved_at_60[0x20];
@@ -5877,7 +5883,8 @@ struct mlx5_ifc_manage_pages_in_bits { · 1413 unmodified lines
58775883 u8 reserved_at_20[0x10];
58785884 u8 op_mod[0x10];
58795885
5880− u8 reserved_at_40[0x10];
5886+ u8 embedded_cpu_function[0x1];
5887+ u8 reserved_at_41[0xf];
58815888 u8 function_id[0x10];
58825889
58835890 u8 input_num_entries[0x20];
@@ -6055,7 +6062,8 @@ struct mlx5_ifc_enable_hca_in_bits { · 171 unmodified lines
60556062 u8 reserved_at_20[0x10];
60566063 u8 op_mod[0x10];
60576064
6058− u8 reserved_at_40[0x10];
6065+ u8 embedded_cpu_function[0x1];
6066+ u8 reserved_at_41[0xf];
60596067 u8 function_id[0x10];
60606068
60616069 u8 reserved_at_60[0x20];
@@ -6099,7 +6107,8 @@ struct mlx5_ifc_disable_hca_in_bits { · 37 unmodified lines
60996107 u8 reserved_at_20[0x10];
61006108 u8 op_mod[0x10];
61016109
6102− u8 reserved_at_40[0x10];
6110+ u8 embedded_cpu_function[0x1];
6111+ u8 reserved_at_41[0xf];
61036112 u8 function_id[0x10];
61046113
61056114 u8 reserved_at_60[0x20];
@@ -7817,21 +7826,23 @@ struct mlx5_ifc_ptys_reg_bits { · 1711 unmodified lines
78177826 u8 proto_mask[0x3];
78187827
78197828 u8 an_status[0x4];
7820− u8 reserved_at_24[0x3c];
7829+ u8 reserved_at_24[0x1c];
7830+
7831+ u8 ext_eth_proto_capability[0x20];
78217832
78227833 u8 eth_proto_capability[0x20];
78237834
78247835 u8 ib_link_width_capability[0x10];
78257836 u8 ib_proto_capability[0x10];
78267837
7827− u8 reserved_at_a0[0x20];
7838+ u8 ext_eth_proto_admin[0x20];
78287839
78297840 u8 eth_proto_admin[0x20];
78307841
78317842 u8 ib_link_width_admin[0x10];
78327843 u8 ib_proto_admin[0x10];
78337844
7834− u8 reserved_at_100[0x20];
7845+ u8 ext_eth_proto_oper[0x20];
78357846
78367847 u8 eth_proto_oper[0x20];
78377848
@@ -8280,7 +8291,9 @@ struct mlx5_ifc_mpegc_reg_bits { · 442 unmodified lines
82808291 struct mlx5_ifc_pcam_enhanced_features_bits {
82818292 u8 reserved_at_0[0x6d];
82828293 u8 rx_icrc_encapsulated_counter[0x1];
8283− u8 reserved_at_6e[0x8];
8294+ u8 reserved_at_6e[0x4];
8295+ u8 ptys_extended_ethernet[0x1];
8296+ u8 reserved_at_73[0x3];
82848297 u8 pfcc_mask[0x1];
82858298 u8 reserved_at_77[0x3];
82868299 u8 per_lane_error_counters[0x1];
@@ -8746,7 +8759,8 @@ struct mlx5_ifc_initial_seg_bits { · 459 unmodified lines
87468759 u8 initializing[0x1];
87478760 u8 reserved_at_fe1[0x4];
87488761 u8 nic_interface_supported[0x3];
8749− u8 reserved_at_fe8[0x18];
8762+ u8 embedded_cpu[0x1];
8763+ u8 reserved_at_fe9[0x17];
87508764
87518765 struct mlx5_ifc_health_buffer_bits health_buffer;
87528766
@@ -9513,4 +9527,44 @@ struct mlx5_ifc_mtrc_ctrl_bits { · 760 unmodified lines
95139527 u8 reserved_at_80[0x180];
95149528 };
95159529
9530+struct mlx5_ifc_host_params_context_bits {
9531+ u8 host_number[0x8];
9532+ u8 reserved_at_8[0x8];
9533+ u8 host_num_of_vfs[0x10];
9534+
9535+ u8 reserved_at_20[0x10];
9536+ u8 host_pci_bus[0x10];
9537+
9538+ u8 reserved_at_40[0x10];
9539+ u8 host_pci_device[0x10];
9540+
9541+ u8 reserved_at_60[0x10];
9542+ u8 host_pci_function[0x10];
9543+
9544+ u8 reserved_at_80[0x180];
9545+};
9546+
9547+struct mlx5_ifc_query_host_params_in_bits {
9548+ u8 opcode[0x10];
9549+ u8 reserved_at_10[0x10];
9550+
9551+ u8 reserved_at_20[0x10];
9552+ u8 op_mod[0x10];
9553+
9554+ u8 reserved_at_40[0x40];
9555+};
9556+
9557+struct mlx5_ifc_query_host_params_out_bits {
9558+ u8 status[0x8];
9559+ u8 reserved_at_8[0x18];
9560+
9561+ u8 syndrome[0x20];
9562+
9563+ u8 reserved_at_40[0x40];
9564+
9565+ struct mlx5_ifc_host_params_context_bits host_params_context;
9566+
9567+ u8 reserved_at_280[0x180];
9568+};
9569+
95169570 #endif /* MLX5_IFC_H */
include/linux/mlx5/port.h+19−11
@@ -92,6 +92,22 @@ enum mlx5e_link_mode { · 91 unmodified lines
9292 MLX5E_LINK_MODES_NUMBER,
9393 };
9494
95+enum mlx5e_ext_link_mode {
96+ MLX5E_SGMII_100M = 0,
97+ MLX5E_1000BASE_X_SGMII = 1,
98+ MLX5E_5GBASE_R = 3,
99+ MLX5E_10GBASE_XFI_XAUI_1 = 4,
100+ MLX5E_40GBASE_XLAUI_4_XLPPI_4 = 5,
101+ MLX5E_25GAUI_1_25GBASE_CR_KR = 6,
102+ MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2 = 7,
103+ MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR = 8,
104+ MLX5E_CAUI_4_100GBASE_CR4_KR4 = 9,
105+ MLX5E_100GAUI_2_100GBASE_CR2_KR2 = 10,
106+ MLX5E_200GAUI_4_200GBASE_CR4_KR4 = 12,
107+ MLX5E_400GAUI_8 = 15,
108+ MLX5E_EXT_LINK_MODES_NUMBER,
109+};
110+
95111 enum mlx5e_connector_type {
96112 MLX5E_PORT_UNKNOWN = 0,
97113 MLX5E_PORT_NONE = 1,
@@ -106,31 +122,23 @@ enum mlx5e_connector_type { · 8 unmodified lines
106122 };
107123
108124 #define MLX5E_PROT_MASK(link_mode) (1 << link_mode)
125+#define MLX5_GET_ETH_PROTO(reg, out, ext, field) \
126+ (ext ? MLX5_GET(reg, out, ext_##field) : \
127+ MLX5_GET(reg, out, field))
109128
110129 int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 port_num, u32 caps);
111130 int mlx5_query_port_ptys(struct mlx5_core_dev *dev, u32 *ptys,
112131 int ptys_size, int proto_mask, u8 local_port);
113−int mlx5_query_port_proto_cap(struct mlx5_core_dev *dev,
114− u32 *proto_cap, int proto_mask);
115−int mlx5_query_port_proto_admin(struct mlx5_core_dev *dev,
116− u32 *proto_admin, int proto_mask);
117132 int mlx5_query_port_link_width_oper(struct mlx5_core_dev *dev,
118133 u8 *link_width_oper, u8 local_port);
119134 int mlx5_query_port_ib_proto_oper(struct mlx5_core_dev *dev,
120135 u8 *proto_oper, u8 local_port);
121−int mlx5_query_port_eth_proto_oper(struct mlx5_core_dev *dev,
122− u32 *proto_oper, u8 local_port);
123−int mlx5_set_port_ptys(struct mlx5_core_dev *dev, bool an_disable,
124− u32 proto_admin, int proto_mask);
125136 void mlx5_toggle_port_link(struct mlx5_core_dev *dev);
126137 int mlx5_set_port_admin_status(struct mlx5_core_dev *dev,
127138 enum mlx5_port_status status);
128139 int mlx5_query_port_admin_status(struct mlx5_core_dev *dev,
129140 enum mlx5_port_status *status);
130141 int mlx5_set_port_beacon(struct mlx5_core_dev *dev, u16 beacon_duration);
131−void mlx5_query_port_autoneg(struct mlx5_core_dev *dev, int proto_mask,
132− u8 *an_status,
133− u8 *an_disable_cap, u8 *an_disable_admin);
134142
135143 int mlx5_set_port_mtu(struct mlx5_core_dev *dev, u16 mtu, u8 port);
136144 void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, u16 *max_mtu, u8 port);
include/linux/mlx5/vport.h+17−4
@@ -36,12 +36,25 @@ · 35 unmodified lines
3636 #include <linux/mlx5/driver.h>
3737 #include <linux/mlx5/device.h>
3838
39+#define MLX5_VPORT_PF_PLACEHOLDER (1u)
40+#define MLX5_SPECIAL_VPORTS (MLX5_VPORT_PF_PLACEHOLDER)
41+#define MLX5_TOTAL_VPORTS(mdev) (MLX5_SPECIAL_VPORTS + mlx5_core_max_vfs(mdev))
42+
43+#define MLX5_VPORT_MANAGER(mdev) \
44+ (MLX5_CAP_GEN(mdev, vport_group_manager) && \
45+ (MLX5_CAP_GEN(mdev, port_type) == MLX5_CAP_PORT_TYPE_ETH) && \
46+ mlx5_core_is_pf(mdev))
47+
3948 enum {
4049 MLX5_CAP_INLINE_MODE_L2,
4150 MLX5_CAP_INLINE_MODE_VPORT_CONTEXT,
4251 MLX5_CAP_INLINE_MODE_NOT_REQUIRED,
4352 };
4453
54+enum {
55+ MLX5_VPORT_UPLINK = 0xffff
56+};
57+
4558 u8 mlx5_query_vport_state(struct mlx5_core_dev *mdev, u8 opmod, u16 vport);
4659 int mlx5_modify_vport_admin_state(struct mlx5_core_dev *mdev, u8 opmod,
4760 u16 vport, u8 state);
@@ -60,7 +73,7 @@ int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev, · 12 unmodified lines
6073 u64 *system_image_guid);
6174 int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid);
6275 int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev,
63− u32 vport, u64 node_guid);
76+ u16 vport, u64 node_guid);
6477 int mlx5_query_nic_vport_qkey_viol_cntr(struct mlx5_core_dev *mdev,
6578 u16 *qkey_viol_cntr);
6679 int mlx5_query_hca_vport_gid(struct mlx5_core_dev *dev, u8 other_vport,
@@ -78,7 +91,7 @@ int mlx5_query_hca_vport_system_image_guid(struct mlx5_core_dev *dev, · 11 unmodified lines
7891 int mlx5_query_hca_vport_node_guid(struct mlx5_core_dev *dev,
7992 u64 *node_guid);
8093 int mlx5_query_nic_vport_mac_list(struct mlx5_core_dev *dev,
81− u32 vport,
94+ u16 vport,
8295 enum mlx5_list_type list_type,
8396 u8 addr_list[][ETH_ALEN],
8497 int *list_size);
@@ -87,7 +100,7 @@ int mlx5_modify_nic_vport_mac_list(struct mlx5_core_dev *dev, · 2 unmodified lines
87100 u8 addr_list[][ETH_ALEN],
88101 int list_size);
89102 int mlx5_query_nic_vport_promisc(struct mlx5_core_dev *mdev,
90− u32 vport,
103+ u16 vport,
91104 int *promisc_uc,
92105 int *promisc_mc,
93106 int *promisc_all);
@@ -96,7 +109,7 @@ int mlx5_modify_nic_vport_promisc(struct mlx5_core_dev *mdev, · 2 unmodified lines
96109 int promisc_mc,
97110 int promisc_all);
98111 int mlx5_query_nic_vport_vlans(struct mlx5_core_dev *dev,
99− u32 vport,
112+ u16 vport,
100113 u16 vlans[],
101114 int *size);
102115 int mlx5_modify_nic_vport_vlans(struct mlx5_core_dev *dev,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t