From: Qi Zhang <qi.z.zhang@intel.com>
To: beilei.xing@intel.com
Cc: dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>
Subject: [dpdk-dev] [PATCH 2/5] common/iavf: minor code clean on virtchnl
Date: Fri, 11 Sep 2020 09:30:35 +0800 [thread overview]
Message-ID: <20200911013038.19744-3-qi.z.zhang@intel.com> (raw)
In-Reply-To: <20200911013038.19744-1-qi.z.zhang@intel.com>
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 <qi.z.zhang@intel.com>
---
drivers/common/iavf/virtchnl.h | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h
index d93ef31ec..ebce68d60 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:
--
2.13.6
next prev parent reply other threads:[~2020-09-11 1:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-11 1:30 [dpdk-dev] [PATCH 0/5] iavf base code update Qi Zhang
2020-09-11 1:30 ` [dpdk-dev] [PATCH 1/5] common/iavf: use pad byte to specify MAC type Qi Zhang
2020-09-11 1:30 ` Qi Zhang [this message]
2020-09-11 1:30 ` [dpdk-dev] [PATCH 3/5] common/iavf: save max MTU received from PF Qi Zhang
2020-09-11 1:30 ` [dpdk-dev] [PATCH 4/5] common/iavf: add GTPC support Qi Zhang
2020-09-11 1:30 ` [dpdk-dev] [PATCH 5/5] common/iavf: add proto hdr field support for ipv6 prefix Qi Zhang
2020-09-11 2:22 ` [dpdk-dev] [PATCH 0/5] iavf base code update Xing, Beilei
2020-09-11 5:08 ` Xing, Beilei
2020-09-11 8:08 ` Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200911013038.19744-3-qi.z.zhang@intel.com \
--to=qi.z.zhang@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).