diff mbox series

[v2,2/3] usb: gadget: f_ncm: set SuperSpeed bulk descriptor bMaxBurst to 15

Message ID 20200818165848.4117493-2-lorenzo@google.com (mailing list archive)
State Superseded
Headers show
Series [v2,1/3] usb: gadget: f_ncm: fix ncm_bitrate for SuperSpeed and above. | expand

Commit Message

Lorenzo Colitti Aug. 18, 2020, 4:58 p.m. UTC
This improves performance on fast connections. When directly
connecting to a Linux laptop running 5.6, single-stream iperf3
goes from ~1.7Gbps to ~2.3Gbps out, and from ~620Mbps to ~720Mbps
in.

Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
---
 drivers/usb/gadget/function/f_ncm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Maciej Żenczykowski Aug. 18, 2020, 9:40 p.m. UTC | #1
On Tue, Aug 18, 2020 at 9:59 AM Lorenzo Colitti <lorenzo@google.com> wrote:
>
> This improves performance on fast connections. When directly
> connecting to a Linux laptop running 5.6, single-stream iperf3
> goes from ~1.7Gbps to ~2.3Gbps out, and from ~620Mbps to ~720Mbps
> in.
>
> Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
> ---
>  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 0c073df225..57ccf30c6c 100644
> --- a/drivers/usb/gadget/function/f_ncm.c
> +++ b/drivers/usb/gadget/function/f_ncm.c
> @@ -348,7 +348,7 @@ static struct usb_ss_ep_comp_descriptor ss_ncm_notify_comp_desc = {
>         .bDescriptorType =      USB_DT_SS_ENDPOINT_COMP,
>
>         /* the following 3 values can be tweaked if necessary */
> -       /* .bMaxBurst =         0, */
> +       .bMaxBurst =            15,
>         /* .bmAttributes =      0, */
>         .wBytesPerInterval =    cpu_to_le16(NCM_STATUS_BYTECOUNT),
>  };
> @@ -376,7 +376,7 @@ static struct usb_ss_ep_comp_descriptor ss_ncm_bulk_comp_desc = {
>         .bDescriptorType =      USB_DT_SS_ENDPOINT_COMP,
>
>         /* the following 2 values can be tweaked if necessary */
> -       /* .bMaxBurst =         0, */
> +       .bMaxBurst =            15,
>         /* .bmAttributes =      0, */
>  };
>
> --
> 2.28.0.220.ged08abb693-goog
>

Reviewed-by: Maciej Żenczykowski <maze@google.com>
diff mbox series

Patch

diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c
index 0c073df225..57ccf30c6c 100644
--- a/drivers/usb/gadget/function/f_ncm.c
+++ b/drivers/usb/gadget/function/f_ncm.c
@@ -348,7 +348,7 @@  static struct usb_ss_ep_comp_descriptor ss_ncm_notify_comp_desc = {
 	.bDescriptorType =	USB_DT_SS_ENDPOINT_COMP,
 
 	/* the following 3 values can be tweaked if necessary */
-	/* .bMaxBurst =		0, */
+	.bMaxBurst =		15,
 	/* .bmAttributes =	0, */
 	.wBytesPerInterval =	cpu_to_le16(NCM_STATUS_BYTECOUNT),
 };
@@ -376,7 +376,7 @@  static struct usb_ss_ep_comp_descriptor ss_ncm_bulk_comp_desc = {
 	.bDescriptorType =	USB_DT_SS_ENDPOINT_COMP,
 
 	/* the following 2 values can be tweaked if necessary */
-	/* .bMaxBurst =		0, */
+	.bMaxBurst =		15,
 	/* .bmAttributes =	0, */
 };