From 19c5d9f3c49c96f87ba7d5403af7539d0d220b8f Mon Sep 17 00:00:00 2001
From: Algernon <lixiaodong67@huawei.com>
Date: Wed, 15 Nov 2023 20:09:35 +0800
Subject: [PATCH 282/283] net: hns3: Fix ethtool_ Ops&gen_ Improper
 modification of kabi changes caused by adding members in the ops structure

driver inclusion
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I8EN49
--------------------------------

Signed-off-by: Xiaodong Li <lixiaodong67@huawei.com>
---
 include/linux/ethtool.h | 21 +++++++++------------
 include/net/genetlink.h |  8 +++++---
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 5b028a126d9a..affef82ee8f3 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -436,10 +436,6 @@ struct ethtool_fec_stats {
  * of the generic netdev features interface.
  */
 struct ethtool_ops {
-#ifndef __GENKSYMS__
-	u32     supported_coalesce_params;
-	u32	supported_ring_params;
-#endif
 	int	(*get_settings)(struct net_device *, struct ethtool_cmd *);
 	int	(*set_settings)(struct net_device *, struct ethtool_cmd *);
 	void	(*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);
@@ -451,10 +447,6 @@ struct ethtool_ops {
 	void	(*set_msglevel)(struct net_device *, u32);
 	int	(*nway_reset)(struct net_device *);
 	u32	(*get_link)(struct net_device *);
-#ifndef __GENKSYMS__
-	int	(*get_link_ext_state)(struct net_device *,
-				      struct ethtool_link_ext_state_info *);
-#endif
 	int	(*get_eeprom_len)(struct net_device *);
 	int	(*get_eeprom)(struct net_device *,
 			      struct ethtool_eeprom *, u8 *);
@@ -521,20 +513,25 @@ struct ethtool_ops {
 				      struct ethtool_link_ksettings *);
 	int	(*set_link_ksettings)(struct net_device *,
 				      const struct ethtool_link_ksettings *);
-#ifndef __GENKSYMS__
-	void	(*get_fec_stats)(struct net_device *dev,
-				 struct ethtool_fec_stats *fec_stats);
-#endif
 	int	(*get_fecparam)(struct net_device *,
 				      struct ethtool_fecparam *);
 	int	(*set_fecparam)(struct net_device *,
 				      struct ethtool_fecparam *);
 	void	(*get_ethtool_phy_stats)(struct net_device *,
 					 struct ethtool_stats *, u64 *);
+#ifndef __GENKSYMS__
+	u32     supported_coalesce_params;
+	u32     supported_ring_params;
 
+	int     (*get_link_ext_state)(struct net_device *,
+				      struct ethtool_link_ext_state_info *);
+	void    (*get_fec_stats)(struct net_device *dev,
+				 struct ethtool_fec_stats *fec_stats);
+#else
 	KABI_RESERVE(1)
 	KABI_RESERVE(2)
 	KABI_RESERVE(3)
+#endif
 	KABI_RESERVE(4)
 	KABI_RESERVE(5)
 	KABI_RESERVE(6)
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 83554e1cc08e..cd57d2e1188b 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -148,14 +148,16 @@ struct genl_ops {
 	int		       (*dumpit)(struct sk_buff *skb,
 					 struct netlink_callback *cb);
 	int		       (*done)(struct netlink_callback *cb);
-#ifndef __GENKSYMS__
-	unsigned int		maxattr;
-#endif
 	u8			cmd;
 	u8			internal_flags;
 	u8			flags;
 
+#ifndef __GENKSYMS__
+	unsigned int		maxattr;
+	unsigned int		reserve;
+#else
 	KABI_RESERVE(1)
+#endif
 	KABI_RESERVE(2)
 	KABI_RESERVE(3)
 	KABI_RESERVE(4)
-- 
2.34.1

