[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <685c8c553072b_2a5da429429@willemb.c.googlers.com.notmuch>
Date: Wed, 25 Jun 2025 19:55:01 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Daniel Zahka <daniel.zahka@...il.com>,
Donald Hunter <donald.hunter@...il.com>,
Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>,
Jonathan Corbet <corbet@....net>,
Andrew Lunn <andrew+netdev@...n.ch>
Cc: Saeed Mahameed <saeedm@...dia.com>,
Leon Romanovsky <leon@...nel.org>,
Tariq Toukan <tariqt@...dia.com>,
Boris Pismenny <borisp@...dia.com>,
Kuniyuki Iwashima <kuniyu@...gle.com>,
Willem de Bruijn <willemb@...gle.com>,
David Ahern <dsahern@...nel.org>,
Neal Cardwell <ncardwell@...gle.com>,
Patrisious Haddad <phaddad@...dia.com>,
Raed Salem <raeds@...dia.com>,
Jianbo Liu <jianbol@...dia.com>,
Dragos Tatulea <dtatulea@...dia.com>,
Rahul Rameshbabu <rrameshbabu@...dia.com>,
Stanislav Fomichev <sdf@...ichev.me>,
Toke Høiland-Jørgensen <toke@...hat.com>,
Alexander Lobakin <aleksander.lobakin@...el.com>,
Jacob Keller <jacob.e.keller@...el.com>,
netdev@...r.kernel.org
Subject: Re: [PATCH v2 02/17] psp: base PSP device support
Daniel Zahka wrote:
> From: Jakub Kicinski <kuba@...nel.org>
>
> Add a netlink family for PSP and allow drivers to register support.
>
> The "PSP device" is its own object. This allows us to perform more
> flexible reference counting / lifetime control than if PSP information
> was part of net_device. In the future we should also be able
> to "delegate" PSP access to software devices, such as *vlan, veth
> or netkit more easily.
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> Signed-off-by: Daniel Zahka <daniel.zahka@...il.com>
> diff --git a/include/net/psp/types.h b/include/net/psp/types.h
> new file mode 100644
> index 000000000000..dbc5423a53df
> --- /dev/null
> +++ b/include/net/psp/types.h
> @@ -0,0 +1,102 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#ifndef __NET_PSP_H
> +#define __NET_PSP_H
> +
> +#include <linux/mutex.h>
> +#include <linux/refcount.h>
> +
> +struct netlink_ext_ack;
> +
> +#define PSP_DEFAULT_UDP_PORT 1000
> +
> +struct psphdr {
> + u8 nexthdr;
> + u8 hdrlen;
> + u8 crypt_offset;
> + u8 verfl;
> + __be32 spi;
> + __be64 iv;
> + __be64 vc[]; /* optional */
> +};
> +
> +#define PSP_SPI_KEY_ID GENMASK(30, 0)
> +#define PSP_SPI_KEY_PHASE BIT(31)
> +
> +#define PSPHDR_CRYPT_OFFSET GENMASK(5, 0)
> +
> +#define PSPHDR_VERFL_SAMPLE BIT(7)
> +#define PSPHDR_VERFL_DROP BIT(6)
> +#define PSPHDR_VERFL_VERSION GENMASK(5, 2)
> +#define PSPHDR_VERFL_VIRT BIT(1)
> +#define PSPHDR_VERFL_ONE BIT(0)
Use bitfields in struct psphdr rather than manual bit twiddling?
Or else just consider just calling it flags rather than verfl
(which stands for version and flags?).
> +
> +/**
> + * struct psp_dev_config - PSP device configuration
> + * @versions: PSP versions enabled on the device
> + */
> +struct psp_dev_config {
> + u32 versions;
> +};
> +
> +/**
> + * struct psp_dev - PSP device struct
> + * @main_netdev: original netdevice of this PSP device
This makes sense with a single physical device plus optional virtual
(vlan, bonding, ..) devices.
It may also be possible for a single physical device (with single
device key) to present multiple PFs and/or VFs. In that case, will
there be multiple struct psp_dev, or will one PF be the "main".
Powered by blists - more mailing lists