Linux USB
 help / color / mirror / Atom feed
From: Hiago De Franco <hiagofranco@gmail.com>
To: oneukum@suse.com
Cc: davem@davemloft.net, edumazet@google.com,
	hiago.franco@toradex.com, hiagofranco@gmail.com, kuba@kernel.org,
	linux-usb@vger.kernel.org, pabeni@redhat.com
Subject: Re: Question regarding CDC NCM and VNC performance issue
Date: Tue,  5 Dec 2023 17:14:53 -0300	[thread overview]
Message-ID: <20231205201453.71764-1-hiagofranco@gmail.com> (raw)
In-Reply-To: <a13fc273-20ee-4027-9508-7e8e93a9cd29@suse.com>

From: Hiago De Franco <hiago.franco@toradex.com>

Hi Oliver,

Following up on your initial email, I found that adjusting the NTB size
successfully resolved the problem on both Linux and Windows. The VNC
client is now operating with speed and stability after dividing the
package size by 8.

I know that altering the NTB size is not the correct solution, please
consider the attached patch as an explanation, but the assumption that the
issue may be related to an accumulation of small packages, causing delays
in fulfilling the 16KB requirement, seems related.

It appears that the proper fix involves the `hrtimer_start` function on
line 1084 of `f_ncm.c`. However, I'm not sure what I could do to fix it.

Thanks and regards,
Hiago.

 drivers/usb/gadget/function/f_ncm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c
index cc0ed29a4adc..138982da794a 100644
--- a/drivers/usb/gadget/function/f_ncm.c
+++ b/drivers/usb/gadget/function/f_ncm.c
@@ -88,8 +88,8 @@ static inline struct f_ncm *func_to_ncm(struct usb_function *f)
  * If the host can group frames, allow it to do that, 16K is selected,
  * because it's used by default by the current linux host driver
  */
-#define NTB_DEFAULT_IN_SIZE	16384
-#define NTB_OUT_SIZE		16384
+#define NTB_DEFAULT_IN_SIZE	2048
+#define NTB_OUT_SIZE		2048
 
 /* Allocation for storing the NDP, 32 should suffice for a
  * 16k packet. This allows a maximum of 32 * 507 Byte packets to
-- 
2.42.0


  parent reply	other threads:[~2023-12-05 20:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 18:37 Question regarding CDC NCM and VNC performance issue Hiago De Franco
2023-12-05  9:50 ` Oliver Neukum
2023-12-05 12:22   ` Hiago De Franco
2023-12-05 12:38     ` Oliver Neukum
2023-12-05 12:55       ` Hiago De Franco
2023-12-05 20:14       ` Hiago De Franco [this message]
2023-12-06 12:21         ` Oliver Neukum
2023-12-06 16:23           ` Hiago De Franco
2023-12-07  9:41             ` Oliver Neukum
2023-12-07 10:03               ` Francesco Dolcini
2023-12-07 11:07                 ` Oliver Neukum
2023-12-07 11:38                   ` Maciej Żenczykowski
2023-12-07 18:57                     ` Hiago De Franco
2023-12-07 19:37                       ` Maciej Żenczykowski
2023-12-11 20:28                         ` Hiago De Franco
2023-12-11 20:44                           ` Maciej Żenczykowski
2023-12-12  9:48                             ` Oliver Neukum
2023-12-12 20:32                               ` Hiago De Franco
2023-12-12 21:21                                 ` Oliver Neukum
2023-12-13  1:11                                   ` Maciej Żenczykowski
2023-12-15 21:20                                     ` Hiago De Franco
2023-12-15 21:44                                       ` Maciej Żenczykowski
2023-12-18 14:34                                         ` Oliver Neukum
2023-12-18 20:59                                           ` Hiago De Franco
2023-12-18 23:00                                             ` Maciej Żenczykowski
2023-12-19  8:45                                               ` Oliver Neukum
2023-12-19 12:19                                                 ` Maciej Żenczykowski
2023-12-19 13:24                                                   ` Oliver Neukum
2023-12-19 16:25                                                     ` Maciej Żenczykowski

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=20231205201453.71764-1-hiagofranco@gmail.com \
    --to=hiagofranco@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hiago.franco@toradex.com \
    --cc=kuba@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=pabeni@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