nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

[HELP] <title>Implementation reference for Receive Side Scaling (RSS) in network drivers

Open Yeon-886 opened this issue 1 year ago • 6 comments

Description

I am currently working on a project using NuttX on a multi-core processor, and I am looking to optimize network performance. My goal is to find an implementation of Receive Side Scaling (RSS) to distribute network packet processing across multiple CPUs.

Could you point me to any existing network drivers in the NuttX source tree that have implemented RSS? I would like to use them as a reference.  If there are no existing examples, what would be the recommended approach or starting point for adding RSS support to a network driver in NuttX?  Any pointers, documentation, or examples would be greatly appreciated. thanks

Verification

  • [x] I have verified before submitting the report.

Yeon-886 avatar Aug 16 '25 05:08 Yeon-886

Hi @Yeon-886 AFAIK there is not a RSS implementation for NuttX, unless someone from Xiaomi, Sony or other had implemented it! @xiaoxiang781216 @wengzhe @nuttxs @yamt @jkivilin ?

acassis avatar Aug 16 '25 11:08 acassis

@Yeon-886 I tried to get some suggestions from ChatGPT: https://chatgpt.com/share/68a06db5-7424-8012-a932-887773029a4b

But there are some mistakes, like using copy_to_user() from Linux on NuttX examples

acassis avatar Aug 16 '25 11:08 acassis

@Yeon-886 we have implemented RSS on in netdev_upperhalf, but which isn't upsteamed yet. @13627105546 could help on this topic.

xiaoxiang781216 avatar Aug 16 '25 11:08 xiaoxiang781216

The patch https://github.com/apache/nuttx/pull/13196 supporting RSS has been merged

13627105546 avatar Aug 16 '25 17:08 13627105546

@13627105546 do you have some board example and/or documentation about how to use it?

acassis avatar Aug 16 '25 18:08 acassis

At present, we do not have direct example code, but I can explain the interface concept provided to the driver: When the socket detects a change in the CPU ID where the application is located, it needs to call the driver interface, pass the hash value and the latest CPU ID to the driver, and update the hardware flow table Hash calculation needs to be based on the protocol type of the message. If there are four tuples (SIP, SPORT, DIP, DPORT), use them to calculate the hash value. Otherwise, use two tuples (SIP, DIP, such as ARP messages) to calculate the hash value, and the algorithm needs to be consistent with the hardware Give the driver an interface with quadruple input and output to obtain the CPU ID value

13627105546 avatar Aug 17 '25 15:08 13627105546