RE: [PATCH v9 0/8] thunderbolt: Introducing Thunderbolt(TM) Networking

2016-11-19 Thread Levy, Amir (Jer)
On Fri, Nov 18 2016, 12:07 PM, gre...@linuxfoundation.org wrote:
> On Fri, Nov 18, 2016 at 08:48:36AM +0000, Levy, Amir (Jer) wrote:
> > > BTW, it is quite a shame that the Thunderbolt firmware version can't
> > > be read from Linux.
> > >
> >
> > This is WIP, once this patch will be upstream, we will be able to
> > focus more on aligning Linux with the Thunderbolt features that we have
> for windows.
> 
> Why is this patch somehow holding that work back?  You aren't just sitting
> around waiting for people to review this and not doing anything else, right?
> Is there some basic building block in these patches that your firmware
> download code is going to rely on?
> 
> confused,
> 
> greg k-h

All the Thunderbolt SW features (including networking and FW update) depend 
on the communication with FW, which is patch 3/8 in the series.
The patch also sets up a generic netlink for user space communication.
So yes, the communication with Thunderbolt FW is a basic building block.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v9 0/8] thunderbolt: Introducing Thunderbolt(TM) Networking

2016-11-18 Thread Levy, Amir (Jer)
On Tue, Nov 15 2016, 12:59 PM, Simon Guinot wrote:
> On Wed, Nov 09, 2016 at 03:42:53PM +0000, Levy, Amir (Jer) wrote:
> > On Wed, Nov 9 2016, 04:36 PM, Simon Guinot wrote:
> > > Hi Amir,
> > >
> > > I have an ASUS "All Series/Z87-DELUXE/QUAD" motherboard with a 
> > > Thunderbolt 2 "Falcon Ridge" chipset (device ID 156d).
> > >
> > > Is the thunderbolt-icm driver supposed to work with this chipset ?
> > >
> >
> > Yes, the thunderbolt-icm supports Falcon Ridge, device ID 156c.
> > 156d is the bridge -
> > http://lxr.free-electrons.com/source/include/linux/pci_ids.h#L2619
> >
> > > I have installed both a 4.8.6 Linux kernel (patched with your v9
> > > series) and the thunderbolt-software-daemon (27 october release) 
> > > inside a Debian system (Jessie).
> > >
> > > If I connect the ASUS motherboard with a MacBook Pro (Thunderbolt 
> > > 2, device ID 156c), I can see that the thunderbolt-icm driver is 
> > > loaded and that the thunderbolt-software-daemon is well started. 
> > > But the Ethernet interface is not created.
> > >
> > > I have attached to this email the syslog file. There is the logs 
> > > from both the kernel and the daemon inside. Note that the daemon 
> > > logs are everything but clear about what could be the issue. Maybe 
> > > I missed some kind of configuration ? But I failed to find any 
> > > valuable information about configuring the driver and/or the 
> > > daemon in
> the various documentation files.
> > >
> > > Please, can you provide some guidance ? I'd really like to test 
> > > your patch series.
> >
> > First, thank you very much for willing to test it.
> > Thunderbolt Networking support was added during Falcon Ridge, in the
> latest FR images.
> > Do you know which Thunderbolt image version you have on your system?
> > Currently I submitted only Thunderbolt Networking feature in Linux, 
> > and we plan to add more features like reading the image version and
> updating the image.
> > If you don't know the image version, the only thing I can suggest is 
> > to load windows, install thunderbolt SW and check in the Thunderbolt
> application the image version.
> > To know if image update is needed, you can check - 
> > https://thunderbolttechnology.net/updates
> 
> Hi Amir,
> 
> From the Windows Thunderbolt software, I can read 13.00 for the 
> firmware version. And from https://thunderbolttechnology.net/updates, 
> I can see that there is no update available for my ASUS motherboard.
> 
> Am I good to go ?
> 

