linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Chien Wong <m@xv97.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wifi: ath9k_htc: limit MTU
Date: Mon, 05 Aug 2024 16:31:15 +0200	[thread overview]
Message-ID: <87ttfzdoss.fsf@toke.dk> (raw)
In-Reply-To: <fc8659fb-7e86-4d29-8966-1f17383b0efe@xv97.com>

Chien Wong <m@xv97.com> writes:

>>> Shouldn't this be the same as the extra_tx_headroom set above? Not sure
>>> what the +4 is for in that assignment, but it seems a bit odd to not be
>>> consistent. Did you verify that an MTU of 1580 works without crashing?
>>> 
>>> Maybe this should just be:
>>> 
>>> 	hw->max_mtu = MAX_USB_WLAN_TX_PIPE_MSG_SIZE - hw->extra_tx_headroom;
>>> 
>>> just to be sure?
>
> The +4 is for the header at the very beginning of the USB packet:
>  >/* hif_usb_send_mgmt() in hif_usb.c */
>  >	hdr = skb_push(skb, 4);
>  >	*hdr++ = cpu_to_le16(skb->len - 4);
>  >	*hdr++ = cpu_to_le16(ATH_USB_TX_STREAM_MODE_TAG);
>
> I suppose that the four bytes are consumed by the USB hardware and they 
> do not occupy buffer in the firmware. And my experiment proved this.
> Unfortunately, setting MTU=1580 alone could not prevent the firmware 
> from crashing. The MTU only limits upper layer length, not taking MAC 
> overhead into account. That's why we need to take other measures such as
> dropping packets before sending via USB, as proposed by my earlier
> patch.

Well, we can also just take the upper layer overhead into account in the
MTU limit? Presumably there's a maximum MTU size that you can use
without the firmware crashing? So just set the MTU limit to that :)

-Toke

      reply	other threads:[~2024-08-05 14:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05 14:52 [PATCH] wifi: ath9k_htc: limit MTU Chien Wong
2024-07-30 10:10 ` Toke Høiland-Jørgensen
2024-08-05 14:17   ` Chien Wong
2024-08-05 14:31     ` Toke Høiland-Jørgensen [this message]

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=87ttfzdoss.fsf@toke.dk \
    --to=toke@toke.dk \
    --cc=linux-wireless@vger.kernel.org \
    --cc=m@xv97.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).