STRUCT ETHTOOL_RXNFC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct ethtool_rxnfc(9) πŸ’…

hii bestie 🫢 welcome to the Kernel API Manual entry for struct ethtool_rxnfc(9) β€” the command to get or set RX flow classification rules. it’s giving kernel networking, and honestly? iconic ✨ let’s get into it.


πŸŽ€ NAME πŸŽ€

  • struct ethtool_rxnfc β€” command to get or set RX flow classification rules πŸ’–

πŸ“œ SYNOPSIS πŸ“œ

       struct ethtool_rxnfc {
           __u32 cmd;
           __u32 flow_type;
           __u64 data;
           struct ethtool_rx_flow_spec     fs;
           union {
             __u32 rule_cnt;
             __u32 rss_context;
           };
           __u32 rule_locs[];
        };

🧩 Members 🧩

  • cmd β€” specific command number β€” ETHTOOL_GRXFH, ETHTOOL_SRXFH, ETHTOOL_GRXRINGS, ETHTOOL_GRXCLSRLCNT, ETHTOOL_GRXCLSRULE, ETHTOOL_GRXCLSRLALL, ETHTOOL_SRXCLSRLDEL or ETHTOOL_SRXCLSRLINS πŸ’…
  • flow_type β€” type of flow to be affected, e.g. TCP_V4_FLOW πŸ¦‹
  • data β€” command-dependent value ✨
  • fs β€” flow classification rule πŸ‘‘
  • {unnamed_union} β€” anonymous πŸ«₯
  • rule_cnt β€” number of rules to be affected πŸ”’
  • rss_context β€” RSS context to be affected 🌈
  • rule_locs β€” array of used rule locations 🎯

🌸 Description 🌸

For ETHTOOL_GRXFH and ETHTOOL_SRXFH, data is a bitmask indicating the fields included in the flow hash, e.g. RXH_IP_SRC.

🚨 caveat, bestie: the following structure fields must not be used, except that if flow_type includes the FLOW_RSS flag, then rss_context determines which RSS context to act on.

For ETHTOOL_GRXRINGS, data is set to the number of RX rings/queues on return.

For ETHTOOL_GRXCLSRLCNT, rule_cnt is set to the number of defined rules on return. If data is non-zero on return then it is the size of the rule table, plus the flag RX_CLS_LOC_SPECIAL if the driver supports any special location values. If that flag is not set in data then special location values should not be used.

For ETHTOOL_GRXCLSRULE, fs.location specifies the location of an existing rule on entry and fs contains the rule on return; if fs.flow_type includes the FLOW_RSS flag, then rss_context is filled with the RSS context ID associated with the rule.

For ETHTOOL_GRXCLSRLALL, rule_cnt specifies the array size of the user buffer for rule_locs on entry. On return, data is the size of the rule table, rule_cnt is the number of defined rules, and rule_locs contains the locations of the defined rules. Drivers must use the second parameter to get_rxnfc instead of rule_locs.

For ETHTOOL_SRXCLSRLINS, fs specifies the rule to add or update. fs.location either specifies the location to use or is a special location value with RX_CLS_LOC_SPECIAL flag set. On return, fs.location is the actual rule location. If fs.flow_type includes the FLOW_RSS flag, rss_context is the RSS context ID to use for flow spreading traffic which matches this rule. The value from the rxfh indirection table will be added to fs.ring_cookie to choose which ring to deliver to.

For ETHTOOL_SRXCLSRLDEL, fs.location specifies the location of an existing rule on entry.

A driver supporting the special location values for ETHTOOL_SRXCLSRLINS may add the rule at any suitable unused location, and may remove a rule at a later location (lower priority) that matches exactly the same set of flows. The special values are RX_CLS_LOC_ANY, selecting any location; RX_CLS_LOC_FIRST, selecting the first suitable location (maximum priority); and RX_CLS_LOC_LAST, selecting the last suitable location (minimum priority). Additional special values may be defined in future and drivers must return -EINVAL for any unrecognised value.

πŸ”— SEE ALSO πŸ”—

kernel file first, then the whole friend group β€” iykyk πŸ’œ:

  • Kernel file ./include/uapi/linux/ethtool.h
  • struct ethtool_cmd(9)
  • struct ethtool_drvinfo(9)
  • struct ethtool_wolinfo(9)
  • struct ethtool_regs(9)
  • struct ethtool_eeprom(9)
  • struct ethtool_eee(9)
  • struct ethtool_modinfo(9)
  • struct ethtool_coalesce(9)
  • struct ethtool_ringparam(9)
  • struct ethtool_channels(9)
  • struct ethtool_pauseparam(9)
  • enum ethtool_stringset(9)
  • enum ethtool_mac_stats_src(9)
  • enum ethtool_module_power_mode_policy(9)
  • enum ethtool_module_power_mode(9)
  • enum ethtool_c33_pse_ext_state(9)
  • enum ethtool_c33_pse_ext_substate_mr_mps_valid(9)
  • enum ethtool_c33_pse_ext_substate_error_condition(9)
  • enum ethtool_c33_pse_ext_substate_mr_pse_enable(9)
  • enum ethtool_c33_pse_ext_substate_option_detect_ted(9)
  • enum ethtool_c33_pse_ext_substate_option_vport_lim(9)
  • enum ethtool_c33_pse_ext_substate_ovld_detected(9)
  • enum ethtool_c33_pse_ext_substate_power_not_available(9)
  • enum ethtool_c33_pse_ext_substate_short_detected(9)
  • enum ethtool_pse_types(9)
  • enum ethtool_c33_pse_admin_state(9)
  • enum ethtool_c33_pse_pw_d_status(9)
  • enum ethtool_podl_pse_admin_state(9)
  • enum ethtool_podl_pse_pw_d_status(9)
  • enum ethtool_mm_verify_status(9)
  • enum ethtool_module_fw_flash_status(9)
  • struct ethtool_gstrings(9)
  • struct ethtool_sset_info(9)
  • enum ethtool_test_flags(9)
  • struct ethtool_test(9)
  • struct ethtool_stats(9)
  • struct ethtool_perm_addr(9)
  • struct ethtool_tcpip4_spec(9)
  • struct ethtool_ah_espip4_spec(9)
  • struct ethtool_usrip4_spec(9)
  • struct ethtool_tcpip6_spec(9)
  • struct ethtool_ah_espip6_spec(9)
  • struct ethtool_usrip6_spec(9)
  • struct ethtool_flow_ext(9)
  • struct ethtool_rx_flow_spec(9)
  • struct ethtool_rxfh_indir(9)
  • struct ethtool_rxfh(9)
  • struct ethtool_rx_ntuple_flow_spec(9)
  • struct ethtool_rx_ntuple(9)
  • struct ethtool_dump(9)
  • struct ethtool_get_features_block(9)
  • struct ethtool_gfeatures(9)
  • struct ethtool_set_features_block(9)
  • struct ethtool_sfeatures(9)
  • struct ethtool_ts_info(9)
  • struct ethtool_per_queue_op(9)
  • struct ethtool_fecparam(9)
  • enum ethtool_fec_config_bits(9)
  • struct ethtool_link_settings(9)
  • enum phy_upstream(9)

okay that’s the whole page, bestie πŸ’œ source/version: ./include/uapi/linux Β· date: October 2026 Β· manual: struct ethtool_rxnfc(9) β€” mwah, bye 🫢✨

πŸ“¦ where this page comes from