Thunderbolt Networking is supported on both Thunderbolt(tm) 2 and 
Thunderbolt(tm) 3 systems.  
Thunderbolt 2 systems must have updated NVM (version 25 or later) in order for 
the functionality to work properly.  
If the system does not have the update, please contact the OEM directly for an 
updated NVM.  
For best functionality and support, Intel recommends using Thunderbolt 3 
systems for all validation and testing.

> BTW, it is quite a shame that the Thunderbolt firmware version can't 
> be read from Linux.
> 

This is WIP, once this patch will be upstream, we will be able to focus more
on aligning Linux with the Thunderbolt features that we have for windows.

Regards,
Amir
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v9 0/8] thunderbolt: Introducing Thunderbolt(TM) Networking

2016-11-10 Thread Levy, Amir (Jer)
On Thu, Nov 10 2016, 01:44 PM, Greg KH wrote:
> On Thu, Nov 10, 2016 at 11:39:19AM +0000, Levy, Amir (Jer) wrote:
> > > And how about getting some internal-Intel kernel developers to
> > > review and sign-off on this code?  Don't make the community do the
> > > review when you have access to resources like this.  You have an
> > > internal mailing list for this very purpose, use it!
> > >
> >
> > The review with the internal-Intel kernel developers was done before
> > submitting the first patch set.
> 
> Then why is their signed-off-by:s not on the patchset showing that they
> "bless" this series?
> 

Working on it.

> thanks,
> 
> greg k-h

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v9 7/8] thunderbolt: Networking doc

