DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xu, Ting" <ting.xu@intel.com>
To: "Yang, SteveX" <stevex.yang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Yang, Qiming" <qiming.yang@intel.com>,
	"Wu, Jingjing" <jingjing.wu@intel.com>,
	"Xing, Beilei" <beilei.xing@intel.com>,
	"Yang, SteveX" <stevex.yang@intel.com>
Subject: Re: [dpdk-dev] [PATCH v3 5/6] net/iavf: fix multiple interrupts for VF
Date: Tue, 8 Sep 2020 07:53:31 +0000	[thread overview]
Message-ID: <CY4PR1101MB2310BC1A5DE99BF9AC62D560F8290@CY4PR1101MB2310.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200904072907.10648-6-stevex.yang@intel.com>

Hi, Steve,

I am also coding on this part for large VF recently, and see that you sent a fix patch, and I have some questions not quite clear, which are shown below in inline.

Thanks!

Best Regards,
Xu Ting

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of SteveX Yang
> Sent: Friday, September 4, 2020 3:29 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Yang, SteveX
> <stevex.yang@intel.com>
> Subject: [dpdk-dev] [PATCH v3 5/6] net/iavf: fix multiple interrupts for VF
> 
> Interrupt mapping should be 1:n queue(s).This patch fixes the logic of
> interrupt bind by code reconstruction.
> 
> Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> 
> Signed-off-by: SteveX Yang <stevex.yang@intel.com>
> ---
>  drivers/net/iavf/iavf_vchnl.c | 56 ++++++++++++++++++++++++++++-------
>  1 file changed, 45 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> 33acea54a..614ea7e79 100644
> --- a/drivers/net/iavf/iavf_vchnl.c
> +++ b/drivers/net/iavf/iavf_vchnl.c
> @@ -18,6 +18,7 @@
>  #include <rte_ether.h>
>  #include <rte_ethdev_driver.h>
>  #include <rte_dev.h>
> +#include <rte_bus_pci.h>
> 
>  #include "iavf.h"
>  #include "iavf_rxtx.h"
> @@ -686,20 +687,53 @@ int
>  iavf_config_irq_map(struct iavf_adapter *adapter)  {
>  	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);
> +	struct iavf_cmd_info args;
> +	uint8_t *cmd_buffer = NULL;
>  	struct virtchnl_irq_map_info *map_info;
>  	struct virtchnl_vector_map *vecmap;
> -	struct iavf_cmd_info args;
> -	int len, i, err;
> +	struct rte_eth_dev *dev = adapter->eth_dev;
> +	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
> +	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
> +	uint32_t vec, cmd_buffer_size, max_vectors, nb_msix, msix_base, i;
> +	uint16_t rxq_map[vf->vf_res->max_vectors];
> +	int err;
> 
> -	len = sizeof(struct virtchnl_irq_map_info) +
> -	      sizeof(struct virtchnl_vector_map) * vf->nb_msix;
> +	memset(rxq_map, 0, sizeof(rxq_map));
> +	if (dev->data->dev_conf.intr_conf.rxq &&
> +		rte_intr_allow_others(intr_handle)) {
> +		msix_base = IAVF_RX_VEC_START;
> +		max_vectors = vf->vf_res->max_vectors - 1;
> +		nb_msix = RTE_MIN(max_vectors, intr_handle->nb_efd);
> +
> +		vec = msix_base;
> +		for (i = 0; i < dev->data->nb_rx_queues; i++) {
> +			rxq_map[vec] |= 1 << i;
> +			intr_handle->intr_vec[i] = vec++;
> +			if (vec >= vf->vf_res->max_vectors)
> +				vec = msix_base;
> +		}
> +	} else {
> +		msix_base = IAVF_MISC_VEC_ID;
> +		nb_msix = 1;
> 
> -	map_info = rte_zmalloc("map_info", len, 0);
> -	if (!map_info)
> -		return -ENOMEM;
> +		for (i = 0; i < dev->data->nb_rx_queues; i++) {
> +			rxq_map[msix_base] |= 1 << i;
> +			if (rte_intr_dp_is_en(intr_handle))
> +				intr_handle->intr_vec[i] = msix_base;
> +		}
> +	}
> 

This part to configure parameters like nb_msix, msix_base and rxq_map, is already done in the upper level function iavf_config_rx_queues_irqs, why shall we do it again here? Or is it OK to change in that function directly if necessary?

