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] [day] [month] [year] [list]
Message-ID: <fc0793c2e87d1944780a243258328cd148088c01.camel@mediatek.com>
Date:   Wed, 2 Nov 2022 05:27:07 +0000
From:   Haozhe Chang (常浩哲) 
        <Haozhe.Chang@...iatek.com>
To:     "loic.poulain@...aro.org" <loic.poulain@...aro.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linuxwwan@...el.com" <linuxwwan@...el.com>,
        "m.chetan.kumar@...ux.intel.com" <m.chetan.kumar@...ux.intel.com>,
        Haijun Liu (刘海军) 
        <haijun.liu@...iatek.com>,
        "chiranjeevi.rapolu@...ux.intel.com" 
        <chiranjeevi.rapolu@...ux.intel.com>,
        "ryazanov.s.a@...il.com" <ryazanov.s.a@...il.com>,
        "kuba@...nel.org" <kuba@...nel.org>,
        Xiayu Zhang (张夏宇) 
        <Xiayu.Zhang@...iatek.com>,
        "johannes@...solutions.net" <johannes@...solutions.net>,
        "chandrashekar.devegowda@...el.com" 
        <chandrashekar.devegowda@...el.com>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        Lambert Wang (王伟) 
        <Lambert.Wang@...iatek.com>,
        "ricardo.martinez@...ux.intel.com" <ricardo.martinez@...ux.intel.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "srv_heupstream@...iatek.com" <srv_heupstream@...iatek.com>
Subject: Re: [PATCH] wwan: core: Support slicing in port TX flow of WWAN
 subsystem

On Sat, 2022-10-29 at 10:04 +0200, Loic Poulain wrote:
> On Thu, 27 Oct 2022 at 03:19, haozhe chang <haozhe.chang@...iatek.com
> > wrote:
> > 
> > On Wed, 2022-10-26 at 22:27 +0800, Loic Poulain wrote:
> > > On Wed, 26 Oct 2022 at 13:45, haozhe chang <
> > > haozhe.chang@...iatek.com
> > > > wrote:
> > > > 
> > > > On Wed, 2022-10-26 at 15:28 +0800, Loic Poulain wrote:
> > > > > Hi Haozhe,
> > > > > 
> > > > > On Wed, 26 Oct 2022 at 03:16, <haozhe.chang@...iatek.com>
> > > > > wrote:
> > > > > > 
> > > > > > From: haozhe chang <haozhe.chang@...iatek.com>
> > > > > > 
> > > > > > wwan_port_fops_write inputs the SKB parameter to the TX
> > > > > > callback of
> > > > > > the WWAN device driver. However, the WWAN device (e.g.,
> > > > > > t7xx)
> > > > > > may
> > > > > > have an MTU less than the size of SKB, causing the TX
> > > > > > buffer to
> > > > > > be
> > > > > > sliced and copied once more in the WWAN device driver.
> > > > > 
> > > > > The benefit of putting data in an skb is that it is easy to
> > > > > manipulate, so not sure why there is an additional copy in
> > > > > the
> > > > > first
> > > > > place. Isn't possible for the t7xx driver to consume the skb
> > > > > progressively (without intermediate copy), according to its
> > > > > own
> > > > > MTU
> > > > > limitation?
> > > > > 
> > > > 
> > > > t7xx driver needs to add metadata to the SKB head for each
> > > > fragment, so
> > > > the driver has to allocate a new buffer to copy
> > > > data(skb_put_data)
> > > > and
> > > > insert metadata.
> > > 
> > > Normally, once the first part (chunk) of the skb has been
> > > consumed
> > > (skb_pull) and written to the device, it will become part of the
> > > skb headroom, which can then be used for appending (skb_push) the
> > > header (metadata) of the second chunks, and so... right?
> > > 
> > > Just want to avoid a bunch of unnecessary copy/alloc here.
> > > 
> > 
> > t7xx DMA can transfer multiple fragments at once, if done as
> > recomended, the DMA performance will be inhibited.
> 
> OK, so the skb fragmentation is valid in t7xx case, but the way of
> doing it is kind of specific to t7xx. Maybe a more acceptable
> solution
> for a generic fragmentation feature would be to keep the extra
> fragments part of the 'main' skb, using skb chaining. That would
> allow
> the fragments to stay linked to a specific user transfer. So if
> fragmentation is enabled for a given driver, core only fills the
> initial skb with MTU size, and appends additional skb as fragments,
> you can look at mhi_net_skb_agg() for skb chaining example.
> 
OK, It is a good suggestion, I will implement it in patch v2. Also, any
advice on reserved headroom?
> Regards,
> Loic

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