2016-11-10 Thread Levy, Amir (Jer)
On Wed, Nov 9 2016, 06:00 PM, Greg KH wrote:
> On Wed, Nov 09, 2016 at 04:20:07PM +0200, Amir Levy wrote:
> > Adding Thunderbolt(TM) networking documentation.
> >
> > Signed-off-by: Amir Levy 
> > ---
> >  Documentation/00-INDEX   |   2 +
> >  Documentation/thunderbolt/networking.txt | 132
> > +++
> 
> Note, new files should be in .rst format, and live in the new subdirectory for
> them (somewhere in Documentation, don't know off the top of my head...)
> 
> >  2 files changed, 134 insertions(+)
> >  create mode 100644 Documentation/thunderbolt/networking.txt
> >
> > diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX index
> > 3acc4f1..0239e68 100644
> > --- a/Documentation/00-INDEX
> > +++ b/Documentation/00-INDEX
> > @@ -440,6 +440,8 @@ this_cpu_ops.txt
> > - List rationale behind and the way to use this_cpu operations.
> >  thermal/
> > - directory with information on managing thermal issues (CPU/temp)
> > +thunderbolt/
> > +   - directory with info regarding Thunderbolt.
> >  trace/
> > - directory with info on tracing technologies within linux
> > unaligned-memory-access.txt
> 
> This change is probably not needed.
> 
> > diff --git a/Documentation/thunderbolt/networking.txt
> > b/Documentation/thunderbolt/networking.txt
> > new file mode 100644
> > index 000..88d1c12
> > --- /dev/null
> > +++ b/Documentation/thunderbolt/networking.txt
> > @@ -0,0 +1,132 @@
> > +Intel Thunderbolt(TM) Networking driver
> > +===
> > +
> > +Copyright(c) 2013 - 2016 Intel Corporation.
> > +
> > +Contact Information:
> > +Intel Thunderbolt mailing list 
> > +Edited by Amir Levy 
> > +
> > +Overview
> > +
> > +
> > +* The Thunderbolt Networking driver enables peer to peer networking
> > +on non-Apple
> > +  platforms running Linux.
> > +
> > +* The driver creates a virtual Ethernet device that enables computer
> > +to computer
> > +  communication over the Thunderbolt cable.
> > +
> > +* Using Thunderbolt Networking you can perform high speed file
> > +transfers between
> > +  computers, perform PC migrations and/or set up small workgroups
> > +with shared
> > +  storage without compromising any other Thunderbolt functionality.
> > +
> > +* The driver is located in drivers/thunderbolt/icm.
> > +
> > +* This driver will function only on non-Apple platforms with firmware
> > +based
> > +  Thunderbolt controllers that support Thunderbolt Networking.
> > +
> > +  ++++
> > +  |Host 1  ||Host 2  |
> > +  ||||
> > +  |   +---+||+---+   |
> > +  |   |Network||||Network|   |
> > +  |   |Stack  ||||Stack  |   |
> > +  |   +---+||+---+   |
> > +  |   ^||^   |
> > +  |   ||||   |
> > +  |   v||v   |
> > +  | +---+  ||  +---+ |
> > +  | |Thunderbolt|  ||  |Thunderbolt| |
> > +  | |Networking |  ||  |Networking | |
> > +  | |Driver |  ||  |Driver | |
> > +  | +---+  ||  +---+ |
> > +  |   ^||^   |
> > +  |   ||||   |
> > +  |   v||v   |
> > +  | +---+  ||  +---+ |
> > +  | |Thunderbolt|  ||  |Thunderbolt| |
> > +  | |Controller |<-++->|Controller | |
> > +  | |with ICM   |  ||  |with ICM   | |
> > +  | |enabled|  ||  |enabled| |
> > +  | +---+  ||  +---+ |
> > +  ++++
> > +
> > +Files
> > +=
> > +
> > +The following files are located in the drivers/thunderbolt/icm directory:
> > +
> > +- icm_nhi.c/h: These files allow communication with the firmware
> (Intel
> > +  Connection Manager) based controller. They also create an interface
> > +for
> > +  netlink communication with a user space daemon.
> > +
> > +- net.c/net.h: These files implement the 'eth' interface for the
> > +  Thunderbolt(TM) Networking.
> 
> You don't have to list the files, right?
> 
> > +
> > +Interface to User Space
> > +===
> > +
> > +The interface to the user space module is implemented through a Generic
> Netlink.
> 
> Huh?  Not a normal network device?
> 
> > +This is the communications protocol between the Thunderbolt driver
> > +and the user space application.
> 
> What userspace application?
> 
> > +Note that this interface mediates user space communication with ICM.
> 
> What is ICM?
> 
> > +(Existing Linux tools can be used to configure the network
> > 

RE: [PATCH v9 0/8] thunderbolt: Introducing Thunderbolt(TM) Networking

2016-11-10 Thread Levy, Amir (Jer)
On Wed, Nov 9 2016, 06:02 PM, Greg KH wrote:
> On Wed, Nov 09, 2016 at 04:20:00PM +0200, Amir Levy wrote:
> > This driver enables Thunderbolt Networking on non-Apple platforms
> > running Linux.
> >
> > Thunderbolt Networking provides peer-to-peer connections to transfer
> > files between computers, perform PC migrations, and/or set up small
> > workgroups with shared storage.
> >
> > This is a virtual connection that emulates an Ethernet adapter that
> > enables Ethernet networking with the benefit of Thunderbolt superfast
> > medium capability.
> >
> > Thunderbolt Networking enables two hosts and several devices that have
> > a Thunderbolt controller to be connected together in a linear (Daisy
> > chain) series from a single port.
> >
> > Thunderbolt Networking for Linux is compatible with Thunderbolt
> > Networking on systems running macOS or Windows and also supports
> > Thunderbolt generation 2 and 3 controllers.
> >
> > Note that all pre-existing Thunderbolt generation 3 features, such as
> > USB, Display and other Thunderbolt device connectivity will continue
> > to function exactly as they did prior to enabling Thunderbolt Networking.
> >
> > Code and Software Specifications:
> > This kernel code creates a virtual ethernet device for computer to
> > computer communication over a Thunderbolt cable.
> > The new driver is a separate driver to the existing Thunderbolt driver.
> > It is designed to work on systems running Linux that interface with
> > Intel Connection Manager (ICM) firmware based Thunderbolt controllers
> > that support Thunderbolt Networking.
> > The kernel code operates in coordination with the Thunderbolt user-
> > space daemon to implement full Thunderbolt networking functionality.
> >
> > Hardware Specifications:
> > Thunderbolt Hardware specs have not yet been published but are used
> > where necessary for register definitions.
> >
> > Acked-by: Andreas Noever 
> > Tested-by: Mario Limonciello 
> 
> This whole series is acked and tested by these people?  If so, why did you not
> include that in each patch?
> 

Will add in next patch set.

> And how about getting some internal-Intel kernel developers to review and
> sign-off on this code?  Don't make the community do the review when you
> have access to resources like this.  You have an internal mailing list for 
> this
> very purpose, use it!
> 

The review with the internal-Intel kernel developers was done before submitting
the first patch set.
Version 9 that we have here isn't so different from Version 0.

> thanks,
> 
> greg k-h

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v9 0/8] thunderbolt: Introducing Thunderbolt(TM) Networking

2016-11-09 Thread Levy, Amir (Jer)
On Wed, Nov 9 2016, 04:36 PM, Simon Guinot wrote:
> On Wed, Nov 09, 2016 at 04:20:00PM +0200, Amir Levy wrote:
> > This driver enables Thunderbolt Networking on non-Apple platforms 
> > running Linux.
> >
> > Thunderbolt Networking provides peer-to-peer connections to transfer 
> > files between computers, perform PC migrations, and/or set up small 
> > workgroups with shared storage.
> >
> > This is a virtual connection that emulates an Ethernet adapter that 
> > enables Ethernet networking with the benefit of Thunderbolt 
> > superfast medium capability.
> >
> > Thunderbolt Networking enables two hosts and several devices that 
> > have a Thunderbolt controller to be connected together in a linear 
> > (Daisy
> > chain) series from a single port.
> >
> > Thunderbolt Networking for Linux is compatible with Thunderbolt 
> > Networking on systems running macOS or Windows and also supports 
> > Thunderbolt generation 2 and 3 controllers.
> >
> > Note that all pre-existing Thunderbolt generation 3 features, such 
> > as USB, Display and other Thunderbolt device connectivity will 
> > continue to function exactly as they did prior to enabling Thunderbolt 
> > Networking.
> >
> > Code and Software Specifications:
> > This kernel code creates a virtual ethernet device for computer to 
> > computer communication over a Thunderbolt cable.
> > The new driver is a separate driver to the existing Thunderbolt driver.
> > It is designed to work on systems running Linux that interface with 
> > Intel Connection Manager (ICM) firmware based Thunderbolt 
> > controllers that support Thunderbolt Networking.
> > The kernel code operates in coordination with the Thunderbolt user- 
> > space daemon to implement full Thunderbolt networking functionality.
> >
> > Hardware Specifications:
> > Thunderbolt Hardware specs have not yet been published but are used 
> > where necessary for register definitions.
> 
> Hi Amir,
> 
> I have an ASUS "All Series/Z87-DELUXE/QUAD" motherboard with a 
> Thunderbolt 2 "Falcon Ridge" chipset (device ID 156d).
> 
> Is the thunderbolt-icm driver supposed to work with this chipset ?
> 

Yes, the thunderbolt-icm supports Falcon Ridge, device ID 156c.
156d is the bridge - 
http://lxr.free-electrons.com/source/include/linux/pci_ids.h#L2619

> I have installed both a 4.8.6 Linux kernel (patched with your v9
> series) and the thunderbolt-software-daemon (27 october release) 
> inside a Debian system (Jessie).
> 
> If I connect the ASUS motherboard with a MacBook Pro (Thunderbolt 2, 
> device ID 156c), I can see that the thunderbolt-icm driver is loaded 
> and that the thunderbolt-software-daemon is well started. But the 
> Ethernet interface is not created.
> 
> I have attached to this email the syslog file. There is the logs from 
> both the kernel and the daemon inside. Note that the daemon logs are 
> everything but clear about what could be the issue. Maybe I missed 
> some kind of configuration ? But I failed to find any valuable 
> information about configuring the driver and/or the daemon in the various 
> documentation files.
> 
> Please, can you provide some guidance ? I'd really like to test your 
> patch series.

First, thank you very much for willing to test it.
Thunderbolt Networking support was added during Falcon Ridge, in the latest FR 
images.
Do you know which Thunderbolt image version you have on your system?
Currently I submitted only Thunderbolt Networking feature in Linux, and we plan 
to add
more features like reading the image version and updating the image.
If you don't know the image version, the only thing I can suggest is to load 
windows, install thunderbolt SW
and check in the Thunderbolt application the image version.
To know if image update is needed, you can check - 
https://thunderbolttechnology.net/updates

> 
> Thanks in advance.
> 
> Simon

Thanks,
Amir
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v8 0/8] thunderbolt: Introducing Thunderbolt(TM) Networking

