Skip to contentSkip to conversation

devlink: use DEVLINK_CMD_ESWITCH_* instead of DEVLINK_CMD_ESWITCH_MODE_*

PATCH Applied Jiri Pirko 2 participants 4 messages Feb 19, 2017

Subsystems (2)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 devlink: use DEVLINK_CMD_ESWITCH_* instead of DEVLINK_CMD_ESWITCH_MODE_*

From: Jiri Pirko <[email protected]>

Sync with kernel and don't use the obsolete enum values.

---
 devlink/devlink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
devlink/devlink.c +2 -2
index 34a409f..c357580 100644
@@ -1303,7 +1303,7 @@ static int cmd_dev_eswitch_show(struct dl *dl)
 	struct nlmsghdr *nlh;
 	int err;
 
-	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_MODE_GET,
+	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_GET,
 			       NLM_F_REQUEST | NLM_F_ACK);
 
 	err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE, 0);
@@ -1321,7 +1321,7 @@ static int cmd_dev_eswitch_set(struct dl *dl)
 	struct nlmsghdr *nlh;
 	int err;
 
-	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_MODE_SET,
+	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_SET,
 			       NLM_F_REQUEST | NLM_F_ACK);
 
 	err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE,
Signature · 1 line
2.7.4
#1 lore raw
Quoted 23 lines · On Sun, 19 Feb 2017 15:37:06 +0100 Jiri Pirko <[email protected]> wrote:

From: Jiri Pirko <[email protected]>

Sync with kernel and don't use the obsolete enum values.

---
 devlink/devlink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
devlink/devlink.c +1 -1
index 34a409f..c357580 100644
@@ -1303,7 +1303,7 @@ static int cmd_dev_eswitch_show(struct dl *dl)
 	struct nlmsghdr *nlh;
 	int err;
 
-	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_MODE_GET,
+	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_GET,
 			       NLM_F_REQUEST | NLM_F_ACK);
 
 	err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE, 0);

devlink/devlink.c static int cmd_dev_eswitch_set(struct dl *dl) · line 1327

Quoted 8 lines
devlink/devlink.c +1 -1
@@ -1321,7 +1321,7 @@ static int cmd_dev_eswitch_set(struct dl *dl)
 	struct nlmsghdr *nlh;
 	int err;
 
-	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_MODE_SET,
+	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_SET,
 			       NLM_F_REQUEST | NLM_F_ACK);
 
 	err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE,

I think you need go go back and reconsider the ABI change. This patch would cause the net-next version of iproute2 devlink to not work with older kernels.

The iproute2 toolset relies on the kernel ABI guarantees so that later versions of iproute2 still interoperate with older kernels. It is possible that new features get added but the old functionality will always work.

#2 lore raw
In reply to Jiri Pirko
Quoted 23 lines · On Sun, 19 Feb 2017 15:37:06 +0100 Jiri Pirko <[email protected]> wrote:

From: Jiri Pirko <[email protected]>

Sync with kernel and don't use the obsolete enum values.

---
 devlink/devlink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
devlink/devlink.c +1 -1
index 34a409f..c357580 100644
@@ -1303,7 +1303,7 @@ static int cmd_dev_eswitch_show(struct dl *dl)
 	struct nlmsghdr *nlh;
 	int err;
 
-	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_MODE_GET,
+	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_GET,
 			       NLM_F_REQUEST | NLM_F_ACK);
 
 	err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE, 0);

devlink/devlink.c static int cmd_dev_eswitch_set(struct dl *dl) · line 1327

Quoted 8 lines
devlink/devlink.c +1 -1
@@ -1321,7 +1321,7 @@ static int cmd_dev_eswitch_set(struct dl *dl)
 	struct nlmsghdr *nlh;
 	int err;
 
-	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_MODE_SET,
+	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_SET,
 			       NLM_F_REQUEST | NLM_F_ACK);
 
 	err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE,

I went back and looked at the original commit.
devlink: fix the name of eswitch commands
OK, so you only changed the name, not the value so it would be binary compatible.

Applied.

author
#3 lore raw
Quoted 33 lines · Sun, Feb 19, 2017 at 09:01:15PM CET, [email protected] wrote:
Quoted 30 lines · On Sun, 19 Feb 2017 15:37:06 +0100 Jiri Pirko <[email protected]> wrote:

From: Jiri Pirko <[email protected]>

Sync with kernel and don't use the obsolete enum values.

---
 devlink/devlink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
devlink/devlink.c +2 -2
index 34a409f..c357580 100644
@@ -1303,7 +1303,7 @@ static int cmd_dev_eswitch_show(struct dl *dl)
 	struct nlmsghdr *nlh;
 	int err;
 
-	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_MODE_GET,
+	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_GET,
 			       NLM_F_REQUEST | NLM_F_ACK);
 
 	err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE, 0);
@@ -1321,7 +1321,7 @@ static int cmd_dev_eswitch_set(struct dl *dl)
 	struct nlmsghdr *nlh;
 	int err;
 
-	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_MODE_SET,
+	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_ESWITCH_SET,
 			       NLM_F_REQUEST | NLM_F_ACK);
 
Quoted 6 lines

devlink/devlink.c static int cmd_dev_eswitch_set(struct dl *dl) · line 1327

Quoted 1 line
devlink/devlink.c +0 -0
 	err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE,

I went back and looked at the original commit.
devlink: fix the name of eswitch commands
OK, so you only changed the name, not the value so it would be binary compatible.

Yep.

Quoted 2 lines

Applied.

Thanks.