DPDK patches and discussions
 help / color / mirror / Atom feed
From: Helin Zhang <helin.zhang@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 3/5] i40e: support of processing crc stripping config in PF host
Date: Sun, 14 Sep 2014 22:48:27 +0800	[thread overview]
Message-ID: <1410706109-30448-4-git-send-email-helin.zhang@intel.com> (raw)
In-Reply-To: <1410706109-30448-1-git-send-email-helin.zhang@intel.com>

To support processing the extra configuration of crc stripping
in DPDK PF host, new 'struct i40e_virtchnl_queue_pair_extra_info'
and a new virtual channel operation of
'I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX' are added, and also
functions are reworked to support configuring VSI queues with
or without crc stripping configuration.

v2 changes:
* Put processing crc stripping configuration in PF host into a
  single patch.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Jing Chen <jing.d.chen@intel.com>
---
 lib/librte_pmd_i40e/i40e_pf.c | 38 ++++++++++++++++++++++++++++++--------
 lib/librte_pmd_i40e/i40e_pf.h |  7 +++++++
 2 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/lib/librte_pmd_i40e/i40e_pf.c b/lib/librte_pmd_i40e/i40e_pf.c
index 1583021..bc9bfcb 100644
--- a/lib/librte_pmd_i40e/i40e_pf.c
+++ b/lib/librte_pmd_i40e/i40e_pf.c
@@ -327,7 +327,8 @@ send_msg:
 static int
 i40e_pf_host_hmc_config_rxq(struct i40e_hw *hw,
 			    struct i40e_pf_vf *vf,
-			    struct i40e_virtchnl_rxq_info *rxq)
+			    struct i40e_virtchnl_rxq_info *rxq,
+			    struct i40e_virtchnl_queue_pair_extra_info *qpei)
 {
 	int err = I40E_SUCCESS;
 	struct i40e_hmc_obj_rxq rx_ctx;
@@ -411,13 +412,15 @@ i40e_pf_host_hmc_config_txq(struct i40e_hw *hw,
 static int
 i40e_pf_host_process_cmd_config_vsi_queues(struct i40e_pf_vf *vf,
 					   uint8_t *msg,
-					   uint16_t msglen)
+					   uint16_t msglen,
+					   int opcode)
 {
 	struct i40e_hw *hw = I40E_PF_TO_HW(vf->pf);
 	struct i40e_vsi *vsi = vf->vsi;
 	struct i40e_virtchnl_vsi_queue_config_info *vc_vqci =
 		(struct i40e_virtchnl_vsi_queue_config_info *)msg;
 	struct i40e_virtchnl_queue_pair_info *vc_qpi;
+	struct i40e_virtchnl_queue_pair_extra_info *vc_qpei = NULL;
 	int i, ret = I40E_SUCCESS;
 
 	if (msg == NULL || msglen <= sizeof(*vc_vqci) ||
@@ -428,6 +431,12 @@ i40e_pf_host_process_cmd_config_vsi_queues(struct i40e_pf_vf *vf,
 	}
 
 	vc_qpi = vc_vqci->qpair;
+	if (opcode == I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX)
+		vc_qpei = (struct i40e_virtchnl_queue_pair_extra_info *)
+						(((uint8_t *)vc_qpi) +
+			(sizeof(struct i40e_virtchnl_queue_pair_info) *
+					vc_vqci->num_queue_pairs));
+
 	for (i = 0; i < vc_vqci->num_queue_pairs; i++) {
 		if (vc_qpi[i].rxq.queue_id > vsi->nb_qps - 1 ||
 			vc_qpi[i].txq.queue_id > vsi->nb_qps - 1) {
@@ -435,9 +444,16 @@ i40e_pf_host_process_cmd_config_vsi_queues(struct i40e_pf_vf *vf,
 			goto send_msg;
 		}
 
-		/* Apply VF RX queue setting to HMC */
-		if (i40e_pf_host_hmc_config_rxq(hw, vf, &vc_qpi[i].rxq)
-			!= I40E_SUCCESS) {
+		/*
+		 * Apply VF RX queue setting to HMC.
+		 * If the opcode is I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX,
+		 * then the extra information of
+		 * 'struct i40e_virtchnl_queue_pair_extra_info' is needed,
+		 * otherwise set the last parameter to NULL.
+		 */
+		if (i40e_pf_host_hmc_config_rxq(hw, vf, &vc_qpi[i].rxq,
+			(vc_qpei != NULL ? (&vc_qpei[i]) : NULL)) !=
+							I40E_SUCCESS) {
 			PMD_DRV_LOG(ERR, "Configure RX queue HMC failed");
 			ret = I40E_ERR_PARAM;
 			goto send_msg;
@@ -453,8 +469,8 @@ i40e_pf_host_process_cmd_config_vsi_queues(struct i40e_pf_vf *vf,
 	}
 
 send_msg:
-	i40e_pf_host_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES,
-							ret, NULL, 0);
+	i40e_pf_host_send_msg_to_vf(vf, opcode, ret, NULL, 0);
+
 	return ret;
 }
 
@@ -870,7 +886,13 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,
 		break;
 	case I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES:
 		PMD_DRV_LOG(INFO, "OP_CONFIG_VSI_QUEUES received\n");
-		i40e_pf_host_process_cmd_config_vsi_queues(vf, msg, msglen);
+		i40e_pf_host_process_cmd_config_vsi_queues(vf, msg,
+						msglen, opcode);
+		break;
+	case I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX:
+		PMD_DRV_LOG(INFO, "OP_CONFIG_VSI_QUEUES_EX received\n");
+		i40e_pf_host_process_cmd_config_vsi_queues(vf, msg,
+						msglen, opcode);
 		break;
 	case I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP:
 		PMD_DRV_LOG(INFO, "OP_CONFIG_IRQ_MAP received\n");
diff --git a/lib/librte_pmd_i40e/i40e_pf.h b/lib/librte_pmd_i40e/i40e_pf.h
index 41b6826..19e1379 100644
--- a/lib/librte_pmd_i40e/i40e_pf.h
+++ b/lib/librte_pmd_i40e/i40e_pf.h
@@ -57,7 +57,14 @@ enum i40e_virtchnl_ops_DPDK {
 	I40E_VIRTCHNL_OP_GET_LINK_STAT = I40E_VIRTCHNL_OP_EVENT + 0x100,
 	I40E_VIRTCHNL_OP_CFG_VLAN_OFFLOAD,
 	I40E_VIRTCHNL_OP_CFG_VLAN_PVID,
+	I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX,
 };
+
+/* DPDK extra configurations for queues */
+struct i40e_virtchnl_queue_pair_extra_info {
+	uint8_t crcstrip;
+};
+
 struct i40e_virtchnl_vlan_offload_info {
 	uint16_t vsi_id;
 	uint8_t enable_vlan_strip;
-- 
1.8.1.4

  parent reply	other threads:[~2014-09-14 14:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-14 14:48 [dpdk-dev] [PATCH v2 0/5] support of configurable CRC stripping in VF Helin Zhang
2014-09-14 14:48 ` [dpdk-dev] [PATCH v2 1/5] config: remove useless i40e items in config files Helin Zhang
2014-09-14 14:48 ` [dpdk-dev] [PATCH v2 2/5] i40e: renaming and code style fix Helin Zhang
2014-09-14 14:48 ` Helin Zhang [this message]
2014-09-14 14:48 ` [dpdk-dev] [PATCH v2 4/5] i40e: set crc stripping in rx queue configuration Helin Zhang
2014-09-29  2:51   ` Xu, HuilongX
2014-09-14 14:48 ` [dpdk-dev] [PATCH v2 5/5] i40evf: support of configurable crc stripping in VF Helin Zhang
2014-11-06 12:53 ` [dpdk-dev] [PATCH v3 0/5] support of configurable CRC " Helin Zhang
2014-11-06 12:53   ` [dpdk-dev] [PATCH v3 1/5] config: remove useless i40e items in config files Helin Zhang
2014-11-06 12:53   ` [dpdk-dev] [PATCH v3 2/5] i40evf: Remove 'host_is_dpdk', and use version number instead Helin Zhang
2014-11-06 12:53   ` [dpdk-dev] [PATCH v3 3/5] i40e: renaming and code style fix Helin Zhang
2014-11-06 12:53   ` [dpdk-dev] [PATCH v3 4/5] i40e: support of configurable crc stripping in rx queue Helin Zhang
2014-11-06 12:53   ` [dpdk-dev] [PATCH v3 5/5] i40e: support of configurable VF crc stripping Helin Zhang
2014-11-06 15:46   ` [dpdk-dev] [PATCH v3 0/5] support of configurable CRC stripping in VF Ananyev, Konstantin
2014-11-06 22:51     ` Thomas Monjalon

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=1410706109-30448-4-git-send-email-helin.zhang@intel.com \
    --to=helin.zhang@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).