Subject: Re: [PATCH RFC v1 net-next 1/5] ethtool: Add support for configuring tx_push_buf_len

From: Jakub Kicinski <[email-masked]>
Date: Wed, 1 Mar 2023 20:00:55 -0800

On Wed, 1 Mar 2023 19:59:12 +0200 Shay Agroskin wrote:
> @@ -98,7 +100,12 @@ static int rings_fill_reply(struct sk_buff *skb,
>  	    (kr->cqe_size &&
>  	     (nla_put_u32(skb, ETHTOOL_A_RINGS_CQE_SIZE, kr->cqe_size))) ||
>  	    nla_put_u8(skb, ETHTOOL_A_RINGS_TX_PUSH, !!kr->tx_push) ||
> -	    nla_put_u8(skb, ETHTOOL_A_RINGS_RX_PUSH, !!kr->rx_push))
> +	    nla_put_u8(skb, ETHTOOL_A_RINGS_RX_PUSH, !!kr->rx_push) ||
> +	    (kr->tx_push_buf_len &&
> +	     (nla_put_u32(skb, ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX,
> +			  kr->tx_push_buf_max_len) ||
> +	      nla_put_u32(skb, ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN,
> +			  kr->tx_push_buf_len))))

Why gate both on kr->tx_push_buf_len and not current and max separately?
Is kr->tx_push_buf_len == 0 never a valid setting?

Otherwise LGTM!

Could you add this chunk to expose the value in the YAML spec?

diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml
index 35c462bce56f..2dd6aef582e4 100644
--- a/Documentation/netlink/specs/ethtool.yaml
+++ b/Documentation/netlink/specs/ethtool.yaml
@@ -163,6 +163,12 @@ doc: Partial family for Ethtool Netlink.
       -
         name: rx-push
         type: u8
+      -
+        name: tx-push-buf-len
+        type: u32
+      -
+        name: tx-push-buf-len-max
+        type: u32
 
   -
     name: mm-stat
@@ -309,6 +315,8 @@ doc: Partial family for Ethtool Netlink.
             - cqe-size
             - tx-push
             - rx-push
+            - tx-push-buf-len
+            - tx-push-buf-len-max
       dump: *ring-get-op
     -
       name: rings-set