Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number of NTB buffers configuration option (IEC-251) #113

Closed
ctag-fh-kiel opened this issue Jan 9, 2025 · 4 comments · Fixed by #114
Closed

Number of NTB buffers configuration option (IEC-251) #113

ctag-fh-kiel opened this issue Jan 9, 2025 · 4 comments · Fixed by #114
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Feature Request Feature Request for esp-usb

Comments

@ctag-fh-kiel
Copy link

Is your feature request related to a problem?

With the current NTB buffer settings, USB-NCM does not seem to work properly and does not achieve optimal performance.
In my setup the following error occurs quite frequently:
tud_network_can_xmit: request blocked

Describe the solution you'd like.

Add configuration option for CFG_TUD_NCM_OUT_NTB_N and CFG_TUD_NCM_IN_NTB_N via component config.
I.e. enhancing tusb_config.h of the component with:
#define CFG_TUD_NCM_IN_NTB_N CONFIG_TINYUSB_NCM_IN_NTB_N
#define CFG_TUD_NCM_OUT_NTB_N CONFIG_TINYUSB_NCM_OUT_NTB_N

and adding to KConfig relevant lines to configure it.

Describe alternatives you've considered.

No response

Additional context.

No response

@ctag-fh-kiel ctag-fh-kiel added the Type: Feature Request Feature Request for esp-usb label Jan 9, 2025
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 9, 2025
@github-actions github-actions bot changed the title Number of NTB buffers configuration option Number of NTB buffers configuration option (IEC-251) Jan 9, 2025
@peter-marcisovsky
Copy link
Collaborator

Hi @ctag-fh-kiel
Thanks for the report, we will take a look.

Could you please specify which chip and which version of Tinyusb are you using?
In the meanwhile, could you please take a look a the #107 and see if the issue is relevant to yours?

@ctag-fh-kiel
Copy link
Author

#107 may be relevant, I posted this in the relevant thread.
I am using esp32-s3 and the Tinyusb version bundled with
espressif/esp_tinyusb:
version: "^1.6.0"

@espressif-bot espressif-bot added Status: Selected for Development Issue is selected for development Status: In Progress Issue is being worked on and removed Status: Opened Issue is new Status: Selected for Development Issue is selected for development labels Jan 9, 2025
@peter-marcisovsky
Copy link
Collaborator

peter-marcisovsky commented Jan 9, 2025

Thank's for the info. I can observe the same behavior.

I presume, you did try to change CFG_TUD_NCM_IN_NTB_N and CFG_TUD_NCM_OUT_NTB_N settings, If yes, how many buffers did you have to use to stop seeing the (II) tud_network_can_xmit: request blocked ?

In the TInyUSB ncm.h it's stated that, for RPi RP2040, the CFG_TUD_NCM_IN_NTB_N shall be set to 3, to mitigate the (II) tud_network_can_xmit: request blocked warning

I biriefly ran iperf with both buffer counts set to 2 and the warning message was not preset anymore.
But, on the other hand, I used esp32s3 as NCM Network Adapter for my Laptop and I had to set the buffer count very high to mitigate the warning (but I was browsing google maps to induce a higher traffic, which is bit extreme case).

@ctag-fh-kiel
Copy link
Author

ctag-fh-kiel commented Jan 9, 2025

I have set
CFG_TUD_NCM_IN_NTB_N=3
CFG_TUD_NCM_OUT_NTB_N=2
as per recommendation in ncm.h

@espressif-bot espressif-bot added Status: Reviewing Issue is being reviewed and removed Status: In Progress Issue is being worked on labels Jan 13, 2025
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Reviewing Issue is being reviewed labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Feature Request Feature Request for esp-usb
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants