DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2 0/5] support of configurable CRC stripping in VF
@ 2014-09-14 14:48 Helin Zhang
  2014-09-14 14:48 ` [dpdk-dev] [PATCH v2 1/5] config: remove useless i40e items in config files Helin Zhang
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Helin Zhang @ 2014-09-14 14:48 UTC (permalink / raw)
  To: dev

To support configurable CRC stripping in both PF host and VF, a new
operation and a new structure are added to carry more configurations
from VF to PF host.

v2 changes:
* Put all the renaming and code style fixes into a patch.
* Put processing crc stripping configuration in PF host into a single patch.
* Put setting the crc stripping into a single patch.
* Put the configuring crc stripping in VF into a single patch.
* Added several more code style fixes reported by checkpatch.pl.

Helin Zhang (5):
  config: remove useless i40e items in config files
  i40e: renaming and code style fix
  i40e: support of processing crc stripping config in PF host
  i40e: set crc stripping in rx queue configuration
  i40evf: support of configurable crc stripping in VF

 config/common_bsdapp                 |   1 -
 config/common_linuxapp               |   1 -
 lib/librte_pmd_i40e/i40e_ethdev_vf.c | 188 ++++++++++++++++++++++++-----------
 lib/librte_pmd_i40e/i40e_pf.c        |  94 +++++++++++-------
 lib/librte_pmd_i40e/i40e_pf.h        |   7 ++
 5 files changed, 193 insertions(+), 98 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v2 1/5] config: remove useless i40e items in config files
  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 ` Helin Zhang
  2014-09-14 14:48 ` [dpdk-dev] [PATCH v2 2/5] i40e: renaming and code style fix Helin Zhang
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Helin Zhang @ 2014-09-14 14:48 UTC (permalink / raw)
  To: dev

Remove 'CONFIG_RTE_LIBRTE_I40E_PF_DISABLE_STRIP_CRC' from
config files of 'common_bsdapp' and 'common_linuxapp', as
nowhere uses it.

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>
---
 config/common_bsdapp   | 1 -
 config/common_linuxapp | 1 -
 2 files changed, 2 deletions(-)

diff --git a/config/common_bsdapp b/config/common_bsdapp
index bf6d8a0..c62388a 100644
--- a/config/common_bsdapp
+++ b/config/common_bsdapp
@@ -180,7 +180,6 @@ CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_DRIVER=n
-CONFIG_RTE_LIBRTE_I40E_PF_DISABLE_STRIP_CRC=y
 CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC=n
 CONFIG_RTE_LIBRTE_I40E_ALLOW_UNSUPPORTED_SFP=y
 CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
diff --git a/config/common_linuxapp b/config/common_linuxapp
index 9047975..c680a63 100644
--- a/config/common_linuxapp
+++ b/config/common_linuxapp
@@ -203,7 +203,6 @@ CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_DRIVER=n
-CONFIG_RTE_LIBRTE_I40E_PF_DISABLE_STRIP_CRC=n
 CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC=y
 CONFIG_RTE_LIBRTE_I40E_ALLOW_UNSUPPORTED_SFP=n
 CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v2 2/5] i40e: renaming and code style fix
  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 ` Helin Zhang
  2014-09-14 14:48 ` [dpdk-dev] [PATCH v2 3/5] i40e: support of processing crc stripping config in PF host Helin Zhang
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Helin Zhang @ 2014-09-14 14:48 UTC (permalink / raw)
  To: dev

Rename some local variables in i40e_pf.c and
i40e_ethdev_vf.c, to express more accurately and briefly.
Fix several issues in i40e_pf.c reported by checkpatch.pl.
Line warpping for some source lines which has more than 80
characters, and merge lines together for those source lines
which does not need any line wrapping actually.

v2 changes:
* Put all the renaming and code style fixes into a patch.
* Add several more code style fixes for i40e_pf.c.

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_ethdev_vf.c | 75 ++++++++++++++++++------------------
 lib/librte_pmd_i40e/i40e_pf.c        | 53 +++++++++++--------------
 2 files changed, 61 insertions(+), 67 deletions(-)

diff --git a/lib/librte_pmd_i40e/i40e_ethdev_vf.c b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
index d8552ad..113bff8 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev_vf.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
@@ -527,27 +527,27 @@ static int
 i40evf_configure_queues(struct rte_eth_dev *dev)
 {
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
-	struct i40e_virtchnl_vsi_queue_config_info *queue_info;
-	struct i40e_virtchnl_queue_pair_info *queue_cfg;
 	struct i40e_rx_queue **rxq =
 		(struct i40e_rx_queue **)dev->data->rx_queues;
 	struct i40e_tx_queue **txq =
 		(struct i40e_tx_queue **)dev->data->tx_queues;
-	int i, len, nb_qpairs, num_rxq, num_txq;
-	int err;
+	struct i40e_virtchnl_vsi_queue_config_info *vc_vqci;
+	struct i40e_virtchnl_queue_pair_info *vc_qpi;
+	int size, i, nb_qp, ret, num_rxq, num_txq;
 	struct vf_cmd_info args;
 	struct rte_pktmbuf_pool_private *mbp_priv;
 
-	nb_qpairs = vf->num_queue_pairs;
-	len = sizeof(*queue_info) + sizeof(*queue_cfg) * nb_qpairs;
-	queue_info = rte_zmalloc("queue_info", len, 0);
-	if (queue_info == NULL) {
-		PMD_INIT_LOG(ERR, "failed alloc memory for queue_info\n");
-		return -1;
+	nb_qp = vf->num_queue_pairs;
+	size = sizeof(*vc_vqci) + sizeof(*vc_qpi) * nb_qp;
+	vc_vqci = rte_zmalloc("vc_vqci", size, 0);
+	if (!vc_vqci) {
+		PMD_DRV_LOG(ERR, "Failed to allocate memory for VF "
+					"configuring queues\n");
+		return -ENOMEM;
 	}
-	queue_info->vsi_id = vf->vsi_res->vsi_id;
-	queue_info->num_queue_pairs = nb_qpairs;
-	queue_cfg = queue_info->qpair;
+	vc_vqci->vsi_id = vf->vsi_res->vsi_id;
+	vc_vqci->num_queue_pairs = nb_qp;
+	vc_qpi = vc_vqci->qpair;
 
 	num_rxq = dev->data->nb_rx_queues;
 	num_txq = dev->data->nb_tx_queues;
@@ -557,48 +557,49 @@ i40evf_configure_queues(struct rte_eth_dev *dev)
 	 * work that way. The solution is fills 0 with HW ring option in case
 	 * they are not equal.
 	 */
-	for (i = 0; i < nb_qpairs; i++) {
+	for (i = 0; i < nb_qp; i++) {
 		/*Fill TX info */
-		queue_cfg->txq.vsi_id = queue_info->vsi_id;
-		queue_cfg->txq.queue_id = i;
+		vc_qpi->txq.vsi_id = vc_vqci->vsi_id;
+		vc_qpi->txq.queue_id = i;
 		if (i < num_txq) {
-			queue_cfg->txq.ring_len = txq[i]->nb_tx_desc;
-			queue_cfg->txq.dma_ring_addr = txq[i]->tx_ring_phys_addr;
+			vc_qpi->txq.ring_len = txq[i]->nb_tx_desc;
+			vc_qpi->txq.dma_ring_addr = txq[i]->tx_ring_phys_addr;
 		} else {
-			queue_cfg->txq.ring_len = 0;
-			queue_cfg->txq.dma_ring_addr = 0;
+			vc_qpi->txq.ring_len = 0;
+			vc_qpi->txq.dma_ring_addr = 0;
 		}
 
 		/* Fill RX info */
-		queue_cfg->rxq.vsi_id = queue_info->vsi_id;
-		queue_cfg->rxq.queue_id = i;
-		queue_cfg->rxq.max_pkt_size = vf->max_pkt_len;
+		vc_qpi->rxq.vsi_id = vc_vqci->vsi_id;
+		vc_qpi->rxq.queue_id = i;
+		vc_qpi->rxq.max_pkt_size = vf->max_pkt_len;
 		if (i < num_rxq) {
 			mbp_priv = rte_mempool_get_priv(rxq[i]->mp);
-			queue_cfg->rxq.databuffer_size = mbp_priv->mbuf_data_room_size -
-						   RTE_PKTMBUF_HEADROOM;;
-			queue_cfg->rxq.ring_len = rxq[i]->nb_rx_desc;
-			queue_cfg->rxq.dma_ring_addr = rxq[i]->rx_ring_phys_addr;;
+			vc_qpi->rxq.databuffer_size =
+				mbp_priv->mbuf_data_room_size -
+					RTE_PKTMBUF_HEADROOM;
+			vc_qpi->rxq.ring_len = rxq[i]->nb_rx_desc;
+			vc_qpi->rxq.dma_ring_addr = rxq[i]->rx_ring_phys_addr;
 		} else {
-			queue_cfg->rxq.ring_len = 0;
-			queue_cfg->rxq.dma_ring_addr = 0;
-			queue_cfg->rxq.databuffer_size = 0;
+			vc_qpi->rxq.ring_len = 0;
+			vc_qpi->rxq.dma_ring_addr = 0;
+			vc_qpi->rxq.databuffer_size = 0;
 		}
-		queue_cfg++;
+		vc_qpi++;
 	}
 
 	args.ops = I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES;
-	args.in_args = (u8 *)queue_info;
-	args.in_args_size = len;
+	args.in_args = (uint8_t *)vc_vqci;
+	args.in_args_size = size;
 	args.out_buffer = cmd_result_buffer;
 	args.out_size = I40E_AQ_BUF_SZ;
-	err = i40evf_execute_vf_cmd(dev, &args);
-	if (err)
+	ret = i40evf_execute_vf_cmd(dev, &args);
+	if (ret)
 		PMD_DRV_LOG(ERR, "fail to execute command "
 				"OP_CONFIG_VSI_QUEUES\n");
-	rte_free(queue_info);
+	rte_free(vc_vqci);
 
-	return err;
+	return ret;
 }
 
 static int
diff --git a/lib/librte_pmd_i40e/i40e_pf.c b/lib/librte_pmd_i40e/i40e_pf.c
index e8b154d..1583021 100644
--- a/lib/librte_pmd_i40e/i40e_pf.c
+++ b/lib/librte_pmd_i40e/i40e_pf.c
@@ -415,29 +415,28 @@ i40e_pf_host_process_cmd_config_vsi_queues(struct i40e_pf_vf *vf,
 {
 	struct i40e_hw *hw = I40E_PF_TO_HW(vf->pf);
 	struct i40e_vsi *vsi = vf->vsi;
-	int ret = I40E_SUCCESS;
-	struct i40e_virtchnl_vsi_queue_config_info *qconfig =
-	    (struct i40e_virtchnl_vsi_queue_config_info *)msg;
-	int i;
-	struct i40e_virtchnl_queue_pair_info *qpair;
+	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;
+	int i, ret = I40E_SUCCESS;
 
-	if (msg == NULL || msglen <= sizeof(*qconfig) ||
-		qconfig->num_queue_pairs > vsi->nb_qps) {
+	if (msg == NULL || msglen <= sizeof(*vc_vqci) ||
+		vc_vqci->num_queue_pairs > vsi->nb_qps) {
 		PMD_DRV_LOG(ERR, "vsi_queue_config_info argument wrong\n");
 		ret = I40E_ERR_PARAM;
 		goto send_msg;
 	}
 
-	qpair = qconfig->qpair;
-	for (i = 0; i < qconfig->num_queue_pairs; i++) {
-		if (qpair[i].rxq.queue_id > vsi->nb_qps - 1 ||
-			qpair[i].txq.queue_id > vsi->nb_qps - 1) {
+	vc_qpi = vc_vqci->qpair;
+	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) {
 			ret = I40E_ERR_PARAM;
 			goto send_msg;
 		}
 
 		/* Apply VF RX queue setting to HMC */
-		if (i40e_pf_host_hmc_config_rxq(hw, vf, &qpair[i].rxq)
+		if (i40e_pf_host_hmc_config_rxq(hw, vf, &vc_qpi[i].rxq)
 			!= I40E_SUCCESS) {
 			PMD_DRV_LOG(ERR, "Configure RX queue HMC failed");
 			ret = I40E_ERR_PARAM;
@@ -445,8 +444,8 @@ i40e_pf_host_process_cmd_config_vsi_queues(struct i40e_pf_vf *vf,
 		}
 
 		/* Apply VF TX queue setting to HMC */
-		if (i40e_pf_host_hmc_config_txq(hw, vf, &qpair[i].txq)
-			!= I40E_SUCCESS) {
+		if (i40e_pf_host_hmc_config_txq(hw, vf,
+			&vc_qpi[i].txq) != I40E_SUCCESS) {
 			PMD_DRV_LOG(ERR, "Configure TX queue HMC failed");
 			ret = I40E_ERR_PARAM;
 			goto send_msg;
@@ -857,11 +856,11 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,
 	}
 
 	switch (opcode) {
-	case I40E_VIRTCHNL_OP_VERSION :
+	case I40E_VIRTCHNL_OP_VERSION:
 		PMD_DRV_LOG(INFO, "OP_VERSION received\n");
 		i40e_pf_host_process_cmd_version(vf);
 		break;
-	case I40E_VIRTCHNL_OP_RESET_VF :
+	case I40E_VIRTCHNL_OP_RESET_VF:
 		PMD_DRV_LOG(INFO, "OP_RESET_VF received\n");
 		i40e_pf_host_process_cmd_reset_vf(vf);
 		break;
@@ -871,8 +870,7 @@ 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);
 		break;
 	case I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP:
 		PMD_DRV_LOG(INFO, "OP_CONFIG_IRQ_MAP received\n");
@@ -880,23 +878,19 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,
 		break;
 	case I40E_VIRTCHNL_OP_ENABLE_QUEUES:
 		PMD_DRV_LOG(INFO, "OP_ENABLE_QUEUES received\n");
-		i40e_pf_host_process_cmd_enable_queues(vf,
-						msg, msglen);
+		i40e_pf_host_process_cmd_enable_queues(vf, msg, msglen);
 		break;
 	case I40E_VIRTCHNL_OP_DISABLE_QUEUES:
 		PMD_DRV_LOG(INFO, "OP_DISABLE_QUEUE received\n");
-		i40e_pf_host_process_cmd_disable_queues(vf,
-						msg, msglen);
+		i40e_pf_host_process_cmd_disable_queues(vf, msg, msglen);
 		break;
 	case I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS:
 		PMD_DRV_LOG(INFO, "OP_ADD_ETHER_ADDRESS received\n");
-		i40e_pf_host_process_cmd_add_ether_address(vf,
-						msg, msglen);
+		i40e_pf_host_process_cmd_add_ether_address(vf, msg, msglen);
 		break;
 	case I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS:
 		PMD_DRV_LOG(INFO, "OP_DEL_ETHER_ADDRESS received\n");
-		i40e_pf_host_process_cmd_del_ether_address(vf,
-						msg, msglen);
+		i40e_pf_host_process_cmd_del_ether_address(vf, msg, msglen);
 		break;
 	case I40E_VIRTCHNL_OP_ADD_VLAN:
 		PMD_DRV_LOG(INFO, "OP_ADD_VLAN received\n");
@@ -932,10 +926,9 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,
 	case I40E_VIRTCHNL_OP_FCOE:
 		PMD_DRV_LOG(ERR, "OP_FCOE received, not supported\n");
 	default:
-		PMD_DRV_LOG(ERR, "%u received, not supported\n",
-							opcode);
-		i40e_pf_host_send_msg_to_vf(vf, opcode,
-				I40E_ERR_PARAM, NULL, 0);
+		PMD_DRV_LOG(ERR, "%u received, not supported\n", opcode);
+		i40e_pf_host_send_msg_to_vf(vf, opcode, I40E_ERR_PARAM,
+								NULL, 0);
 		break;
 	}
 }
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v2 3/5] i40e: support of processing crc stripping config in PF host
  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
  2014-09-14 14:48 ` [dpdk-dev] [PATCH v2 4/5] i40e: set crc stripping in rx queue configuration Helin Zhang
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Helin Zhang @ 2014-09-14 14:48 UTC (permalink / raw)
  To: dev

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v2 4/5] i40e: set crc stripping in rx queue configuration
  2014-09-14 14:48 [dpdk-dev] [PATCH v2 0/5] support of configurable CRC stripping in VF Helin Zhang
                   ` (2 preceding siblings ...)
  2014-09-14 14:48 ` [dpdk-dev] [PATCH v2 3/5] i40e: support of processing crc stripping config in PF host Helin Zhang
