* [dpdk-dev] [PATCH 0/4] enhancement to i40e PF host driver @ 2017-01-03 0:59 Chen Jing D(Mark) 2017-01-03 0:59 ` [dpdk-dev] [PATCH 1/4] net/i40e: change version number to support Linux VF Chen Jing D(Mark) ` (3 more replies) 0 siblings, 4 replies; 15+ messages in thread From: Chen Jing D(Mark) @ 2017-01-03 0:59 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, vincent.jardin, jingjing.wu, Chen Jing D(Mark) Current PF host driver can serve DPDK VF well, but the implementation is not complete to support Linux VF, even both DPDK VF and Linux VF use same API set. This patch set made below changes: 1. Make an enhancement on interface to serve VF, so both Linux and DPDK VF can be well served. 2. Change API version number so both DPDK and Linux VF can recognize and select proper command and data structure to request service. But the sacrifice is DPDK VF can't identify host driver (Linux or DPDK) and extended function provided in DPDK PF host driver can't be used. This situation will change after negotiate with Linux maintainer to provide a better mechanism to identify both PF and VF function. Chen Jing D(Mark) (4): net/i40e: change version number to support Linux VF net/i40e: return correct VSI id net/i40e: parse more VF parameter and configure net/i40e: support Linux VF to configure IRQ link list drivers/net/i40e/i40e_pf.c | 174 +++++++++++++++++++++++++++++++++++++++----- 1 files changed, 156 insertions(+), 18 deletions(-) -- 1.7.7.6 ^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH 1/4] net/i40e: change version number to support Linux VF 2017-01-03 0:59 [dpdk-dev] [PATCH 0/4] enhancement to i40e PF host driver Chen Jing D(Mark) @ 2017-01-03 0:59 ` Chen Jing D(Mark) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver Chen Jing D(Mark) 2017-01-03 0:59 ` [dpdk-dev] [PATCH 2/4] net/i40e: return correct VSI id Chen Jing D(Mark) ` (2 subsequent siblings) 3 siblings, 1 reply; 15+ messages in thread From: Chen Jing D(Mark) @ 2017-01-03 0:59 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, vincent.jardin, jingjing.wu, Chen Jing D(Mark) i40e PF host only support to work with DPDK VF driver, Linux VF driver is not supported. This change will enhance in version number returned. Current version info returned won't be able to be recognized by Linux VF driver, change to values that both DPDK VF and Linux driver can recognize. The expense is original DPDK host specific feature like CFG_VLAN_PVID and CONFIG_VSI_QUEUES_EXT will not available. DPDK VF also can't identify host driver by version number returned. It always assume talking with Linux PF. Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com> --- drivers/net/i40e/i40e_pf.c | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index 97b8ecc..229f71a 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -278,8 +278,20 @@ { struct i40e_virtchnl_version_info info; - info.major = I40E_DPDK_VERSION_MAJOR; - info.minor = I40E_DPDK_VERSION_MINOR; + /* Respond like a Linux PF host in order to support both DPDK VF and + * Linux VF driver. The expense is original DPDK host specific feature + * like CFG_VLAN_PVID and CONFIG_VSI_QUEUES_EXT will not available. + * + * DPDK VF also can't identify host driver by version number returned. + * It always assume talking with Linux PF. + * + * TODO: + * Discuss with Linux driver maintainer if possible to carry more info + * in this function to identify it's Linux or DPDK host. + */ + info.major = I40E_VIRTCHNL_VERSION_MAJOR; + info.minor = I40E_VIRTCHNL_VERSION_MINOR_NO_VF_CAPS; + i40e_pf_host_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_VERSION, I40E_SUCCESS, (uint8_t *)&info, sizeof(info)); } -- 1.7.7.6 ^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver 2017-01-03 0:59 ` [dpdk-dev] [PATCH 1/4] net/i40e: change version number to support Linux VF Chen Jing D(Mark) @ 2017-01-13 3:13 ` Chen Jing D(Mark) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 1/4] net/i40e: change version number to support Linux VF Chen Jing D(Mark) ` (4 more replies) 0 siblings, 5 replies; 15+ messages in thread From: Chen Jing D(Mark) @ 2017-01-13 3:13 UTC (permalink / raw) To: dev Cc: daniels, helin.zhang, ferruh.yigit, vincent.jardin, jingjing.wu, Chen Jing D(Mark) v2: - add macro to replace numeric - rework comments Current PF host driver can serve DPDK VF well, but the implementation is not complete to support Linux VF, even both DPDK VF and Linux VF use same API set. Note that the patch are experimental for use and might be removed without prior notice. This patch set made below changes: 1. Make an enhancement on interface to serve VF, so both Linux and DPDK VF can be well served. 2. Change API version number so both DPDK and Linux VF can recognize and select proper command and data structure to request service. But the sacrifice is DPDK VF can't identify host driver (Linux or DPDK) and extended function provided in DPDK PF host driver can't be used. This situation will change after negotiate with Linux maintainer to provide a better mechanism to identify both PF and VF function. Chen Jing D(Mark) (4): net/i40e: change version number to support Linux VF net/i40e: return correct VSI id net/i40e: parse more VF parameter and configure net/i40e: support Linux VF to configure IRQ link list drivers/net/i40e/i40e_pf.c | 171 +++++++++++++++++++++++++++++++++++++++----- 1 files changed, 153 insertions(+), 18 deletions(-) -- 1.7.7.6 ^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v2 1/4] net/i40e: change version number to support Linux VF 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver Chen Jing D(Mark) @ 2017-01-13 3:13 ` Chen Jing D(Mark) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 2/4] net/i40e: return correct VSI id Chen Jing D(Mark) ` (3 subsequent siblings) 4 siblings, 0 replies; 15+ messages in thread From: Chen Jing D(Mark) @ 2017-01-13 3:13 UTC (permalink / raw) To: dev Cc: daniels, helin.zhang, ferruh.yigit, vincent.jardin, jingjing.wu, Chen Jing D(Mark) i40e PF host only support to work with DPDK VF driver, Linux VF driver is not supported. This change will enhance in version number returned. Current version info returned won't be able to be recognized by Linux VF driver, change to values that both DPDK VF and Linux driver can recognize. The expense is original DPDK host specific feature like CFG_VLAN_PVID and CONFIG_VSI_QUEUES_EXT will not available. DPDK VF also can't identify host driver by version number returned. It always assume talking with Linux PF. Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com> --- drivers/net/i40e/i40e_pf.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index ddfc140..fa4af2b 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -276,8 +276,16 @@ { struct i40e_virtchnl_version_info info; - info.major = I40E_DPDK_VERSION_MAJOR; - info.minor = I40E_DPDK_VERSION_MINOR; + /* Respond like a Linux PF host in order to support both DPDK VF and + * Linux VF driver. The expense is original DPDK host specific feature + * like CFG_VLAN_PVID and CONFIG_VSI_QUEUES_EXT will not available. + * + * DPDK VF also can't identify host driver by version number returned. + * It always assume talking with Linux PF. + */ + info.major = I40E_VIRTCHNL_VERSION_MAJOR; + info.minor = I40E_VIRTCHNL_VERSION_MINOR_NO_VF_CAPS; + i40e_pf_host_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_VERSION, I40E_SUCCESS, (uint8_t *)&info, sizeof(info)); } -- 1.7.7.6 ^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v2 2/4] net/i40e: return correct VSI id 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver Chen Jing D(Mark) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 1/4] net/i40e: change version number to support Linux VF Chen Jing D(Mark) @ 2017-01-13 3:13 ` Chen Jing D(Mark) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 3/4] net/i40e: parse more VF parameter and configure Chen Jing D(Mark) ` (2 subsequent siblings) 4 siblings, 0 replies; 15+ messages in thread From: Chen Jing D(Mark) @ 2017-01-13 3:13 UTC (permalink / raw) To: dev Cc: daniels, helin.zhang, ferruh.yigit, vincent.jardin, jingjing.wu, Chen Jing D(Mark) PF host didn't return correct VSI id to VF. This change fix it. Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com> --- drivers/net/i40e/i40e_pf.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index fa4af2b..fd83c16 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -329,8 +329,7 @@ /* Change below setting if PF host can support more VSIs for VF */ vf_res->vsi_res[0].vsi_type = I40E_VSI_SRIOV; - /* As assume Vf only has single VSI now, always return 0 */ - vf_res->vsi_res[0].vsi_id = 0; + vf_res->vsi_res[0].vsi_id = vf->vsi->vsi_id; vf_res->vsi_res[0].num_queue_pairs = vf->vsi->nb_qps; ether_addr_copy(&vf->mac_addr, (struct ether_addr *)vf_res->vsi_res[0].default_mac_addr); -- 1.7.7.6 ^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v2 3/4] net/i40e: parse more VF parameter and configure 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver Chen Jing D(Mark) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 1/4] net/i40e: change version number to support Linux VF Chen Jing D(Mark) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 2/4] net/i40e: return correct VSI id Chen Jing D(Mark) @ 2017-01-13 3:13 ` Chen Jing D(Mark) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 4/4] net/i40e: support Linux VF to configure IRQ link list Chen Jing D(Mark) 2017-01-16 0:55 ` [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver Zhang, Helin 4 siblings, 0 replies; 15+ messages in thread From: Chen Jing D(Mark) @ 2017-01-13 3:13 UTC (permalink / raw) To: dev Cc: daniels, helin.zhang, ferruh.yigit, vincent.jardin, jingjing.wu, Chen Jing D(Mark) When VF requested to configure TX queue, a few parameters are missed to be configured in PF host. This change have more fields parsed and configured for TX context. Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com> --- drivers/net/i40e/i40e_pf.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index fd83c16..f12a6aa 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -400,10 +400,12 @@ /* clear the context structure first */ memset(&tx_ctx, 0, sizeof(tx_ctx)); - tx_ctx.new_context = 1; tx_ctx.base = txq->dma_ring_addr / I40E_QUEUE_BASE_ADDR_UNIT; tx_ctx.qlen = txq->ring_len; tx_ctx.rdylist = rte_le_to_cpu_16(vf->vsi->info.qs_handle[0]); + tx_ctx.head_wb_ena = txq->headwb_enabled; + tx_ctx.head_wb_addr = txq->dma_headwb_addr; + err = i40e_clear_lan_tx_queue_context(hw, abs_queue_id); if (err != I40E_SUCCESS) return err; -- 1.7.7.6 ^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v2 4/4] net/i40e: support Linux VF to configure IRQ link list 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver Chen Jing D(Mark) ` (2 preceding siblings ...) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 3/4] net/i40e: parse more VF parameter and configure Chen Jing D(Mark) @ 2017-01-13 3:13 ` Chen Jing D(Mark) 2017-01-16 0:55 ` [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver Zhang, Helin 4 siblings, 0 replies; 15+ messages in thread From: Chen Jing D(Mark) @ 2017-01-13 3:13 UTC (permalink / raw) To: dev Cc: daniels, helin.zhang, ferruh.yigit, vincent.jardin, jingjing.wu, Chen Jing D(Mark) i40e PF host only support to work with DPDK VF driver, Linux VF driver is not supported. This change will enhance in configuring IRQ link list. This Change will identify VF client by number of vector requested. DPDK VF will ask only single one while Linux VF will request at least 2. It will have different configuration for different clients. DPDK VF will be configured to link all queue together, while Linux VF will be configured per request. Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com> --- drivers/net/i40e/i40e_pf.c | 152 ++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 139 insertions(+), 13 deletions(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index f12a6aa..384dfe9 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -546,13 +546,116 @@ return ret; } +static void +i40e_pf_config_irq_link_list(struct i40e_pf_vf *vf, + struct i40e_virtchnl_vector_map *vvm) +{ +#define BITS_PER_CHAR 8 + uint64_t linklistmap = 0, tempmap; + struct i40e_hw *hw = I40E_PF_TO_HW(vf->pf); + uint16_t qid; + bool b_first_q = true; + enum i40e_queue_type qtype; + uint16_t vector_id; + uint32_t reg, reg_idx; + uint16_t itr_idx = 0, i; + + vector_id = vvm->vector_id; + /* setup the head */ + if (!vector_id) + reg_idx = I40E_VPINT_LNKLST0(vf->vf_idx); + else + reg_idx = I40E_VPINT_LNKLSTN( + ((hw->func_caps.num_msix_vectors_vf - 1) * vf->vf_idx) + + (vector_id - 1)); + + if (vvm->rxq_map == 0 && vvm->txq_map == 0) { + I40E_WRITE_REG(hw, reg_idx, + I40E_VPINT_LNKLST0_FIRSTQ_INDX_MASK); + goto cfg_irq_done; + } + + /* sort all rx and tx queues */ + tempmap = vvm->rxq_map; + for (i = 0; i < sizeof(vvm->rxq_map) * BITS_PER_CHAR; i++) { + if (tempmap & 0x1) + linklistmap |= (1 << (2 * i)); + tempmap >>= 1; + } + + tempmap = vvm->txq_map; + for (i = 0; i < sizeof(vvm->txq_map) * BITS_PER_CHAR; i++) { + if (tempmap & 0x1) + linklistmap |= (1 << (2 * i + 1)); + tempmap >>= 1; + } + + /* Link all rx and tx queues into a chained list */ + tempmap = linklistmap; + i = 0; + b_first_q = true; + do { + if (tempmap & 0x1) { + qtype = (enum i40e_queue_type)(i % 2); + qid = vf->vsi->base_queue + i / 2; + if (b_first_q) { + /* This is header */ + b_first_q = false; + reg = ((qtype << + I40E_VPINT_LNKLSTN_FIRSTQ_TYPE_SHIFT) + | qid); + } else { + /* element in the link list */ + reg = (vector_id) | + (qtype << I40E_QINT_RQCTL_NEXTQ_TYPE_SHIFT) | + (qid << I40E_QINT_RQCTL_NEXTQ_INDX_SHIFT) | + BIT(I40E_QINT_RQCTL_CAUSE_ENA_SHIFT) | + (itr_idx << I40E_QINT_RQCTL_ITR_INDX_SHIFT); + } + I40E_WRITE_REG(hw, reg_idx, reg); + /* find next register to program */ + switch (qtype) { + case I40E_QUEUE_TYPE_RX: + reg_idx = I40E_QINT_RQCTL(qid); + itr_idx = vvm->rxitr_idx; + break; + case I40E_QUEUE_TYPE_TX: + reg_idx = I40E_QINT_TQCTL(qid); + itr_idx = vvm->txitr_idx; + break; + default: + break; + } + } + i++; + tempmap >>= 1; + } while (tempmap); + + /* Terminate the link list */ + reg = (vector_id) | + (0 << I40E_QINT_RQCTL_NEXTQ_TYPE_SHIFT) | + (0x7FF << I40E_QINT_RQCTL_NEXTQ_INDX_SHIFT) | + BIT(I40E_QINT_RQCTL_CAUSE_ENA_SHIFT) | + (itr_idx << I40E_QINT_RQCTL_ITR_INDX_SHIFT); + I40E_WRITE_REG(hw, reg_idx, reg); + +cfg_irq_done: + I40E_WRITE_FLUSH(hw); +} + static int i40e_pf_host_process_cmd_config_irq_map(struct i40e_pf_vf *vf, uint8_t *msg, uint16_t msglen) { int ret = I40E_SUCCESS; + struct i40e_pf *pf = vf->pf; + struct i40e_hw *hw = I40E_PF_TO_HW(vf->pf); struct i40e_virtchnl_irq_map_info *irqmap = (struct i40e_virtchnl_irq_map_info *)msg; + struct i40e_virtchnl_vector_map *map; + int i; + uint16_t vector_id; + unsigned long qbit_max; if (msg == NULL || msglen < sizeof(struct i40e_virtchnl_irq_map_info)) { PMD_DRV_LOG(ERR, "buffer too short"); @@ -560,23 +663,46 @@ goto send_msg; } - /* Assume VF only have 1 vector to bind all queues */ - if (irqmap->num_vectors != 1) { - PMD_DRV_LOG(ERR, "DKDK host only support 1 vector"); - ret = I40E_ERR_PARAM; + /* PF host will support both DPDK VF or Linux VF driver, identify by + * number of vectors requested. + */ + + /* DPDK VF only requires single vector */ + if (irqmap->num_vectors == 1) { + /* This MSIX intr store the intr in VF range */ + vf->vsi->msix_intr = irqmap->vecmap[0].vector_id; + vf->vsi->nb_msix = irqmap->num_vectors; + vf->vsi->nb_used_qps = vf->vsi->nb_qps; + + /* Don't care how the TX/RX queue mapping with this vector. + * Link all VF RX queues together. Only did mapping work. + * VF can disable/enable the intr by itself. + */ + i40e_vsi_queues_bind_intr(vf->vsi); goto send_msg; } - /* This MSIX intr store the intr in VF range */ - vf->vsi->msix_intr = irqmap->vecmap[0].vector_id; - vf->vsi->nb_msix = irqmap->num_vectors; - vf->vsi->nb_used_qps = vf->vsi->nb_qps; + /* Then, it's Linux VF driver */ + qbit_max = 1 << pf->vf_nb_qp_max; + for (i = 0; i < irqmap->num_vectors; i++) { + map = &irqmap->vecmap[i]; + + vector_id = map->vector_id; + /* validate msg params */ + if (vector_id >= hw->func_caps.num_msix_vectors_vf) { + ret = I40E_ERR_PARAM; + goto send_msg; + } + + if ((map->rxq_map < qbit_max) && (map->txq_map < qbit_max)) { + i40e_pf_config_irq_link_list(vf, map); + } else { + /* configured queue size excceed limit */ + ret = I40E_ERR_PARAM; + goto send_msg; + } + } - /* Don't care how the TX/RX queue mapping with this vector. - * Link all VF RX queues together. Only did mapping work. - * VF can disable/enable the intr by itself. - */ - i40e_vsi_queues_bind_intr(vf->vsi); send_msg: i40e_pf_host_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP, ret, NULL, 0); -- 1.7.7.6 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver Chen Jing D(Mark) ` (3 preceding siblings ...) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 4/4] net/i40e: support Linux VF to configure IRQ link list Chen Jing D(Mark) @ 2017-01-16 0:55 ` Zhang, Helin 2017-01-16 7:51 ` Vincent JARDIN 4 siblings, 1 reply; 15+ messages in thread From: Zhang, Helin @ 2017-01-16 0:55 UTC (permalink / raw) To: Chen, Jing D, dev Acked-by: Helin Zhang <helin.zhang@intel.com> -----Original Message----- From: Chen, Jing D Sent: Friday, January 13, 2017 11:13 AM To: dev@dpdk.org Cc: daniels@research.att.com; Zhang, Helin <helin.zhang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>; vincent.jardin@6wind.com; Wu, Jingjing <jingjing.wu@intel.com>; Chen, Jing D <jing.d.chen@intel.com> Subject: [PATCH v2 0/4] enhancement to i40e PF host driver v2: - add macro to replace numeric - rework comments Current PF host driver can serve DPDK VF well, but the implementation is not complete to support Linux VF, even both DPDK VF and Linux VF use same API set. Note that the patch are experimental for use and might be removed without prior notice. This patch set made below changes: 1. Make an enhancement on interface to serve VF, so both Linux and DPDK VF can be well served. 2. Change API version number so both DPDK and Linux VF can recognize and select proper command and data structure to request service. But the sacrifice is DPDK VF can't identify host driver (Linux or DPDK) and extended function provided in DPDK PF host driver can't be used. This situation will change after negotiate with Linux maintainer to provide a better mechanism to identify both PF and VF function. Chen Jing D(Mark) (4): net/i40e: change version number to support Linux VF net/i40e: return correct VSI id net/i40e: parse more VF parameter and configure net/i40e: support Linux VF to configure IRQ link list drivers/net/i40e/i40e_pf.c | 171 +++++++++++++++++++++++++++++++++++++++----- 1 files changed, 153 insertions(+), 18 deletions(-) -- 1.7.7.6 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver 2017-01-16 0:55 ` [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver Zhang, Helin @ 2017-01-16 7:51 ` Vincent JARDIN 2017-01-17 16:11 ` Ferruh Yigit 0 siblings, 1 reply; 15+ messages in thread From: Vincent JARDIN @ 2017-01-16 7:51 UTC (permalink / raw) To: Zhang, Helin, Chen, Jing D; +Cc: dev Le 16/01/2017 à 01:55, Zhang, Helin a écrit : > Acked-by: Helin Zhang <helin.zhang@intel.com> Acked-by: Vincent Jardin <vincent.jardin@6wind.com> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver 2017-01-16 7:51 ` Vincent JARDIN @ 2017-01-17 16:11 ` Ferruh Yigit 0 siblings, 0 replies; 15+ messages in thread From: Ferruh Yigit @ 2017-01-17 16:11 UTC (permalink / raw) To: Vincent JARDIN, Zhang, Helin, Chen, Jing D; +Cc: dev On 1/16/2017 7:51 AM, Vincent JARDIN wrote: > Le 16/01/2017 à 01:55, Zhang, Helin a écrit : >> Acked-by: Helin Zhang <helin.zhang@intel.com> > > Acked-by: Vincent Jardin <vincent.jardin@6wind.com> Series applied to dpdk-next-net/master, thanks. ^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH 2/4] net/i40e: return correct VSI id 2017-01-03 0:59 [dpdk-dev] [PATCH 0/4] enhancement to i40e PF host driver Chen Jing D(Mark) 2017-01-03 0:59 ` [dpdk-dev] [PATCH 1/4] net/i40e: change version number to support Linux VF Chen Jing D(Mark) @ 2017-01-03 0:59 ` Chen Jing D(Mark) 2017-01-03 0:59 ` [dpdk-dev] [PATCH 3/4] net/i40e: parse more VF parameter and configure Chen Jing D(Mark) 2017-01-03 0:59 ` [dpdk-dev] [PATCH 4/4] net/i40e: support Linux VF to configure IRQ link list Chen Jing D(Mark) 3 siblings, 0 replies; 15+ messages in thread From: Chen Jing D(Mark) @ 2017-01-03 0:59 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, vincent.jardin, jingjing.wu, Chen Jing D(Mark) PF host didn't return correct VSI id to VF. This change fix it. Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com> --- drivers/net/i40e/i40e_pf.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index 229f71a..5314d9f 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -335,8 +335,7 @@ /* Change below setting if PF host can support more VSIs for VF */ vf_res->vsi_res[0].vsi_type = I40E_VSI_SRIOV; - /* As assume Vf only has single VSI now, always return 0 */ - vf_res->vsi_res[0].vsi_id = 0; + vf_res->vsi_res[0].vsi_id = vf->vsi->vsi_id; vf_res->vsi_res[0].num_queue_pairs = vf->vsi->nb_qps; ether_addr_copy(&vf->mac_addr, (struct ether_addr *)vf_res->vsi_res[0].default_mac_addr); -- 1.7.7.6 ^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH 3/4] net/i40e: parse more VF parameter and configure 2017-01-03 0:59 [dpdk-dev] [PATCH 0/4] enhancement to i40e PF host driver Chen Jing D(Mark) 2017-01-03 0:59 ` [dpdk-dev] [PATCH 1/4] net/i40e: change version number to support Linux VF Chen Jing D(Mark) 2017-01-03 0:59 ` [dpdk-dev] [PATCH 2/4] net/i40e: return correct VSI id Chen Jing D(Mark) @ 2017-01-03 0:59 ` Chen Jing D(Mark) 2017-01-03 0:59 ` [dpdk-dev] [PATCH 4/4] net/i40e: support Linux VF to configure IRQ link list Chen Jing D(Mark) 3 siblings, 0 replies; 15+ messages in thread From: Chen Jing D(Mark) @ 2017-01-03 0:59 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, vincent.jardin, jingjing.wu, Chen Jing D(Mark) When VF requested to configure TX queue, a few parameters are missed to be configured in PF host. This change have more fields parsed and configured for TX context. Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com> --- drivers/net/i40e/i40e_pf.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index 5314d9f..75c5f03 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -406,10 +406,12 @@ /* clear the context structure first */ memset(&tx_ctx, 0, sizeof(tx_ctx)); - tx_ctx.new_context = 1; tx_ctx.base = txq->dma_ring_addr / I40E_QUEUE_BASE_ADDR_UNIT; tx_ctx.qlen = txq->ring_len; tx_ctx.rdylist = rte_le_to_cpu_16(vf->vsi->info.qs_handle[0]); + tx_ctx.head_wb_ena = txq->headwb_enabled; + tx_ctx.head_wb_addr = txq->dma_headwb_addr; + err = i40e_clear_lan_tx_queue_context(hw, abs_queue_id); if (err != I40E_SUCCESS) return err; -- 1.7.7.6 ^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH 4/4] net/i40e: support Linux VF to configure IRQ link list 2017-01-03 0:59 [dpdk-dev] [PATCH 0/4] enhancement to i40e PF host driver Chen Jing D(Mark) ` (2 preceding siblings ...) 2017-01-03 0:59 ` [dpdk-dev] [PATCH 3/4] net/i40e: parse more VF parameter and configure Chen Jing D(Mark) @ 2017-01-03 0:59 ` Chen Jing D(Mark) 3 siblings, 0 replies; 15+ messages in thread From: Chen Jing D(Mark) @ 2017-01-03 0:59 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, vincent.jardin, jingjing.wu, Chen Jing D(Mark) i40e PF host only support to work with DPDK VF driver, Linux VF driver is not supported. This change will enhance in configuring IRQ link list. This Change will identify VF client by number of vector requested. DPDK VF will ask only single one while Linux VF will request at least 2. It will have different configuration for different clients. DPDK VF will be configured to link all queue together, while Linux VF will be configured per request. Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com> --- drivers/net/i40e/i40e_pf.c | 151 ++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 138 insertions(+), 13 deletions(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index 75c5f03..eee5e85 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -552,13 +552,115 @@ return ret; } +static void +i40e_pf_config_irq_link_list(struct i40e_pf_vf *vf, + struct i40e_virtchnl_vector_map *vvm) +{ + uint64_t linklistmap = 0, tempmap; + struct i40e_hw *hw = I40E_PF_TO_HW(vf->pf); + uint16_t qid; + bool b_first_q = true; + enum i40e_queue_type qtype; + uint16_t vector_id; + uint32_t reg, reg_idx; + uint16_t itr_idx = 0, i; + + vector_id = vvm->vector_id; + /* setup the head */ + if (!vector_id) + reg_idx = I40E_VPINT_LNKLST0(vf->vf_idx); + else + reg_idx = I40E_VPINT_LNKLSTN( + ((hw->func_caps.num_msix_vectors_vf - 1) * vf->vf_idx) + + (vector_id - 1)); + + if (vvm->rxq_map == 0 && vvm->txq_map == 0) { + I40E_WRITE_REG(hw, reg_idx, + I40E_VPINT_LNKLST0_FIRSTQ_INDX_MASK); + goto cfg_irq_done; + } + + /* sort all rx and tx queues */ + tempmap = vvm->rxq_map; + for (i = 0; i < sizeof(vvm->rxq_map) * 8; i++) { + if (tempmap & 0x1) + linklistmap |= (1 << (2 * i)); + tempmap >>= 1; + } + + tempmap = vvm->txq_map; + for (i = 0; i < sizeof(vvm->txq_map) * 8; i++) { + if (tempmap & 0x1) + linklistmap |= (1 << (2 * i + 1)); + tempmap >>= 1; + } + + /* Link all rx and tx queues into a chained list */ + tempmap = linklistmap; + i = 0; + b_first_q = true; + do { + if (tempmap & 0x1) { + qtype = (enum i40e_queue_type)(i % 2); + qid = vf->vsi->base_queue + i / 2; + if (b_first_q) { + /* This is header */ + b_first_q = false; + reg = ((qtype << + I40E_VPINT_LNKLSTN_FIRSTQ_TYPE_SHIFT) + | qid); + } else { + /* element in the link list */ + reg = (vector_id) | + (qtype << I40E_QINT_RQCTL_NEXTQ_TYPE_SHIFT) | + (qid << I40E_QINT_RQCTL_NEXTQ_INDX_SHIFT) | + BIT(I40E_QINT_RQCTL_CAUSE_ENA_SHIFT) | + (itr_idx << I40E_QINT_RQCTL_ITR_INDX_SHIFT); + } + I40E_WRITE_REG(hw, reg_idx, reg); + /* find next register to program */ + switch (qtype) { + case I40E_QUEUE_TYPE_RX: + reg_idx = I40E_QINT_RQCTL(qid); + itr_idx = vvm->rxitr_idx; + break; + case I40E_QUEUE_TYPE_TX: + reg_idx = I40E_QINT_TQCTL(qid); + itr_idx = vvm->txitr_idx; + break; + default: + break; + } + } + i++; + tempmap >>= 1; + } while (tempmap); + + /* Terminate the link list */ + reg = (vector_id) | + (0 << I40E_QINT_RQCTL_NEXTQ_TYPE_SHIFT) | + (0x7FF << I40E_QINT_RQCTL_NEXTQ_INDX_SHIFT) | + BIT(I40E_QINT_RQCTL_CAUSE_ENA_SHIFT) | + (itr_idx << I40E_QINT_RQCTL_ITR_INDX_SHIFT); + I40E_WRITE_REG(hw, reg_idx, reg); + +cfg_irq_done: + I40E_WRITE_FLUSH(hw); +} + static int i40e_pf_host_process_cmd_config_irq_map(struct i40e_pf_vf *vf, uint8_t *msg, uint16_t msglen) { int ret = I40E_SUCCESS; + struct i40e_pf *pf = vf->pf; + struct i40e_hw *hw = I40E_PF_TO_HW(vf->pf); struct i40e_virtchnl_irq_map_info *irqmap = (struct i40e_virtchnl_irq_map_info *)msg; + struct i40e_virtchnl_vector_map *map; + int i; + uint16_t vector_id; + unsigned long qbit_max; if (msg == NULL || msglen < sizeof(struct i40e_virtchnl_irq_map_info)) { PMD_DRV_LOG(ERR, "buffer too short"); @@ -566,23 +668,46 @@ goto send_msg; } - /* Assume VF only have 1 vector to bind all queues */ - if (irqmap->num_vectors != 1) { - PMD_DRV_LOG(ERR, "DKDK host only support 1 vector"); - ret = I40E_ERR_PARAM; + /* PF host will support both DPDK VF or Linux VF driver, identify by + * number of vectors requested. + */ + + /* DPDK VF only requires single vector */ + if (irqmap->num_vectors == 1) { + /* This MSIX intr store the intr in VF range */ + vf->vsi->msix_intr = irqmap->vecmap[0].vector_id; + vf->vsi->nb_msix = irqmap->num_vectors; + vf->vsi->nb_used_qps = vf->vsi->nb_qps; + + /* Don't care how the TX/RX queue mapping with this vector. + * Link all VF RX queues together. Only did mapping work. + * VF can disable/enable the intr by itself. + */ + i40e_vsi_queues_bind_intr(vf->vsi); goto send_msg; } - /* This MSIX intr store the intr in VF range */ - vf->vsi->msix_intr = irqmap->vecmap[0].vector_id; - vf->vsi->nb_msix = irqmap->num_vectors; - vf->vsi->nb_used_qps = vf->vsi->nb_qps; + /* Then, it's Linux VF driver */ + qbit_max = 1 << pf->vf_nb_qp_max; + for (i = 0; i < irqmap->num_vectors; i++) { + map = &irqmap->vecmap[i]; + + vector_id = map->vector_id; + /* validate msg params */ + if (vector_id >= hw->func_caps.num_msix_vectors_vf) { + ret = I40E_ERR_PARAM; + goto send_msg; + } + + if ((map->rxq_map < qbit_max) && (map->txq_map < qbit_max)) { + i40e_pf_config_irq_link_list(vf, map); + } else { + /* configured queue size excceed limit */ + ret = I40E_ERR_PARAM; + goto send_msg; + } + } - /* Don't care how the TX/RX queue mapping with this vector. - * Link all VF RX queues together. Only did mapping work. - * VF can disable/enable the intr by itself. - */ - i40e_vsi_queues_bind_intr(vf->vsi); send_msg: i40e_pf_host_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP, ret, NULL, 0); -- 1.7.7.6 ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <1482476332-21376-1-git-send-email-jing.d.chen@intel.com>]
* Re: [dpdk-dev] [PATCH 0/4] enhancement to i40e PF host driver [not found] <1482476332-21376-1-git-send-email-jing.d.chen@intel.com> @ 2016-12-23 12:52 ` Vincent JARDIN 2016-12-26 12:17 ` Chen, Jing D 0 siblings, 1 reply; 15+ messages in thread From: Vincent JARDIN @ 2016-12-23 12:52 UTC (permalink / raw) To: Chen Jing D(Mark), dev; +Cc: ferruh.yigit, jingjing.wu Thanks for this update. Still, I would like to get good arguments why DPDK should be a PF because it creates fragmentations. Please, first, let's reply to: http://dpdk.org/ml/archives/dev/2016-December/053107.html Having both Linux and DPDK being PF, it means that we double the combinations so we double the issues. The following should be used instead: assuming you want to use DPDK PF for dataplane feature, an alternative is, - configure one VF on the hypervisor from Linux's PF, let's name if VF_forPFtraffic, see http://dpdk.org/doc/guides/howto/flow_bifurcation.html - have no (or few IOs) to the PF's queue - assign the traffic to all VF_forPFtraffic's queues of the hypervisor, - run DPDK into the hypervisor's VF_forPFtraffic Thank you, Vincent ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH 0/4] enhancement to i40e PF host driver 2016-12-23 12:52 ` [dpdk-dev] [PATCH 0/4] enhancement to i40e PF host driver Vincent JARDIN @ 2016-12-26 12:17 ` Chen, Jing D 0 siblings, 0 replies; 15+ messages in thread From: Chen, Jing D @ 2016-12-26 12:17 UTC (permalink / raw) To: Vincent JARDIN, dev; +Cc: Yigit, Ferruh, Wu, Jingjing Hi, Vincent, Since original patch set are split into 2 different patches, can we discuss in this thread? Attach original discussion below. Sorry for top-post. > > Le 22/12/2016 à 09:10, Chen, Jing D a écrit : > > In the meanwhile, we have some test models ongoing to validate > > combination of Linux and DPDK drivers for VF and PF. We'll fully > > support > below 4 cases going forward. > > 1. DPDK PF + DPDK VF > > 2. DPDK PF + Linux VF > > + DPDK PF + FreeBSD VF > + DPDK PF + Windows VF > + DPDK PF + OS xyz VF > If all drivers follow same API spec, what's the problem here? What extra DPDK PF effort you observed? > > 3. Linux PF + DPDK VF > > 4. Linux PF + Linux VF (it's not our scope) > > So, you confirm the issue: having DPDK becoming a PF, even if SRIOV > protocol includes version-ing, it doubles the combinatory cases. If extended functions are needed, the answer is yes. That's not a big problem, right? I have several workarounds/approaches to support extended funcs while following original API spec. I can fix it in this release. In order to have a mature solution, I left it here for further implementation. > > > > > After applied this patch, i've done below test without observing > compatibility issue. > > 1. DPDK PF + DPDK VF (middle of 16.11 and 17.02 code base). PF to > > support > API 1.0 while VF > > to support API 1.1/1.0 > > 2. DPDK PF + Linux VF 1.5.14. PF to support 1.0, while Linux to > > support 1.1/1.0 > > > > Linux PF + DPDK VF has been tested with 1.0 API long time ago. There > > is some test activities ongoing. > > > > Finally, please give strong reasons to support your NAC. > > I feel bad because I do recognize the strong and hard work that you > have done on this PF development, but I feel we need first to assess > if DPDK should become a PF or not. I know ixgbe did open the path and > that they are some historical DPDK PF supports in Intel NICs, but > before we generalize it, we have to make sure we are not turning this > DataPlane development Kit into a ControlPlane Driver Kit that we are > scared to upstream into Linux kernel. Even if "DPDK is not Linux", it > does not mean that Linux should be ignored. In case of DPDK on other OS, same, their PF could be extended too. > Thanks for the recognition of our work on PF driver. :) > So currently, yes, I do keep a nack't > > Since DPDK PF features can be into Linux PF features too and since > Linux (and other hypervisors) has already some tools to manage PF (see > iproute2, etc.), why should we have an other management path with DPDK? > DPDK is aimed to be a Dataplane Development kit, not a > management/control plane driver kit. Before we debated on Dataplane and ControPlane, can you answer me a question, why we have generic filter API? Is it a API for dataplane? I can't imagine that we'll have to say 'you need to use Linux PF' driver when users want to deploy PF + VF cases. Why we can't provide an alternative option. they are not exclusive and users can decide which combination is better for them. The reason why we developed DPDK PF host driver is we have requirements from users. Our motivation is simple, there are requirements, we satisfy them. Sorry, you NACK can't convince me. > > Assuming you want to use DPDK PF for dataplane feature, that could be > OK then, using: > - configure one VF on the hypervisor from Linux's PF, let's name if > VF_forPFtraffic, see http://dpdk.org/doc/guides/howto/flow_bifurcation.html > - have no (or few IO)s to the PF's queue > - assign the traffic to all VF_forPFtraffic's queues of the hypervisor, > - run DPDK into the hypervisor's VF_forPFtraffic > > Doing so, we get the same benefit of running DPDK over PF or running > DPDK over VF_forPFtraffic, don't we? It is a benefit of: > http://dpdk.org/doc/guides/howto/flow_bifurcation.html > > Thank you, > Vincent > > -----Original Message----- > From: Vincent JARDIN [mailto:vincent.jardin@6wind.com] > Sent: Friday, December 23, 2016 8:53 PM > To: Chen, Jing D <jing.d.chen@intel.com>; dev@dpdk.org > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Wu, Jingjing > <jingjing.wu@intel.com> > Subject: Re: [PATCH 0/4] enhancement to i40e PF host driver > > Thanks for this update. > > Still, I would like to get good arguments why DPDK should be a PF because it > creates fragmentations. Please, first, let's reply to: > http://dpdk.org/ml/archives/dev/2016-December/053107.html > > Having both Linux and DPDK being PF, it means that we double the > combinations so we double the issues. > > The following should be used instead: assuming you want to use DPDK PF for > dataplane feature, an alternative is, > - configure one VF on the hypervisor from Linux's PF, let's name if > VF_forPFtraffic, see > http://dpdk.org/doc/guides/howto/flow_bifurcation.html > - have no (or few IOs) to the PF's queue > - assign the traffic to all VF_forPFtraffic's queues of the hypervisor, > - run DPDK into the hypervisor's VF_forPFtraffic > > Thank you, > Vincent ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2017-01-17 16:11 UTC | newest] Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-01-03 0:59 [dpdk-dev] [PATCH 0/4] enhancement to i40e PF host driver Chen Jing D(Mark) 2017-01-03 0:59 ` [dpdk-dev] [PATCH 1/4] net/i40e: change version number to support Linux VF Chen Jing D(Mark) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver Chen Jing D(Mark) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 1/4] net/i40e: change version number to support Linux VF Chen Jing D(Mark) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 2/4] net/i40e: return correct VSI id Chen Jing D(Mark) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 3/4] net/i40e: parse more VF parameter and configure Chen Jing D(Mark) 2017-01-13 3:13 ` [dpdk-dev] [PATCH v2 4/4] net/i40e: support Linux VF to configure IRQ link list Chen Jing D(Mark) 2017-01-16 0:55 ` [dpdk-dev] [PATCH v2 0/4] enhancement to i40e PF host driver Zhang, Helin 2017-01-16 7:51 ` Vincent JARDIN 2017-01-17 16:11 ` Ferruh Yigit 2017-01-03 0:59 ` [dpdk-dev] [PATCH 2/4] net/i40e: return correct VSI id Chen Jing D(Mark) 2017-01-03 0:59 ` [dpdk-dev] [PATCH 3/4] net/i40e: parse more VF parameter and configure Chen Jing D(Mark) 2017-01-03 0:59 ` [dpdk-dev] [PATCH 4/4] net/i40e: support Linux VF to configure IRQ link list Chen Jing D(Mark) [not found] <1482476332-21376-1-git-send-email-jing.d.chen@intel.com> 2016-12-23 12:52 ` [dpdk-dev] [PATCH 0/4] enhancement to i40e PF host driver Vincent JARDIN 2016-12-26 12:17 ` Chen, Jing D
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).