linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Levy, Amir (Jer)" <amir.jer.levy@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "andreas.noever@gmail.com" <andreas.noever@gmail.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"corbet@lwn.net" <corbet@lwn.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	thunderbolt-linux <thunderbolt-linux@intel.com>,
	"Westerberg, Mika" <mika.westerberg@intel.com>,
	"Winkler, Tomas" <tomas.winkler@intel.com>
Subject: RE: [PATCH v5 6/8] thunderbolt: Networking transmit and receive
Date: Sun, 31 Jul 2016 10:15:52 +0000	[thread overview]
Message-ID: <E607265CB020454880711A6F96C05A039710868B@hasmsx108.ger.corp.intel.com> (raw)
In-Reply-To: <20160729140741.18ca3e35@xeon-e3>

On Sat, Jul 30 2016, 12:07 AM, Stephen Hemminger wrote:
> On Thu, 28 Jul 2016 11:15:19 +0300
> Amir Levy <amir.jer.levy@intel.com> wrote:
> 
> > +		/* pad short packets */
> > +		if (unlikely(skb->len < ETH_ZLEN)) {
> > +			int pad_len = ETH_ZLEN - skb->len;
> > +
> > +			/* The skb is freed on error */
> > +			if (unlikely(skb_pad(skb, pad_len))) {
> > +				cleaned_count += frame_count;
> > +				continue;
> > +			}
> > +			__skb_put(skb, pad_len);
> > +		}
> 
> Packets should be padded on transmit, not on receive??

This driver emulates an Ethernet adapter on top of Thunderbolt technology.
The Thunderbolt medium hasn't any restriction on minimum frame size and doesn't have the Ethernet collision detection limitation.
So moving this code from transmit is actually an optimization - sending the minimum on the wire.
The network stack thinks it is Ethernet, it might not accept Runt frames, so the driver pads the frame in receive.

Looks like it deserves a comment in the code. Will add it.

  reply	other threads:[~2016-07-31 10:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28  8:15 [PATCH v5 0/8] thunderbolt: Introducing Thunderbolt(TM) networking Amir Levy
2016-07-28  8:15 ` [PATCH v5 1/8] thunderbolt: Macro rename Amir Levy
2016-07-28  8:15 ` [PATCH v5 2/8] thunderbolt: Updating the register definitions Amir Levy
2016-07-28  8:15 ` [PATCH v5 3/8] thunderbolt: Kconfig for Thunderbolt(TM) networking Amir Levy
2016-07-28  8:15 ` [PATCH v5 4/8] thunderbolt: Communication with the ICM (firmware) Amir Levy
2016-07-29 21:02   ` Stephen Hemminger
2016-07-29 21:48     ` Greg KH
2016-07-31 10:18       ` Levy, Amir (Jer)
2016-07-29 21:03   ` Stephen Hemminger
2016-07-31 12:07     ` Levy, Amir (Jer)
2016-07-28  8:15 ` [PATCH v5 5/8] thunderbolt: Networking state machine Amir Levy
2016-07-28 11:35   ` Lukas Wunner
2016-07-31 11:58     ` Levy, Amir (Jer)
2016-07-28  8:15 ` [PATCH v5 6/8] thunderbolt: Networking transmit and receive Amir Levy
2016-07-29 21:07   ` Stephen Hemminger
2016-07-31 10:15     ` Levy, Amir (Jer) [this message]
2016-07-31 18:45       ` David Miller
2016-08-01  4:30         ` Levy, Amir (Jer)
2016-07-28  8:15 ` [PATCH v5 7/8] thunderbolt: Networking doc Amir Levy
2016-07-28  8:15 ` [PATCH v5 8/8] thunderbolt: Adding maintainer entry Amir Levy

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=E607265CB020454880711A6F96C05A039710868B@hasmsx108.ger.corp.intel.com \
    --to=amir.jer.levy@intel.com \
    --cc=andreas.noever@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mika.westerberg@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=thunderbolt-linux@intel.com \
    --cc=tomas.winkler@intel.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).