From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Dengdui Huang" <huangdengdui@huawei.com>, <dev@dpdk.org>,
<stephen@networkplumber.org>
Cc: <lihuisong@huawei.com>, <fengchengwen@huawei.com>,
<haijie1@huawei.com>, <liuyonglong@huawei.com>
Subject: RE: [PATCH] mbuf: add packet offload Rx flag for keep CRC
Date: Fri, 24 Jan 2025 15:34:24 +0100 [thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F9E9@smartserver.smartshare.dk> (raw)
In-Reply-To: <20250124095957.3496874-1-huangdengdui@huawei.com>
> From: Dengdui Huang [mailto:huangdengdui@huawei.com]
> Sent: Friday, 24 January 2025 11.00
>
> After discussion[1], the drivers do not include the CRC in the packet
> length calculation. This will cause users to be confused about whether
> the mbuf contains CRC data. This patch adds a packet offload Rx flag,
> indicating that CRC data exists at the end of the mbuf chain.
>
> [1] https://inbox.dpdk.org/dev/20240206011030.2007689-1-
> haijie1@huawei.com/
>
> Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
> ---
Mbufs with F_RX_KEEP_CRC requires much more than this.
If the packet length omits the 4 byte Ethernet CRC, and the last segment only holds the CRC, rte_mbuf_check() will fail and cause panic in rte_mbuf_sanity_check().
And many functions working on segments, such as rte_pktmbuf_copy(), linearize(), etc. need to be patched to check for F_RX_KEEP_CRC when working on the packet. This will degrade performance, and we are also talking about frequently used dataplane functions.
Furthermore, if we really need to support KEEP_CRC with segmented packets, we need to add test cases with the CRC partially in the last segment, and with only the CRC in the last segment, for functions and libraries supporting segmented packets. Regardless if the packet length includes the 4 bytes CRC or not.
KEEP_CRC looks exotic to me, and am worried that full support for KEEP_CRC will impact performance and would be essentially untested in a bunch of libraries. I don't want exotic features impacting the performance of frequently used dataplane functions.
Can you please remind me of the use cases for KEEP_CRC?
Perhaps support for KEEP_CRC could be a build time option (default omitted, for performance and test coverage reasons)?
Alternatively, support for KEEP_CRC could be limited to non-segmented packets?
Or, how about a completely different approach:
Drivers supporting KEEP_CRC can strip the 4 byte CRC (like stripping a VLAN tag) and store it in an mbuf dynfield.
next prev parent reply other threads:[~2025-01-24 14:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-24 9:59 Dengdui Huang
2025-01-24 14:34 ` Morten Brørup [this message]
2025-01-24 17:34 ` Stephen Hemminger
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=98CBD80474FA8B44BF855DF32C47DC35E9F9E9@smartserver.smartshare.dk \
--to=mb@smartsharesystems.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=haijie1@huawei.com \
--cc=huangdengdui@huawei.com \
--cc=lihuisong@huawei.com \
--cc=liuyonglong@huawei.com \
--cc=stephen@networkplumber.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).