lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <553A8AF7.2020206@cogentembedded.com>
Date:	Fri, 24 Apr 2015 21:27:03 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	David Laight <David.Laight@...LAB.COM>,
	David Miller <davem@...emloft.net>
CC:	"mitsuhiro.kimura.kc@...esas.com" <mitsuhiro.kimura.kc@...esas.com>,
	"f.fainelli@...il.com" <f.fainelli@...il.com>,
	"robh+dt@...nel.org" <robh+dt@...nel.org>,
	"pawel.moll@....com" <pawel.moll@....com>,
	"mark.rutland@....com" <mark.rutland@....com>,
	"ijc+devicetree@...lion.org.uk" <ijc+devicetree@...lion.org.uk>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"galak@...eaurora.org" <galak@...eaurora.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"richardcochran@...il.com" <richardcochran@...il.com>,
	"linux-sh@...r.kernel.org" <linux-sh@...r.kernel.org>,
	"masaru.nagai.vx@...esas.com" <masaru.nagai.vx@...esas.com>
Subject: Re: [PATCH v3] Renesas Ethernet AVB driver

On 04/24/2015 12:03 PM, David Laight wrote:

>> Sent: 22 April 2015 22:39
>> On 04/22/2015 11:42 PM, David Miller wrote:

>>>>      Hmm, I've been digging in the net core, and was unable to see where TX
>>>>      skb's get their NET_IP_ALIGN bytes reserved. Have I missed something?
>>>>      Probably need to print out skb's fields...

>>> NET_IP_ALIGN is for receive, not transmit.

>>      But when I print 'skb->data' from the ndo_start_xmit() method (in the
>> 'sh_eth' driver), all addresses end with 2, so it looks like NET_IP_ALIGN gets
>> added somewhere...

> For a locally generated message:
> The TCP userdata is likely to be 4 byte aligned.
> The TCP and IP headers are multiples of 4 bytes.
> The MAC header is 14 bytes.
> So you end up with a buffer that starts on a 4n+2 boundary or an initial
> short fragment that is 4n+2 bytes long.

> If a message is being forwarded the alignment probably depends on where
> it came from.

    Thanks for the detailed reply, though it came a bit late. :-)

> If you have ethernet hardware that requires tx or rx buffers to be on

    The RX buffers can be adjusted with skb_resrerve(), it's only the TX 
buffers that need to be copied...

> 4n boundaries you should send it back as 'not fit for purpose'.

    I'm afraid we can't. :-)
    However, my colleague has suggested a scheme minimizing the copying:
only up to 3 first bytes need to be copied to the driver's internal buffers, 
the rest can be sent from an skb itself. That would require substantial 
changes to the driver though...

> 	David

WBR, Sergei

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