[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <06ac82ec-3a13-47cc-bd94-b664430b7a2c@quicinc.com>
Date: Thu, 1 Feb 2024 11:14:47 +0530
From: Krishna Kurapati PSSNV <quic_kriskura@...cinc.com>
To: Maciej Żenczykowski <maze@...gle.com>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Hardik Gajjar
<hgajjar@...adit-jv.com>, <linux-usb@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <quic_ppratap@...cinc.com>,
<quic_wcheng@...cinc.com>, <quic_jackp@...cinc.com>
Subject: Re: [PATCH v2] usb: gadget: ncm: Avoid dropping datagrams of properly
parsed NTBs
On 2/1/2024 12:24 AM, Maciej Żenczykowski wrote:
>
> I believe so, yes.
>
> I believe they are trying to avoid having to send ZLPs.
> That's determined *purely* by the size of things as they show up on
> the usb cable (ie. the size of the usb xfer).
> ie. that's where things that are a multiple of 512 (USB2) or 1024
> (USB3) need an extra 0 byte sized packet to prevent ZLP.
>
> The actual size of the NTB doesn't matter.
>
> That said... maybe we're overcomplicating this...
> Maybe it's enough to just remove this modulo check entirely (I know I
> asked for it before).
>
> Ultimately if we just do:
>
> // Windows NCM driver avoids USB ZLPs by adding a 1-byte zero pad as needed
> if (to_process == 1 && !*(u8*)(ntb_ptr + block_len)) --to_process;
>
> it'll fix the problem too, and perhaps be easier to understand?
>
I agree. This will simplify the check and also cover all cases.
To keep diff minimal from tested version (because issue comes up easily
with a particular test here), I can remove the second check in the if
block in the v2 and push it as v3.
Regards,
Krishna,
Powered by blists - more mailing lists