All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Alonso <joalonsof@gmail.com>
To: David Laight <David.Laight@ACULAB.COM>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH v2] net: usb: ax88179_178a: ax88179_rx_fixup corrections
Date: Mon, 20 Jun 2022 22:18:41 -0300	[thread overview]
Message-ID: <72d0a65781b833dd3b93b03695facd59a0214817.camel@gmail.com> (raw)
In-Reply-To: <6dacc318fcb1425e85168a6628846258@AcuMS.aculab.com>


On Mon, 2022-06-20 at 03:45 +0000, David Laight wrote:
> 
> > -                       ax_skb->truesize = pkt_len + sizeof(struct sk_buff);
> 
> You've 'lost' this lie.
> IIRC the 'skb' are allocated with 64k buffer space.
> I'm not at all sure how the buffer space of skb that are cloned
> into multiple rx buffers are supposed to be accounted for.
> 
> Does this driver ever copy the data for short frames?

The driver receives a skb with a URB (dev->rx_urb_size=24576)
with N packets and do skb->clone for the N-1 first packets and
for the last return the skb received.
The usb transfer uses bulk io of 512 bytes (dev->maxpacket).
skb_clone creates a new sk_buff sharing the same skb->data avoiding
extra copy of the packets and the URB area will be released when
all packets were processed (reference count = 0).
The length of rx queue is setted by usbnet:
#define MAX_QUEUE_MEMORY        (60 * 1518)
...
        case USB_SPEED_HIGH:
                dev->rx_qlen = MAX_QUEUE_MEMORY / dev->rx_urb_size;
                dev->tx_qlen = MAX_QUEUE_MEMORY / dev->hard_mtu;
                break;
        case USB_SPEED_SUPER:
        case USB_SPEED_SUPER_PLUS:
		...
                dev->rx_qlen = 5 * MAX_QUEUE_MEMORY / dev->rx_urb_size;
                dev->tx_qlen = 5 * MAX_QUEUE_MEMORY / dev->hard_mtu;

> 
> There ought to be an error count here.
yes.
> I know there wasn't one before.
> 
>         David

Jose Alonso



  reply	other threads:[~2022-06-21  1:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-19  0:53 [PATCH v2] net: usb: ax88179_178a: ax88179_rx_fixup corrections Jose Alonso
2022-06-20  3:45 ` David Laight
2022-06-21  1:18   ` Jose Alonso [this message]
2022-06-21  8:29     ` David Laight
2022-06-21  9:03     ` Paolo Abeni
2022-06-22  3:56       ` Jose Alonso

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=72d0a65781b833dd3b93b03695facd59a0214817.camel@gmail.com \
    --to=joalonsof@gmail.com \
    --cc=David.Laight@ACULAB.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.