From: "Wu, Jingjing" <jingjing.wu@intel.com>
To: "Xing, Beilei" <beilei.xing@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "Zhang, Qi Z" <qi.z.zhang@intel.com>
Subject: RE: [PATCH v4 07/15] common/idpf: add irq map/unmap
Date: Tue, 31 Jan 2023 08:11:27 +0000 [thread overview]
Message-ID: <MW3PR11MB458742C78886466E9C5BB472E3D09@MW3PR11MB4587.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230117080622.105657-8-beilei.xing@intel.com>
> @@ -247,8 +247,21 @@ idpf_vport_init(struct idpf_vport *vport,
> goto err_rss_lut;
> }
>
> + /* recv_vectors is used for VIRTCHNL2_OP_ALLOC_VECTORS response,
> + * reserve maximum size for it now, may need optimization in future.
> + */
> + vport->recv_vectors = rte_zmalloc("recv_vectors", IDPF_DFLT_MBX_BUF_SIZE, 0);
> + if (vport->recv_vectors == NULL) {
> + DRV_LOG(ERR, "Failed to allocate ecv_vectors");
ecv-> recv?
> + ret = -ENOMEM;
> + goto err_recv_vec;
> + }
> +
> return 0;
>
> +err_recv_vec:
> + rte_free(vport->rss_lut);
> + vport->rss_lut = NULL;
> err_rss_lut:
> vport->dev_data = NULL;
> rte_free(vport->rss_key);
> @@ -261,6 +274,8 @@ idpf_vport_init(struct idpf_vport *vport,
> int
> idpf_vport_deinit(struct idpf_vport *vport)
> {
> + rte_free(vport->recv_vectors);
> + vport->recv_vectors = NULL;
> rte_free(vport->rss_lut);
> vport->rss_lut = NULL;
>
> @@ -298,4 +313,88 @@ idpf_config_rss(struct idpf_vport *vport)
>
> return ret;
> }
> +
> +int
> +idpf_config_irq_map(struct idpf_vport *vport, uint16_t nb_rx_queues)
> +{
> + struct idpf_adapter *adapter = vport->adapter;
> + struct virtchnl2_queue_vector *qv_map;
> + struct idpf_hw *hw = &adapter->hw;
> + uint32_t dynctl_val, itrn_val;
> + uint32_t dynctl_reg_start;
> + uint32_t itrn_reg_start;
> + uint16_t i;
> +
> + qv_map = rte_zmalloc("qv_map",
> + nb_rx_queues *
> + sizeof(struct virtchnl2_queue_vector), 0);
> + if (qv_map == NULL) {
> + DRV_LOG(ERR, "Failed to allocate %d queue-vector map",
> + nb_rx_queues);
> + goto qv_map_alloc_err;
Use error code -ENOMEM instead of using -1?
> + }
> +
> + /* Rx interrupt disabled, Map interrupt only for writeback */
> +
> + /* The capability flags adapter->caps.other_caps should be
> + * compared with bit VIRTCHNL2_CAP_WB_ON_ITR here. The if
> + * condition should be updated when the FW can return the
> + * correct flag bits.
> + */
> + dynctl_reg_start =
> + vport->recv_vectors->vchunks.vchunks->dynctl_reg_start;
> + itrn_reg_start =
> + vport->recv_vectors->vchunks.vchunks->itrn_reg_start;
> + dynctl_val = IDPF_READ_REG(hw, dynctl_reg_start);
> + DRV_LOG(DEBUG, "Value of dynctl_reg_start is 0x%x", dynctl_val);
> + itrn_val = IDPF_READ_REG(hw, itrn_reg_start);
> + DRV_LOG(DEBUG, "Value of itrn_reg_start is 0x%x", itrn_val);
> + /* Force write-backs by setting WB_ON_ITR bit in DYN_CTL
> + * register. WB_ON_ITR and INTENA are mutually exclusive
> + * bits. Setting WB_ON_ITR bits means TX and RX Descs
> + * are written back based on ITR expiration irrespective
> + * of INTENA setting.
> + */
> + /* TBD: need to tune INTERVAL value for better performance. */
> + itrn_val = (itrn_val == 0) ? IDPF_DFLT_INTERVAL : itrn_val;
> + dynctl_val = VIRTCHNL2_ITR_IDX_0 <<
> + PF_GLINT_DYN_CTL_ITR_INDX_S |
> + PF_GLINT_DYN_CTL_WB_ON_ITR_M |
> + itrn_val << PF_GLINT_DYN_CTL_INTERVAL_S;
> + IDPF_WRITE_REG(hw, dynctl_reg_start, dynctl_val);
> +
> + for (i = 0; i < nb_rx_queues; i++) {
> + /* map all queues to the same vector */
> + qv_map[i].queue_id = vport->chunks_info.rx_start_qid + i;
> + qv_map[i].vector_id =
> + vport->recv_vectors->vchunks.vchunks->start_vector_id;
> + }
> + vport->qv_map = qv_map;
> +
> + if (idpf_vc_config_irq_map_unmap(vport, nb_rx_queues, true) != 0) {
> + DRV_LOG(ERR, "config interrupt mapping failed");
> + goto config_irq_map_err;
> + }
> +
> + return 0;
> +
> +config_irq_map_err:
> + rte_free(vport->qv_map);
> + vport->qv_map = NULL;
> +
> +qv_map_alloc_err:
> + return -1;
> +}
> +
next prev parent reply other threads:[~2023-01-31 8:12 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <https://patches.dpdk.org/project/dpdk/cover/20230117072626.93796-1-beilei.xing@intel.com/>
2023-01-17 8:06 ` [PATCH v4 00/15] net/idpf: introduce idpf common modle beilei.xing
2023-01-17 8:06 ` [PATCH v4 01/15] common/idpf: add adapter structure beilei.xing
2023-01-17 8:06 ` [PATCH v4 02/15] common/idpf: add vport structure beilei.xing
2023-01-17 8:06 ` [PATCH v4 03/15] common/idpf: add virtual channel functions beilei.xing
2023-01-18 4:00 ` Zhang, Qi Z
2023-01-18 4:10 ` Zhang, Qi Z
2023-01-17 8:06 ` [PATCH v4 04/15] common/idpf: introduce adapter init and deinit beilei.xing
2023-01-17 8:06 ` [PATCH v4 05/15] common/idpf: add vport init/deinit beilei.xing
2023-01-17 8:06 ` [PATCH v4 06/15] common/idpf: add config RSS beilei.xing
2023-01-17 8:06 ` [PATCH v4 07/15] common/idpf: add irq map/unmap beilei.xing
2023-01-31 8:11 ` Wu, Jingjing [this message]
2023-01-17 8:06 ` [PATCH v4 08/15] common/idpf: support get packet type beilei.xing
2023-01-17 8:06 ` [PATCH v4 09/15] common/idpf: add vport info initialization beilei.xing
2023-01-31 8:24 ` Wu, Jingjing
2023-01-17 8:06 ` [PATCH v4 10/15] common/idpf: add vector flags in vport beilei.xing
2023-01-17 8:06 ` [PATCH v4 11/15] common/idpf: add rxq and txq struct beilei.xing
2023-01-17 8:06 ` [PATCH v4 12/15] common/idpf: add help functions for queue setup and release beilei.xing
2023-01-17 8:06 ` [PATCH v4 13/15] common/idpf: add Rx and Tx data path beilei.xing
2023-01-17 8:06 ` [PATCH v4 14/15] common/idpf: add vec queue setup beilei.xing
2023-01-17 8:06 ` [PATCH v4 15/15] common/idpf: add avx512 for single queue model beilei.xing
2023-02-02 9:53 ` [PATCH v5 00/15] net/idpf: introduce idpf common modle beilei.xing
2023-02-02 9:53 ` [PATCH v5 01/15] common/idpf: add adapter structure beilei.xing
2023-02-02 9:53 ` [PATCH v5 02/15] common/idpf: add vport structure beilei.xing
2023-02-02 9:53 ` [PATCH v5 03/15] common/idpf: add virtual channel functions beilei.xing
2023-02-02 9:53 ` [PATCH v5 04/15] common/idpf: introduce adapter init and deinit beilei.xing
2023-02-02 9:53 ` [PATCH v5 05/15] common/idpf: add vport init/deinit beilei.xing
2023-02-02 9:53 ` [PATCH v5 06/15] common/idpf: add config RSS beilei.xing
2023-02-02 9:53 ` [PATCH v5 07/15] common/idpf: add irq map/unmap beilei.xing
2023-02-02 9:53 ` [PATCH v5 08/15] common/idpf: support get packet type beilei.xing
2023-02-02 9:53 ` [PATCH v5 09/15] common/idpf: add vport info initialization beilei.xing
2023-02-02 9:53 ` [PATCH v5 10/15] common/idpf: add vector flags in vport beilei.xing
2023-02-02 9:53 ` [PATCH v5 11/15] common/idpf: add rxq and txq struct beilei.xing
2023-02-02 9:53 ` [PATCH v5 12/15] common/idpf: add help functions for queue setup and release beilei.xing
2023-02-02 9:53 ` [PATCH v5 13/15] common/idpf: add Rx and Tx data path beilei.xing
2023-02-02 9:53 ` [PATCH v5 14/15] common/idpf: add vec queue setup beilei.xing
2023-02-02 9:53 ` [PATCH v5 15/15] common/idpf: add avx512 for single queue model beilei.xing
2023-02-03 9:43 ` [PATCH v6 00/19] net/idpf: introduce idpf common modle beilei.xing
2023-02-03 9:43 ` [PATCH v6 01/19] common/idpf: add adapter structure beilei.xing
2023-02-03 9:43 ` [PATCH v6 02/19] common/idpf: add vport structure beilei.xing
2023-02-03 9:43 ` [PATCH v6 03/19] common/idpf: add virtual channel functions beilei.xing
2023-02-03 9:43 ` [PATCH v6 04/19] common/idpf: introduce adapter init and deinit beilei.xing
2023-02-03 9:43 ` [PATCH v6 05/19] common/idpf: add vport init/deinit beilei.xing
2023-02-03 9:43 ` [PATCH v6 06/19] common/idpf: add config RSS beilei.xing
2023-02-03 9:43 ` [PATCH v6 07/19] common/idpf: add irq map/unmap beilei.xing
2023-02-03 9:43 ` [PATCH v6 08/19] common/idpf: support get packet type beilei.xing
2023-02-03 9:43 ` [PATCH v6 09/19] common/idpf: add vport info initialization beilei.xing
2023-02-03 9:43 ` [PATCH v6 10/19] common/idpf: add vector flags in vport beilei.xing
2023-02-03 9:43 ` [PATCH v6 11/19] common/idpf: add rxq and txq struct beilei.xing
2023-02-03 9:43 ` [PATCH v6 12/19] common/idpf: add help functions for queue setup and release beilei.xing
2023-02-03 9:43 ` [PATCH v6 13/19] common/idpf: add Rx and Tx data path beilei.xing
2023-02-03 9:43 ` [PATCH v6 14/19] common/idpf: add vec queue setup beilei.xing
2023-02-03 9:43 ` [PATCH v6 15/19] common/idpf: add avx512 for single queue model beilei.xing
2023-02-03 9:43 ` [PATCH v6 16/19] common/idpf: refine API name for vport functions beilei.xing
2023-02-03 9:43 ` [PATCH v6 17/19] common/idpf: refine API name for queue config module beilei.xing
2023-02-03 9:43 ` [PATCH v6 18/19] common/idpf: refine API name for data path module beilei.xing
2023-02-03 9:43 ` [PATCH v6 19/19] common/idpf: refine API name for virtual channel functions beilei.xing
2023-02-06 2:58 ` [PATCH v6 00/19] net/idpf: introduce idpf common modle Zhang, Qi Z
2023-02-06 6:16 ` Xing, Beilei
2023-02-06 5:45 ` [PATCH v7 " beilei.xing
2023-02-06 5:46 ` [PATCH v7 01/19] common/idpf: add adapter structure beilei.xing
2023-02-06 5:46 ` [PATCH v7 02/19] common/idpf: add vport structure beilei.xing
2023-02-06 5:46 ` [PATCH v7 03/19] common/idpf: add virtual channel functions beilei.xing
2023-02-06 5:46 ` [PATCH v7 04/19] common/idpf: introduce adapter init and deinit beilei.xing
2023-02-06 5:46 ` [PATCH v7 05/19] common/idpf: add vport init/deinit beilei.xing
2023-02-06 5:46 ` [PATCH v7 06/19] common/idpf: add config RSS beilei.xing
2023-02-06 5:46 ` [PATCH v7 07/19] common/idpf: add irq map/unmap beilei.xing
2023-02-06 5:46 ` [PATCH v7 08/19] common/idpf: support get packet type beilei.xing
2023-02-06 5:46 ` [PATCH v7 09/19] common/idpf: add vport info initialization beilei.xing
2023-02-06 5:46 ` [PATCH v7 10/19] common/idpf: add vector flags in vport beilei.xing
2023-02-06 5:46 ` [PATCH v7 11/19] common/idpf: add rxq and txq struct beilei.xing
2023-02-06 5:46 ` [PATCH v7 12/19] common/idpf: add help functions for queue setup and release beilei.xing
2023-02-06 5:46 ` [PATCH v7 13/19] common/idpf: add Rx and Tx data path beilei.xing
2023-02-06 5:46 ` [PATCH v7 14/19] common/idpf: add vec queue setup beilei.xing
2023-02-06 5:46 ` [PATCH v7 15/19] common/idpf: add avx512 for single queue model beilei.xing
2023-02-06 5:46 ` [PATCH v7 16/19] common/idpf: refine API name for vport functions beilei.xing
2023-02-06 5:46 ` [PATCH v7 17/19] common/idpf: refine API name for queue config module beilei.xing
2023-02-06 5:46 ` [PATCH v7 18/19] common/idpf: refine API name for data path module beilei.xing
2023-02-06 5:46 ` [PATCH v7 19/19] common/idpf: refine API name for virtual channel functions beilei.xing
2023-02-06 13:15 ` [PATCH v7 00/19] net/idpf: introduce idpf common modle Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MW3PR11MB458742C78886466E9C5BB472E3D09@MW3PR11MB4587.namprd11.prod.outlook.com \
--to=jingjing.wu@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).