DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] ixgbevf: fix incorrect RX function selection
Date: Fri, 12 Jun 2015 15:45:09 +0000	[thread overview]
Message-ID: <2601191342CEEE43887BDE71AB97725836A09119@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <1434122299-1632-1-git-send-email-sergio.gonzalez.monroy@intel.com>



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Sergio Gonzalez Monroy
> Sent: Friday, June 12, 2015 4:18 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] ixgbevf: fix incorrect RX function selection
> 
> The logic to select ixgbe VF RX function is different than PF side.
> 
> There are a few issues with its current state:
>  - it does not allow to select ixgbe_recv_pkts_vec among other options.
>  - it can cause memory corruption for scatter mode as it does not allocate
>    enough entries in sw_ring.
>  - when checksum is enabled, incorrect vector RX function is selected.
> 
> To solve above issues, change the VF RX function selection logic to
> mimic PF side.
> 
> Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c |  9 +++++++++
>  drivers/net/ixgbe/ixgbe_rxtx.c   | 11 ++---------
>  2 files changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 0d9f9b2..c1a70a1 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -2947,6 +2947,8 @@ static int
>  ixgbevf_dev_configure(struct rte_eth_dev *dev)
>  {
>  	struct rte_eth_conf* conf = &dev->data->dev_conf;
> +	struct ixgbe_adapter *adapter =
> +			(struct ixgbe_adapter *)dev->data->dev_private;
> 
>  	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
>  		     dev->data->port_id);
> @@ -2967,6 +2969,13 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev)
>  	}
>  #endif
> 
> +	/*
> +	 * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
> +	 * allocation or vector Rx preconditions we will reset it.
> +	 */
> +	adapter->rx_bulk_alloc_allowed = true;
> +	adapter->rx_vec_allowed = true;
> +
>  	return 0;
>  }
> 
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
> index 4f9ab22..7cc26ef 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
> @@ -4549,7 +4549,6 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev)
>  		(uint16_t)dev->data->dev_conf.rxmode.max_rx_pkt_len);
> 
>  	/* Setup RX queues */
> -	dev->rx_pkt_burst = ixgbe_recv_pkts;
>  	for (i = 0; i < dev->data->nb_rx_queues; i++) {
>  		rxq = dev->data->rx_queues[i];
> 
> @@ -4615,14 +4614,6 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev)
>  			if (!dev->data->scattered_rx)
>  				PMD_INIT_LOG(DEBUG, "forcing scatter mode");
>  			dev->data->scattered_rx = 1;
> -#ifdef RTE_IXGBE_INC_VECTOR
> -			if (rte_is_power_of_2(rxq->nb_rx_desc))
> -				dev->rx_pkt_burst =
> -					ixgbe_recv_scattered_pkts_vec;
> -			else
> -#endif
> -				dev->rx_pkt_burst =
> -					ixgbe_recv_pkts_lro_single_alloc;
>  		}
>  	}
> 
> @@ -4640,6 +4631,8 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev)
>  		IXGBE_PSRTYPE_RQPL_SHIFT;
>  	IXGBE_WRITE_REG(hw, IXGBE_VFPSRTYPE, psrtype);
> 
> +	ixgbe_set_rx_function(dev);
> +
>  	return 0;
>  }
> 

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

> --
> 1.9.3

  reply	other threads:[~2015-06-12 15:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 15:18 Sergio Gonzalez Monroy
2015-06-12 15:45 ` Ananyev, Konstantin [this message]
2015-06-22 10:13   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2601191342CEEE43887BDE71AB97725836A09119@irsmsx105.ger.corp.intel.com \
    --to=konstantin.ananyev@intel.com \
    --cc=dev@dpdk.org \
    --cc=sergio.gonzalez.monroy@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).