From: Qi Zhang Date: Fri, 11 Sep 2020 01:30:35 +0000 (+0800) Subject: common/iavf: cleanup virtual channel code X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a8593fe86e9ffd6c22b7b367302abe72923ba1e3;p=dpdk.git common/iavf: cleanup virtual channel code 1. use BIT to replace << 2. move VIRTCHNL_VF_CAP_DCF to keep order 3. align the vc msg validate Signed-off-by: Qi Zhang Acked-by: Beilei Xing --- diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h index d93ef31ece..ebce68d600 100644 --- a/drivers/common/iavf/virtchnl.h +++ b/drivers/common/iavf/virtchnl.h @@ -254,10 +254,11 @@ VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vsi_resource); #define VIRTCHNL_VF_OFFLOAD_ADQ 0X00800000 #define VIRTCHNL_VF_OFFLOAD_ADQ_V2 0X01000000 #define VIRTCHNL_VF_OFFLOAD_USO 0X02000000 -#define VIRTCHNL_VF_CAP_DCF 0X40000000 #define VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC 0X04000000 #define VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF 0X08000000 #define VIRTCHNL_VF_OFFLOAD_FDIR_PF 0X10000000 + /* 0X20000000 is reserved */ +#define VIRTCHNL_VF_CAP_DCF 0X40000000 /* 0X80000000 is reserved */ /* Define below the capability flags that are not offloads */ @@ -690,7 +691,7 @@ struct virtchnl_dcf_vsi_map { u16 num_vfs; /* The actual number of VFs allocated */ #define VIRTCHNL_DCF_VF_VSI_ID_S 0 #define VIRTCHNL_DCF_VF_VSI_ID_M (0xFFF << VIRTCHNL_DCF_VF_VSI_ID_S) -#define VIRTCHNL_DCF_VF_VSI_VALID (1 << 15) +#define VIRTCHNL_DCF_VF_VSI_VALID BIT(15) u16 vf_vsi[1]; }; @@ -1299,13 +1300,10 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode, /* These two opcodes are specific to handle the AdminQ command, * so the validation needs to be done in PF's context. */ - return 0; + valid_len = msglen; + break; case VIRTCHNL_OP_DCF_DISABLE: case VIRTCHNL_OP_DCF_GET_VSI_MAP: - /* The two opcodes are required by DCF without message buffer, - * so the valid length keeps the default value 0. - */ - break; case VIRTCHNL_OP_DCF_GET_PKG_INFO: break; case VIRTCHNL_OP_GET_SUPPORTED_RXDIDS: