diff mbox series

[RFC,ethtool,1/2] ethtool: add has_input in struct cmdline_info to record cmdline params

Message ID 20220315031834.56676-2-wangjie125@huawei.com (mailing list archive)
State RFC
Delegated to: Michal Kubecek
Headers show
Series add new ethtool command to support features contained entirely to driver | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

wangjie (L) March 15, 2022, 3:18 a.m. UTC
In driver feature configuration scene, ethtool need to record the config
combination. So this patch add has_input to mark the features to be
configured.

Signed-off-by: Jie Wang <wangjie125@huawei.com>
---
 ethtool.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/ethtool.c b/ethtool.c
index 5d718a2..e2b4e17 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -111,6 +111,8 @@  struct cmdline_info {
 	 * For anything else, points to int and is set if the option is
 	 * seen. */
 	void *seen_val;
+	/* indicate current input has this item */
+	u32 has_input;
 };
 
 struct feature_def {
@@ -244,6 +246,7 @@  static void parse_generic_cmdline(struct cmd_context *ctx,
 			if (!strcmp(info[idx].name, argp[i])) {
 				found = 1;
 				*changed = 1;
+				info[idx].has_input = 1;
 				if (info[idx].type != CMDL_FLAG &&
 				    info[idx].seen_val)
 					*(int *)info[idx].seen_val = 1;