> -	map_info->num_vectors = vf->nb_msix;
> -	for (i = 0; i < vf->nb_msix; i++) {
> +	cmd_buffer_size = sizeof(struct virtchnl_irq_map_info) +
> +	      sizeof(struct virtchnl_vector_map) * nb_msix;
> +	cmd_buffer = rte_zmalloc("iavf", cmd_buffer_size, 0);
> +	if (!cmd_buffer) {
> +		PMD_DRV_LOG(ERR, "Failed to allocate memory");
> +		return IAVF_ERR_NO_MEMORY;
> +	}
> +
> +	map_info = (struct virtchnl_irq_map_info *)cmd_buffer;
> +	map_info->num_vectors = nb_msix;
> +	for (i = 0; i < nb_msix; i++) {
>  		vecmap = &map_info->vecmap[i];
>  		vecmap->vsi_id = vf->vsi_res->vsi_id;
>  		vecmap->rxitr_idx = IAVF_ITR_INDEX_DEFAULT; @@ -709,8

Here is a line of code "vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];" not displayed. I noticed that this is not changed. That means we still use the bitmap configured in iavf_config_rx_queues_irqs, not the new one here (although they may be the same)
But it seems that the new rxq_map is not used. Do I miss something? Thank!

> +743,8 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
>  	}
> 
>  	args.ops = VIRTCHNL_OP_CONFIG_IRQ_MAP;
> -	args.in_args = (u8 *)map_info;
> -	args.in_args_size = len;
> +	args.in_args = (u8 *)cmd_buffer;
> +	args.in_args_size = cmd_buffer_size;
>  	args.out_buffer = vf->aq_resp;
>  	args.out_size = IAVF_AQ_BUF_SZ;
>  	err = iavf_execute_vf_cmd(adapter, &args);
> --
> 2.17.1


  reply	other threads:[~2020-09-08  7:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11  7:59 [dpdk-dev] [PATCH 0/7] Bugs Porting from I40evf For IAVF Feature SteveX Yang
2020-08-11  7:59 ` [dpdk-dev] [PATCH 1/7] net/iavf: fix scattered Rx enabling SteveX Yang
2020-08-11  7:59 ` [dpdk-dev] [PATCH 2/7] net/iavf: set speed to undefined for default case SteveX Yang
2020-08-11  7:59 ` [dpdk-dev] [PATCH 3/7] net/iavf: fix port start during configuration restore SteveX Yang
2020-08-11  7:59 ` [dpdk-dev] [PATCH 4/7] net/iavf: fix setting of MAC address on iavf SteveX Yang
2020-08-11  7:59 ` [dpdk-dev] [PATCH 5/7] net/iavf: fix multiple interrupts for VF SteveX Yang
2020-08-11  7:59 ` [dpdk-dev] [PATCH 6/7] net/iavf: downgrade error log SteveX Yang
2020-08-11  7:59 ` [dpdk-dev] [PATCH 7/7] net/iavf: fix port close SteveX Yang
2020-08-12  2:57   ` Wu, Jingjing
2020-08-27  1:01 ` [dpdk-dev] [PATCH v2 0/6] These patches are bugs porting from i40evf to SteveX Yang
2020-08-27  1:14 ` SteveX Yang
2020-08-27  1:14   ` [dpdk-dev] [PATCH v2 1/6] net/iavf: fix scattered Rx enabling SteveX Yang
2020-08-27  2:49     ` Xing, Beilei
2020-08-27  1:14   ` [dpdk-dev] [PATCH v2 2/6] net/iavf: set speed to undefined for default case SteveX Yang
2020-08-27  6:46     ` Xing, Beilei
2020-08-27  1:14   ` [dpdk-dev] [PATCH v2 3/6] net/iavf: fix port start during configuration restore SteveX Yang
2020-08-27  1:14   ` [dpdk-dev] [PATCH v2 4/6] net/iavf: fix setting of MAC address on iavf SteveX Yang
2020-08-27  1:14   ` [dpdk-dev] [PATCH v2 5/6] net/iavf: fix multiple interrupts for VF SteveX Yang
2020-08-27  1:14   ` [dpdk-dev] [PATCH v2 6/6] net/iavf: downgrade error log SteveX Yang
2020-09-04  7:29   ` [dpdk-dev] [PATCH v3 0/6] Bugs Porting from I40evf For IAVF Feature SteveX Yang
2020-09-04  7:29     ` [dpdk-dev] [PATCH v3 1/6] net/iavf: fix scattered Rx enabling SteveX Yang
2020-09-04  7:29     ` [dpdk-dev] [PATCH v3 2/6] net/iavf: fix incorrect link status when speed is undefined SteveX Yang
2020-09-07 14:39       ` Ferruh Yigit
2020-09-04  7:29     ` [dpdk-dev] [PATCH v3 3/6] net/iavf: fix port start during configuration restore SteveX Yang
2020-09-04  7:29     ` [dpdk-dev] [PATCH v3 4/6] net/iavf: fix setting of MAC address on iavf SteveX Yang
2020-09-04  7:29     ` [dpdk-dev] [PATCH v3 5/6] net/iavf: fix multiple interrupts for VF SteveX Yang
2020-09-08  7:53       ` Xu, Ting [this message]
2020-09-11  9:04       ` Zhang, Qi Z
2020-09-11 12:07         ` Ferruh Yigit
2020-09-04  7:29     ` [dpdk-dev] [PATCH v3 6/6] net/iavf: downgrade error log SteveX Yang
2020-09-04  8:17     ` [dpdk-dev] [PATCH v3 0/6] Bugs Porting from I40evf For IAVF Feature Xing, Beilei
2020-09-07  5:58       ` Zhang, Qi Z
2020-09-07 15:23         ` Ferruh Yigit

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=CY4PR1101MB2310BC1A5DE99BF9AC62D560F8290@CY4PR1101MB2310.namprd11.prod.outlook.com \
    --to=ting.xu@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=stevex.yang@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).