@ 2014-09-14 14:48 ` 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
  5 siblings, 1 reply; 15+ messages in thread
From: Helin Zhang @ 2014-09-14 14:48 UTC (permalink / raw)
  To: dev

It enables/disables the crc stripping in the rx queue contexts,
according to the extra configuration carried from VF.

v2 changes:
* Put setting the crc stripping 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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/librte_pmd_i40e/i40e_pf.c b/lib/librte_pmd_i40e/i40e_pf.c
index bc9bfcb..2910fd5 100644
--- a/lib/librte_pmd_i40e/i40e_pf.c
+++ b/lib/librte_pmd_i40e/i40e_pf.c
@@ -357,7 +357,10 @@ i40e_pf_host_hmc_config_rxq(struct i40e_hw *hw,
 	rx_ctx.tphdata_ena = 1;
 	rx_ctx.tphhead_ena = 1;
 	rx_ctx.lrxqthresh = 2;
-	rx_ctx.crcstrip = 1;
+	if (qpei) /* For DPDK PF host */
+		rx_ctx.crcstrip = qpei->crcstrip ? 1 : 0;
+	else /* For Linux PF host */
+		rx_ctx.crcstrip = 1;
 	rx_ctx.l2tsel = 1;
 	rx_ctx.prefena = 1;
 
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v2 5/5] i40evf: support of configurable crc stripping in VF
  2014-09-14 14:48 [dpdk-dev] [PATCH v2 0/5] support of configurable CRC stripping in VF Helin Zhang
                   ` (3 preceding siblings ...)
  2014-09-14 14:48 ` [dpdk-dev] [PATCH v2 4/5] i40e: set crc stripping in rx queue configuration Helin Zhang
@ 2014-09-14 14:48 ` Helin Zhang
  2014-11-06 12:53 ` [dpdk-dev] [PATCH v3 0/5] support of configurable CRC " Helin Zhang
  5 siblings, 0 replies; 15+ messages in thread
From: Helin Zhang @ 2014-09-14 14:48 UTC (permalink / raw)
  To: dev

Configurable crc stripping is supported in DPDK PF host,
while not in Linux PF host. Two functions have been
defined to talk with the those PF hosts respectively.

v2 changes:
* Put configuring crc stripping in VF 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_ethdev_vf.c | 133 +++++++++++++++++++++++++++--------
 1 file changed, 102 insertions(+), 31 deletions(-)

diff --git a/lib/librte_pmd_i40e/i40e_ethdev_vf.c b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
index 113bff8..af5a0f3 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev_vf.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
@@ -523,8 +523,9 @@ i40evf_config_vlan_pvid(struct rte_eth_dev *dev,
 	return err;
 }
 
+/* It configures VSI queues without extra configuration */
 static int
-i40evf_configure_queues(struct rte_eth_dev *dev)
+i40evf_configure_vsi_queues(struct rte_eth_dev *dev)
 {
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	struct i40e_rx_queue **rxq =
@@ -533,13 +534,13 @@ i40evf_configure_queues(struct rte_eth_dev *dev)
 		(struct i40e_tx_queue **)dev->data->tx_queues;
 	struct i40e_virtchnl_vsi_queue_config_info *vc_vqci;
 	struct i40e_virtchnl_queue_pair_info *vc_qpi;
-	int size, i, nb_qp, ret, num_rxq, num_txq;
 	struct vf_cmd_info args;
-	struct rte_pktmbuf_pool_private *mbp_priv;
+	int size, i, nb_qp, ret;
 
 	nb_qp = vf->num_queue_pairs;
-	size = sizeof(*vc_vqci) + sizeof(*vc_qpi) * nb_qp;
-	vc_vqci = rte_zmalloc("vc_vqci", size, 0);
+	size = sizeof(struct i40e_virtchnl_vsi_queue_config_info) +
+		sizeof(struct i40e_virtchnl_queue_pair_info) * nb_qp;
+	vc_vqci = rte_zmalloc("queue_info", size, 0);
 	if (!vc_vqci) {
 		PMD_DRV_LOG(ERR, "Failed to allocate memory for VF "
 					"configuring queues\n");
@@ -547,62 +548,132 @@ i40evf_configure_queues(struct rte_eth_dev *dev)
 	}
 	vc_vqci->vsi_id = vf->vsi_res->vsi_id;
 	vc_vqci->num_queue_pairs = nb_qp;
-	vc_qpi = vc_vqci->qpair;
 
-	num_rxq = dev->data->nb_rx_queues;
-	num_txq = dev->data->nb_tx_queues;
-	/*
-	 * PF host driver required to configure queues in pairs, which means
-	 * rxq_num should equals to txq_num. The actual usage won't always
-	 * work that way. The solution is fills 0 with HW ring option in case
-	 * they are not equal.
-	 */
-	for (i = 0; i < nb_qp; i++) {
-		/*Fill TX info */
+	for (i = 0, vc_qpi = vc_vqci->qpair; i < nb_qp; i++, vc_qpi++) {
 		vc_qpi->txq.vsi_id = vc_vqci->vsi_id;
 		vc_qpi->txq.queue_id = i;
-		if (i < num_txq) {
+		if (i < dev->data->nb_tx_queues) {
 			vc_qpi->txq.ring_len = txq[i]->nb_tx_desc;
 			vc_qpi->txq.dma_ring_addr = txq[i]->tx_ring_phys_addr;
-		} else {
-			vc_qpi->txq.ring_len = 0;
-			vc_qpi->txq.dma_ring_addr = 0;
 		}
 
-		/* Fill RX info */
 		vc_qpi->rxq.vsi_id = vc_vqci->vsi_id;
 		vc_qpi->rxq.queue_id = i;
 		vc_qpi->rxq.max_pkt_size = vf->max_pkt_len;
-		if (i < num_rxq) {
+		if (i < dev->data->nb_rx_queues) {
+			struct rte_pktmbuf_pool_private *mbp_priv;
+
+			vc_qpi->rxq.ring_len = rxq[i]->nb_rx_desc;
+			vc_qpi->rxq.dma_ring_addr = rxq[i]->rx_ring_phys_addr;
 			mbp_priv = rte_mempool_get_priv(rxq[i]->mp);
 			vc_qpi->rxq.databuffer_size =
 				mbp_priv->mbuf_data_room_size -
 					RTE_PKTMBUF_HEADROOM;
+		}
+	}
+	memset(&args, 0, sizeof(args));
+	args.ops = I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES;
+	args.in_args = (uint8_t *)vc_vqci;
+	args.in_args_size = size;
+	args.out_buffer = cmd_result_buffer;
+	args.out_size = I40E_AQ_BUF_SZ;
+	ret = i40evf_execute_vf_cmd(dev, &args);
+	if (ret)
+		PMD_DRV_LOG(ERR, "Failed to execute command of "
+			"I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES\n");
+	rte_free(vc_vqci);
+
+	return ret;
+}
+
+/* It configures VSI queues with extra configuration of crc stripping */
+static int
+i40evf_configure_vsi_queues_ex(struct rte_eth_dev *dev)
+{
+	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+	struct i40e_rx_queue **rxq =
+		(struct i40e_rx_queue **)dev->data->rx_queues;
+	struct i40e_tx_queue **txq =
+		(struct i40e_tx_queue **)dev->data->tx_queues;
+	struct i40e_virtchnl_vsi_queue_config_info *vc_vqci;
+	struct i40e_virtchnl_queue_pair_info *vc_qpi;
+	struct i40e_virtchnl_queue_pair_extra_info *vc_qpei;
+	struct vf_cmd_info args;
+	int size, i, nb_qp, ret;
+
+	nb_qp = vf->num_queue_pairs;
+	size = sizeof(struct i40e_virtchnl_vsi_queue_config_info) +
+		sizeof(struct i40e_virtchnl_queue_pair_info) * nb_qp +
+		sizeof(struct i40e_virtchnl_queue_pair_extra_info) * nb_qp;
+	vc_vqci = rte_zmalloc("queue_info", size, 0);
+	if (!vc_vqci) {
+		PMD_DRV_LOG(ERR, "Failed to allocate memory for VF "
+					"configuring queues\n");
+		return -ENOMEM;
+	}
+	vc_vqci->vsi_id = vf->vsi_res->vsi_id;
+	vc_vqci->num_queue_pairs = nb_qp;
+	vc_qpi = vc_vqci->qpair;
+	vc_qpei = (struct i40e_virtchnl_queue_pair_extra_info *)
+		(((uint8_t *)vc_vqci->qpair) +
+		sizeof(struct i40e_virtchnl_queue_pair_info) * nb_qp);
+
+	for (i = 0; i < nb_qp; i++, vc_qpi++, vc_qpei++) {
+		vc_qpi->txq.vsi_id = vc_vqci->vsi_id;
+		vc_qpi->txq.queue_id = i;
+		if (i < dev->data->nb_tx_queues) {
+			vc_qpi->txq.ring_len = txq[i]->nb_tx_desc;
+			vc_qpi->txq.dma_ring_addr = txq[i]->tx_ring_phys_addr;
+		}
+		vc_qpi->rxq.vsi_id = vc_vqci->vsi_id;
+		vc_qpi->rxq.queue_id = i;
+		vc_qpi->rxq.max_pkt_size = vf->max_pkt_len;
+		if (i < dev->data->nb_rx_queues) {
+			struct rte_pktmbuf_pool_private *mbp_priv;
+
 			vc_qpi->rxq.ring_len = rxq[i]->nb_rx_desc;
 			vc_qpi->rxq.dma_ring_addr = rxq[i]->rx_ring_phys_addr;
-		} else {
-			vc_qpi->rxq.ring_len = 0;
-			vc_qpi->rxq.dma_ring_addr = 0;
-			vc_qpi->rxq.databuffer_size = 0;
+			mbp_priv = rte_mempool_get_priv(rxq[i]->mp);
+			vc_qpi->rxq.databuffer_size =
+				mbp_priv->mbuf_data_room_size -
+					RTE_PKTMBUF_HEADROOM;
+			/*
+			 * It adds extra info for configuring VSI queues, which
+			 * is needed to enable the configurable crc stripping
+			 * in VF.
+			 */
+			vc_qpei->crcstrip =
+				dev->data->dev_conf.rxmode.hw_strip_crc;
 		}
-		vc_qpi++;
 	}
-
-	args.ops = I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES;
+	memset(&args, 0, sizeof(args));
+	args.ops =
+		(enum i40e_virtchnl_ops)I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX;
 	args.in_args = (uint8_t *)vc_vqci;
 	args.in_args_size = size;
 	args.out_buffer = cmd_result_buffer;
 	args.out_size = I40E_AQ_BUF_SZ;
 	ret = i40evf_execute_vf_cmd(dev, &args);
 	if (ret)
-		PMD_DRV_LOG(ERR, "fail to execute command "
-				"OP_CONFIG_VSI_QUEUES\n");
+		PMD_DRV_LOG(ERR, "Failed to execute command of "
+			"I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX\n");
 	rte_free(vc_vqci);
 
 	return ret;
 }
 
 static int
+i40evf_configure_queues(struct rte_eth_dev *dev)
+{
+	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+
+	if (vf->host_is_dpdk) /* To support DPDK PF host */
+		return i40evf_configure_vsi_queues_ex(dev);
+	else /* To support Linux PF host */
+		return i40evf_configure_vsi_queues(dev);
+}
+
+static int
 i40evf_config_irq_map(struct rte_eth_dev *dev)
 {
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH v2 4/5] i40e: set crc stripping in rx queue configuration
  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
  0 siblings, 0 replies; 15+ messages in thread
From: Xu, HuilongX @ 2014-09-29  2:51 UTC (permalink / raw)
  To: Zhang, Helin, dev

Tested-by: HuilongX xu <huilongx.xu@intel.com>

This patch has been verified on FC20 with eagle fountain:4*10G fortville, spirit falls 1*40G fortville and 2*40G fortville.
The VF is greater by SRIOV, and testpmd should be run on host to support  VF work on VM.

CRC stripping function works well in the testpmd app in VM and host.

Test environment information detail information as the following:
HOST environment:
CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
OS: Linux 3.11.10-301.fc20.x86_64    
GCC: 4.8.3
NIC: Eagle Fountain:4*10G fortville, Spirit Falls 1*40G fortville and 2*40G fortville.

VM environment generated by KVM:
CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
OS: Linux 3.11.10-301.fc20.x86_64
GCC: 4.8.2
NIC: VF generated through SRIOV   

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Helin Zhang
Sent: Sunday, September 14, 2014 10:48 PM
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 4/5] i40e: set crc stripping in rx queue configuration

It enables/disables the crc stripping in the rx queue contexts,
according to the extra configuration carried from VF.

v2 changes:
* Put setting the crc stripping 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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/librte_pmd_i40e/i40e_pf.c b/lib/librte_pmd_i40e/i40e_pf.c
index bc9bfcb..2910fd5 100644
--- a/lib/librte_pmd_i40e/i40e_pf.c
+++ b/lib/librte_pmd_i40e/i40e_pf.c
@@ -357,7 +357,10 @@ i40e_pf_host_hmc_config_rxq(struct i40e_hw *hw,
 	rx_ctx.tphdata_ena = 1;
 	rx_ctx.tphhead_ena = 1;
 	rx_ctx.lrxqthresh = 2;
-	rx_ctx.crcstrip = 1;
+	if (qpei) /* For DPDK PF host */
+		rx_ctx.crcstrip = qpei->crcstrip ? 1 : 0;
+	else /* For Linux PF host */
+		rx_ctx.crcstrip = 1;
 	rx_ctx.l2tsel = 1;
 	rx_ctx.prefena = 1;
 
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v3 0/5] support of configurable CRC stripping in VF
  2014-09-14 14:48 [dpdk-dev] [PATCH v2 0/5] support of configurable CRC stripping in VF Helin Zhang
                   ` (4 preceding siblings ...)
  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 ` Helin Zhang
  2014-11-06 12:53   ` [dpdk-dev] [PATCH v3 1/5] config: remove useless i40e items in config files Helin Zhang
                     ` (5 more replies)
  5 siblings, 6 replies; 15+ messages in thread
From: Helin Zhang @ 2014-11-06 12:53 UTC (permalink / raw)
  To: dev

To support configurable CRC stripping in both PF host
and VF, a new operation and a new structure are added
to carry more configurations from VF to PF host.

v2 changes:
* Put all the renaming and code style fixes into a patch.
* Put processing crc stripping configuration in PF host
  into a single patch.
* Put setting the crc stripping into a single patch.
* Put the configuring crc stripping in VF into a single patch.
* Added several more code style fixes reported by checkpatch.pl.

v3 changes:
* Added a macro of calculating memory size for configuring
  vsi queues.
* Used array of memory in stack to replace the memory
  allocated by rte_zmalloc().
* Added an input parameter for configuring crc stripping in
  RX queue context.
* Put configuring crc stripping of both PF host and VF
  into a single patch.
* Defined below new structures for the configuring specifically.
  - struct i40e_virtchnl_rxq_ext_info;
  - struct i40e_virtchnl_queue_pair_ext_info;
  - struct i40e_virtchnl_vsi_queue_config_ext_info;
* Renamed 'I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX' to
  'I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT'.

Helin Zhang (5):
  config: remove useless i40e items in config files
  i40evf: Remove 'host_is_dpdk', and use version number instead
  i40e: renaming and code style fix
  i40e: support of configurable crc stripping in rx queue
  i40e: support of configurable VF crc stripping

 config/common_bsdapp                 |   1 -
 config/common_linuxapp               |   1 -
 lib/librte_pmd_i40e/i40e_ethdev.h    |   3 +-
 lib/librte_pmd_i40e/i40e_ethdev_vf.c | 218 +++++++++++++++++++++++------------
 lib/librte_pmd_i40e/i40e_pf.c        | 134 +++++++++++++++------
 lib/librte_pmd_i40e/i40e_pf.h        |  57 +++++++--
 6 files changed, 297 insertions(+), 117 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v3 1/5] config: remove useless i40e items in config files
  2014-11-06 12:53 ` [dpdk-dev] [PATCH v3 0/5] support of configurable CRC " Helin Zhang
@ 2014-11-06 12:53   ` 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
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Helin Zhang @ 2014-11-06 12:53 UTC (permalink / raw)
  To: dev

Remove 'CONFIG_RTE_LIBRTE_I40E_PF_DISABLE_STRIP_CRC'
from config files, as nowhere uses it.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 config/common_bsdapp   | 1 -
 config/common_linuxapp | 1 -
 2 files changed, 2 deletions(-)

diff --git a/config/common_bsdapp b/config/common_bsdapp
index 9dc9f56..57cad76 100644
--- a/config/common_bsdapp
+++ b/config/common_bsdapp
@@ -179,7 +179,6 @@ CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_DRIVER=n
-CONFIG_RTE_LIBRTE_I40E_PF_DISABLE_STRIP_CRC=y
 CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC=n
 CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
 CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF=4
diff --git a/config/common_linuxapp b/config/common_linuxapp
index 8be79c3..57b61c9 100644
--- a/config/common_linuxapp
+++ b/config/common_linuxapp
@@ -202,7 +202,6 @@ CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_DRIVER=n
-CONFIG_RTE_LIBRTE_I40E_PF_DISABLE_STRIP_CRC=n
 CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC=y
 CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
 CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF=4
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v3 2/5] i40evf: Remove 'host_is_dpdk', and use version number instead
  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   ` Helin Zhang
  2014-11-06 12:53   ` [dpdk-dev] [PATCH v3 3/5] i40e: renaming and code style fix Helin Zhang
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Helin Zhang @ 2014-11-06 12:53 UTC (permalink / raw)
  To: dev

API version number is straightfoward enough for checking
the PF host, and no need to use 'host_is_dpdk'.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 lib/librte_pmd_i40e/i40e_ethdev.h    |  3 ++-
 lib/librte_pmd_i40e/i40e_ethdev_vf.c | 29 +++++++++++++++--------------
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/lib/librte_pmd_i40e/i40e_ethdev.h b/lib/librte_pmd_i40e/i40e_ethdev.h
index afa14aa..96361c2 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev.h
+++ b/lib/librte_pmd_i40e/i40e_ethdev.h
@@ -323,7 +323,8 @@ struct i40e_vf {
 	bool promisc_unicast_enabled;
 	bool promisc_multicast_enabled;
 
-	bool host_is_dpdk; /* The flag indicates if the host is DPDK */
+	uint32_t version_major; /* Major version number */
+	uint32_t version_minor; /* Minor version number */
 	uint16_t promisc_flags; /* Promiscuous setting */
 	uint32_t vlan[I40E_VFTA_SIZE]; /* VLAN bit map */
 
diff --git a/lib/librte_pmd_i40e/i40e_ethdev_vf.c b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
index fa838e6..966f02f 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev_vf.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
@@ -393,17 +393,18 @@ i40evf_check_api_version(struct rte_eth_dev *dev)
 	}
 
 	pver = (struct i40e_virtchnl_version_info *)args.out_buffer;
-	/* We are talking with DPDK host */
-	if (pver->major == I40E_DPDK_VERSION_MAJOR) {
-		vf->host_is_dpdk = TRUE;
-		PMD_DRV_LOG(INFO, "Detect PF host is DPDK app");
-	}
-	/* It's linux host driver */
-	else if ((pver->major != version.major) ||
-	    (pver->minor != version.minor)) {
-		PMD_INIT_LOG(ERR, "pf/vf API version mismatch. "
-			     "(%u.%u)-(%u.%u)", pver->major, pver->minor,
-			     version.major, version.minor);
+	vf->version_major = pver->major;
+	vf->version_minor = pver->minor;
+	if (vf->version_major == I40E_DPDK_VERSION_MAJOR)
+		PMD_DRV_LOG(INFO, "Peer is DPDK PF host");
+	else if ((vf->version_major == I40E_VIRTCHNL_VERSION_MAJOR) &&
+		(vf->version_minor == I40E_VIRTCHNL_VERSION_MINOR))
+		PMD_DRV_LOG(INFO, "Peer is Linux PF host");
+	else {
+		PMD_INIT_LOG(ERR, "PF/VF API version mismatch:(%u.%u)-(%u.%u)",
+					vf->version_major, vf->version_minor,
+						I40E_VIRTCHNL_VERSION_MAJOR,
+						I40E_VIRTCHNL_VERSION_MINOR);
 		return -1;
 	}
 
@@ -1182,7 +1183,7 @@ i40evf_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 
 	/* Linux pf host doesn't support vlan offload yet */
-	if (vf->host_is_dpdk) {
+	if (vf->version_major == I40E_DPDK_VERSION_MAJOR) {
 		/* Vlan stripping setting */
 		if (mask & ETH_VLAN_STRIP_MASK) {
 			/* Enable or disable VLAN stripping */
@@ -1207,7 +1208,7 @@ i40evf_vlan_pvid_set(struct rte_eth_dev *dev, uint16_t pvid, int on)
 	info.on = on;
 
 	/* Linux pf host don't support vlan offload yet */
-	if (vf->host_is_dpdk) {
+	if (vf->version_major == I40E_DPDK_VERSION_MAJOR) {
 		if (info.on)
 			info.config.pvid = pvid;
 		else {
@@ -1480,7 +1481,7 @@ i40evf_dev_link_update(struct rte_eth_dev *dev,
 	 * DPDK pf host provide interfacet to acquire link status
 	 * while Linux driver does not
 	 */
-	if (vf->host_is_dpdk)
+	if (vf->version_major == I40E_DPDK_VERSION_MAJOR)
 		i40evf_get_link_status(dev, &new_link);
 	else {
 		/* Always assume it's up, for Linux driver PF host */
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v3 3/5] i40e: renaming and code style fix
  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   ` Helin Zhang
  2014-11-06 12:53   ` [dpdk-dev] [PATCH v3 4/5] i40e: support of configurable crc stripping in rx queue Helin Zhang
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Helin Zhang @ 2014-11-06 12:53 UTC (permalink / raw)
  To: dev

Rename some local variables to express more accurately
and briefly. Fix several code style issues reported by
checkpatch.pl. Line warpping for some source lines which
has more than 80 characters, and merge lines together for
those source lines which does not need any line wrapping
actually. Add macros for numeric or calculating memory
sizes.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 lib/librte_pmd_i40e/i40e_ethdev_vf.c | 86 ++++++++++++++++++------------------
 lib/librte_pmd_i40e/i40e_pf.c        | 46 +++++++++----------
 lib/librte_pmd_i40e/i40e_pf.h        | 29 +++++++++---
 3 files changed, 84 insertions(+), 77 deletions(-)

v2 changes:
* Put all the renaming and code style fixes into a patch.
* Added several more code style fixes for i40e_pf.c.

v3 changes:
* Added a macro of calculating memory size for configuring
  vsi queues.
* Used array of memory in stack to replace the memory
  allocated by rte_zmalloc().

diff --git a/lib/librte_pmd_i40e/i40e_ethdev_vf.c b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
index 966f02f..9a8cdc8 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev_vf.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
@@ -537,78 +537,76 @@ static int
 i40evf_configure_queues(struct rte_eth_dev *dev)
 {
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
-	struct i40e_virtchnl_vsi_queue_config_info *queue_info;
-	struct i40e_virtchnl_queue_pair_info *queue_cfg;
 	struct i40e_rx_queue **rxq =
 		(struct i40e_rx_queue **)dev->data->rx_queues;
 	struct i40e_tx_queue **txq =
 		(struct i40e_tx_queue **)dev->data->tx_queues;
-	int i, len, nb_qpairs, num_rxq, num_txq;
-	int err;
+	struct i40e_virtchnl_vsi_queue_config_info *vc_vqci;
+	struct i40e_virtchnl_queue_pair_info *vc_qpi;
 	struct vf_cmd_info args;
-	struct rte_pktmbuf_pool_private *mbp_priv;
+	uint16_t i, nb_qp = vf->num_queue_pairs;
+	const uint32_t size =
+		I40E_VIRTCHNL_CONFIG_VSI_QUEUES_SIZE(vc_vqci, nb_qp);
+	uint8_t buff[size];
+	int ret;
 
-	nb_qpairs = vf->num_queue_pairs;
-	len = sizeof(*queue_info) + sizeof(*queue_cfg) * nb_qpairs;
-	queue_info = rte_zmalloc("queue_info", len, 0);
-	if (queue_info == NULL) {
-		PMD_INIT_LOG(ERR, "failed alloc memory for queue_info");
-		return -1;
-	}
-	queue_info->vsi_id = vf->vsi_res->vsi_id;
-	queue_info->num_queue_pairs = nb_qpairs;
-	queue_cfg = queue_info->qpair;
+	memset(buff, 0, sizeof(buff));
+	vc_vqci = (struct i40e_virtchnl_vsi_queue_config_info *)buff;
+	vc_vqci->vsi_id = vf->vsi_res->vsi_id;
+	vc_vqci->num_queue_pairs = nb_qp;
+	vc_qpi = vc_vqci->qpair;
 
-	num_rxq = dev->data->nb_rx_queues;
-	num_txq = dev->data->nb_tx_queues;
 	/*
 	 * PF host driver required to configure queues in pairs, which means
 	 * rxq_num should equals to txq_num. The actual usage won't always
 	 * work that way. The solution is fills 0 with HW ring option in case
 	 * they are not equal.
 	 */
-	for (i = 0; i < nb_qpairs; i++) {
+	for (i = 0; i < nb_qp; i++) {
 		/*Fill TX info */
-		queue_cfg->txq.vsi_id = queue_info->vsi_id;
-		queue_cfg->txq.queue_id = i;
-		if (i < num_txq) {
-			queue_cfg->txq.ring_len = txq[i]->nb_tx_desc;
-			queue_cfg->txq.dma_ring_addr = txq[i]->tx_ring_phys_addr;
+		vc_qpi->txq.vsi_id = vc_vqci->vsi_id;
+		vc_qpi->txq.queue_id = i;
+		if (i < dev->data->nb_tx_queues) {
+			vc_qpi->txq.ring_len = txq[i]->nb_tx_desc;
+			vc_qpi->txq.dma_ring_addr = txq[i]->tx_ring_phys_addr;
 		} else {
-			queue_cfg->txq.ring_len = 0;
-			queue_cfg->txq.dma_ring_addr = 0;
+			vc_qpi->txq.ring_len = 0;
+			vc_qpi->txq.dma_ring_addr = 0;
 		}
 
 		/* Fill RX info */
-		queue_cfg->rxq.vsi_id = queue_info->vsi_id;
-		queue_cfg->rxq.queue_id = i;
-		queue_cfg->rxq.max_pkt_size = vf->max_pkt_len;
-		if (i < num_rxq) {
-			mbp_priv = rte_mempool_get_priv(rxq[i]->mp);
-			queue_cfg->rxq.databuffer_size = mbp_priv->mbuf_data_room_size -
-						   RTE_PKTMBUF_HEADROOM;;
-			queue_cfg->rxq.ring_len = rxq[i]->nb_rx_desc;
-			queue_cfg->rxq.dma_ring_addr = rxq[i]->rx_ring_phys_addr;;
+		vc_qpi->rxq.vsi_id = vc_vqci->vsi_id;
+		vc_qpi->rxq.queue_id = i;
+		vc_qpi->rxq.max_pkt_size = vf->max_pkt_len;
+		if (i < dev->data->nb_rx_queues) {
+			struct rte_pktmbuf_pool_private *mbp_priv =
+				rte_mempool_get_priv(rxq[i]->mp);
+
+			vc_qpi->rxq.databuffer_size =
+				mbp_priv->mbuf_data_room_size -
+					RTE_PKTMBUF_HEADROOM;
+			vc_qpi->rxq.ring_len = rxq[i]->nb_rx_desc;
+			vc_qpi->rxq.dma_ring_addr = rxq[i]->rx_ring_phys_addr;
 		} else {
-			queue_cfg->rxq.ring_len = 0;
-			queue_cfg->rxq.dma_ring_addr = 0;
-			queue_cfg->rxq.databuffer_size = 0;
+			vc_qpi->rxq.ring_len = 0;
+			vc_qpi->rxq.dma_ring_addr = 0;
+			vc_qpi->rxq.databuffer_size = 0;
 		}
-		queue_cfg++;
+		vc_qpi++;
 	}
 
+	memset(&args, 0, sizeof(args));
 	args.ops = I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES;
-	args.in_args = (u8 *)queue_info;
-	args.in_args_size = len;
+	args.in_args = (uint8_t *)vc_vqci;
+	args.in_args_size = size;
 	args.out_buffer = cmd_result_buffer;
 	args.out_size = I40E_AQ_BUF_SZ;
-	err = i40evf_execute_vf_cmd(dev, &args);
-	if (err)
+	ret = i40evf_execute_vf_cmd(dev, &args);
+	if (ret)
 		PMD_DRV_LOG(ERR, "fail to execute command "
 			    "OP_CONFIG_VSI_QUEUES");
-	rte_free(queue_info);
 
-	return err;
+	return ret;
 }
 
 static int
diff --git a/lib/librte_pmd_i40e/i40e_pf.c b/lib/librte_pmd_i40e/i40e_pf.c
index f9049e1..f4b4f2d 100644
--- a/lib/librte_pmd_i40e/i40e_pf.c
+++ b/lib/librte_pmd_i40e/i40e_pf.c
@@ -413,29 +413,28 @@ i40e_pf_host_process_cmd_config_vsi_queues(struct i40e_pf_vf *vf,
 {
 	struct i40e_hw *hw = I40E_PF_TO_HW(vf->pf);
 	struct i40e_vsi *vsi = vf->vsi;
-	int ret = I40E_SUCCESS;
-	struct i40e_virtchnl_vsi_queue_config_info *qconfig =
-	    (struct i40e_virtchnl_vsi_queue_config_info *)msg;
-	int i;
-	struct i40e_virtchnl_queue_pair_info *qpair;
+	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;
+	int i, ret = I40E_SUCCESS;
 
-	if (msg == NULL || msglen <= sizeof(*qconfig) ||
-		qconfig->num_queue_pairs > vsi->nb_qps) {
+	if (msg == NULL || msglen <= sizeof(*vc_vqci) ||
+		vc_vqci->num_queue_pairs > vsi->nb_qps) {
 		PMD_DRV_LOG(ERR, "vsi_queue_config_info argument wrong");
 		ret = I40E_ERR_PARAM;
 		goto send_msg;
 	}
 
-	qpair = qconfig->qpair;
-	for (i = 0; i < qconfig->num_queue_pairs; i++) {
-		if (qpair[i].rxq.queue_id > vsi->nb_qps - 1 ||
-			qpair[i].txq.queue_id > vsi->nb_qps - 1) {
+	vc_qpi = vc_vqci->qpair;
+	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) {
 			ret = I40E_ERR_PARAM;
 			goto send_msg;
 		}
 
 		/* Apply VF RX queue setting to HMC */
-		if (i40e_pf_host_hmc_config_rxq(hw, vf, &qpair[i].rxq)
+		if (i40e_pf_host_hmc_config_rxq(hw, vf, &vc_qpi[i].rxq)
 			!= I40E_SUCCESS) {
 			PMD_DRV_LOG(ERR, "Configure RX queue HMC failed");
 			ret = I40E_ERR_PARAM;
@@ -443,7 +442,7 @@ i40e_pf_host_process_cmd_config_vsi_queues(struct i40e_pf_vf *vf,
 		}
 
 		/* Apply VF TX queue setting to HMC */
-		if (i40e_pf_host_hmc_config_txq(hw, vf, &qpair[i].txq)
+		if (i40e_pf_host_hmc_config_txq(hw, vf, &vc_qpi[i].txq)
 			!= I40E_SUCCESS) {
 			PMD_DRV_LOG(ERR, "Configure TX queue HMC failed");
 			ret = I40E_ERR_PARAM;
@@ -454,6 +453,7 @@ 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);
+
 	return ret;
 }
 
@@ -660,7 +660,6 @@ send_msg:
 	return ret;
 }
 
-
 static int
 i40e_pf_host_process_cmd_add_vlan(struct i40e_pf_vf *vf,
 				uint8_t *msg, uint16_t msglen)
@@ -874,8 +873,7 @@ 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");
-		i40e_pf_host_process_cmd_config_vsi_queues(vf,
-						msg, msglen);
+		i40e_pf_host_process_cmd_config_vsi_queues(vf, msg, msglen);
 		break;
 	case I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP:
 		PMD_DRV_LOG(INFO, "OP_CONFIG_IRQ_MAP received");
@@ -883,23 +881,19 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,
 		break;
 	case I40E_VIRTCHNL_OP_ENABLE_QUEUES:
 		PMD_DRV_LOG(INFO, "OP_ENABLE_QUEUES received");
-		i40e_pf_host_process_cmd_enable_queues(vf,
-						msg, msglen);
+		i40e_pf_host_process_cmd_enable_queues(vf, msg, msglen);
 		break;
 	case I40E_VIRTCHNL_OP_DISABLE_QUEUES:
 		PMD_DRV_LOG(INFO, "OP_DISABLE_QUEUE received");
-		i40e_pf_host_process_cmd_disable_queues(vf,
-						msg, msglen);
+		i40e_pf_host_process_cmd_disable_queues(vf, msg, msglen);
 		break;
 	case I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS:
 		PMD_DRV_LOG(INFO, "OP_ADD_ETHER_ADDRESS received");
-		i40e_pf_host_process_cmd_add_ether_address(vf,
-						msg, msglen);
+		i40e_pf_host_process_cmd_add_ether_address(vf, msg, msglen);
 		break;
 	case I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS:
 		PMD_DRV_LOG(INFO, "OP_DEL_ETHER_ADDRESS received");
-		i40e_pf_host_process_cmd_del_ether_address(vf,
-						msg, msglen);
+		i40e_pf_host_process_cmd_del_ether_address(vf, msg, msglen);
 		break;
 	case I40E_VIRTCHNL_OP_ADD_VLAN:
 		PMD_DRV_LOG(INFO, "OP_ADD_VLAN received");
@@ -936,8 +930,8 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,
 		PMD_DRV_LOG(ERR, "OP_FCOE received, not supported");
 	default:
 		PMD_DRV_LOG(ERR, "%u received, not supported", opcode);
-		i40e_pf_host_send_msg_to_vf(vf, opcode,
-				I40E_ERR_PARAM, NULL, 0);
+		i40e_pf_host_send_msg_to_vf(vf, opcode, I40E_ERR_PARAM,
+								NULL, 0);
 		break;
 	}
 }
diff --git a/lib/librte_pmd_i40e/i40e_pf.h b/lib/librte_pmd_i40e/i40e_pf.h
index 41b6826..ce5a978 100644
--- a/lib/librte_pmd_i40e/i40e_pf.h
+++ b/lib/librte_pmd_i40e/i40e_pf.h
@@ -46,28 +46,43 @@
 /* Default setting on number of VSIs that VF can contain */
 #define I40E_DEFAULT_VF_VSI_NUM 1
 
+#define I40E_DPDK_OFFSET  0x100
+
 enum i40e_pf_vfr_state {
 	I40E_PF_VFR_INPROGRESS = 0,
 	I40E_PF_VFR_COMPLETED = 1,
 };
 
 /* DPDK pf driver specific command to VF */
-enum i40e_virtchnl_ops_DPDK {
-	/* Keep some gap between Linu PF commands and DPDK PF specific commands */
-	I40E_VIRTCHNL_OP_GET_LINK_STAT = I40E_VIRTCHNL_OP_EVENT + 0x100,
+enum i40e_virtchnl_ops_dpdk {
+	/*
+	 * Keep some gap between Linux PF commands and
+	 * DPDK PF extended commands.
+	 */
+	I40E_VIRTCHNL_OP_GET_LINK_STAT = I40E_VIRTCHNL_OP_VERSION +
+						I40E_DPDK_OFFSET,
 	I40E_VIRTCHNL_OP_CFG_VLAN_OFFLOAD,
 	I40E_VIRTCHNL_OP_CFG_VLAN_PVID,
 };
+
 struct i40e_virtchnl_vlan_offload_info {
 	uint16_t vsi_id;
 	uint8_t enable_vlan_strip;
 	uint8_t reserved;
 };
 
-/* I40E_VIRTCHNL_OP_CFG_VLAN_PVID
- * VF sends this message to enable/disable pvid. If it's enable op, needs to specify the
- * pvid.
- * PF returns status code in retval.
+/*
+ * Macro to calculate the memory size for configuring VSI queues
+ * via virtual channel.
+ */
+#define I40E_VIRTCHNL_CONFIG_VSI_QUEUES_SIZE(x, n) \
+	(sizeof(*(x)) + sizeof((x)->qpair[0]) * (n))
+
+/*
+ * I40E_VIRTCHNL_OP_CFG_VLAN_PVID
+ * VF sends this message to enable/disable pvid. If it's
+ * enable op, needs to specify the pvid. PF returns status
+ * code in retval.
  */
 struct i40e_virtchnl_pvid_info {
 	uint16_t vsi_id;
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v3 4/5] i40e: support of configurable crc stripping in rx queue
  2014-11-06 12:53 ` [dpdk-dev] [PATCH v3 0/5] support of configurable CRC " Helin Zhang
                     ` (2 preceding siblings ...)
  2014-11-06 12:53   ` [dpdk-dev] [PATCH v3 3/5] i40e: renaming and code style fix Helin Zhang
@ 2014-11-06 12:53   ` 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
  5 siblings, 0 replies; 15+ messages in thread
From: Helin Zhang @ 2014-11-06 12:53 UTC (permalink / raw)
  To: dev

Support of configurable crc stripping in context of
VF RX queues.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 lib/librte_pmd_i40e/i40e_pf.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

v2 changes:
* Put setting the crc stripping into a single patch.

v3 changes:
* Added an input parameter for configuring crc stripping in
  RX queue context.

diff --git a/lib/librte_pmd_i40e/i40e_pf.c b/lib/librte_pmd_i40e/i40e_pf.c
index f4b4f2d..7f98636 100644
--- a/lib/librte_pmd_i40e/i40e_pf.c
+++ b/lib/librte_pmd_i40e/i40e_pf.c
@@ -56,6 +56,8 @@
 #include "i40e_rxtx.h"
 #include "i40e_pf.h"
 
+#define I40E_CFG_CRCSTRIP_DEFAULT 1
+
 static int
 i40e_pf_host_switch_queues(struct i40e_pf_vf *vf,
 			   struct i40e_virtchnl_queue_select *qsel,
@@ -325,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,
+			    uint8_t crcstrip)
 {
 	int err = I40E_SUCCESS;
 	struct i40e_hmc_obj_rxq rx_ctx;
@@ -354,7 +357,7 @@ i40e_pf_host_hmc_config_rxq(struct i40e_hw *hw,
 	rx_ctx.tphdata_ena = 1;
 	rx_ctx.tphhead_ena = 1;
 	rx_ctx.lrxqthresh = 2;
-	rx_ctx.crcstrip = 1;
+	rx_ctx.crcstrip = crcstrip;
 	rx_ctx.l2tsel = 1;
 	rx_ctx.prefena = 1;
 
@@ -434,8 +437,8 @@ i40e_pf_host_process_cmd_config_vsi_queues(struct i40e_pf_vf *vf,
 		}
 
 		/* Apply VF RX queue setting to HMC */
-		if (i40e_pf_host_hmc_config_rxq(hw, vf, &vc_qpi[i].rxq)
-			!= I40E_SUCCESS) {
+		if (i40e_pf_host_hmc_config_rxq(hw, vf, &vc_qpi[i].rxq,
+			I40E_CFG_CRCSTRIP_DEFAULT) != I40E_SUCCESS) {
 			PMD_DRV_LOG(ERR, "Configure RX queue HMC failed");
 			ret = I40E_ERR_PARAM;
 			goto send_msg;
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v3 5/5] i40e: support of configurable VF crc stripping
  2014-11-06 12:53 ` [dpdk-dev] [PATCH v3 0/5] support of configurable CRC " Helin Zhang
                     ` (3 preceding siblings ...)
  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   ` Helin Zhang
  2014-11-06 15:46   ` [dpdk-dev] [PATCH v3 0/5] support of configurable CRC stripping in VF Ananyev, Konstantin
  5 siblings, 0 replies; 15+ messages in thread
From: Helin Zhang @ 2014-11-06 12:53 UTC (permalink / raw)
  To: dev

Configurable CRC stripping needs to be supported in VF,
and the configuration should be finally set in relevant
RX queue context with PF host support.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 lib/librte_pmd_i40e/i40e_ethdev_vf.c | 155 +++++++++++++++++++++++++----------
 lib/librte_pmd_i40e/i40e_pf.c        |  83 +++++++++++++++++--
 lib/librte_pmd_i40e/i40e_pf.h        |  28 +++++++
 3 files changed, 218 insertions(+), 48 deletions(-)

v2 changes:
* Put setting the crc stripping of PF host into a single patch.
* Put configuring crc stripping in VF into a single patch.

v3 changes:
* Put configuring crc stripping of both PF host and VF
  into a single patch.
* Defined below new structures for the configuring specifically.
  - struct i40e_virtchnl_rxq_ext_info;
  - struct i40e_virtchnl_queue_pair_ext_info;
  - struct i40e_virtchnl_vsi_queue_config_ext_info;
* Renamed 'I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX' to
  'I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT'.

diff --git a/lib/librte_pmd_i40e/i40e_ethdev_vf.c b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
index 9a8cdc8..554d9d7 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev_vf.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
@@ -533,8 +533,46 @@ i40evf_config_vlan_pvid(struct rte_eth_dev *dev,
 	return err;
 }
 
+static void
+i40evf_fill_virtchnl_vsi_txq_info(struct i40e_virtchnl_txq_info *txq_info,
+				  uint16_t vsi_id,
+				  uint16_t queue_id,
+				  uint16_t nb_txq,
+				  struct i40e_tx_queue *txq)
+{
+	txq_info->vsi_id = vsi_id;
+	txq_info->queue_id = queue_id;
+	if (queue_id < nb_txq) {
+		txq_info->ring_len = txq->nb_tx_desc;
+		txq_info->dma_ring_addr = txq->tx_ring_phys_addr;
+	}
+}
+
+static void
+i40evf_fill_virtchnl_vsi_rxq_info(struct i40e_virtchnl_rxq_info *rxq_info,
+				  uint16_t vsi_id,
+				  uint16_t queue_id,
+				  uint16_t nb_rxq,
+				  uint32_t max_pkt_size,
+				  struct i40e_rx_queue *rxq)
+{
+	rxq_info->vsi_id = vsi_id;
+	rxq_info->queue_id = queue_id;
+	rxq_info->max_pkt_size = max_pkt_size;
+	if (queue_id < nb_rxq) {
+		struct rte_pktmbuf_pool_private *mbp_priv;
+
+		rxq_info->ring_len = rxq->nb_rx_desc;
+		rxq_info->dma_ring_addr = rxq->rx_ring_phys_addr;
+		mbp_priv = rte_mempool_get_priv(rxq->mp);
+		rxq_info->databuffer_size =
+			mbp_priv->mbuf_data_room_size - RTE_PKTMBUF_HEADROOM;
+	}
+}
+
+/* It configures VSI queues to co-work with Linux PF host */
 static int
-i40evf_configure_queues(struct rte_eth_dev *dev)
+i40evf_configure_vsi_queues(struct rte_eth_dev *dev)
 {
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	struct i40e_rx_queue **rxq =
@@ -554,47 +592,14 @@ i40evf_configure_queues(struct rte_eth_dev *dev)
 	vc_vqci = (struct i40e_virtchnl_vsi_queue_config_info *)buff;
 	vc_vqci->vsi_id = vf->vsi_res->vsi_id;
 	vc_vqci->num_queue_pairs = nb_qp;
-	vc_qpi = vc_vqci->qpair;
-
-	/*
-	 * PF host driver required to configure queues in pairs, which means
-	 * rxq_num should equals to txq_num. The actual usage won't always
-	 * work that way. The solution is fills 0 with HW ring option in case
-	 * they are not equal.
-	 */
-	for (i = 0; i < nb_qp; i++) {
-		/*Fill TX info */
-		vc_qpi->txq.vsi_id = vc_vqci->vsi_id;
-		vc_qpi->txq.queue_id = i;
-		if (i < dev->data->nb_tx_queues) {
-			vc_qpi->txq.ring_len = txq[i]->nb_tx_desc;
-			vc_qpi->txq.dma_ring_addr = txq[i]->tx_ring_phys_addr;
-		} else {
-			vc_qpi->txq.ring_len = 0;
-			vc_qpi->txq.dma_ring_addr = 0;
-		}
 
-		/* Fill RX info */
-		vc_qpi->rxq.vsi_id = vc_vqci->vsi_id;
-		vc_qpi->rxq.queue_id = i;
-		vc_qpi->rxq.max_pkt_size = vf->max_pkt_len;
-		if (i < dev->data->nb_rx_queues) {
-			struct rte_pktmbuf_pool_private *mbp_priv =
-				rte_mempool_get_priv(rxq[i]->mp);
-
-			vc_qpi->rxq.databuffer_size =
-				mbp_priv->mbuf_data_room_size -
-					RTE_PKTMBUF_HEADROOM;
-			vc_qpi->rxq.ring_len = rxq[i]->nb_rx_desc;
-			vc_qpi->rxq.dma_ring_addr = rxq[i]->rx_ring_phys_addr;
-		} else {
-			vc_qpi->rxq.ring_len = 0;
-			vc_qpi->rxq.dma_ring_addr = 0;
-			vc_qpi->rxq.databuffer_size = 0;
-		}
-		vc_qpi++;
+	for (i = 0, vc_qpi = vc_vqci->qpair; i < nb_qp; i++, vc_qpi++) {
+		i40evf_fill_virtchnl_vsi_txq_info(&vc_qpi->txq,
+			vc_vqci->vsi_id, i, dev->data->nb_tx_queues, txq[i]);
+		i40evf_fill_virtchnl_vsi_rxq_info(&vc_qpi->rxq,
+			vc_vqci->vsi_id, i, dev->data->nb_rx_queues,
+					vf->max_pkt_len, rxq[i]);
 	}
-
 	memset(&args, 0, sizeof(args));
 	args.ops = I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES;
 	args.in_args = (uint8_t *)vc_vqci;
@@ -603,13 +608,79 @@ i40evf_configure_queues(struct rte_eth_dev *dev)
 	args.out_size = I40E_AQ_BUF_SZ;
 	ret = i40evf_execute_vf_cmd(dev, &args);
 	if (ret)
-		PMD_DRV_LOG(ERR, "fail to execute command "
-			    "OP_CONFIG_VSI_QUEUES");
+		PMD_DRV_LOG(ERR, "Failed to execute command of "
+			"I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES\n");
+
+	return ret;
+}
+
+/* It configures VSI queues to co-work with DPDK PF host */
+static int
+i40evf_configure_vsi_queues_ext(struct rte_eth_dev *dev)
+{
+	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+	struct i40e_rx_queue **rxq =
+		(struct i40e_rx_queue **)dev->data->rx_queues;
+	struct i40e_tx_queue **txq =
+		(struct i40e_tx_queue **)dev->data->tx_queues;
+	struct i40e_virtchnl_vsi_queue_config_ext_info *vc_vqcei;
+	struct i40e_virtchnl_queue_pair_ext_info *vc_qpei;
+	struct vf_cmd_info args;
+	uint16_t i, nb_qp = vf->num_queue_pairs;
+	const uint32_t size =
+		I40E_VIRTCHNL_CONFIG_VSI_QUEUES_SIZE(vc_vqcei, nb_qp);
+	uint8_t buff[size];
+	int ret;
+
+	memset(buff, 0, sizeof(buff));
+	vc_vqcei = (struct i40e_virtchnl_vsi_queue_config_ext_info *)buff;
+	vc_vqcei->vsi_id = vf->vsi_res->vsi_id;
+	vc_vqcei->num_queue_pairs = nb_qp;
+	vc_qpei = vc_vqcei->qpair;
+	for (i = 0; i < nb_qp; i++, vc_qpei++) {
+		i40evf_fill_virtchnl_vsi_txq_info(&vc_qpei->txq,
+			vc_vqcei->vsi_id, i, dev->data->nb_tx_queues, txq[i]);
+		i40evf_fill_virtchnl_vsi_rxq_info(&vc_qpei->rxq,
+			vc_vqcei->vsi_id, i, dev->data->nb_rx_queues,
+					vf->max_pkt_len, rxq[i]);
+		if (i < dev->data->nb_rx_queues)
+			/*
+			 * It adds extra info for configuring VSI queues, which
+			 * is needed to enable the configurable crc stripping
+			 * in VF.
+			 */
+			vc_qpei->rxq_ext.crcstrip =
+				dev->data->dev_conf.rxmode.hw_strip_crc;
+	}
+	memset(&args, 0, sizeof(args));
+	args.ops =
+		(enum i40e_virtchnl_ops)I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT;
+	args.in_args = (uint8_t *)vc_vqcei;
+	args.in_args_size = size;
+	args.out_buffer = cmd_result_buffer;
+	args.out_size = I40E_AQ_BUF_SZ;
+	ret = i40evf_execute_vf_cmd(dev, &args);
+	if (ret)
+		PMD_DRV_LOG(ERR, "Failed to execute command of "
+			"I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT\n");
 
 	return ret;
 }
 
 static int
+i40evf_configure_queues(struct rte_eth_dev *dev)
+{
+	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+
+	if (vf->version_major == I40E_DPDK_VERSION_MAJOR)
+		/* To support DPDK PF host */
+		return i40evf_configure_vsi_queues_ext(dev);
+	else
+		/* To support Linux PF host */
+		return i40evf_configure_vsi_queues(dev);
+}
+
+static int
 i40evf_config_irq_map(struct rte_eth_dev *dev)
 {
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
diff --git a/lib/librte_pmd_i40e/i40e_pf.c b/lib/librte_pmd_i40e/i40e_pf.c
index 7f98636..cbb2dcc 100644
--- a/lib/librte_pmd_i40e/i40e_pf.c
+++ b/lib/librte_pmd_i40e/i40e_pf.c
@@ -421,9 +421,11 @@ i40e_pf_host_process_cmd_config_vsi_queues(struct i40e_pf_vf *vf,
 	struct i40e_virtchnl_queue_pair_info *vc_qpi;
 	int i, ret = I40E_SUCCESS;
 
-	if (msg == NULL || msglen <= sizeof(*vc_vqci) ||
-		vc_vqci->num_queue_pairs > vsi->nb_qps) {
-		PMD_DRV_LOG(ERR, "vsi_queue_config_info argument wrong");
+	if (!msg || vc_vqci->num_queue_pairs > vsi->nb_qps ||
+		vc_vqci->num_queue_pairs > I40E_MAX_VSI_QP ||
+		msglen < I40E_VIRTCHNL_CONFIG_VSI_QUEUES_SIZE(vc_vqci,
+					vc_vqci->num_queue_pairs)) {
+		PMD_DRV_LOG(ERR, "vsi_queue_config_info argument wrong\n");
 		ret = I40E_ERR_PARAM;
 		goto send_msg;
 	}
@@ -436,7 +438,13 @@ i40e_pf_host_process_cmd_config_vsi_queues(struct i40e_pf_vf *vf,
 			goto send_msg;
 		}
 
-		/* Apply VF RX queue setting to HMC */
+		/*
+		 * Apply VF RX queue setting to HMC.
+		 * If the opcode is I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT,
+		 * 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,
 			I40E_CFG_CRCSTRIP_DEFAULT) != I40E_SUCCESS) {
 			PMD_DRV_LOG(ERR, "Configure RX queue HMC failed");
@@ -445,8 +453,8 @@ i40e_pf_host_process_cmd_config_vsi_queues(struct i40e_pf_vf *vf,
 		}
 
 		/* Apply VF TX queue setting to HMC */
-		if (i40e_pf_host_hmc_config_txq(hw, vf, &vc_qpi[i].txq)
-			!= I40E_SUCCESS) {
+		if (i40e_pf_host_hmc_config_txq(hw, vf,
+			&vc_qpi[i].txq) != I40E_SUCCESS) {
 			PMD_DRV_LOG(ERR, "Configure TX queue HMC failed");
 			ret = I40E_ERR_PARAM;
 			goto send_msg;
@@ -461,6 +469,64 @@ send_msg:
 }
 
 static int
+i40e_pf_host_process_cmd_config_vsi_queues_ext(struct i40e_pf_vf *vf,
+					       uint8_t *msg,
+					       uint16_t msglen)
+{
+	struct i40e_hw *hw = I40E_PF_TO_HW(vf->pf);
+	struct i40e_vsi *vsi = vf->vsi;
+	struct i40e_virtchnl_vsi_queue_config_ext_info *vc_vqcei =
+		(struct i40e_virtchnl_vsi_queue_config_ext_info *)msg;
+	struct i40e_virtchnl_queue_pair_ext_info *vc_qpei;
+	int i, ret = I40E_SUCCESS;
+
+	if (!msg || vc_vqcei->num_queue_pairs > vsi->nb_qps ||
+		vc_vqcei->num_queue_pairs > I40E_MAX_VSI_QP ||
+		msglen < I40E_VIRTCHNL_CONFIG_VSI_QUEUES_SIZE(vc_vqcei,
+					vc_vqcei->num_queue_pairs)) {
+		PMD_DRV_LOG(ERR, "vsi_queue_config_ext_info argument wrong\n");
+		ret = I40E_ERR_PARAM;
+		goto send_msg;
+	}
+
+	vc_qpei = vc_vqcei->qpair;
+	for (i = 0; i < vc_vqcei->num_queue_pairs; i++) {
+		if (vc_qpei[i].rxq.queue_id > vsi->nb_qps - 1 ||
+			vc_qpei[i].txq.queue_id > vsi->nb_qps - 1) {
+			ret = I40E_ERR_PARAM;
+			goto send_msg;
+		}
+		/*
+		 * Apply VF RX queue setting to HMC.
+		 * If the opcode is I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT,
+		 * then the extra information of
+		 * 'struct i40e_virtchnl_queue_pair_ext_info' is needed,
+		 * otherwise set the last parameter to NULL.
+		 */
+		if (i40e_pf_host_hmc_config_rxq(hw, vf, &vc_qpei[i].rxq,
+			vc_qpei[i].rxq_ext.crcstrip) != I40E_SUCCESS) {
+			PMD_DRV_LOG(ERR, "Configure RX queue HMC failed");
+			ret = I40E_ERR_PARAM;
+			goto send_msg;
+		}
+
+		/* Apply VF TX queue setting to HMC */
+		if (i40e_pf_host_hmc_config_txq(hw, vf, &vc_qpei[i].txq) !=
+							I40E_SUCCESS) {
+			PMD_DRV_LOG(ERR, "Configure TX queue HMC failed");
+			ret = I40E_ERR_PARAM;
+			goto send_msg;
+		}
+	}
+
+send_msg:
+	i40e_pf_host_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT,
+								ret, NULL, 0);
+
+	return ret;
+}
+
+static int
 i40e_pf_host_process_cmd_config_irq_map(struct i40e_pf_vf *vf,
 					uint8_t *msg, uint16_t msglen)
 {
@@ -878,6 +944,11 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,
 		PMD_DRV_LOG(INFO, "OP_CONFIG_VSI_QUEUES received");
 		i40e_pf_host_process_cmd_config_vsi_queues(vf, msg, msglen);
 		break;
+	case I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT:
+		PMD_DRV_LOG(INFO, "OP_CONFIG_VSI_QUEUES_EXT received");
+		i40e_pf_host_process_cmd_config_vsi_queues_ext(vf, msg,
+								msglen);
+		break;
 	case I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP:
 		PMD_DRV_LOG(INFO, "OP_CONFIG_IRQ_MAP received");
 		i40e_pf_host_process_cmd_config_irq_map(vf, msg, msglen);
diff --git a/lib/librte_pmd_i40e/i40e_pf.h b/lib/librte_pmd_i40e/i40e_pf.h
index ce5a978..8bf83c2 100644
--- a/lib/librte_pmd_i40e/i40e_pf.h
+++ b/lib/librte_pmd_i40e/i40e_pf.h
@@ -63,6 +63,34 @@ enum i40e_virtchnl_ops_dpdk {
 						I40E_DPDK_OFFSET,
 	I40E_VIRTCHNL_OP_CFG_VLAN_OFFLOAD,
 	I40E_VIRTCHNL_OP_CFG_VLAN_PVID,
+	I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT,
+};
+
+/* A structure to support extended info of a receive queue. */
+struct i40e_virtchnl_rxq_ext_info {
+	uint8_t crcstrip;
+};
+
+/*
+ * A structure to support extended info of queue pairs, an additional field
+ * is added, comparing to original 'struct i40e_virtchnl_queue_pair_info'.
+ */
+struct i40e_virtchnl_queue_pair_ext_info {
+	/* vsi_id and queue_id should be identical for both rx and tx queues.*/
+	struct i40e_virtchnl_txq_info txq;
+	struct i40e_virtchnl_rxq_info rxq;
+	struct i40e_virtchnl_rxq_ext_info rxq_ext;
+};
+
+/*
+ * A structure to support extended info of VSI queue pairs,
+ * 'struct i40e_virtchnl_queue_pair_ext_info' is used, see its original
+ * of 'struct i40e_virtchnl_queue_pair_info'.
+ */
+struct i40e_virtchnl_vsi_queue_config_ext_info {
+	uint16_t vsi_id;
+	uint16_t num_queue_pairs;
+	struct i40e_virtchnl_queue_pair_ext_info qpair[0];
 };
 
 struct i40e_virtchnl_vlan_offload_info {
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH v3 0/5] support of configurable CRC stripping in VF
  2014-11-06 12:53 ` [dpdk-dev] [PATCH v3 0/5] support of configurable CRC " Helin Zhang
                     ` (4 preceding siblings ...)
  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   ` Ananyev, Konstantin
  2014-11-06 22:51     ` Thomas Monjalon
  5 siblings, 1 reply; 15+ messages in thread
From: Ananyev, Konstantin @ 2014-11-06 15:46 UTC (permalink / raw)
  To: Zhang, Helin, dev


> From: Zhang, Helin
> Sent: Thursday, November 06, 2014 12:54 PM
> To: dev@dpdk.org
> Cc: Cao, Waterman; Cao, Min; Ananyev, Konstantin; Zhang, Helin
> Subject: [PATCH v3 0/5] support of configurable CRC stripping in VF
> 
> To support configurable CRC stripping in both PF host
> and VF, a new operation and a new structure are added
> to carry more configurations from VF to PF host.
> 
> v2 changes:
> * Put all the renaming and code style fixes into a patch.
> * Put processing crc stripping configuration in PF host
>   into a single patch.
> * Put setting the crc stripping into a single patch.
> * Put the configuring crc stripping in VF into a single patch.
> * Added several more code style fixes reported by checkpatch.pl.
> 
> v3 changes:
> * Added a macro of calculating memory size for configuring
>   vsi queues.
> * Used array of memory in stack to replace the memory
>   allocated by rte_zmalloc().
> * Added an input parameter for configuring crc stripping in
>   RX queue context.
> * Put configuring crc stripping of both PF host and VF
>   into a single patch.
> * Defined below new structures for the configuring specifically.
>   - struct i40e_virtchnl_rxq_ext_info;
>   - struct i40e_virtchnl_queue_pair_ext_info;
>   - struct i40e_virtchnl_vsi_queue_config_ext_info;
> * Renamed 'I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX' to
>   'I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT'.
> 
> Helin Zhang (5):
>   config: remove useless i40e items in config files
>   i40evf: Remove 'host_is_dpdk', and use version number instead
>   i40e: renaming and code style fix
>   i40e: support of configurable crc stripping in rx queue
>   i40e: support of configurable VF crc stripping
> 
>  config/common_bsdapp                 |   1 -
>  config/common_linuxapp               |   1 -
>  lib/librte_pmd_i40e/i40e_ethdev.h    |   3 +-
>  lib/librte_pmd_i40e/i40e_ethdev_vf.c | 218 +++++++++++++++++++++++------------
>  lib/librte_pmd_i40e/i40e_pf.c        | 134 +++++++++++++++------
>  lib/librte_pmd_i40e/i40e_pf.h        |  57 +++++++--
>  6 files changed, 297 insertions(+), 117 deletions(-)
> 
> --
> 1.8.1.4

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH v3 0/5] support of configurable CRC stripping in VF
  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
  0 siblings, 0 replies; 15+ messages in thread
From: Thomas Monjalon @ 2014-11-06 22:51 UTC (permalink / raw)
  To: Zhang, Helin; +Cc: dev

> > To support configurable CRC stripping in both PF host
> > and VF, a new operation and a new structure are added
> > to carry more configurations from VF to PF host.
> > 
> > v2 changes:
> > * Put all the renaming and code style fixes into a patch.
> > * Put processing crc stripping configuration in PF host
> >   into a single patch.
> > * Put setting the crc stripping into a single patch.
> > * Put the configuring crc stripping in VF into a single patch.
> > * Added several more code style fixes reported by checkpatch.pl.
> > 
> > v3 changes:
> > * Added a macro of calculating memory size for configuring
> >   vsi queues.
> > * Used array of memory in stack to replace the memory
> >   allocated by rte_zmalloc().
> > * Added an input parameter for configuring crc stripping in
> >   RX queue context.
> > * Put configuring crc stripping of both PF host and VF
> >   into a single patch.
> > * Defined below new structures for the configuring specifically.
> >   - struct i40e_virtchnl_rxq_ext_info;
> >   - struct i40e_virtchnl_queue_pair_ext_info;
> >   - struct i40e_virtchnl_vsi_queue_config_ext_info;
> > * Renamed 'I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX' to
> >   'I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT'.
> > 
> > Helin Zhang (5):
> >   config: remove useless i40e items in config files
> >   i40evf: Remove 'host_is_dpdk', and use version number instead
> >   i40e: renaming and code style fix
> >   i40e: support of configurable crc stripping in rx queue
> >   i40e: support of configurable VF crc stripping
> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Applied

Thanks
-- 
Thomas

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-11-06 22:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [dpdk-dev] [PATCH v2 3/5] i40e: support of processing crc stripping config in PF host Helin Zhang
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

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).