From: Oliver Neukum <oneukum@suse.de>
To: "Bjørn Mork" <bjorn@mork.no>
Cc: Ming Lei <ming.lei@canonical.com>,
"David S. Miller" <davem@davemloft.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Network Development <netdev@vger.kernel.org>,
linux-usb <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] USBNET: fix handling padding packet
Date: Wed, 18 Sep 2013 19:06:24 +0200 [thread overview]
Message-ID: <1379523984.2430.3.camel@linux-fkkt.site> (raw)
In-Reply-To: <87zjra5dpx.fsf@nemi.mork.no>
On Wed, 2013-09-18 at 17:52 +0200, Bjørn Mork wrote:
> No modern device should need the padding. No old device will be able to
> use the SG feature as implemented. You only enable it on USB3, don't
On XHCI.
> you? If this feature is restricted to USB3 capable devices, then it most
> certainly can be restricted to ZLP capable devices with absolutely no
> difference in the resulting set of supported devices.
No, USB 3.0 uses no companion controllers, so you can have devices
of any speed connected to it.
> Anyway, if you want to keep the padding for SG then maybe this will work
> and allow you to drop the extra struct usbnet field and allocation:
>
> if (skb_tailroom(skb) && !dev->can_dma_sg) {
> skb->data[skb->len] = 0;
> __skb_put(skb, 1);
> } else if (dev->can_dma_sg) {
> sg_set_buf(&urb->sg[urb->num_sgs++], skb->data, 1);
> }
>
> I.e. cheat and use the skb->data buffer twice, if that is allowed? The
> actual value of the padding byte should not matter, I believe?
That makes me immediately suspect a violation of the DMA rules.
Regards
Oliver
next prev parent reply other threads:[~2013-09-18 17:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-17 9:10 [PATCH] USBNET: fix handling padding packet Ming Lei
[not found] ` <1379409002-7698-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2013-09-18 0:33 ` David Miller
2013-09-18 13:46 ` Oliver Neukum
2013-09-18 13:59 ` Bjørn Mork
2013-09-18 15:09 ` Ming Lei
2013-09-18 15:52 ` Bjørn Mork
2013-09-18 16:12 ` David Miller
[not found] ` <87zjra5dpx.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2013-09-18 17:03 ` Ming Lei
2013-09-18 18:33 ` Bjørn Mork
2013-09-18 17:06 ` Oliver Neukum [this message]
2013-09-18 18:56 ` Bjørn Mork
2013-09-19 6:57 ` Oliver Neukum
[not found] ` <1379573843.8608.7.camel-B2T3B9s34ElbnMAlSieJcQ@public.gmane.org>
2013-09-19 7:18 ` Bjørn Mork
2013-09-19 8:29 ` David Laight
[not found] ` <87wqmd46vj.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2013-09-19 13:08 ` Ming Lei
[not found] ` <CACVXFVPOyr3eDrJxGhmoxDdZS2FL17qm6jv0ezDECUAk267jFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-11 14:26 ` David Laight
2013-09-18 15:43 ` David Laight
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=1379523984.2430.3.camel@linux-fkkt.site \
--to=oneukum@suse.de \
--cc=bjorn@mork.no \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=ming.lei@canonical.com \
--cc=netdev@vger.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;
as well as URLs for NNTP newsgroup(s).