2016-09-30 Thread Levy, Amir (Jer)
On Fri, Sep 30 2016, 09:40 AM, David Miller wrote:
> From: Greg KH 
> Date: Fri, 30 Sep 2016 08:30:05 +0200
> 
> > On Fri, Sep 30, 2016 at 01:55:55AM -0400, David Miller wrote:
> >> From: Amir Levy 
> >> Date: Wed, 28 Sep 2016 17:44:22 +0300
> >>
> >> > This driver enables Thunderbolt Networking on non-Apple platforms
> >> > running Linux.
> >>
> >> Greg, any idea where this should get merged once fully vetted?  I can
> >> take it through the net-next tree, but I'm fine with another more
> >> appropriate tree taking it as well.
> >
> > I am supposed to be taking thunderbolt patches, but if this really is
> > a network driver, it should go under drivers/net/ somewhere.  It needs
> > more review though, it's not ready to go through anyone's tree just
> > yet :)
> >
> > I'll let the thunderbolt maintainer go through it first before asking
> > for a netdev review.
> 
> Ok, thanks Greg.

Greg, David,
Andreas replied to similar request on patch v6:
"This driver is independent from mine. It uses an interface provided by the 
firmware which is not present on Apple hardware and with which I am not 
familiar (also it does networking, not pci with which I am also not familiar). 
So I cannot comment on the driver itself. I don't mind a second driver, if that 
is what you are asking."

