Re: [PATCH net-next v7 09/12] virtio_net: Implement IPv4 ethtool flow rules
From: Dan Jurgens <hidden>
Date: 2025-11-04 17:04:44
Also in:
virtualization
From: Dan Jurgens <hidden>
Date: 2025-11-04 17:04:44
Also in:
virtualization
On 11/3/25 10:35 PM, Jason Wang wrote:
On Tue, Nov 4, 2025 at 6:56 AM Daniel Jurgens [off-list ref] wrote:quoted
Add support for IP_USER type rules from ethtool. Example: $ ethtool -U ens9 flow-type ip4 src-ip 192.168.51.101 action -1 Added rule with ID 1 The example rule will drop packets with the source IP specified. Signed-off-by: Daniel Jurgens <redacted> Reviewed-by: Parav Pandit <redacted> Reviewed-by: Shahar Shitrit <redacted> Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> ---
quoted
- memcpy(eth_m, &fs->m_u.ether_spec, sizeof(*eth_m)); - memcpy(eth_k, &fs->h_u.ether_spec, sizeof(*eth_k)); + if (num_hdrs > 1) { + eth_m->h_proto = cpu_to_be16(0xffff); + eth_k->h_proto = cpu_to_be16(ETH_P_IP);Do we need to check IPV6 here?
That comes in a subsequent patch. None of this is actually reachable until we set the get operations in the last patch. So I think it's fine.
Thanks