linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Felix Fietkau <nbd@nbd.name>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	lorenzo@kernel.org
Subject: Re: [PATCH 0/4] do not use sg if not properly supported by usb controller
Date: Tue, 12 Feb 2019 16:08:37 +0100	[thread overview]
Message-ID: <20190212150836.GA10823@localhost.localdomain> (raw)
In-Reply-To: <20190212145424.GE12906@redhat.com>

> On Tue, Feb 12, 2019 at 03:25:30PM +0100, Lorenzo Bianconi wrote:
> > > On Tue, Feb 12, 2019 at 03:09:53PM +0100, Lorenzo Bianconi wrote:
> > > > >
> > > > > (repost with corrected Lorenzo email)
> > > > >
> > > > > On Tue, Feb 12, 2019 at 02:45:50PM +0100, Stanislaw Gruszka wrote:
> > > > > > On Tue, Feb 12, 2019 at 02:24:47PM +0100, LorenzoBianconilorenzo@kernel.org wrote:
> > > > > > > From: Lorenzo Bianconi <lorenzo@kernel.org>
> > > > > > >
> > > > > > > Use linear fragment and not a single usb scatter-gather buffer in mt76u
> > > > > > > {tx,rx} datapath if the usb controller has sg data length constraints.
> > > > > > > Moreover add disable_usb_sg module parameter in order to explicitly
> > > > > > > disable scatter-gather. SG I/O is not supported by all host drivers and
> > > > > > > some users have reported sg issues on AMD IOMMU.
> > > > > >
> > > > > > Again. This is not right approach. SG issues should be fixed
> > > > > > not workarounded.
> > > > 
> > > > Hi Stanislaw,
> > > > 
> > > > here we do not use SG, so num_sg is 0 and we use transfer_buffer. I do
> > > > not see how I am working around the issue.
> > > 
> > > By avoiding SG buffer allocation and configuration which most likely
> > > need to be fixed.
> > 
> > In my series I:
> > 1- set num_sg to 0
> > 2- use transfer_buffer
> >
> > please correct me if I am wrong but in your solution you did the same since AFAIK
> > PageHighMem is always 0 so you end up setting num_sg to 0 and using
> > transfer_buffer as well. Is my understanding correct?
> 
> Yes. But it still using all existing SG allocation and setup code and
> buffer is tracked in urb->sg[0].

both of them are from page_frag_alloc()

> 
> > > > Moreover with this approach we avoid some unnecessary operation in the hotpath
> > > 
> > > What unnecessary operation ?
> > 
> > the ones in mt76u_fill_bulk_urb()
> 
> Your patches also add extra operations on hotpath due to urb->num_sgs and
> dev->usb.sg_en checks.

here I guess you should use mt76u_check_sg() instead of
udev->bus->sg_tablesize > 0 so I think you need to precompute it since it is in
the hotpath

Moreover the RFC series has been tested by multiple users and on multiple
devices

Regards,
Lorenzo

> 
> Stanislaw

  reply	other threads:[~2019-02-12 15:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-12 13:42 [PATCH RESEND 0/4] do not use sg if not properly supported by usb controller lorenzo
2019-02-12 13:42 ` [PATCH RESEND 1/4] mt76: usb: move mt76u_check_sg in usb.c lorenzo
2019-02-12 13:42 ` [PATCH RESEND 2/4] mt76: usb: do not use sg buffers for mcu messages lorenzo
2019-02-12 13:42 ` [PATCH RESEND 3/4] mt76: usb: use a linear buffer for tx/rx datapath if sg is not supported lorenzo
2019-02-12 13:42 ` [PATCH RESEND 4/4] mt76: usb: introduce disable_usb_sg parameter lorenzo
2019-02-12 13:45 ` [PATCH 0/4] do not use sg if not properly supported by usb controller Stanislaw Gruszka
2019-02-12 13:51   ` Stanislaw Gruszka
2019-02-12 14:09     ` Lorenzo Bianconi
2019-02-12 14:17       ` Stanislaw Gruszka
2019-02-12 14:25         ` Lorenzo Bianconi
2019-02-12 14:54           ` Stanislaw Gruszka
2019-02-12 15:08             ` Lorenzo Bianconi [this message]
2019-02-12 15:26               ` Stanislaw Gruszka
2019-02-12 15:50                 ` Lorenzo Bianconi
2019-02-12 22:09                   ` Lorenzo Bianconi
2019-02-13  9:44                     ` Stanislaw Gruszka
2019-02-13 11:00                       ` Lorenzo Bianconi
2019-02-13 11:59                         ` Stanislaw Gruszka
2019-02-18 18:56 ` [PATCH RESEND " Felix Fietkau

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=20190212150836.GA10823@localhost.localdomain \
    --to=lorenzo.bianconi@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=nbd@nbd.name \
    --cc=sgruszka@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).