DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xueming(Steven) Li" <xuemingl@nvidia.com>
To: "dev@dpdk.org" <dev@dpdk.org>,
	"chenqiming_huawei@163.com" <chenqiming_huawei@163.com>
Cc: "beilei.xing@intel.com" <beilei.xing@intel.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix vf rxq buf size alignment
Date: Mon, 8 Nov 2021 11:33:15 +0000	[thread overview]
Message-ID: <ee236631e8b91a33a2850f954977f442e259ae4d.camel@nvidia.com> (raw)
In-Reply-To: <20210906070014.9680-1-chenqiming_huawei@163.com>

On Mon, 2021-09-06 at 15:00 +0800, Qiming Chen wrote:
> The RTE_ALIGN macro is aligned upwards. If the buf_size variable is not
> aligned with 1 << I40E_RXQ_CTX_DBUFF_SHIFT, the rx_buf_len is larger than
> the actual mbuf memory after the operation. When receiving the packet, if
> the packet is larger than the configured buf_size, it will cause a memory
> stepping event.
> 
> The patch uses the RTE_ALIGN_FLOOR down alignment macro to correct the
> problem.
> 
> Fixes: c1715402df8f ("i40evf: fix jumbo frame support")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
> index 924da8dfb4..5b1c8e76ab 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -1927,7 +1927,7 @@ i40evf_rxq_init(struct rte_eth_dev *dev, struct i40e_rx_queue *rxq)
>  					RTE_PKTMBUF_HEADROOM);
>  	rxq->hs_mode = i40e_header_split_none;
>  	rxq->rx_hdr_len = 0;
> -	rxq->rx_buf_len = RTE_ALIGN(buf_size, (1 << I40E_RXQ_CTX_DBUFF_SHIFT));
> +	rxq->rx_buf_len = RTE_ALIGN_FLOOR(buf_size, (1 << I40E_RXQ_CTX_DBUFF_SHIFT));
>  	len = rxq->rx_buf_len * I40E_MAX_CHAINED_RX_BUFFERS;
>  	rxq->max_pkt_len = RTE_MIN(len,
>  		dev_data->dev_conf.rxmode.max_rx_pkt_len);

Added to 20.11.4 pipeline, thanks!

      reply	other threads:[~2021-11-08 11:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06  7:00 Qiming Chen
2021-11-08 11:33 ` Xueming(Steven) Li [this message]

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=ee236631e8b91a33a2850f954977f442e259ae4d.camel@nvidia.com \
    --to=xuemingl@nvidia.com \
    --cc=beilei.xing@intel.com \
    --cc=chenqiming_huawei@163.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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).