Search Linux Wireless

Re: [RFC 11/12] mt76usb: allocate urb and sg as linear data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 12, 2019 at 05:34:32PM +0100, Lorenzo Bianconi wrote:
> > Alloc sg table at the end of urb structure. This will increase
> > cache usage.
> > 
> 
> I am curious, have you observed any performance improvement doing so?

It's hard to measure that. Stressing net transfer with about 175 Mbit/s
by netperf (what is max I can get) only took about 15% of CPU for me
and net performance fluctuate so CPU pref stats vary too.

> > -	if (dev->usb.sg_en) {
> > -		urb->sg = devm_kcalloc(dev->dev, MT_SG_MAX_SIZE,
> > -				       sizeof(urb->sg), GFP_KERNEL);
FTR: Here is bug it should be sizeof(*urb->sg).

> > -		if (!urb->sg)
> > -			return -ENOMEM;
> > -	}
> > +	usb_init_urb(e->urb);
> > +
> > +	if (dev->usb.sg_en)
> > +		e->urb->sg = (struct scatterlist *)((u8 *)e->urb + sizeof(struct urb));
> 
> You can avoid u8 cast doing:
> (struct scatterlist *)(e->urb + 1)
Cool trick!

Stanislaw




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux