Re: [PATCH] wwan: core: Support slicing in port TX flow of WWAN subsystem

From: haozhe chang
Date: Wed Oct 26 2022 - 21:20:04 EST


On Wed, 2022-10-26 at 22:27 +0800, Loic Poulain wrote:
> On Wed, 26 Oct 2022 at 13:45, haozhe chang <haozhe.chang@xxxxxxxxxxxx
> > 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@xxxxxxxxxxxx> wrote:
> > > >
> > > > From: haozhe chang <haozhe.chang@xxxxxxxxxxxx>
> > > >
> > > > 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.
> Regards,
> Loic