From: dwilder <dwilder@us.ibm.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Network Development <netdev@vger.kernel.org>,
tlfalcon@linux.ibm.com, cris.forno@ibm.com,
pradeeps@linux.vnet.ibm.com, wilder@us.ibm.com
Subject: RE: [ PATCH v1 2/2] ibmveth: Identify ingress large send packets.
Date: Mon, 12 Oct 2020 15:30:12 -0700 [thread overview]
Message-ID: <ad0d23a8d3c246d5ff10c52b52a8175c@linux.vnet.ibm.com> (raw)
In-Reply-To: <20201011113125.3f370b77@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
On 2020-10-11 11:31, Jakub Kicinski wrote:
> On Sat, 10 Oct 2020 12:51:30 -0400 Willem de Bruijn wrote:
>> > > @@ -1385,7 +1386,17 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
>> > > skb_put(skb, length);
>> > > skb->protocol = eth_type_trans(skb, netdev);
>> > >
>> > > - if (length > netdev->mtu + ETH_HLEN) {
>> > > + /* PHYP without PLSO support places a -1 in the ip
>> > > + * checksum for large send frames.
>> > > + */
>> > > + if (be16_to_cpu(skb->protocol) == ETH_P_IP) {
>
> You can byteswap the constant, so its done at compilation time.
Thanks for the comments.
For V2 of patch I will change above to BE16_TO_CPU()
>
>> > > + struct iphdr *iph = (struct iphdr *)skb->data;
>> > > +
>> > > + iph_check = iph->check;
>> >
>> > Check against truncated/bad packets.
>>
>> .. unless I missed context. Other code in this driver seems to peek in
>> the network and transport layer headers without additional geometry
>> and integrity checks, too.
>
> Good catch, even if we trust the hypervisor to only forward valid
> frames this needs to be at least mentioned in the commit message.
>
> Also please add Fixes tags to both patches.
For V2: ( posting soon )
-Will add Fix tags
-update commit message re: validity of frames from Hypervisor.
-switch be16_to_cpu() to BE16_TO_CPU().
Thanks
prev parent reply other threads:[~2020-10-12 22:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-08 19:05 [ PATCH v1 0/2] ibmveth gso fix David Wilder
2020-10-08 19:05 ` [ PATCH v1 1/2] ibmveth: Switch order of ibmveth_helper calls David Wilder
2020-10-10 16:49 ` Willem de Bruijn
2020-10-08 19:05 ` [ PATCH v1 2/2] ibmveth: Identify ingress large send packets David Wilder
2020-10-10 16:40 ` Willem de Bruijn
2020-10-10 16:51 ` Willem de Bruijn
2020-10-11 18:31 ` Jakub Kicinski
2020-10-12 22:30 ` dwilder [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=ad0d23a8d3c246d5ff10c52b52a8175c@linux.vnet.ibm.com \
--to=dwilder@us.ibm.com \
--cc=cris.forno@ibm.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pradeeps@linux.vnet.ibm.com \
--cc=tlfalcon@linux.ibm.com \
--cc=wilder@us.ibm.com \
--cc=willemdebruijn.kernel@gmail.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).