Note that Thunderbolt Networking is the first feature we would like to submit, 
but the next features aren't related to network, but more to Thunderbolt 
functionality. 
This is the reason I created the directory thunderbolt/icm, since the next 
features requires ICM to be enabled as well.
I also followed the firewire as example that includes net.c (in 
drivers/firewire directory) along with other firewire functionality. 

Thanks,
Amir

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v6 2/8] thunderbolt: Updating the register definitions

2016-09-11 Thread Levy, Amir (Jer)
On Sun, Sep 11 2016, 03:02 AM, Andreas Noever wrote:
> On Mon, Aug 1, 2016 at 2:23 PM, Amir Levy  wrote:
> > Adding more Thunderbolt(TM) register definitions and some helper
> > macros.
> 
> Thinking about this again I would prefer it if you would put your definitions
> into a separate file under icm/ (even if there is some duplication). The style
> (bitfields vs. genmask) is different between the drivers and for a reader it 
> is
> difficult to find out what is actually supposed to be used by the two drivers
> (ring_desc vs tbt_buf_desc or the ring RING_INT_EN/DISABLE macros in the
> header file vs. ring_interrupt_active in nhi.c).
> 
> This would also completely separate the two drivers.
> 
> Andreas
> 

I'm also in favor of completely separating the drivers, but is it the right 
thing to do with the register definitions
when the underlying registers layout is exactly the same?

