On Wed, Nov 19, 2025 at 01:17:28AM -0600, Dan Jurgens wrote:
> On 11/19/25 1:06 AM, Michael S. Tsirkin wrote:
> > On Wed, Nov 19, 2025 at 01:03:36AM -0600, Dan Jurgens wrote:
> >> On 11/18/25 3:31 PM, Michael S. Tsirkin wrote:
> >>> On Tue, Nov 18, 2025 at 08:38:59AM -0600, Daniel Jurgens wrote:
> >>>> Add support for IP_USER type rules from ethtool.
> >>>>
> >>>> +static void parse_ip4(struct iphdr *mask, struct iphdr *key,
> >>>> + const struct ethtool_rx_flow_spec *fs)
> >>>> +{
> >>>> + const struct ethtool_usrip4_spec *l3_mask =
> >>>> &fs->m_u.usr_ip4_spec;
> >>>> + const struct ethtool_usrip4_spec *l3_val =
> >>>> &fs->h_u.usr_ip4_spec;
> >>>> +
> >>>> + mask->saddr = l3_mask->ip4src;
> >>>> + mask->daddr = l3_mask->ip4dst;
> >>>> + key->saddr = l3_val->ip4src;
> >>>> + key->daddr = l3_val->ip4dst;
> >>>> +
> >>>> + if (l3_mask->proto) {
> >>>
> >>> you seem to check mask for proto here but the ethtool_usrip4_spec doc
> >>> seems to say the mask for proto must be 0.
> >>>
> >>>
> >>> what gives?
> >>>
> >>
> >> Then for user_ip flows ethtool should provide 0 as the mask, and based
> >> on your comment below I'm verifying that.
> >
> > but if it does then how did this patch work in your testing?
>
> Why wouldn't it work? For IP only flows the proto field is not relevant.
> It only filters on IP address, not port.
I mean it's dead code with mask 0.
> >
> >> I can move this hunk to the TCP/UDP patch if you prefer.
> >
> >
> > not sure what you mean so I can't comment on that.
> > generally it's best to add code in the same patch where
> > it's used - easier to review.
> >
>
> the l3_mask->proto will only be set for TCP/UDP flows.
I'd move it there in that case then.
--
MST