netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: David Wilder <dwilder@us.ibm.com>
Cc: 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: Sat, 10 Oct 2020 12:51:30 -0400	[thread overview]
Message-ID: <CA+FuTSejypj6fvU3-b8V-kU6Xcwg7m4R3OO3Ry4kQK=87hNwvw@mail.gmail.com> (raw)
In-Reply-To: <CA+FuTSc8qw_U=nKR0tM06z99Es8JVKR0P6rQpR=Bkwj1eOtXCw@mail.gmail.com>

On Sat, Oct 10, 2020 at 12:40 PM Willem de Bruijn
<willemdebruijn.kernel@gmail.com> wrote:
>
> On Thu, Oct 8, 2020 at 3:06 PM David Wilder <dwilder@us.ibm.com> wrote:
> >
> > Ingress large send packets are identified by either:
> > The IBMVETH_RXQ_LRG_PKT flag in the receive buffer
> > or with a -1 placed in the ip header checksum.
> > The method used depends on firmware version.
> >
> > Signed-off-by: David Wilder <dwilder@us.ibm.com>
> > Reviewed-by: Thomas Falcon <tlfalcon@linux.ibm.com>
> > Reviewed-by: Cristobal Forno <cris.forno@ibm.com>
> > Reviewed-by: Pradeep Satyanarayana <pradeeps@linux.vnet.ibm.com>
> > ---
> >  drivers/net/ethernet/ibm/ibmveth.c | 13 ++++++++++++-
> >  1 file changed, 12 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
> > index 3935a7e..e357cbe 100644
> > --- a/drivers/net/ethernet/ibm/ibmveth.c
> > +++ b/drivers/net/ethernet/ibm/ibmveth.c
> > @@ -1349,6 +1349,7 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
> >                         int offset = ibmveth_rxq_frame_offset(adapter);
> >                         int csum_good = ibmveth_rxq_csum_good(adapter);
> >                         int lrg_pkt = ibmveth_rxq_large_packet(adapter);
> > +                       __sum16 iph_check = 0;
> >
> >                         skb = ibmveth_rxq_get_buffer(adapter);
> >
> > @@ -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) {
> > +                               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.

  reply	other threads:[~2020-10-10 23:12 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 [this message]
2020-10-11 18:31       ` Jakub Kicinski
2020-10-12 22:30         ` dwilder

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='CA+FuTSejypj6fvU3-b8V-kU6Xcwg7m4R3OO3Ry4kQK=87hNwvw@mail.gmail.com' \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=cris.forno@ibm.com \
    --cc=dwilder@us.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pradeeps@linux.vnet.ibm.com \
    --cc=tlfalcon@linux.ibm.com \
    --cc=wilder@us.ibm.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).