1 From a2c92bf26e724eacd52971c4a83861ada82a6cb4 Mon Sep 17 00:00:00 2001
2 From: Chenmin Sun <chenmin.sun@intel.com>
3 Date: Fri, 17 Apr 2020 00:37:41 +0800
4 Subject: [DPDK 03/17] common/iavf: support VSI mapping table
6 Add an opcode for getting VSI mapping table.
7 Add an virtchnl event code for VF reset done.
9 Signed-off-by: Beilei Xing <beilei.xing@intel.com>
10 Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
11 Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
12 Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
14 Acked-by: Beilei Xing <beilei.xing@intel.com>
16 drivers/common/iavf/virtchnl.h | 30 ++++++++++++++++++++++++++++++
17 1 file changed, 30 insertions(+)
19 diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h
20 index 83a7a7174..6f9cf18cb 100644
21 --- a/drivers/common/iavf/virtchnl.h
22 +++ b/drivers/common/iavf/virtchnl.h
23 @@ -131,6 +131,7 @@ enum virtchnl_ops {
24 /* opcodes 34, 35, 36, 37 and 38 are reserved */
25 VIRTCHNL_OP_DCF_CMD_DESC = 39,
26 VIRTCHNL_OP_DCF_CMD_BUFF = 40,
27 + VIRTCHNL_OP_DCF_GET_VSI_MAP = 42,
28 VIRTCHNL_OP_DCF_GET_PKG_INFO = 43,
31 @@ -645,6 +646,25 @@ struct virtchnl_filter {
33 VIRTCHNL_CHECK_STRUCT_LEN(272, virtchnl_filter);
35 +/* VIRTCHNL_OP_DCF_GET_VSI_MAP
36 + * VF sends this message to get VSI mapping table.
37 + * PF responds with an indirect message containing VF's
39 + * The index of vf_vsi array is the logical VF ID, the
40 + * value of vf_vsi array is the VF's HW VSI ID with its
41 + * valid configuration.
43 +struct virtchnl_dcf_vsi_map {
44 + u16 pf_vsi; /* PF's HW VSI ID */
45 + u16 num_vfs; /* The actual number of VFs allocated */
46 +#define VIRTCHNL_DCF_VF_VSI_ID_S 0
47 +#define VIRTCHNL_DCF_VF_VSI_ID_M (0xFFF << VIRTCHNL_DCF_VF_VSI_ID_S)
48 +#define VIRTCHNL_DCF_VF_VSI_VALID (1 << 15)
52 +VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_dcf_vsi_map);
55 * PF sends this message to inform the VF driver of events that may affect it.
56 * No direct response is expected from the VF, though it may generate other
57 @@ -655,6 +675,7 @@ enum virtchnl_event_codes {
58 VIRTCHNL_EVENT_LINK_CHANGE,
59 VIRTCHNL_EVENT_RESET_IMPENDING,
60 VIRTCHNL_EVENT_PF_DRIVER_CLOSE,
61 + VIRTCHNL_EVENT_DCF_VSI_MAP_UPDATE,
64 #define PF_EVENT_SEVERITY_INFO 0
65 @@ -682,6 +703,10 @@ struct virtchnl_pf_event {
76 @@ -912,6 +937,11 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,
78 case VIRTCHNL_OP_DCF_GET_PKG_INFO:
80 + case VIRTCHNL_OP_DCF_GET_VSI_MAP:
81 + /* The two opcodes are required by DCF without message buffer,
82 + * so the valid length keeps the default value 0.
85 /* These are always errors coming from the VF. */
86 case VIRTCHNL_OP_EVENT:
87 case VIRTCHNL_OP_UNKNOWN: