Re: [PATCH v17 01/20] net: Introduce direct data placement tcp offload

Jiri Pirko
2023-10-27T09:30:45Z

Fri, Oct 27, 2023 at 11:07:58AM CEST, aaptel@nvidia.com wrote:
>Jiri Pirko <jiri@resnulli.us> writes:
>>>@@ -2134,6 +2146,9 @@ struct net_device {
>>> netdev_features_t mpls_features;
>>> netdev_features_t gso_partial_features;
>>>
>>>+#ifdef CONFIG_ULP_DDP
>>>+ struct ulp_ddp_netdev_caps ulp_ddp_caps;
>>
>> Why can't you have this inside the driver? You have set_caps/get_stats
>> ops. Try to avoid netdev struct pollution.
>
>Ok, we will move ulp_ddp_caps to the driver and add a get_caps() operation.
>
>>>+struct netlink_ulp_ddp_stats {
>> There is nothing "netlink" about this. Just stats. Exposed over netlink,
>> yes, but that does not need the prefix.
>
>Ok, we will remove the netlink prefix.
>
>>>+enum {
>>>+ ULP_DDP_C_NVME_TCP_BIT,
>>>+ ULP_DDP_C_NVME_TCP_DDGST_RX_BIT,
>>>+
>>>+ /*
>>>+ * add capabilities above and keep in sync with
>>>+ * Documentation/netlink/specs/ulp_ddp.yaml
>>
>> Wait what? Why do you need this at all? Just use the uapi enum.
>
>The generated enum does not define a "count" (ULP_DDP_C_COUNT) which we
>need to know how big the bitfield should be. Maybe the code generator
>can be patched to add a #define with the number of values in the enum?

Yeah. One way or another, don't duplicate the uapi enums.