From: David Miller <davem@davemloft.net>
To: doronrk@fb.com
Cc: davejwatson@fb.com, vakul.garg@nxp.com, borisp@mellanox.com,
aviadye@mellanox.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next,v4] net/tls: Calculate nsg for zerocopy path without skb_cow_data.
Date: Sat, 11 Aug 2018 11:54:53 -0700 (PDT) [thread overview]
Message-ID: <20180811.115453.2016294695634012705.davem@davemloft.net> (raw)
In-Reply-To: <20180809224344.GA48089@doronrk-mbp.dhcp.thefacebook.com>
From: Doron Roberts-Kedes <doronrk@fb.com>
Date: Thu, 9 Aug 2018 15:43:44 -0700
> Taking a step back, is there an existing solution for what this function
> is trying to do? I was surprised to find that there did not seem to
> exist a function for determining the number of scatterlist elements
> required to map an skb without COW.
The reason is that we usually never need to "map" an SKB on receive,
and on transmit the SKB geometry is normalized by the destination
device features which means no frag_list.
And the other existing receive path doing SW crypto, IPSEC, always
COWs the data so get the number of SG array entries needed from
skb_cow_data().
Frag lists on RX should be pretty rare. They occur when GRO
segmentation encouters poorly arranged incoming SKBs. For example
this happens if the incoming frames use lots of tiny SKB page frags,
and therefore prevent accumulation into the page frag array of the
head GRO skb.
So yes it can happen, and we have to account for it.
So I guess you really do need to accomodate this situation. Why
don't you try to rearrange your new function with some likely()
and unlikely() tests so that the straight code path optimizes for
the non-frag-list case?
Thanks!
next prev parent reply other threads:[~2018-08-11 22:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-07 18:09 [PATCH net-next,v4] net/tls: Calculate nsg for zerocopy path without skb_cow_data Doron Roberts-Kedes
2018-08-08 19:14 ` David Miller
2018-08-09 22:43 ` Doron Roberts-Kedes
2018-08-11 18:54 ` David Miller [this message]
2018-08-21 0:27 ` Doron Roberts-Kedes
2018-08-21 0:30 ` David Miller
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=20180811.115453.2016294695634012705.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=aviadye@mellanox.com \
--cc=borisp@mellanox.com \
--cc=davejwatson@fb.com \
--cc=doronrk@fb.com \
--cc=netdev@vger.kernel.org \
--cc=vakul.garg@nxp.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).