From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 038CE189906 for ; Tue, 18 Nov 2025 22:07:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763503631; cv=none; b=Yl54ibAvmb96u2HqKLsevHaSnfB2Yx1/u8E37rjNhwIetYu/wikREJzduTb6E0aew9cTuOamwwF1c/n/OMbfwhpU5hFfY8dS9VUXY9zFa8ONLhUCNa919IBBifk6CuVOGqcvAjSTCBR1GLEP99efA1wN/+dcI83TFKwmP1zmRFM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763503631; c=relaxed/simple; bh=8D11xP7+4Jk+thTLdB06wOliVbLwybwBo35BGH/zG/U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ekc3mYG2YizhbgGdu0kcvAc/Mpm9c6aR+p96vvtK2BocRihhTdyqNNnTUc/gP/NoYig/PI1THwjNYol1+DcI9PNhTEaET0LifegDTaVKwUL8fMye1Jm+2FBm5CTHv/WRdkBGcq6J4L+qYDBYt+joIfp2u+1FksIQ/Ow7NrJHWRE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=UE4JiZ5q; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=jgdJPcTU; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UE4JiZ5q"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="jgdJPcTU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763503624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A/QZAmik1+VZ+zpg7kNphq1hJrZOaie5bivquMjmvUE=; b=UE4JiZ5q8DWDZyMuFFyY+fYaDHHVdpZ6wkP+qIxBX2eFdUSuB0FS2sk36RQOnLnySfSEOt AAmLCGqoQn5SouQdMkdw1y0KKwRY/3UXngv6z48t0lS0DUe6NDCjPZzz/eLco8c6m5pCA4 NeLoZIwq9FFlRlq4M00Id5056s70Ozc= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-610-EADtC6VpOuyhRpWcMIbHmQ-1; Tue, 18 Nov 2025 17:07:03 -0500 X-MC-Unique: EADtC6VpOuyhRpWcMIbHmQ-1 X-Mimecast-MFC-AGG-ID: EADtC6VpOuyhRpWcMIbHmQ_1763503622 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4779c35a66bso23660335e9.2 for ; Tue, 18 Nov 2025 14:07:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1763503622; x=1764108422; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=A/QZAmik1+VZ+zpg7kNphq1hJrZOaie5bivquMjmvUE=; b=jgdJPcTUK591+yG487d4oADygOwXBWyyrr4CfFySR1uKN6l7nf2qEHDe++iKJ6Hn8N a9i/PxQb0gTw0Sk0ArWBAy5fu7FY2AO9kc4vAgXhh3ViXLsYqP9083aWCQcjXQzJpk+r MJ+LnWo9CzV86fWzgsgxv8zU4c4kMEa9FExew+WwbPoteqAoCodJTARCpOT4XY+XYNYY 1ru20F2KMfvqf3r47y95jery3C7hXkYMmQ3XsDcuFJbmNJbEnlSLRXveKfZtU4c8BuRI TQXfATJdNnlxZOt+PRNbpCV9lQLJSrriA/luPyUmQ+4tq5rC4I3RlcCW/CeylFgfLASv e/pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763503622; x=1764108422; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A/QZAmik1+VZ+zpg7kNphq1hJrZOaie5bivquMjmvUE=; b=OwHmW+mwjbzdr/ZFy5s97t2UfBGRVj5An+X/BkCCJZux6vDswYVqD2D6PkAAlqCWMj nzYnEqtfIvxdIb2iKVBh2dHTV1zFCXfCrfr+J3QyxYpJr0dv3CDqxXzordLFp3OvlXra MeIkXpYpdtV0KRpnsvz3bSX/fcIym8C/qXy3biVvWYeNBUDqR4VwfD/PfLkQvIfYMKPu Gsp5mrrKJFbRJtKnoYwRFbAvqSUaS12q3bqpXBnVCJi+FPpgYVCBJzGmV/68ZPm+LN5U Q0aQ+cna6yMYh1Nd2NM/j8lrQv70Sy5ohwCR4n3vUgZXsd8BqpA1H5eOcNAXrBs3wVWI VI6Q== X-Gm-Message-State: AOJu0Yzwmo1IscaBeAJKBINyztwo1H9655oAs4qdlrrPzFxwp9z/pvC7 Ndiu9E5aNokyTaQm7ozd3Ej2RCiBlt66kFHxacup75MtRmAw581qcVgnJKnY0lqS9uKUTJk11sm F5rN8fbMjlUxdp9U6D2hyAwjqJHloACCEVXZaUpc3Qv9S9/L0Lo9kDvGgbQ== X-Gm-Gg: ASbGncsnFV6yGd1RS5J6MtQSfgQs0CpJBU5aokBJKjhDLrYt+i6mnSwLA9TzC0nurQ8 ZVdGHtAJA7immW8hCly6h2ZqNnIK+b07LwbVQ1QZvklgbsBOamFrVei7MP1NDyw7S0i05GNE1t1 uPvHIE3FxLMBbXVHaaCfPxFfSemeyyOy7QKJYoliFqXmDgeXDu05pCS20okZ/dbX0xqQpNF7Xon XN4E7S6z6yd5lLq6YCzuomgo8xzQTeALk+q7bQw3HmWVAxUeY69cSulJ7P6yc89+7XVwEHRMI6M A4zhJoEX9z3KfNDK4RVM0AHlZrdcxyyCWJ2OrASAc6OViaCrr0N2gRmj/PsgLQtOs1i+5kh4kL8 U1gWi3Ug458T3MDklNYmgisuPYyZPOw== X-Received: by 2002:a05:600c:450f:b0:477:76bf:e1fb with SMTP id 5b1f17b1804b1-4778fe4a05emr195736175e9.16.1763503621799; Tue, 18 Nov 2025 14:07:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZAiD4+lO1tZ9gw8WuixVtBTsE1tSJHm3Wu3xcLt3kc+rNem5/xNq/JGOoNd6EcCa5e6e23g== X-Received: by 2002:a05:600c:450f:b0:477:76bf:e1fb with SMTP id 5b1f17b1804b1-4778fe4a05emr195735885e9.16.1763503621325; Tue, 18 Nov 2025 14:07:01 -0800 (PST) Received: from redhat.com (IGLD-80-230-39-63.inter.net.il. [80.230.39.63]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b53e7ae88sm33592276f8f.6.2025.11.18.14.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 14:07:00 -0800 (PST) Date: Tue, 18 Nov 2025 17:06:57 -0500 From: "Michael S. Tsirkin" To: Daniel Jurgens Cc: netdev@vger.kernel.org, jasowang@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, jgg@ziepe.ca, kevin.tian@intel.com, kuba@kernel.org, andrew+netdev@lunn.ch, edumazet@google.com Subject: Re: [PATCH net-next v11 05/12] virtio_net: Query and set flow filter caps Message-ID: <20251118165659-mutt-send-email-mst@kernel.org> References: <20251118143903.958844-1-danielj@nvidia.com> <20251118143903.958844-6-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: <20251118143903.958844-6-danielj@nvidia.com> On Tue, Nov 18, 2025 at 08:38:55AM -0600, 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 > > --- > v4: > - Validate the length in the selector caps > - Removed __free usage. > - Removed for(int. > v5: > - Remove unneed () after MAX_SEL_LEN macro (test bot) > v6: > - Fix sparse warning "array of flexible structures" Jakub K/Simon H > - Use new variable and validate ff_mask_size before set_cap. MST > v7: > - Set ff->ff_{caps, mask, actions} NULL in error path. Paolo Abeni > - Return errors from virtnet_ff_init, -ENOTSUPP is not fatal. Xuan > > v8: > - Use real_ff_mask_size when setting the selector caps. Jason Wang > > v9: > - Set err after failed memory allocations. Simon Horman > > v10: > - Return -EOPNOTSUPP in virnet_ff_init before allocing any memory. > Jason/Paolo. > > v11: > - Return -EINVAL if any resource limit is 0. Simon Horman > - Ensure we don't overrun alloced space of ff->ff_mask by moving the > real_ff_mask_size > ff_mask_size check into the loop. Simon Horman > --- > drivers/net/virtio_net.c | 201 +++++++++++++++++++++++++++++ > include/linux/virtio_admin.h | 1 + > include/uapi/linux/virtio_net_ff.h | 91 +++++++++++++ > 3 files changed, 293 insertions(+) > create mode 100644 include/uapi/linux/virtio_net_ff.h > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index cfa006b88688..3615f45ac358 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -26,6 +26,9 @@ > #include > #include > #include > +#include > +#include > +#include > > static int napi_weight = NAPI_POLL_WEIGHT; > module_param(napi_weight, int, 0444); > @@ -281,6 +284,14 @@ static const struct virtnet_stat_desc virtnet_stats_tx_speed_desc_qstat[] = { > VIRTNET_STATS_DESC_TX_QSTAT(speed, ratelimit_packets, hw_drop_ratelimits), > }; > > +struct virtnet_ff { > + struct virtio_device *vdev; > + bool ff_supported; > + struct virtio_net_ff_cap_data *ff_caps; > + struct virtio_net_ff_cap_mask_data *ff_mask; > + struct virtio_net_ff_actions *ff_actions; > +}; > + > #define VIRTNET_Q_TYPE_RX 0 > #define VIRTNET_Q_TYPE_TX 1 > #define VIRTNET_Q_TYPE_CQ 2 > @@ -493,6 +504,8 @@ struct virtnet_info { > struct failover *failover; > > u64 device_stats_cap; > + > + struct virtnet_ff ff; > }; > > struct padded_vnet_hdr { > @@ -6774,6 +6787,183 @@ static const struct xdp_metadata_ops virtnet_xdp_metadata_ops = { > .xmo_rx_hash = virtnet_xdp_rx_hash, > }; > > +static size_t get_mask_size(u16 type) > +{ > + switch (type) { > + case VIRTIO_NET_FF_MASK_TYPE_ETH: > + return sizeof(struct ethhdr); > + case VIRTIO_NET_FF_MASK_TYPE_IPV4: > + return sizeof(struct iphdr); > + case VIRTIO_NET_FF_MASK_TYPE_IPV6: > + return sizeof(struct ipv6hdr); > + case VIRTIO_NET_FF_MASK_TYPE_TCP: > + return sizeof(struct tcphdr); > + case VIRTIO_NET_FF_MASK_TYPE_UDP: > + return sizeof(struct udphdr); > + } > + > + return 0; > +} > + > +#define MAX_SEL_LEN (sizeof(struct ipv6hdr)) > + > +static int virtnet_ff_init(struct virtnet_ff *ff, struct virtio_device *vdev) > +{ > + size_t ff_mask_size = sizeof(struct virtio_net_ff_cap_mask_data) + > + sizeof(struct virtio_net_ff_selector) * > + VIRTIO_NET_FF_MASK_TYPE_MAX; > + struct virtio_admin_cmd_query_cap_id_result *cap_id_list; > + struct virtio_net_ff_selector *sel; > + size_t real_ff_mask_size; > + int err; > + int i; > + > + if (!vdev->config->admin_cmd_exec) > + return -EOPNOTSUPP; > + > + cap_id_list = kzalloc(sizeof(*cap_id_list), GFP_KERNEL); > + if (!cap_id_list) > + return -ENOMEM; > + > + err = virtio_admin_cap_id_list_query(vdev, cap_id_list); > + if (err) > + goto err_cap_list; > + > + if (!(VIRTIO_CAP_IN_LIST(cap_id_list, > + VIRTIO_NET_FF_RESOURCE_CAP) && > + VIRTIO_CAP_IN_LIST(cap_id_list, > + VIRTIO_NET_FF_SELECTOR_CAP) && > + VIRTIO_CAP_IN_LIST(cap_id_list, > + VIRTIO_NET_FF_ACTION_CAP))) { > + err = -EOPNOTSUPP; > + goto err_cap_list; > + } > + > + ff->ff_caps = kzalloc(sizeof(*ff->ff_caps), GFP_KERNEL); > + if (!ff->ff_caps) { > + err = -ENOMEM; > + goto err_cap_list; > + } > + > + err = virtio_admin_cap_get(vdev, > + VIRTIO_NET_FF_RESOURCE_CAP, > + ff->ff_caps, > + sizeof(*ff->ff_caps)); > + > + if (err) > + goto err_ff; > + > + if (!ff->ff_caps->groups_limit || > + !ff->ff_caps->classifiers_limit || > + !ff->ff_caps->rules_limit || > + !ff->ff_caps->rules_per_group_limit) { > + err = -EINVAL; > + goto err_ff; > + } > + > + /* VIRTIO_NET_FF_MASK_TYPE start at 1 */ > + for (i = 1; i <= VIRTIO_NET_FF_MASK_TYPE_MAX; i++) > + ff_mask_size += get_mask_size(i); > + > + ff->ff_mask = kzalloc(ff_mask_size, GFP_KERNEL); > + if (!ff->ff_mask) { > + err = -ENOMEM; > + goto err_ff; > + } > + > + err = virtio_admin_cap_get(vdev, > + VIRTIO_NET_FF_SELECTOR_CAP, > + ff->ff_mask, > + ff_mask_size); > + > + if (err) > + goto err_ff_mask; > + > + ff->ff_actions = kzalloc(sizeof(*ff->ff_actions) + > + VIRTIO_NET_FF_ACTION_MAX, > + GFP_KERNEL); > + if (!ff->ff_actions) { > + err = -ENOMEM; > + goto err_ff_mask; > + } > + > + err = virtio_admin_cap_get(vdev, > + VIRTIO_NET_FF_ACTION_CAP, > + ff->ff_actions, > + sizeof(*ff->ff_actions) + VIRTIO_NET_FF_ACTION_MAX); > + > + if (err) > + goto err_ff_action; > + > + err = virtio_admin_cap_set(vdev, > + VIRTIO_NET_FF_RESOURCE_CAP, > + ff->ff_caps, > + sizeof(*ff->ff_caps)); > + if (err) > + goto err_ff_action; > + > + real_ff_mask_size = sizeof(struct virtio_net_ff_cap_mask_data); > + sel = (void *)&ff->ff_mask->selectors[0]; why the cast? discards type checks for no good reason I can see. And &...[0] is unnecessarily funky. Just plain ff->ff_mask->selectors will do. > + > + for (i = 0; i < ff->ff_mask->count; i++) { > + if (sel->length > MAX_SEL_LEN) { > + err = -EINVAL; > + goto err_ff_action; > + } > + real_ff_mask_size += sizeof(struct virtio_net_ff_selector) + sel->length; > + if (real_ff_mask_size > ff_mask_size) { > + err = -EINVAL; > + goto err_ff_action; > + } > + sel = (void *)sel + sizeof(*sel) + sel->length; I guess the MAX_SEL_LEN check guarantees the allocation is big enough? Let's add a BUG_ON just in case. > + } > + > + err = virtio_admin_cap_set(vdev, > + VIRTIO_NET_FF_SELECTOR_CAP, > + ff->ff_mask, > + real_ff_mask_size); > + if (err) > + goto err_ff_action; > + > + err = virtio_admin_cap_set(vdev, > + VIRTIO_NET_FF_ACTION_CAP, > + ff->ff_actions, > + sizeof(*ff->ff_actions) + VIRTIO_NET_FF_ACTION_MAX); > + if (err) > + goto err_ff_action; > + > + ff->vdev = vdev; > + ff->ff_supported = true; > + > + kfree(cap_id_list); > + > + return 0; > + > +err_ff_action: > + kfree(ff->ff_actions); > + ff->ff_actions = NULL; > +err_ff_mask: > + kfree(ff->ff_mask); > + ff->ff_mask = NULL; > +err_ff: > + kfree(ff->ff_caps); > + ff->ff_caps = NULL; > +err_cap_list: > + kfree(cap_id_list); > + > + return err; > +} > + > +static void virtnet_ff_cleanup(struct virtnet_ff *ff) > +{ > + if (!ff->ff_supported) > + return; > + > + kfree(ff->ff_actions); > + kfree(ff->ff_mask); > + kfree(ff->ff_caps); > +} > + > static int virtnet_probe(struct virtio_device *vdev) > { > int i, err = -ENOMEM; > @@ -7137,6 +7327,15 @@ static int virtnet_probe(struct virtio_device *vdev) > } > vi->guest_offloads_capable = vi->guest_offloads; > > + /* Initialize flow filters. Not supported is an acceptable and common > + * return code > + */ > + err = virtnet_ff_init(&vi->ff, vi->vdev); > + if (err && err != -EOPNOTSUPP) { > + rtnl_unlock(); > + goto free_unregister_netdev; > + } > + > rtnl_unlock(); > > err = virtnet_cpu_notif_add(vi); > @@ -7152,6 +7351,7 @@ static int virtnet_probe(struct virtio_device *vdev) > > free_unregister_netdev: > unregister_netdev(dev); > + virtnet_ff_cleanup(&vi->ff); > free_failover: > net_failover_destroy(vi->failover); > free_vqs: > @@ -7201,6 +7401,7 @@ static void virtnet_remove(struct virtio_device *vdev) > virtnet_free_irq_moder(vi); > > unregister_netdev(vi->dev); > + virtnet_ff_cleanup(&vi->ff); > > net_failover_destroy(vi->failover); > > diff --git a/include/linux/virtio_admin.h b/include/linux/virtio_admin.h > index 039b996f73ec..db0f42346ca9 100644 > --- a/include/linux/virtio_admin.h > +++ b/include/linux/virtio_admin.h > @@ -3,6 +3,7 @@ > * Header file for virtio admin operations > */ > #include > +#include > > #ifndef _LINUX_VIRTIO_ADMIN_H > #define _LINUX_VIRTIO_ADMIN_H Why do it? Let net pull this header itself. > diff --git a/include/uapi/linux/virtio_net_ff.h b/include/uapi/linux/virtio_net_ff.h > new file mode 100644 > index 000000000000..bd7a194a9959 > --- /dev/null > +++ b/include/uapi/linux/virtio_net_ff.h you should document in commit log that you are adding these types to UAPI, and which spec they are from. > @@ -0,0 +1,91 @@ > +/* 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 - Flow filter resource capability limits > + * @groups_limit: maximum number of flow filter groups supported by the device > + * @classifiers_limit: maximum number of classifiers supported by the device > + * @rules_limit: maximum number of rules supported device-wide across all groups > + * @rules_per_group_limit: maximum number of rules allowed in a single group > + * @last_rule_priority: priority value associated with the lowest-priority rule > + * @selectors_per_classifier_limit: maximum selectors allowed in one classifier > + * > + * The limits are reported by the device and describe resource capacities for > + * flow filters. Multi-byte fields are little-endian. > + */ > +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; Ouch this is a problem. There is a 2 byte padding here. This is a spec bug but I don't know if it is too late to fix. Parav what do you think? > +}; > + > +/** > + * struct virtio_net_ff_selector - Selector mask descriptor > + * @type: selector type, one of VIRTIO_NET_FF_MASK_TYPE_* constants > + * @flags: selector flags, see VIRTIO_NET_FF_MASK_F_* constants > + * @reserved: must be set to 0 by the driver and ignored by the device > + * @length: size in bytes of @mask > + * @reserved1: must be set to 0 by the driver and ignored by the device > + * @mask: variable-length mask payload for @type, length given by @length > + * > + * A selector describes a header mask that a classifier can apply. The format > + * of @mask depends on @type. > + */ > +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 - Supported selector mask formats > + * @count: number of entries in @selectors > + * @reserved: must be set to 0 by the driver and ignored by the device > + * @selectors: array of supported selector descriptors > + */ > +struct virtio_net_ff_cap_mask_data { > + __u8 count; > + __u8 reserved[7]; > + __u8 selectors[]; > +}; > +#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 - Supported flow actions > + * @count: number of supported actions in @actions > + * @reserved: must be set to 0 by the driver and ignored by the device > + * @actions: array of action identifiers (VIRTIO_NET_FF_ACTION_*) > + */ > +struct virtio_net_ff_actions { > + __u8 count; > + __u8 reserved[7]; > + __u8 actions[]; > +}; > +#endif > -- > 2.50.1