From: Hyong Youb Kim <hyonkim@cisco.com>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>,
Shyam Shrivastav <shrivastav.shyam@gmail.com>,
lidejun1@huawei.com, users <users@dpdk.org>,
dev@dpdk.org, lichunhe@huawei.com, zhangxufeng4@huawei.com
Subject: Re: [dpdk-dev] [dpdk-users] IPV4/IPV6 TCP/UDP Pseudo Header Checksum APIs
Date: Thu, 29 Nov 2018 00:07:19 +0900 [thread overview]
Message-ID: <20181128150718.GA25832@HYONKIM-7R0DR.cisco.com> (raw)
In-Reply-To: <20181023090158.z5w3gtvdzax247w6@platinum>
On Tue, Oct 23, 2018 at 11:01:58AM +0200, Olivier Matz wrote:
> Hi,
>
> You are right, the current code does not take IP or IPv6 options
> in account. I think this should be considered as a bug.
>
> The fix for IPv4 is not complicated, I did a quick draft here:
> http://git.droids-corp.org/?p=dpdk.git;a=commitdiff;h=96a6978ef6814e1450e1bd65fbce91c3d85b3121
>
> For IPv6, it is more complex than expected:
> https://tools.ietf.org/html/rfc2460.html#section-8.1
>
> - we need to skip extension headers
> - we need to parse routing headers and use the proper destination
> address in the pseudo header checksum
>
> This makes me think that the API is not adequate. Asking the user
> to provide the headers in a contiguous memory without specifying
> the length is quite dangerous, especially if the header comes from
> outside, as it can trigger out of bound accesses.
>
> I wonder if we shouldn't switch to a mbuf based API instead, and
> deprecate the old one.
>
> Thoughts?
> Olivier
>
I have been looking into a similar issue because
rte_net_intel_cksum_prepare(), which is used by most tx_pkt_prepare
handlers, does not work when ipv6 extensions are present. That
function is using rte_ipv6_phdr_cksum(). And this makes
rte_eth_tx_prepare() kinda useless for any workloads that encounter
ipv6 extensions.
There are 2 routing header types now (2 and 3).
https://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml#ipv6-parameters-3
In addition to these routing headers, there is also ipv6
mobility. Pseudo header's source address is supposed to be the address
in the Home Address option.
https://tools.ietf.org/html/rfc6275#page-36
Who knows there may be future extensions that affect pseudo
header.. We can probably make rte_ipv6_phdr_cksum() to understand all
existing headers that affect pseudo header, but it will still not be future
proof. Should at least document the limitations for rte_ipv6_phdr_cksum()..
-Hyong
prev parent reply other threads:[~2018-11-28 15:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-20 3:32 [dpdk-dev] " lidejun
2018-10-20 5:12 ` Shyam Shrivastav
2018-10-20 5:22 ` Shyam Shrivastav
2018-10-20 6:14 ` [dpdk-dev] 答复: " lidejun
2018-10-20 6:30 ` [dpdk-dev] " Shyam Shrivastav
2018-10-22 8:03 ` [dpdk-dev] [dpdk-users] " Ferruh Yigit
2018-10-23 9:01 ` Olivier Matz
2018-10-23 10:53 ` Shyam Shrivastav
2018-11-28 15:07 ` Hyong Youb Kim [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=20181128150718.GA25832@HYONKIM-7R0DR.cisco.com \
--to=hyonkim@cisco.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=lichunhe@huawei.com \
--cc=lidejun1@huawei.com \
--cc=olivier.matz@6wind.com \
--cc=shrivastav.shyam@gmail.com \
--cc=users@dpdk.org \
--cc=zhangxufeng4@huawei.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).