Chenmin Sun | 7f83738 | 2020-03-28 00:34:19 +0800 | [diff] [blame] | 1 | From e2a382090a344152a79d079bb0af32bc7f03fb16 Mon Sep 17 00:00:00 2001 |
| 2 | From: Chenmin Sun <chenmin.sun@intel.com> |
| 3 | Date: Fri, 27 Mar 2020 08:26:17 +0800 |
| 4 | Subject: [DPDK 02/17] common/iavf: add virtual channel opcodes 39,40,43 |
| 5 | |
| 6 | VIRTCHNL_OP_DCF_CMD_DESC = 39, |
| 7 | VIRTCHNL_OP_DCF_CMD_BUFF = 40, |
| 8 | VIRTCHNL_OP_DCF_GET_PKG_INFO = 43, |
| 9 | |
| 10 | Signed-off-by: Chenmin Sun <chenmin.sun@intel.com> |
| 11 | --- |
| 12 | drivers/common/iavf/virtchnl.h | 33 +++++++++++++++++++++++++++++++++ |
| 13 | 1 file changed, 33 insertions(+) |
| 14 | |
| 15 | diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h |
| 16 | index 2fbbb9e28..83a7a7174 100644 |
| 17 | --- a/drivers/common/iavf/virtchnl.h |
| 18 | +++ b/drivers/common/iavf/virtchnl.h |
| 19 | @@ -129,6 +129,9 @@ enum virtchnl_ops { |
| 20 | VIRTCHNL_OP_ADD_CLOUD_FILTER = 32, |
| 21 | VIRTCHNL_OP_DEL_CLOUD_FILTER = 33, |
| 22 | /* opcodes 34, 35, 36, 37 and 38 are reserved */ |
| 23 | + VIRTCHNL_OP_DCF_CMD_DESC = 39, |
| 24 | + VIRTCHNL_OP_DCF_CMD_BUFF = 40, |
| 25 | + VIRTCHNL_OP_DCF_GET_PKG_INFO = 43, |
| 26 | }; |
| 27 | |
| 28 | /* These macros are used to generate compilation errors if a structure/union |
| 29 | @@ -266,6 +269,28 @@ struct virtchnl_vf_resource { |
| 30 | |
| 31 | VIRTCHNL_CHECK_STRUCT_LEN(36, virtchnl_vf_resource); |
| 32 | |
| 33 | +#define PKG_NAME_SIZE 32 |
| 34 | +#define DSN_SIZE 8 |
| 35 | + |
| 36 | +struct pkg_version { |
| 37 | + u8 major; |
| 38 | + u8 minor; |
| 39 | + u8 update; |
| 40 | + u8 draft; |
| 41 | +}; |
| 42 | + |
| 43 | +VIRTCHNL_CHECK_STRUCT_LEN(4, pkg_version); |
| 44 | + |
| 45 | +struct virtchnl_pkg_info { |
| 46 | + struct pkg_version pkg_ver; |
| 47 | + u32 track_id; |
| 48 | + char pkg_name[PKG_NAME_SIZE]; |
| 49 | + u8 dsn[DSN_SIZE]; |
| 50 | +}; |
| 51 | + |
| 52 | + |
| 53 | +VIRTCHNL_CHECK_STRUCT_LEN(48, virtchnl_pkg_info); |
| 54 | + |
| 55 | /* VIRTCHNL_OP_CONFIG_TX_QUEUE |
| 56 | * VF sends this message to set up parameters for one TX queue. |
| 57 | * External data buffer contains one instance of virtchnl_txq_info. |
| 58 | @@ -879,6 +904,14 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode, |
| 59 | case VIRTCHNL_OP_DEL_CLOUD_FILTER: |
| 60 | valid_len = sizeof(struct virtchnl_filter); |
| 61 | break; |
| 62 | + case VIRTCHNL_OP_DCF_CMD_DESC: |
| 63 | + case VIRTCHNL_OP_DCF_CMD_BUFF: |
| 64 | + /* These two opcodes are specific to handle the AdminQ command, |
| 65 | + * so the validation needs to be done in PF's context. |
| 66 | + */ |
| 67 | + return 0; |
| 68 | + case VIRTCHNL_OP_DCF_GET_PKG_INFO: |
| 69 | + break; |
| 70 | /* These are always errors coming from the VF. */ |
| 71 | case VIRTCHNL_OP_EVENT: |
| 72 | case VIRTCHNL_OP_UNKNOWN: |
| 73 | -- |
| 74 | 2.17.1 |
| 75 | |