stanford-esrg / retina

Retina is a network analysis framework that supports 100+ Gbps traffic analysis on a single server with no specialized hardware.
Apache License 2.0
146 stars 23 forks source link

RSS flow type assignment not valid on all NICs #38

Closed sippejw closed 1 month ago

sippejw commented 3 months ago

I am running Retina in online mode using an Intel X710. I found that during setup I would get the following error:

Ethdev port_id=0 invalid rss_hf: 0x3afbc, valid value: 0x7ef8

This is associated with how Retina configures DPDK RSS: https://github.com/stanford-esrg/retina/blob/b7b2c9f4b9606336e4bc71cb82e0f393d4aa77d3/core/src/port/mod.rs#L297-L298

Changing to port_conf.rx_adv_conf.rss_conf.rss_hf = 0x7ef8; resolves the problem for X710's.

Given the error was able to provide a valid config, I'm expecting there is a way to check the supported types before assignment and configure the field based on what the NIC supports.

0x7ef8 = RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_NONFRAG_IPV4_UDP | RTE_ETH_RSS_NONFRAG_IPV4_SCTP | RTE_ETH_RSS_NONFRAG_IPV4_OTHER | RTE_ETH_RSS_FRAG_IPV6 | RTE_ETH_RSS_NONFRAG_IPV6_TCP | RTE_ETH_RSS_NONFRAG_IPV6_UDP | RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_NONFRAG_IPV6_OTHER | RTE_ETH_RSS_L2_PAYLOAD

thearossman commented 3 months ago

Oh wow, thank you! Definitely agree w/ this fix (flow rules are generally tested, but I guess this one was missed).

Are you able to submit the fix you made as a PR? We only have access to MLNX right now so would be hard to test. If not, I can submit a PR in the next week or so and ask you to test it on your NICs?

sippejw commented 3 months ago

I don't have a generic fix yet, just my hack to get things working on the X710. Happy to look at this more after I get a little further with the QUIC stuff (#37).

sippejw commented 3 months ago

Also happy to test your fix on our NICs if you get to it first!

tbarbette commented 3 months ago

FYI, dev_info.flow_type_rss_offloads is a mask of the supported rss_hf "modes" of the device. So one could simply do a bitwise and of this mask.