From: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
To: Huichao Cai <chcchc88@163.com>,
Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org
Subject: Re: [PATCH v6] ip_frag: add IPv4 fragment copy packet API
Date: Sun, 7 Aug 2022 12:49:11 +0100 [thread overview]
Message-ID: <fec8a117-db0d-ef17-cfd1-7b1dbf0fb0ec@yandex.ru> (raw)
In-Reply-To: <66a29fb8.75d.1823818ffdb.Coremail.chcchc88@163.com>
>
> At 2022-07-25 23:42:06, "Stephen Hemminger" <stephen@networkplumber.org> wrote:
>>On Sun, 24 Jul 2022 16:10:03 +0800
>>Huichao Cai <chcchc88@163.com> wrote:
>>
>>> +
>>> + /*
>>> + * Formal parameter checking.
>>> + */
>>> + if (unlikely(pkt_in == NULL) || unlikely(pkts_out == NULL) ||
>>> + unlikely(nb_pkts_out == 0) || unlikely(pool_direct == NULL) ||
>>> + unlikely(mtu_size < RTE_ETHER_MIN_MTU))
>>> + return -EINVAL;
>>> +
>>> + in_hdr = rte_pktmbuf_mtod(pkt_in, struct rte_ipv4_hdr *);
>>> + header_len = (in_hdr->version_ihl & RTE_IPV4_HDR_IHL_MASK) *
>>> + RTE_IPV4_IHL_MULTIPLIER;
>>> +
>>> + /* Check IP header length */
>>> + if (unlikely(pkt_in->data_len < header_len) ||
>>> + unlikely(mtu_size < header_len))
>>> + return -EINVAL;
>>> +
>>
>>My suspicions are all this input parameter checking probably costs more
> >than any performance gain of having a non-segmented fast path.
I think checks are not that expensive.
My guess - actual copying will be the main cycles eater here.
Though if percentage of packets that need to be fragmented is tiny,
might be it is still worth it.
Though yes, I still think better would be not to use MBUF_FAST_FREE at
all, but we are where we are.
> These checks are consistent with the rte_ipv4_fragment_packet function.
> I think these have been tested for performance.If these checks do affect
> performance,
> perhaps the legitimacy of the variable is better guaranteed by the caller
next prev parent reply other threads:[~2022-08-07 11:49 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-09 2:39 [PATCH v1] " Huichao Cai
2022-06-09 14:19 ` [PATCH v2] " Huichao Cai
2022-07-10 23:35 ` Konstantin Ananyev
2022-07-11 9:14 ` Konstantin Ananyev
2022-07-15 8:05 ` Huichao Cai
2022-07-19 8:19 ` Konstantin Ananyev
2022-07-22 13:01 ` [PATCH v3] " Huichao Cai
2022-07-22 14:42 ` Morten Brørup
2022-07-22 14:49 ` Stephen Hemminger
2022-07-22 15:52 ` Morten Brørup
2022-07-22 15:58 ` Huichao Cai
2022-07-22 16:14 ` Morten Brørup
2022-07-22 22:35 ` Konstantin Ananyev
2022-07-23 8:24 ` Morten Brørup
2022-07-23 18:25 ` Konstantin Ananyev
2022-07-23 22:27 ` Morten Brørup
2022-07-22 14:49 ` [PATCH v4] " Huichao Cai
2022-07-24 4:50 ` [PATCH v5] " Huichao Cai
2022-07-24 8:10 ` [PATCH v6] " Huichao Cai
2022-07-25 15:42 ` Stephen Hemminger
2022-07-26 1:22 ` Huichao Cai
2022-08-07 11:49 ` Konstantin Ananyev [this message]
2022-08-07 11:45 ` Konstantin Ananyev
2022-08-08 1:48 ` [PATCH v7] " Huichao Cai
2022-08-08 22:29 ` Konstantin Ananyev
2022-08-29 14:22 ` 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=fec8a117-db0d-ef17-cfd1-7b1dbf0fb0ec@yandex.ru \
--to=konstantin.v.ananyev@yandex.ru \
--cc=chcchc88@163.com \
--cc=dev@dpdk.org \
--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).