From: Wenjun Wu <wenjun1.wu@intel.com>
To: dev@dpdk.org, Yuying.Zhang@intel.com, beilei.xing@intel.com,
jingjing.wu@intel.com, qiming.yang@intel.com,
qi.z.zhang@intel.com
Cc: Wenjun Wu <wenjun1.wu@intel.com>, stable@dpdk.org
Subject: [PATCH v1 1/5] net/i40e: fix RX data buffer size
Date: Fri, 14 Apr 2023 11:51:47 +0800 [thread overview]
Message-ID: <20230414035151.1377726-2-wenjun1.wu@intel.com> (raw)
In-Reply-To: <20230414035151.1377726-1-wenjun1.wu@intel.com>
No matter what the mbuf size is, the data buffer size should not
be greater than 16K - 128.
Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
---
drivers/net/i40e/i40e_rxtx.c | 2 ++
drivers/net/i40e/i40e_rxtx.h | 3 +++
2 files changed, 5 insertions(+)
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 788ffb51c2..fbbefb5015 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -2904,6 +2904,8 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq)
rxq->rx_hdr_len = 0;
rxq->rx_buf_len = RTE_ALIGN_FLOOR(buf_size,
(1 << I40E_RXQ_CTX_DBUFF_SHIFT));
+ rxq->rx_buf_len = RTE_MIN(rxq->rx_buf_len,
+ I40E_RX_MAX_DATA_BUF_SIZE);
rxq->hs_mode = i40e_header_split_none;
break;
}
diff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h
index 5e6eecc501..0376c219be 100644
--- a/drivers/net/i40e/i40e_rxtx.h
+++ b/drivers/net/i40e/i40e_rxtx.h
@@ -21,6 +21,9 @@
/* In none-PXE mode QLEN must be whole number of 32 descriptors. */
#define I40E_ALIGN_RING_DESC 32
+/* Max data buffer size must be 16K - 128 bytes */
+#define I40E_RX_MAX_DATA_BUF_SIZE (16 * 1024 - 128)
+
#define I40E_MIN_RING_DESC 64
#define I40E_MAX_RING_DESC 4096
--
2.34.1
next prev parent reply other threads:[~2023-04-14 3:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 3:51 [PATCH v1 0/5] " Wenjun Wu
2023-04-14 3:51 ` Wenjun Wu [this message]
2023-04-14 3:51 ` [PATCH v1 2/5] net/ice: " Wenjun Wu
2023-04-14 3:51 ` [PATCH v1 3/5] net/iavf: " Wenjun Wu
2023-04-14 3:51 ` [PATCH v1 4/5] net/idpf: " Wenjun Wu
2023-04-14 3:51 ` [PATCH v1 5/5] net/cpfl: " Wenjun Wu
2023-04-14 5:47 ` [PATCH v2 0/5] fix Rx " Wenjun Wu
2023-04-14 5:47 ` [PATCH v2 1/5] net/i40e: " Wenjun Wu
2023-04-14 5:47 ` [PATCH v2 2/5] net/ice: " Wenjun Wu
2023-04-14 5:47 ` [PATCH v2 3/5] net/iavf: " Wenjun Wu
2023-04-14 5:47 ` [PATCH v2 4/5] net/idpf: " Wenjun Wu
2023-04-14 5:47 ` [PATCH v2 5/5] net/cpfl: " Wenjun Wu
2023-04-26 2:50 ` [PATCH v2 0/5] " 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=20230414035151.1377726-2-wenjun1.wu@intel.com \
--to=wenjun1.wu@intel.com \
--cc=Yuying.Zhang@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=qi.z.zhang@intel.com \
--cc=qiming.yang@intel.com \
--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).