STRUCT ETHTOOL_RX_NTUPLE_FLOW_SPEC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct ethtool_rx_ntuple_flow_spec(9) β€” like, the RX flow filter spec, bestie ✨

okay so this is a page straight out of the Kernel API Manual and it's all about struct ethtool_rx_ntuple_flow_spec, which is literally the spec for an RX flow filter πŸŽ€ ngl it's giving "let me tell the NIC exactly which packets I care about" and I am obsessed.


🌸 NAME 🌸

struct ethtool_rx_ntuple_flow_spec β€” specification for RX flow filter πŸ’–


✨ SYNOPSIS ✨

struct ethtool_rx_ntuple_flow_spec {
    __u32 flow_type;
    union {
      struct ethtool_tcpip4_spec              tcp_ip4_spec;
      struct ethtool_tcpip4_spec              udp_ip4_spec;
      struct ethtool_tcpip4_spec              sctp_ip4_spec;
      struct ethtool_ah_espip4_spec           ah_ip4_spec;
      struct ethtool_ah_espip4_spec           esp_ip4_spec;
      struct ethtool_usrip4_spec              usr_ip4_spec;
      struct ethhdr                           ether_spec;
      __u8 hdata[72];
    } h_u, m_u;
    __u16 vlan_tag;
    __u16 vlan_tag_mask;
    __u64 data;
    __u64 data_mask;
    __s32 action;
  #define ETHTOOL_RXNTUPLE_ACTION_DROP    (-1)    ;
  #define ETHTOOL_RXNTUPLE_ACTION_CLEAR   (-2)    ;
 };

like, yes, that union is doing a lot, but she's iconic and she knows it πŸ‘‘


πŸ¦‹ Members πŸ¦‹

  • flow_type β€” the type of match we're doing, e.g. TCP_V4_FLOW. it's the vibe check that tells everyone else which fields even matter πŸ’«
  • h_u β€” the flow field values to match, and yes bestie it's dependent on flow_type (that's the whole point of the union) πŸ”₯
  • m_u β€” the masks for flow field value bits to be ignored πŸ™ˆ like "don't look at these bits, they're not the moment"
  • vlan_tag β€” the VLAN tag to match 🏷️
  • vlan_tag_mask β€” the mask for VLAN tag bits to be ignored, same energy as above, just for the tag ✨
  • data β€” driver-dependent data to match, so what it means is on your driver, iykyk πŸ€·β€β™€οΈ
  • data_mask β€” mask for driver-dependent data bits to be ignored πŸŽ€
  • action β€” the RX ring/queue index to deliver to (non-negative!) or some other action (negative, e.g. ETHTOOL_RXNTUPLE_ACTION_DROP) πŸ’€

🌈 Description 🌈

okay this is the important part, don't skip it 🫢

For the flow types TCP_V4_FLOW, UDP_V4_FLOW and SCTP_V4_FLOW, when a field value and mask are both zero, that's treated as if all mask bits are set β€” i.e. the field is ignored, periodt. so don't come for me thinking zero means "match zero", because no ma'am, it means "literally don't care" πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/uapi/linux/ethtool.h β€” go read it, it's the source of truth πŸ“

  • 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_rxnfc(9), struct ethtool_rxfh_indir(9), struct ethtool_rxfh(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)

🧚 and that's the whole page, no cap. every field, every mask, every macro preserved exactly β€” the vibe is new, the facts are untouched πŸ’œ

later bestie!! this one came from ./include/uapi/linux and it's dated October 2026, mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from