From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33699233149; Fri, 26 Sep 2025 16:01:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758902499; cv=none; b=gHcMmgYuLmoo3c0PZPoUYDJkbUjGCh+XiJ+mWjk48M+NDIipYELDvO9Lps7bgrjkNXsRQibZBerEXea8gpla5lyFUs6xWFkunB9cWwUvJ0Q74HKgp8r2HDVcsS3oSavlIjT2Y+3tEv5MLKJlRrOhEXjcjIMVfzllurPpk2YBde4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758902499; c=relaxed/simple; bh=HcYdmSLat9f9B0b9qTdRhBV/lSrO6G/CYECEyOBRwTg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rYXh4ro9UWqLjLBkVOQuxatcEs24BeK9X4nxI/TIkXIXgtFDqHVgGMLM1CXfmviB5eqTyq+cNZ7DPa3Vt+TWiqRbjBXX36vPKQ7Fccq/uetV49ZDdT4HXnYXp0VL9Nb9b6t4ZDv3jT9ASeztU5l5ZP9J0yDA/mknfx1qMuRblhc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Tq2zJTM0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Tq2zJTM0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C79FC4CEF4; Fri, 26 Sep 2025 16:01:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758902497; bh=HcYdmSLat9f9B0b9qTdRhBV/lSrO6G/CYECEyOBRwTg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Tq2zJTM0Eunax6CBUHAgtobwzIhaFTluZO12R73NwAD4vP/BH55owYQVUA1qCwJPW +ESQthF3uY9oHPZJUkwGoA5Ue7I/LNxNwL/o5GsUDL1K1st4yVADbwFfVqr/SXxDHg CaFXiRuuQvSh51I0nzryD+dPD8hFTVpR3YH3ZJYLu+LkZfuEN3qnWfikPacG1ji2K7 p/Ufv3PEl9seZiS+nROGloSoTJXWrt1El+4D15CTvDM17joKafp3QGmvYv6ZYAu1I1 JGrPVJkliq66fJDVMMyDN1qd2Yr4cX300K3385UYvAQjQymo4/uTVLGV3exVhLdhKY pw8Jq871gSiEw== Date: Fri, 26 Sep 2025 17:01:32 +0100 From: Simon Horman To: Daniel Jurgens Cc: netdev@vger.kernel.org, mst@redhat.com, jasowang@redhat.com, alex.williamson@redhat.com, pabeni@redhat.com, virtualization@lists.linux.dev, parav@nvidia.com, shshitrit@nvidia.com, yohadt@nvidia.com, xuanzhuo@linux.alibaba.com, eperezma@redhat.com, shameerali.kolothum.thodi@huawei.com, jgg@ziepe.ca, kevin.tian@intel.com, kuba@kernel.org, andrew+netdev@lunn.ch, edumazet@google.com Subject: Re: [PATCH net-next v3 04/11] virtio_net: Query and set flow filter caps Message-ID: References: <20250923141920.283862-1-danielj@nvidia.com> <20250923141920.283862-5-danielj@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250923141920.283862-5-danielj@nvidia.com> On Tue, Sep 23, 2025 at 09:19:13AM -0500, Daniel Jurgens wrote: > When probing a virtnet device, attempt to read the flow filter > capabilities. In order to use the feature the caps must also > be set. For now setting what was read is sufficient. > > Signed-off-by: Daniel Jurgens > Reviewed-by: Parav Pandit > Reviewed-by: Shahar Shitrit ... > diff --git a/include/uapi/linux/virtio_net_ff.h b/include/uapi/linux/virtio_net_ff.h > new file mode 100644 > index 000000000000..a35533bf8377 > --- /dev/null > +++ b/include/uapi/linux/virtio_net_ff.h > @@ -0,0 +1,55 @@ > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note > + * > + * Header file for virtio_net flow filters > + */ > +#ifndef _LINUX_VIRTIO_NET_FF_H > +#define _LINUX_VIRTIO_NET_FF_H > + > +#include > +#include > + > +#define VIRTIO_NET_FF_RESOURCE_CAP 0x800 > +#define VIRTIO_NET_FF_SELECTOR_CAP 0x801 > +#define VIRTIO_NET_FF_ACTION_CAP 0x802 > + > +struct virtio_net_ff_cap_data { > + __le32 groups_limit; > + __le32 classifiers_limit; > + __le32 rules_limit; > + __le32 rules_per_group_limit; > + __u8 last_rule_priority; > + __u8 selectors_per_classifier_limit; > +}; > + > +struct virtio_net_ff_selector { > + __u8 type; > + __u8 flags; > + __u8 reserved[2]; > + __u8 length; > + __u8 reserved1[3]; > + __u8 mask[]; > +}; > + > +#define VIRTIO_NET_FF_MASK_TYPE_ETH 1 > +#define VIRTIO_NET_FF_MASK_TYPE_IPV4 2 > +#define VIRTIO_NET_FF_MASK_TYPE_IPV6 3 > +#define VIRTIO_NET_FF_MASK_TYPE_TCP 4 > +#define VIRTIO_NET_FF_MASK_TYPE_UDP 5 > +#define VIRTIO_NET_FF_MASK_TYPE_MAX VIRTIO_NET_FF_MASK_TYPE_UDP > + > +struct virtio_net_ff_cap_mask_data { > + __u8 count; > + __u8 reserved[7]; > + struct virtio_net_ff_selector selectors[]; Hi Daniel, Sparse warns that the line above is an array of flexible structures. I wonder if that can be addressed somehow. > +}; > +#define VIRTIO_NET_FF_MASK_F_PARTIAL_MASK (1 << 0) > + > +#define VIRTIO_NET_FF_ACTION_DROP 1 > +#define VIRTIO_NET_FF_ACTION_RX_VQ 2 > +#define VIRTIO_NET_FF_ACTION_MAX VIRTIO_NET_FF_ACTION_RX_VQ > +struct virtio_net_ff_actions { > + __u8 count; > + __u8 reserved[7]; > + __u8 actions[]; > +}; > +#endif > -- > 2.45.0 > >