Subject: Re: [PATCH v12 01/26] net: Introduce direct data placement tcp offload

From: Aurelien Aptel <[email-masked]>
Date: Thu, 10 Aug 2023 17:46:52 +0300

Sagi Grimberg <[email-masked]> writes:
>> +struct ulp_ddp_limits {
>> +     enum ulp_ddp_type       type;
>> +     int                     max_ddp_sgl_len;
>> +     int                     io_threshold;
>> +     bool                    tls:1;
>
> Is this a catch-all for tls 1.2/1.3 or future ones?

This is catch-all. Once it will be supported together with the offload,
we can add the TLS type incrementaly.

>> +struct ulp_ddp_dev_ops {
>> +     int (*limits)(struct net_device *netdev,
>> +                   struct ulp_ddp_limits *limits);
>> +     int (*sk_add)(struct net_device *netdev,
>> +                   struct sock *sk,
>> +                   struct ulp_ddp_config *config);
>> +     void (*sk_del)(struct net_device *netdev,
>> +                    struct sock *sk);
>> +     int (*setup)(struct net_device *netdev,
>> +                  struct sock *sk,
>> +                  struct ulp_ddp_io *io);
>> +     void (*teardown)(struct net_device *netdev,
>> +                      struct sock *sk,
>> +                      struct ulp_ddp_io *io,
>> +                      void *ddp_ctx);
>> +     void (*resync)(struct net_device *netdev,
>> +                    struct sock *sk, u32 seq);
>> +     int (*set_caps)(struct net_device *dev, unsigned long *bits,
>> +                     struct netlink_ext_ack *extack);
>> +     int (*get_stats)(struct net_device *dev,
>> +                      struct ethtool_ulp_ddp_stats *stats);
>> +};
>
> It would be beneficial to have proper wrappers to these that
> can also do some housekeeping work around the callbacks.

We can add wrappers in net/core/ulp_ddp.c that can NULL-check the
function pointers and do any common housekeeping if needed.

Thanks