RE: [PATCH v7 01/23] net: Introduce direct data placement tcp offload

Shai Malin
2022-10-28T10:32:37Z

On Wed, 26 Oct 2022 at 17:24, Jakub Kicinski <kuba@kernel.org> wrote:
> On Wed, 26 Oct 2022 15:01:42 +0000 Shai Malin wrote:
> > > > @@ -14,7 +14,7 @@ typedef u64 netdev_features_t;
> > > > enum {
> > > > NETIF_F_SG_BIT, /* Scatter/gather IO. */
> > > > NETIF_F_IP_CSUM_BIT, /* Can checksum TCP/UDP over
> IPv4. */
> > > > - __UNUSED_NETIF_F_1,
> > > > + NETIF_F_HW_ULP_DDP_BIT, /* ULP direct data placement
> offload */
> > >
> > > Why do you need a feature bit if there is a whole caps / limit querying
> > > mechanism?
> >
> > The caps are used for the HW device to publish the supported
> > capabilities/limitation, while the feature bit is used for the DDP
> > enablement "per net-device".
> >
> > Disabling will be required in case that another feature which is
> > mutually exclusive to the DDP is needed (as an example in the mlx case,
> > CQE compress which is controlled from ethtool).
>
> It's a big enough feature to add a genetlink or at least a ethtool
> command to control. If you add more L5 protos presumably you'll want
> to control disable / enable separately for them. Also it'd be cleaner
> to expose the full capabilities and report stats via a dedicated API.
> Feature bits are not a good fix for complex control-pathy features.

With our existing design, we are supporting a bundle of DDP + CRC offload.
We don't see the value of letting the user control it individually.

The capabilities bits were added in order to allow future devices which
supported only one of the capabilities to plug into the infrastructure
or to allow additional capabilities/protocols.
We could expose the caps via ethtool as regular netdev features, it would
make everything simpler and cleaner, but the problem is that features have
run out of bits (all 64 are taken, and we understand the challenge with
changing that).

We could add a new ethtool command, but on the kernel side it would be
quite redundant as we would essentially re-implement feature flag processing
(comparing string of features names and enabling bits).

What do you think?

>
> > > It's somewhat unclear to me why we add ops to struct net_device,
> > > rather than to ops.. can you explain?
> >
> > We were trying to follow the TLS design which is similar.
>
> Ack, TLS should really move as well, IMHO, but that's a separate convo.
>
> > Can you please clarify what do you mean by "rather than to ops.."?
>
> Add the ulp_dpp_ops pointer to struct net_device_ops rather than struct
> net_device.

Sure, will be fixed in v8.