mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lukasz Stelmach <l.stelmach@samsung.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "Andrew Lunn" <andrew@lunn.ch>,
	jim.cromie@gmail.com, "Heiner Kallweit" <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Kukjin Kim" <kgene@kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Russell King" <linux@armlinux.org.uk>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	"Bartłomiej Żolnierkiewicz" <b.zolnierkie@samsung.com>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>
Subject: Re: [PATCH v8 3/3] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver
Date: Thu, 17 Dec 2020 12:46:57 +0100	[thread overview]
Message-ID: <dleftjv9d07iz2.fsf%l.stelmach@samsung.com> (raw)
In-Reply-To: <20201216081300.3477c3fb@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (Jakub Kicinski's message of "Wed, 16 Dec 2020 08:13:00 -0800")

[-- Attachment #1: Type: text/plain, Size: 1744 bytes --]

It was <2020-12-16 śro 08:13>, when Jakub Kicinski wrote:
> On Wed, 16 Dec 2020 13:21:52 +0100 Lukasz Stelmach wrote:
>> So, the only thing that's left is pskb_expand_head(). I need to wrap my
>> head around it. Can you tell me how a cloned skb is different and why
>> there may be separate branch for it?
>
> I think this driver needs to prepend and append some info to the packet
> data, right? Cloned skb is sharing the data with another skb, the
> metadata is separate but the packet data is shared, so you can't modify
> the data, you need to do a copy of the data. pskb_expand_head() should
> take care of cloned skbs so you can just call it upfront and it will
> make sure the skb is the right geometry for you.
>
> BTW you should set netdev->needed_headroom and netdev->needed_tailroom

Done.

> to the correct values so the stack pre-allocates the needed spaces,
> when it can.

Yes, I fonud these. However, I am not sure setting needed_tailroom has
any effect. In many places where alloc_skb() is called needed_headrom
and hard_header_len are refered to via the LL_RESERVED_SPACE macro. But
the macro does not refer to needed_tailroom. Once (f5184d267c1a ("net:
Allow netdevices to specify needed head/tailroom") there was
LL_ALLOCATED_SPACE macro, but but it was removed in 56c978f1da1f ("net:
Remove LL_ALLOCATED_SPACE"). And now only some protocols refer to
needet_tailroom.

BTW. What is hard_header_len for? Is it the length of the link layer
header? Considering "my" hardware requires some headers with each
packet, I find hard_headr_len name a bit confusing.

I will be sending v9 in a minute or two.

Kind regards,
-- 
Łukasz Stelmach
Samsung R&D Institute Poland
Samsung Electronics

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  parent reply	other threads:[~2020-12-17 11:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20201202214711eucas1p15c135e19e371890891c38dcf50c86eb2@eucas1p1.samsung.com>
2020-12-02 21:47 ` [PATCH v8 0/3] AX88796C SPI Ethernet Adapter Łukasz Stelmach
     [not found]   ` <CGME20201202214711eucas1p12888022f68f0d0ca2423c7ea7b7fef44@eucas1p1.samsung.com>
2020-12-02 21:47     ` [PATCH v8 1/3] dt-bindings: vendor-prefixes: Add asix prefix Łukasz Stelmach
     [not found]   ` <CGME20201202214712eucas1p123a11da20004b01c0d906a0d3d3f947c@eucas1p1.samsung.com>
2020-12-02 21:47     ` [PATCH v8 2/3] dt-bindings: net: Add bindings for AX88796C SPI Ethernet Adapter Łukasz Stelmach
     [not found]   ` <CGME20201202214712eucas1p213bfb590b05086954a6ccd13deabe450@eucas1p2.samsung.com>
2020-12-02 21:47     ` [PATCH v8 3/3] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver Łukasz Stelmach
2020-12-05  3:37       ` Jakub Kicinski
     [not found]         ` <CGME20201216004251eucas1p17b212b74d7382f4dbc0eb9a1955404e7@eucas1p1.samsung.com>
2020-12-16  0:42           ` Lukasz Stelmach
2020-12-16  1:46             ` Jakub Kicinski
     [not found]               ` <CGME20201216122211eucas1p22314f0e8a28774545d168290ed57b355@eucas1p2.samsung.com>
2020-12-16 12:21                 ` Lukasz Stelmach
2020-12-16 16:13                   ` Jakub Kicinski
     [not found]                     ` <CGME20201217114714eucas1p1aea2208877de2a39feb692fe795e6d3e@eucas1p1.samsung.com>
2020-12-17 11:46                       ` Lukasz Stelmach [this message]
2020-12-17 17:06                         ` Jakub Kicinski

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=dleftjv9d07iz2.fsf%l.stelmach@samsung.com \
    --to=l.stelmach@samsung.com \
    --cc=andrew@lunn.ch \
    --cc=b.zolnierkie@samsung.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=jim.cromie@gmail.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=m.szyprowski@samsung.com \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /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

all inboxes | Powered by JetHome®