Note that bitfields are not so recommended when you care about the format/order 
of bits, like in the ring descriptor.

Amir
N�r��yb�X��ǧv�^�)޺{.n�+{�v�"��^n�r���z���h�&���G���h�(�階�ݢj"���m��z�ޖ���f���h���~�m�

RE: [PATCH v5 6/8] thunderbolt: Networking transmit and receive

2016-07-31 Thread Levy, Amir (Jer)
On Sun, Jul 31 2016, 09:45 PM, David Miller wrote:
> From: "Levy, Amir (Jer)" <amir.jer.l...@intel.com>
> Date: Sun, 31 Jul 2016 10:15:52 +
> 
> > The network stack thinks it is Ethernet, it might not accept Runt
> > frames, so the driver pads the frame in receive.
> 
> The network stack doesn't care about this at all.  It's wasted effort on your
> part.

Great, I'll remove this code.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v5 4/8] thunderbolt: Communication with the ICM (firmware)

2016-07-31 Thread Levy, Amir (Jer)
On Sat, Jul 30 2016, 12:03 AM, Stephen Hemminger wrote:
> On Thu, 28 Jul 2016 11:15:17 +0300
> Amir Levy  wrote:
> 
> > +int nhi_send_message(struct tbt_nhi_ctxt *nhi_ctxt, enum pdf_value
> pdf,
> > +u32 msg_len, const u8 *msg, bool ignore_icm_resp) {
> 
> Why not make msg a void * and not have to do so many casts?

I couldn't agree more.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v5 5/8] thunderbolt: Networking state machine

2016-07-31 Thread Levy, Amir (Jer)
On Thu, Jul 28 2016, 02:35 PM, Lukas Wunner wrote:
> On Thu, Jul 28, 2016 at 11:15:18AM +0300, Amir Levy wrote:
> > +   nhi_ctxt->net_devices[
> > +   port_num].medium_sts =
> 
> Looks like a carriage return slipped in here.

Will be fixed.

> 
> In patch [4/8], I've found it a bit puzzling that FW->SW responses and
> FW->SW notifications are defined in icm_nhi.c, whereas SW->FW commands
> are defined in net.h. It would perhaps be more logical to have them all in the
> header file. The FW->SW responses and SW->FW commands are almost
> identical, there are odd spelling differences (CONNEXION vs.
> CONNECTION).

Will move them to the header and will change to CONNECTION.

> 
> It would probably be good to explain the PDF acronym somewhere.

Will explain in the enum.

> 
> I've skimmed over all patches in the series, too superficial to provide a
> Reviewed-by, it's just too much code to review thoroughly and I also lack the
> hardware to test it, but broadly this LGTM.

Thank you for the review.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v5 4/8] thunderbolt: Communication with the ICM (firmware)

2016-07-31 Thread Levy, Amir (Jer)
On Sat, Jul 30 2016, 12:48 AM, Greg KH wrote:
> On Fri, Jul 29, 2016 at 02:02:24PM -0700, Stephen Hemminger wrote:
> > On Thu, 28 Jul 2016 11:15:17 +0300
> > Amir Levy  wrote:
> >
> > > +static LIST_HEAD(controllers_list); static
> > > +DECLARE_RWSEM(controllers_list_rwsem);
> >
> > Why use a semaphore when simple spinlock or mutex would be better?
> 
> And never use a RW semaphore unless you can benchmark the difference
> from a normal lock.  If you can't benchmark it, then don't use it...

I used RW semaphore since most of the time the list will be accessed for read.
Since it is used in non-time sensitive flows, I'll change it to mutex.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v5 6/8] thunderbolt: Networking transmit and receive

2016-07-31 Thread Levy, Amir (Jer)
On Sat, Jul 30 2016, 12:07 AM, Stephen Hemminger wrote:
> On Thu, 28 Jul 2016 11:15:19 +0300
> Amir Levy  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.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html