Thread (4 messages) flat view 4 messages, 2 authors, 2021-11-02

Re: [PATCH net] ethtool: fix ethtool msg len calculation for pause stats

From: Saeed Mahameed <saeedm@nvidia.com>
Date: 2021-11-02 20:41:57

On Tue, 2021-11-02 at 11:10 -0700, Jakub Kicinski wrote:
On Tue, 2 Nov 2021 16:08:52 +0000 Saeed Mahameed wrote:
quoted
quoted
...
quoted
maybe we need to separate stats from non-stats, or define
ETHTOOL_A_PAUSE_STAT_CNT where it needs to be defined.
Fair point, something like this?
LGTM
quoted hunk ↗ jump to hunk
+++ b/include/uapi/linux/ethtool_netlink.h
@@ -411,10 +411,14 @@ enum {
        ETHTOOL_A_PAUSE_STAT_TX_FRAMES,
        ETHTOOL_A_PAUSE_STAT_RX_FRAMES,
 
-       /* add new constants above here */
+       /* add new constants above here
+        * adjust ETHTOOL_PAUSE_STAT_CNT if adding non-stats!
+        */
        __ETHTOOL_A_PAUSE_STAT_CNT,
        ETHTOOL_A_PAUSE_STAT_MAX = (__ETHTOOL_A_PAUSE_STAT_CNT - 1)
 };
+#define ETHTOOL_PAUSE_STAT_CNT (__ETHTOOL_A_PAUSE_STAT_CNT -
           \
+                                ETHTOOL_A_PAUSE_STAT_TX_FRAMES)
 
 /* EEE */
 
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help