Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1452802
| From | "Levy, Amir (Jer)" <amir.jer.levy@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | RE: [PATCH v5 6/8] thunderbolt: Networking transmit and receive |
| Date | 2016-07-31 12:20 +0200 |
| Message-ID | <s0W0F-7ec-1@gated-at.bofh.it> (permalink) |
| References | <rZOHT-3yL-3@gated-at.bofh.it> <rZOHU-3yL-17@gated-at.bofh.it> <s0nmh-1FG-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v5 0/8] thunderbolt: Introducing Thunderbolt(TM) networking Amir Levy <amir.jer.levy@intel.com> - 2016-07-28 10:20 +0200
[PATCH v5 2/8] thunderbolt: Updating the register definitions Amir Levy <amir.jer.levy@intel.com> - 2016-07-28 10:20 +0200
[PATCH v5 8/8] thunderbolt: Adding maintainer entry Amir Levy <amir.jer.levy@intel.com> - 2016-07-28 10:20 +0200
[PATCH v5 7/8] thunderbolt: Networking doc Amir Levy <amir.jer.levy@intel.com> - 2016-07-28 10:20 +0200
Re: [PATCH v5 5/8] thunderbolt: Networking state machine Lukas Wunner <lukas@wunner.de> - 2016-07-28 13:40 +0200
RE: [PATCH v5 5/8] thunderbolt: Networking state machine "Levy, Amir (Jer)" <amir.jer.levy@intel.com> - 2016-07-31 14:00 +0200
Re: [PATCH v5 4/8] thunderbolt: Communication with the ICM (firmware) Stephen Hemminger <stephen@networkplumber.org> - 2016-07-29 23:10 +0200
Re: [PATCH v5 4/8] thunderbolt: Communication with the ICM (firmware) Greg KH <gregkh@linuxfoundation.org> - 2016-07-29 23:50 +0200
RE: [PATCH v5 4/8] thunderbolt: Communication with the ICM (firmware) "Levy, Amir (Jer)" <amir.jer.levy@intel.com> - 2016-07-31 12:20 +0200
Re: [PATCH v5 4/8] thunderbolt: Communication with the ICM (firmware) Stephen Hemminger <stephen@networkplumber.org> - 2016-07-29 23:10 +0200
RE: [PATCH v5 4/8] thunderbolt: Communication with the ICM (firmware) "Levy, Amir (Jer)" <amir.jer.levy@intel.com> - 2016-07-31 14:10 +0200
Re: [PATCH v5 6/8] thunderbolt: Networking transmit and receive Stephen Hemminger <stephen@networkplumber.org> - 2016-07-29 23:20 +0200
RE: [PATCH v5 6/8] thunderbolt: Networking transmit and receive "Levy, Amir (Jer)" <amir.jer.levy@intel.com> - 2016-07-31 12:20 +0200
Re: [PATCH v5 6/8] thunderbolt: Networking transmit and receive David Miller <davem@davemloft.net> - 2016-07-31 20:50 +0200
RE: [PATCH v5 6/8] thunderbolt: Networking transmit and receive "Levy, Amir (Jer)" <amir.jer.levy@intel.com> - 2016-08-01 06:40 +0200
csiph-web