Blame SOURCES/open-lldp-v1.0.1-6-VDP-Support-in-VDP22-for-correct-error-code-status-t.patch

89f6b3
From faf19bd8bdb1a6ca0dd98843cd09fd96b1f2f901 Mon Sep 17 00:00:00 2001
89f6b3
From: padkrish <padkrish@cisco.com>
89f6b3
Date: Wed, 21 Jan 2015 03:37:57 +0000
89f6b3
Subject: [PATCH] VDP: Support in VDP22 for correct error code/status to
89f6b3
 vdptool
89f6b3
89f6b3
This commit has the following changes:
89f6b3
a. Returning the status or error code to vdptool for the error cases. Errors
89f6b3
can be Tx error, invalid parameters, incorrect configuration etc. The vdptool
89f6b3
 is modified to print the error messages from lldpad.
89f6b3
b. Modify the vdptool option from set-tlv/get-tlv to set-vsi/get-vsi. The
89f6b3
 vdptool man page document is also modified accordingly.
89f6b3
c. Re-arrange the definitions in header files.
89f6b3
d. Fix some formatting issues.
89f6b3
89f6b3
Signed-off-by: padkrish <padkrish@cisco.com>
89f6b3
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
89f6b3
---
89f6b3
 docs/vdptool.8           |  12 ++--
89f6b3
 include/lldpad_status.h  |  25 +++++----
89f6b3
 include/qbg_vdp22.h      |  50 +++++++++--------
89f6b3
 include/qbg_vdp22_clif.h |   8 +++
89f6b3
 include/qbg_vdp22def.h   |  39 +++++++++++++
89f6b3
 qbg/vdp22.c              |  20 ++++++-
89f6b3
 qbg/vdp22_cmds.c         |  63 +++++++++++++++------
89f6b3
 qbg/vdp22sm.c            |  15 -----
89f6b3
 qbg/vdp_ascii.c          |  56 +++++++++++++++----
89f6b3
 vdptool.c                | 141 ++++++++++++++++++++++++++++++++++++++---------
89f6b3
 10 files changed, 316 insertions(+), 113 deletions(-)
89f6b3
89f6b3
diff --git a/docs/vdptool.8 b/docs/vdptool.8
89f6b3
index 02b4e8e..0b50a13 100644
89f6b3
--- a/docs/vdptool.8
89f6b3
+++ b/docs/vdptool.8
89f6b3
@@ -98,7 +98,7 @@ Wait for the bridge response message
89f6b3
 .SS VSI Parameter
89f6b3
 Each VDP22 TLVs contains a command mode, manager identifier,
89f6b3
 type identifier, type identifier version, VSI instance identifier,
89f6b3
-migiration hints and filter information.
89f6b3
+migration hints and filter information.
89f6b3
 The fields are explained next:
89f6b3
 .TP
89f6b3
 .B "mode (Command Mode):"
89f6b3
@@ -140,7 +140,7 @@ an UUID according to RFC 4122
89f6b3
 with optional dashes in between.
89f6b3
 .TP
89f6b3
 .B "hints (Migration Hints):"
89f6b3
-The migiration hints is a string aiding in
89f6b3
+The migration hints is a string aiding in
89f6b3
 migration of virtual machines:
89f6b3
 .RS
89f6b3
 .IP none:
89f6b3
@@ -193,11 +193,11 @@ show usage information
89f6b3
 .B \-v, version
89f6b3
 show version information
89f6b3
 .TP
89f6b3
-.B \-t, get-tlv
89f6b3
-get TLV information for the specified interface
89f6b3
+.B \-t, get-vsi
89f6b3
+get VSI information for the specified interface
89f6b3
 .TP
89f6b3
-.B \-T, set-tlv
89f6b3
-set TLV information for the specified interface
89f6b3
+.B \-T, set-vsi
89f6b3
+set VSI information for the specified interface
89f6b3
 .TP
89f6b3
 .B \-p, ping
89f6b3
 display the process identifier of the running lldpad process
89f6b3
diff --git a/include/lldpad_status.h b/include/lldpad_status.h
89f6b3
index df6e0f7..568063b 100644
89f6b3
--- a/include/lldpad_status.h
89f6b3
+++ b/include/lldpad_status.h
89f6b3
@@ -33,18 +33,19 @@
89f6b3
 #define LLDPAD_STATUS_H
89f6b3
 
89f6b3
 typedef enum {
89f6b3
-    cmd_success = 0,
89f6b3
-    cmd_failed,
89f6b3
-    cmd_device_not_found,
89f6b3
-    cmd_agent_not_found,
89f6b3
-    cmd_invalid,
89f6b3
-    cmd_bad_params,
89f6b3
-    cmd_peer_not_present,
89f6b3
-    cmd_ctrl_vers_not_compatible,
89f6b3
-    cmd_not_capable,
89f6b3
-    cmd_not_applicable,
89f6b3
-    cmd_no_access,
89f6b3
-    cmd_agent_not_supported,
89f6b3
+	cmd_success = 0,
89f6b3
+	cmd_failed,
89f6b3
+	cmd_device_not_found,
89f6b3
+	cmd_agent_not_found,
89f6b3
+	cmd_invalid,
89f6b3
+	cmd_bad_params,
89f6b3
+	cmd_peer_not_present,
89f6b3
+	cmd_ctrl_vers_not_compatible,
89f6b3
+	cmd_not_capable,
89f6b3
+	cmd_not_applicable,
89f6b3
+	cmd_no_access,
89f6b3
+	cmd_agent_not_supported,
89f6b3
+	cmd_max_status,
89f6b3
 } cmd_status;
89f6b3
 
89f6b3
 #endif /* LLDPAD_STATUS_H */
89f6b3
diff --git a/include/qbg_vdp22.h b/include/qbg_vdp22.h
89f6b3
index af0aa15..6c3c9ee 100644
89f6b3
--- a/include/qbg_vdp22.h
89f6b3
+++ b/include/qbg_vdp22.h
89f6b3
@@ -65,22 +65,36 @@ enum vdp22_role {		/* State for VDP22 bridge processing */
89f6b3
 	VDP22_STATION		/* State role */
89f6b3
 };
89f6b3
 
89f6b3
-enum vdp22_cmdresp {			/* VDP22 Protocol command responses */
89f6b3
-	VDP22_RESP_SUCCESS = 0,		/* Success */
89f6b3
-	VDP22_RESP_INVALID_FORMAT = 1,
89f6b3
-	VDP22_RESP_NO_RESOURCES = 2,
89f6b3
-	VDP22_RESP_NO_VSIMGR = 3,	/* No contact to VSI manager */
89f6b3
-	VDP22_RESP_OTHER = 4,		/* Other reasons */
89f6b3
-	VDP22_RESP_NOADDR = 5,		/* Invalid VID, MAC, GROUP etc */
89f6b3
-	VDP22_RESP_DEASSOC = 252,	/* Deassoc response */
89f6b3
-	VDP22_RESP_TIMEOUT = 253,	/* Timeout response */
89f6b3
-	VDP22_RESP_KEEP = 254,		/* Keep response */
89f6b3
-	VDP22_RESP_NONE = 255		/* No response returned so far */
89f6b3
+/*
89f6b3
+ * VSI information. One node per matching entry (same mgrid, type_id, type_ver,
89f6b3
+ * id_fmt, id and fif). Filter data can be added and removed.
89f6b3
+ */
89f6b3
+enum vsi22_flags {			/* Flags (or'ed in) */
89f6b3
+	VDP22_BUSY = 1,			/* This node is under work */
89f6b3
+	VDP22_DELETE_ME = 2,		/* Deallocate this node */
89f6b3
+	VDP22_RETURN_VID = 4,		/* Return wildcard vlan id */
89f6b3
+	VDP22_NOTIFY = 8,		/* Send netlink message to requestor */
89f6b3
+	VDP22_NLCMD = 16		/* Netlink command pending */
89f6b3
+};
89f6b3
+
89f6b3
+enum {                                  /* VDP22 Protocol command responses */
89f6b3
+	USEC_PER_SEC = 1000000,         /* Microseconds per second */
89f6b3
+	VDP22_RESBIT = 0x80,            /* VSI reserved bit */
89f6b3
+	VDP22_ACKBIT = 0x40,            /* VSI Acknowledgement bit */
89f6b3
+	VDP22_KEEPBIT = 0x20,           /* VSI keep error bit */
89f6b3
+	VDP22_HARDBIT = 0x10,           /* VSI hard error bit */
89f6b3
+	VDP22_STATUS_MASK = 0x0f,       /* Status mask */
89f6b3
+	VDP22_STATUS_SHIFT = 0,         /* Status offset */
89f6b3
 };
89f6b3
 
89f6b3
 enum {
89f6b3
 	VDP22_MGRIDSZ = 16,		/* Size of manager identifier */
89f6b3
-	VDP22_IDSZ = 16			/* Size of vsi identifier */
89f6b3
+	VDP22_IDSZ = 16,		/* Size of vsi identifier */
89f6b3
+};
89f6b3
+
89f6b3
+struct vdp22_ptlv {                     /* Packed TLV for VDP data exchange */
89f6b3
+	unsigned short head;            /* TLV 16 bit header */
89f6b3
+	unsigned char data[];           /* TLV Data buffer */
89f6b3
 };
89f6b3
 
89f6b3
 struct vsi_origin {		/* Originator of VSI request */
89f6b3
@@ -99,18 +113,6 @@ struct fid22 {				/* Filter data: GROUP,MAC,VLAN entry */
89f6b3
 	struct vsi_origin requestor;
89f6b3
 };
89f6b3
 
89f6b3
-/*
89f6b3
- * VSI information. One node per matching entry (same mgrid, type_id, type_ver,
89f6b3
- * id_fmt, id and fif). Filter data can be added and removed.
89f6b3
- */
89f6b3
-enum vsi22_flags {			/* Flags (or'ed in) */
89f6b3
-	VDP22_BUSY = 1,			/* This node is under work */
89f6b3
-	VDP22_DELETE_ME = 2,		/* Deallocate this node */
89f6b3
-	VDP22_RETURN_VID = 4,		/* Return wildcard vlan id */
89f6b3
-	VDP22_NOTIFY = 8,		/* Send netlink message to requestor */
89f6b3
-	VDP22_NLCMD = 16		/* Netlink command pending */
89f6b3
-};
89f6b3
-
89f6b3
 struct vdp22smi {		/* Data structure for VDP22 state machine */
89f6b3
 	int state;		/* State of VDP state machine for VSI */
89f6b3
 	bool kato;		/* VSI KA ACK timeout hit for this VSI */
89f6b3
diff --git a/include/qbg_vdp22_clif.h b/include/qbg_vdp22_clif.h
89f6b3
index 8346b98..0cc603e 100644
89f6b3
--- a/include/qbg_vdp22_clif.h
89f6b3
+++ b/include/qbg_vdp22_clif.h
89f6b3
@@ -33,6 +33,8 @@
89f6b3
 #define OP_FID_POS 8 /* Second Byte */
89f6b3
 #define OP_OUI_POS 16 /* Third Byte */
89f6b3
 
89f6b3
+#include "lldpad_status.h"
89f6b3
+
89f6b3
 typedef enum {
89f6b3
 	cmd_getstats,
89f6b3
 	cmd_gettlv,
89f6b3
@@ -60,5 +62,11 @@ typedef enum {
89f6b3
 	 */
89f6b3
 } vdp22_op;
89f6b3
 
89f6b3
+enum vdp22_cmd_status {
89f6b3
+	cmd_vdp_prot_no_support = cmd_max_status + 1,
89f6b3
+	cmd_vdp_nomem,
89f6b3
+	cmd_vdp_busy,
89f6b3
+};
89f6b3
+
89f6b3
 struct lldp_module *vdp22_cli_register(void);
89f6b3
 #endif
89f6b3
diff --git a/include/qbg_vdp22def.h b/include/qbg_vdp22def.h
89f6b3
index ff4270c..c305a2b 100644
89f6b3
--- a/include/qbg_vdp22def.h
89f6b3
+++ b/include/qbg_vdp22def.h
89f6b3
@@ -94,6 +94,31 @@ enum vsi_key_arg {
89f6b3
 	VSI_INVALID_ARG
89f6b3
 };
89f6b3
 
89f6b3
+enum vdp22_cmdresp {			/* VDP22 Protocol command responses */
89f6b3
+	VDP22_RESP_SUCCESS = 0,		/* Success */
89f6b3
+	VDP22_RESP_INVALID_FORMAT = 1,
89f6b3
+	VDP22_RESP_NO_RESOURCES = 2,
89f6b3
+	VDP22_RESP_NO_VSIMGR = 3,	/* No contact to VSI manager */
89f6b3
+	VDP22_RESP_OTHER = 4,		/* Other reasons */
89f6b3
+	VDP22_RESP_NOADDR = 5,		/* Invalid VID, MAC, GROUP etc */
89f6b3
+	VDP22_RESP_DEASSOC = 252,	/* Deassoc response */
89f6b3
+	VDP22_RESP_TIMEOUT = 253,	/* Timeout response */
89f6b3
+	VDP22_RESP_KEEP = 254,		/* Keep response */
89f6b3
+	VDP22_RESP_NONE = 255		/* No response returned so far */
89f6b3
+};
89f6b3
+
89f6b3
+/*
89f6b3
+ * Errors applicable mostly for VDP22_RESP_NONE
89f6b3
+ */
89f6b3
+
89f6b3
+enum vdp22_cmderr {
89f6b3
+	VDP22_KATO = 0,
89f6b3
+	VDP22_ACKTO,
89f6b3
+	VDP22_TXERR
89f6b3
+};
89f6b3
+
89f6b3
+#define VDP22_STATUS_BITS  8          /* Number of bits in Status field */
89f6b3
+
89f6b3
 #define VSI22_ARG_MODE_STR "mode"
89f6b3
 #define VSI22_ARG_MGRID_STR "mgrid2"
89f6b3
 #define VSI22_ARG_TYPEID_STR "typeid"
89f6b3
@@ -105,4 +130,18 @@ enum vsi_key_arg {
89f6b3
 #define VSI22_ARG_FILTER_STR "filter"
89f6b3
 #define VSI22_ARG_OUI_STR "oui"
89f6b3
 
89f6b3
+#define VSI22_KATO_ERR_STR "Keepalive Timeout"
89f6b3
+#define VSI22_ACKTO_ERR_STR "Ack not received from bridge"
89f6b3
+#define VSI22_TX_ERR_STR "Transmission Error"
89f6b3
+
89f6b3
+#define VSI22_INVALID_FRMT_ERR_STR "VDP TLV Format is Invalid"
89f6b3
+#define VSI22_NO_RES_ERR_STR "Insufficient resources at bridge"
89f6b3
+#define VSI22_NO_VSIMGR_ERR_STR "Unable to contact VSI Mgr"
89f6b3
+#define VSI22_OTHER_ERR_STR "Other Failures"
89f6b3
+#define VSI22_NOADDR_ERR_STR "Invalid VID, GroupID or MAC address field"
89f6b3
+#define VSI22_DEASS_ERR_STR "Deassoc received from switch"
89f6b3
+#define VSI22_TIMEOUT_ERR_STR "Timeout Error"
89f6b3
+#define VSI22_KEEP_ERR_STR "Command rejected by bridge and state prior to" \
89f6b3
+			   " requested command is kept"
89f6b3
+
89f6b3
 #endif
89f6b3
diff --git a/qbg/vdp22.c b/qbg/vdp22.c
89f6b3
index af11af8..d7aa648 100644
89f6b3
--- a/qbg/vdp22.c
89f6b3
+++ b/qbg/vdp22.c
89f6b3
@@ -42,6 +42,7 @@
89f6b3
 #include "qbg_vdp22.h"
89f6b3
 #include "qbg_utils.h"
89f6b3
 #include "qbg_vdp22_cmds.h"
89f6b3
+#include "qbg_vdp22def.h"
89f6b3
 
89f6b3
 /*
89f6b3
  * VDP22 helper functions
89f6b3
@@ -469,7 +470,8 @@ static bool filter_ok(unsigned char ffmt, struct fid22 *fp,
89f6b3
 		else
89f6b3
 			rc = false;
89f6b3
 	}
89f6b3
-	LLDPAD_DBG("%s:rc:%d\n", __func__, rc);
89f6b3
+	LLDPAD_DBG("%s: ffmt:%d gpid_on:%d rc:%d\n", __func__, ffmt,
89f6b3
+		   gpid_on, rc);
89f6b3
 	return rc;
89f6b3
 }
89f6b3
 
89f6b3
@@ -1007,12 +1009,26 @@ static pid_t havepid(struct vsi22 *vsi)
89f6b3
 	return mypid;
89f6b3
 }
89f6b3
 
89f6b3
+unsigned char vdp22_getsm_errcode(struct vsi22 *vsi)
89f6b3
+{
89f6b3
+	unsigned char err_code = 0;
89f6b3
+
89f6b3
+	if (vsi->smi.kato)
89f6b3
+		err_code |= (1 << VDP22_KATO);
89f6b3
+	if (vsi->smi.acktimeout)
89f6b3
+		err_code |= (1 << VDP22_ACKTO);
89f6b3
+	if (vsi->smi.txmit_error)
89f6b3
+		err_code |= (1 << VDP22_TXERR);
89f6b3
+	return err_code;
89f6b3
+}
89f6b3
+
89f6b3
 /*
89f6b3
  * Convert and VSI22 to VDP netlink format and send it back to the originator.
89f6b3
  */
89f6b3
 static int vdp22_back(struct vsi22 *vsi, pid_t to,
89f6b3
 		      int (*fct)(struct vdpnl_vsi *))
89f6b3
 {
89f6b3
+	unsigned char err_code;
89f6b3
 	int i;
89f6b3
 	struct vdpnl_vsi nl;
89f6b3
 	struct vdpnl_mac nlmac[vsi->no_fdata];
89f6b3
@@ -1025,6 +1041,8 @@ static int vdp22_back(struct vsi22 *vsi, pid_t to,
89f6b3
 	memcpy(nl.ifname, vsi->vdp->ifname, sizeof(nl.ifname));
89f6b3
 	nl.request = vsi->vsi_mode;
89f6b3
 	nl.response = vsi->status;
89f6b3
+	err_code = vdp22_getsm_errcode(vsi);
89f6b3
+	nl.response |= (err_code << VDP22_STATUS_BITS);
89f6b3
 	nl.vsi_mgrid = vsi->mgrid[0];
89f6b3
 	memcpy(nl.vsi_mgrid2, vsi->mgrid, sizeof(nl.vsi_mgrid2));
89f6b3
 	nl.vsi_typeversion = vsi->type_ver;
89f6b3
diff --git a/qbg/vdp22_cmds.c b/qbg/vdp22_cmds.c
89f6b3
index 409858d..5d5ef6b 100644
89f6b3
--- a/qbg/vdp22_cmds.c
89f6b3
+++ b/qbg/vdp22_cmds.c
89f6b3
@@ -165,7 +165,8 @@ static int handle_set_arg(struct cmd *cmd, char *arg, char *argvalue,
89f6b3
  * bb:  C for command and 2 or 3 for message version number
89f6b3
  * cc: 1 for get command and 2 for set command
89f6b3
  * dddddddd: 8 hex digits options, supported are op_arg, op_argval, op_conifg
89f6b3
- *           and op_local
89f6b3
+ *           and op_local. The number of filter (fid) parameters are encoded
89f6b3
+ *           here (second byte from right).
89f6b3
  * ee: 2 hex digit length of interface name
89f6b3
  * ffff: string for interface name
89f6b3
  * gg: 2 hex digit for bridge type (nearest customer bridge only)
89f6b3
@@ -179,7 +180,7 @@ static int handle_set_arg(struct cmd *cmd, char *arg, char *argvalue,
89f6b3
  * The total input length can be used to determine the number of arguaments.
89f6b3
  *
89f6b3
  * The member ops of struct cmd settings depends on the invoked with
89f6b3
- * -T (cmd_gettlv) -a assoc:
89f6b3
+ * -T (cmd_getvsi) -a assoc:
89f6b3
  * -c key      --> ops=(0x15) op_config,op_arg,op_local), numargs > 0
89f6b3
  * -c key=abc  --> ops=(0x1d) op_config,op_arg,op_argval,op_local), numargs > 0
89f6b3
  * -c          --> ops=0x11 (op_config,op_local), numargs = 0
89f6b3
@@ -279,8 +280,16 @@ int vdp22_clif_cmd(UNUSED void *data, UNUSED struct sockaddr_un *from,
89f6b3
 int vdp22_sendevent(struct vdpnl_vsi *p)
89f6b3
 {
89f6b3
 	char msg[MAX_CLIF_MSGBUF];
89f6b3
+	char tmp_buf[MAX_CLIF_MSGBUF];
89f6b3
+	int c, len;
89f6b3
 
89f6b3
-	vdp_vdpnl2str(p, msg, sizeof(msg));
89f6b3
+	vdp_vdpnl2str(p, tmp_buf, sizeof(msg));
89f6b3
+	len = strlen(tmp_buf);
89f6b3
+	if ((unsigned)len > sizeof(msg))
89f6b3
+		return 0;
89f6b3
+	c = snprintf(msg, sizeof(msg), "%04x%s", len, tmp_buf);
89f6b3
+	if ((c < 0) || ((unsigned)c >= sizeof(msg)))
89f6b3
+		return 0;
89f6b3
 	LLDPAD_DBG("%s:%s vsi:%p(%#2x), len:%zd msg:%s\n", __func__,
89f6b3
 		   p->ifname, p, p->vsi_uuid[0], strlen(msg), msg);
89f6b3
 	send_event(16, LLDP_MOD_VDP22, msg);
89f6b3
@@ -324,6 +333,29 @@ static int ifok(struct cmd *cmd)
89f6b3
 	return good_cmd;
89f6b3
 }
89f6b3
 
89f6b3
+static int get_vdp22_retval(int rc)
89f6b3
+{
89f6b3
+	if (!rc)
89f6b3
+		return cmd_success;
89f6b3
+
89f6b3
+	switch (rc) {
89f6b3
+	case -EPROTONOSUPPORT:
89f6b3
+		return cmd_vdp_prot_no_support;
89f6b3
+	case -EOPNOTSUPP:
89f6b3
+		return cmd_not_capable;
89f6b3
+	case -EINVAL:
89f6b3
+		return cmd_bad_params;
89f6b3
+	case -ENOMEM:
89f6b3
+		return cmd_vdp_nomem;
89f6b3
+	case -EBUSY:
89f6b3
+		return cmd_vdp_busy;
89f6b3
+	case -ENODEV:
89f6b3
+		return cmd_device_not_found;
89f6b3
+	default:
89f6b3
+		return cmd_failed;
89f6b3
+	}
89f6b3
+}
89f6b3
+
89f6b3
 static int set_arg_vsi3(struct cmd *cmd, char *argvalue, bool test, int size)
89f6b3
 {
89f6b3
 	cmd_status good_cmd = vdp22_cmdok(cmd, cmd_settlv);
89f6b3
@@ -340,7 +372,7 @@ static int set_arg_vsi3(struct cmd *cmd, char *argvalue, bool test, int size)
89f6b3
 	vsi.macsz = size;
89f6b3
 	rc = vdp_str2vdpnl(argvalue, &vsi, cmd->ifname);
89f6b3
 	if (rc) {
89f6b3
-		good_cmd = cmd_bad_params;
89f6b3
+		good_cmd = get_vdp22_retval(rc);
89f6b3
 		goto out;
89f6b3
 	}
89f6b3
 	if (!port_find_by_ifindex(get_ifidx(cmd->ifname))) {
89f6b3
@@ -351,12 +383,8 @@ static int set_arg_vsi3(struct cmd *cmd, char *argvalue, bool test, int size)
89f6b3
 	if (good_cmd != cmd_success || test)
89f6b3
 		goto out;
89f6b3
 	rc = vdp22_request(&vsi, 1);
89f6b3
-	if (!rc)
89f6b3
-		good_cmd = cmd_success;
89f6b3
-	else if (rc == -ENODEV)
89f6b3
-		good_cmd = cmd_device_not_found;
89f6b3
-	else
89f6b3
-		good_cmd = cmd_failed;
89f6b3
+	good_cmd = get_vdp22_retval(rc);
89f6b3
+
89f6b3
 out:
89f6b3
 	return good_cmd;
89f6b3
 }
89f6b3
@@ -480,7 +508,8 @@ static int get_vsi_partial_arg(UNUSED char *arg, char *orig_argvalue,
89f6b3
 	int rc = -ENOMEM, len, c;
89f6b3
 	u16 vsi_arg_key_flags = 0;
89f6b3
 
89f6b3
-	if (vdp22_parse_str_vdpnl(vsinl, &vsi_arg_key_flags, orig_argvalue))
89f6b3
+	rc = vdp22_parse_str_vdpnl(vsinl, &vsi_arg_key_flags, orig_argvalue);
89f6b3
+	if (rc)
89f6b3
 		goto out;
89f6b3
 	vdp = vdp22_getvdp(vsinl->ifname);
89f6b3
 	if (!vdp)
89f6b3
@@ -498,7 +527,6 @@ static int get_vsi_partial_arg(UNUSED char *arg, char *orig_argvalue,
89f6b3
 			len = strlen(tmp_buf);
89f6b3
 			c = snprintf(out + used, out_len - used, "%04x%s",
89f6b3
 				     len, tmp_buf);
89f6b3
-			vdp22_freemaclist(vsinl);
89f6b3
 			if ((c < 0) || ((unsigned)c >= (out_len - used)))
89f6b3
 				goto out_delvsi;
89f6b3
 			if (rc)
89f6b3
@@ -544,11 +572,14 @@ static int get_arg_vsi(struct cmd *cmd, char *arg, char *argvalue,
89f6b3
 		memset(&mac, 0, sizeof(mac));
89f6b3
 		vsi.macsz = fsize;
89f6b3
 		vsi.maclist = mac;
89f6b3
-		if (!get_vsi_partial_arg(arg, argvalue, &vsi, vsi_str,
89f6b3
-					 sizeof(vsi_str)))
89f6b3
-			goto out;
89f6b3
-	} else if (!catvsis(&vsi, vsi_str, sizeof(vsi_str)))
89f6b3
+		rc = get_vsi_partial_arg(arg, argvalue, &vsi, vsi_str,
89f6b3
+					 sizeof(vsi_str));
89f6b3
+	} else
89f6b3
+		rc = catvsis(&vsi, vsi_str, sizeof(vsi_str));
89f6b3
+	if (!rc) {
89f6b3
+		good_cmd = get_vdp22_retval(rc);
89f6b3
 		goto out;
89f6b3
+	}
89f6b3
 	rc = snprintf(obuf, obuf_len, "%s", vsi_str);
89f6b3
 	if (rc > 0 || rc < obuf_len)
89f6b3
 		good_cmd = cmd_success;
89f6b3
diff --git a/qbg/vdp22sm.c b/qbg/vdp22sm.c
89f6b3
index 6264f74..83a97fb 100644
89f6b3
--- a/qbg/vdp22sm.c
89f6b3
+++ b/qbg/vdp22sm.c
89f6b3
@@ -46,21 +46,6 @@
89f6b3
 #include "qbg_vdp22.h"
89f6b3
 #include "qbg_utils.h"
89f6b3
 
89f6b3
-struct vdp22_ptlv {			/* Packed TLV for VDP data exchange */
89f6b3
-	unsigned short head;		/* TLV 16 bit header */
89f6b3
-	unsigned char data[];		/* TLV Data buffer */
89f6b3
-};
89f6b3
-
89f6b3
-enum {					/* VDP22 Protocol command responses */
89f6b3
-	USEC_PER_SEC = 1000000,		/* Microseconds per second */
89f6b3
-	VDP22_RESBIT = 0x80,		/* VSI reserved bit */
89f6b3
-	VDP22_ACKBIT = 0x40,		/* VSI Acknowledgement bit */
89f6b3
-	VDP22_KEEPBIT = 0x20,		/* VSI keep error bit */
89f6b3
-	VDP22_HARDBIT = 0x10,		/* VSI hard error bit */
89f6b3
-	VDP22_STATUS_MASK = 0x0f,	/* Status mask */
89f6b3
-	VDP22_STATUS_SHIFT = 0,		/* Status offset */
89f6b3
-};
89f6b3
-
89f6b3
 /*
89f6b3
  * Set status code
89f6b3
  */
89f6b3
diff --git a/qbg/vdp_ascii.c b/qbg/vdp_ascii.c
89f6b3
index 76dde4a..70ec79b 100644
89f6b3
--- a/qbg/vdp_ascii.c
89f6b3
+++ b/qbg/vdp_ascii.c
89f6b3
@@ -44,6 +44,7 @@
89f6b3
 #include "qbg_vdpnl.h"
89f6b3
 #include "qbg_utils.h"
89f6b3
 #include "lldp_util.h"
89f6b3
+#include "messages.h"
89f6b3
 
89f6b3
 struct vsi_keyword_handler vsi_key_handle[] = {
89f6b3
 	{VSI22_ARG_MODE_STR, VSI_MODE_ARG},
89f6b3
@@ -285,6 +286,24 @@ enum vsi_key_arg get_keywork_val(char *keyword)
89f6b3
 	return VSI_INVALID_ARG;
89f6b3
 }
89f6b3
 
89f6b3
+/*
89f6b3
+ * If the ordering is maintained in vsi_key_handle, then this function is not
89f6b3
+ * necessary as the keyword can be retrieved using
89f6b3
+ * 'vsi_key_handle[keyval].keyword'.
89f6b3
+ */
89f6b3
+
89f6b3
+char *get_keyword_str(enum vsi_key_arg keyval)
89f6b3
+{
89f6b3
+	int count, key_str_size;
89f6b3
+
89f6b3
+	key_str_size = sizeof(vsi_key_handle) / sizeof(vsi_key_handle[0]);
89f6b3
+	for (count = 0; count < key_str_size; count++) {
89f6b3
+		if (vsi_key_handle[count].val == keyval)
89f6b3
+			return vsi_key_handle[count].keyword;
89f6b3
+	}
89f6b3
+	return NULL;
89f6b3
+}
89f6b3
+
89f6b3
 int vdp22_parse_str_vdpnl(struct vdpnl_vsi *vsi, u16 *key_flags,
89f6b3
 			  char *orig_argvalue)
89f6b3
 {
89f6b3
@@ -315,52 +334,57 @@ int vdp22_parse_str_vdpnl(struct vdpnl_vsi *vsi, u16 *key_flags,
89f6b3
 	numargs = get_arg_val_list(argvalue, ilen, &ioff, args, argvals);
89f6b3
 	if (numargs == 0)
89f6b3
 		goto out_free;
89f6b3
+	rc = -EINVAL;
89f6b3
 	for (i = 0; i < numargs; i++) {
89f6b3
 		vsi_key = get_keywork_val(args[i]);
89f6b3
 		switch (vsi_key) {
89f6b3
 		case VSI_MODE_ARG:
89f6b3
 			if (!argvals[i] || !getmode(vsi, argvals[i]))
89f6b3
-				goto out_free;
89f6b3
+				goto out_err;
89f6b3
 			break;
89f6b3
 		case VSI_MGRID2_ARG:
89f6b3
 			if (!argvals[i] || !getmgr2id(vsi, argvals[i]))
89f6b3
-				goto out_free;
89f6b3
+				goto out_err;
89f6b3
 			break;
89f6b3
 		case VSI_TYPEID_ARG:
89f6b3
 			if (!argvals[i] ||
89f6b3
 				!getnumber(argvals[i], 0, 0xffffff, &no))
89f6b3
-				goto out_free;
89f6b3
+				goto out_err;
89f6b3
 			vsi->vsi_typeid = no;
89f6b3
 			break;
89f6b3
 		case VSI_TYPEIDVER_ARG:
89f6b3
 			if (!argvals[i] || !getnumber(argvals[i], 0, 0xff, &no))
89f6b3
-				goto out_free;
89f6b3
+				goto out_err;
89f6b3
 			vsi->vsi_typeversion = no;
89f6b3
 			break;
89f6b3
 		case VSI_VSIID_ARG:
89f6b3
 			if (!argvals[i] ||
89f6b3
 				vdp_str2uuid(vsi->vsi_uuid, argvals[i],
89f6b3
 					sizeof(vsi->vsi_uuid)))
89f6b3
-				goto out_free;
89f6b3
+				goto out_err;
89f6b3
 			vsi->vsi_idfmt = VDP22_ID_UUID;
89f6b3
 			break;
89f6b3
 		case VSI_FILTER_ARG:
89f6b3
 			if (idx < vsi->macsz && !getfid(vsi, argvals[i], idx))
89f6b3
-				goto out_free;
89f6b3
+				goto out_err;
89f6b3
 			idx++;
89f6b3
 			break;
89f6b3
 		case VSI_HINTS_ARG:
89f6b3
 			if (!argvals[i] || !gethints(vsi, argvals[i]))
89f6b3
-				goto out_free;
89f6b3
+				goto out_err;
89f6b3
 			break;
89f6b3
 		default:
89f6b3
-			goto out_free;
89f6b3
+			goto out_err;
89f6b3
 		}
89f6b3
 		num_arg_keys |= (1 << vsi_key);
89f6b3
 	}
89f6b3
 	*key_flags = num_arg_keys;
89f6b3
 	rc = 0;
89f6b3
 
89f6b3
+out_err:
89f6b3
+	if (rc)
89f6b3
+		LLDPAD_ERR("Incorrect arguments specified for key %s\n",
89f6b3
+			   get_keyword_str(vsi_key));
89f6b3
 out_free:
89f6b3
 	free(argvals);
89f6b3
 out_args:
89f6b3
@@ -400,11 +424,16 @@ static int str2vdpnl(char *orig_argvalue, struct vdpnl_vsi *vsi)
89f6b3
 	u16 vsi_mand_mask = (1 << VSI_MAND_NUM_ARG) - 1;
89f6b3
 	u16 num_arg_keys = 0;
89f6b3
 
89f6b3
-	if (vdp22_parse_str_vdpnl(vsi, &num_arg_keys, orig_argvalue))
89f6b3
+	rc = vdp22_parse_str_vdpnl(vsi, &num_arg_keys, orig_argvalue);
89f6b3
+	if (rc) {
89f6b3
+		LLDPAD_ERR("%s: Incorrect arguments\n", __func__);
89f6b3
 		goto out;
89f6b3
+	}
89f6b3
 	/* Return error if no filter information provided */
89f6b3
 	if ((num_arg_keys & vsi_mand_mask) == vsi_mand_mask)
89f6b3
 		rc = 0;
89f6b3
+	else
89f6b3
+		LLDPAD_ERR("%s: Incomplete arguments\n", __func__);
89f6b3
 out:
89f6b3
 	return rc;
89f6b3
 }
89f6b3
@@ -444,7 +473,6 @@ static char *check_and_update(size_t *total, size_t *length, char *s, int c)
89f6b3
 /*
89f6b3
  * Convert VSI association to string.
89f6b3
  */
89f6b3
-#ifdef LATER_USE
89f6b3
 static const char *mode2str(unsigned char x)
89f6b3
 {
89f6b3
 	if (x == VDP22_ASSOC)
89f6b3
@@ -457,7 +485,6 @@ static const char *mode2str(unsigned char x)
89f6b3
 		return "deassoc";
89f6b3
 	return "unknown";
89f6b3
 }
89f6b3
-#endif
89f6b3
 
89f6b3
 /*
89f6b3
  * Convert filter information format into vlan[-mac][-group] string.
89f6b3
@@ -544,7 +571,12 @@ int vdp_vdpnl2str(struct vdpnl_vsi *p, char *s, size_t length)
89f6b3
 	char instance[VDP_UUID_STRLEN + 2];
89f6b3
 
89f6b3
 	mgrid2str(instance, p, sizeof(instance));
89f6b3
-	c = snprintf(s, length, "%02x%s%04x%s%02x%s%04x%lu%02x%s%04x%d",
89f6b3
+	c = snprintf(s, length, "%02x%s%04x%s%02x%s%04x%s%02x%s%04x%lu%02x%s"
89f6b3
+		     "%04x%d",
89f6b3
+		     (unsigned int)strlen(VSI22_ARG_MODE_STR),
89f6b3
+		     VSI22_ARG_MODE_STR,
89f6b3
+		     (unsigned int)strlen(mode2str(p->request)),
89f6b3
+		     mode2str(p->request),
89f6b3
 		     (unsigned int)strlen(VSI22_ARG_MGRID_STR),
89f6b3
 		     VSI22_ARG_MGRID_STR,
89f6b3
 		     (unsigned int)strlen(instance), instance,
89f6b3
diff --git a/vdptool.c b/vdptool.c
89f6b3
index 551e829..f7fd288 100644
89f6b3
--- a/vdptool.c
89f6b3
+++ b/vdptool.c
89f6b3
@@ -54,6 +54,28 @@
89f6b3
 #include "qbg22.h"
89f6b3
 #include "qbg_vdp22_clif.h"
89f6b3
 #include "lldp_util.h"
89f6b3
+#include "qbg_vdp22def.h"
89f6b3
+
89f6b3
+static char *print_vdp_status(enum vdp22_cmd_status status)
89f6b3
+{
89f6b3
+	char *str;
89f6b3
+
89f6b3
+	switch (status) {
89f6b3
+	case cmd_vdp_prot_no_support:
89f6b3
+		str = "VDP protocol not supported on interface";
89f6b3
+		break;
89f6b3
+	case cmd_vdp_nomem:
89f6b3
+		str = "Not enough memory";
89f6b3
+		break;
89f6b3
+	case cmd_vdp_busy:
89f6b3
+		str = "VSI association in progress";
89f6b3
+		break;
89f6b3
+	default:
89f6b3
+		str = "Unknown status";
89f6b3
+		break;
89f6b3
+	}
89f6b3
+	return str;
89f6b3
+}
89f6b3
 
89f6b3
 static char *print_status(cmd_status status)
89f6b3
 {
89f6b3
@@ -97,7 +119,7 @@ static char *print_status(cmd_status status)
89f6b3
 		str = "TLV does not support agent type";
89f6b3
 		break;
89f6b3
 	default:
89f6b3
-		str = "Unknown status";
89f6b3
+		str = print_vdp_status(status);
89f6b3
 		break;
89f6b3
 	}
89f6b3
 	return str;
89f6b3
@@ -165,7 +187,7 @@ static int render_cmd(struct cmd *cmd, int argc, char **args, char **argvals)
89f6b3
 
89f6b3
 int vdp_clif_command(struct clif *, char *, int);
89f6b3
 
89f6b3
-static int vdp_cmd_gettlv(struct clif *clif, int argc, char *argv[],
89f6b3
+static int vdp_cmd_getvsi(struct clif *clif, int argc, char *argv[],
89f6b3
 			  struct cmd *cmd, int raw)
89f6b3
 {
89f6b3
 	int numargs = 0;
89f6b3
@@ -219,7 +241,7 @@ out:
89f6b3
 	return cmd_invalid;
89f6b3
 }
89f6b3
 
89f6b3
-static int vdp_cmd_settlv(struct clif *clif, int argc, char *argv[],
89f6b3
+static int vdp_cmd_setvsi(struct clif *clif, int argc, char *argv[],
89f6b3
 			  struct cmd *cmd, int raw)
89f6b3
 {
89f6b3
 	int numargs = 0;
89f6b3
@@ -299,12 +321,77 @@ static int vdp_parse_response(char *buf)
89f6b3
 	return hex2u8(buf + CLIF_STAT_OFF);
89f6b3
 }
89f6b3
 
89f6b3
-int get_vsi_args(char *ibuf)
89f6b3
+void print_vsi_err_msg(char *key_val)
89f6b3
+{
89f6b3
+	unsigned long errcode;
89f6b3
+	int resp_err, smi_err;
89f6b3
+
89f6b3
+	errcode = strtol(key_val, NULL, 10);
89f6b3
+	resp_err = errcode & 0xff;
89f6b3
+	smi_err = (errcode >> VDP22_STATUS_BITS) & 0xff;
89f6b3
+
89f6b3
+	switch (resp_err) {
89f6b3
+	case VDP22_RESP_INVALID_FORMAT:
89f6b3
+		printf("\tError returned by Bridge: %s\n",
89f6b3
+			VSI22_INVALID_FRMT_ERR_STR);
89f6b3
+		break;
89f6b3
+	case VDP22_RESP_NO_RESOURCES:
89f6b3
+		printf("\tError returned by Bridge: %s\n",
89f6b3
+			VSI22_NO_RES_ERR_STR);
89f6b3
+		break;
89f6b3
+	case VDP22_RESP_NO_VSIMGR:
89f6b3
+		printf("\tError returned by Bridge: %s\n",
89f6b3
+			VSI22_NO_VSIMGR_ERR_STR);
89f6b3
+		break;
89f6b3
+	case VDP22_RESP_OTHER:
89f6b3
+		printf("\tError returned by Bridge: %s\n", VSI22_OTHER_ERR_STR);
89f6b3
+		break;
89f6b3
+	case VDP22_RESP_NOADDR:
89f6b3
+		printf("\tError returned by Bridge: %s\n",
89f6b3
+			VSI22_NOADDR_ERR_STR);
89f6b3
+		break;
89f6b3
+	case VDP22_RESP_DEASSOC:
89f6b3
+		printf("\tError returned by Bridge: %s\n", VSI22_DEASS_ERR_STR);
89f6b3
+		break;
89f6b3
+	case VDP22_RESP_TIMEOUT:
89f6b3
+		printf("\tError returned by Bridge: %s\n",
89f6b3
+			VSI22_TIMEOUT_ERR_STR);
89f6b3
+		break;
89f6b3
+	case VDP22_RESP_KEEP:
89f6b3
+		printf("\tError returned by Bridge: %s\n", VSI22_KEEP_ERR_STR);
89f6b3
+		break;
89f6b3
+	default:
89f6b3
+		break;
89f6b3
+	}
89f6b3
+	if (smi_err & (1 << VDP22_KATO))
89f6b3
+		printf("\tInternal Error : %s\n", VSI22_KATO_ERR_STR);
89f6b3
+	if (smi_err & (1 << VDP22_ACKTO))
89f6b3
+		printf("\tInternal Error : %s\n", VSI22_ACKTO_ERR_STR);
89f6b3
+	if (smi_err & (1 << VDP22_TXERR))
89f6b3
+		printf("\tInternal Error : %s\n", VSI22_TX_ERR_STR);
89f6b3
+}
89f6b3
+
89f6b3
+static void print_vsi(char **args, char **argvals, int numargs,
89f6b3
+		      bool err_flag)
89f6b3
+{
89f6b3
+	int i;
89f6b3
+
89f6b3
+	for (i = 0; i < numargs; i++) {
89f6b3
+		if (err_flag && (!strcmp(args[i], VSI22_ARG_HINTS_STR)))
89f6b3
+			print_vsi_err_msg(argvals[i]);
89f6b3
+		else {
89f6b3
+			printf("\t%s", args[i]);
89f6b3
+			printf(" = %s\n", argvals[i]);
89f6b3
+		}
89f6b3
+	}
89f6b3
+}
89f6b3
+
89f6b3
+int get_vsi_args(char *ibuf, bool print_err_code)
89f6b3
 {
89f6b3
 	int ioff = 0;
89f6b3
 	char **args;
89f6b3
 	char **argvals;
89f6b3
-	int numargs, i;
89f6b3
+	int numargs;
89f6b3
 	int ilen = strlen(ibuf);
89f6b3
 
89f6b3
 	/* count args and argvalus */
89f6b3
@@ -321,17 +408,14 @@ int get_vsi_args(char *ibuf)
89f6b3
 	}
89f6b3
 
89f6b3
 	numargs = get_arg_val_list(ibuf, ilen, &ioff, args, argvals);
89f6b3
-	for (i = 0; i < numargs; i++) {
89f6b3
-		printf("\t%s", args[i]);
89f6b3
-		printf(" = %s\n", argvals[i]);
89f6b3
-	}
89f6b3
+	print_vsi(args, argvals, numargs, print_err_code);
89f6b3
 
89f6b3
 	free(args);
89f6b3
 	free(argvals);
89f6b3
 	return ioff;
89f6b3
 }
89f6b3
 
89f6b3
-static void print_all_vsis(char *ibuf)
89f6b3
+static void print_all_vsis(char *ibuf, bool err_code, char *msg)
89f6b3
 {
89f6b3
 	size_t ilen = strlen(ibuf);
89f6b3
 	u16 vsi_len;
89f6b3
@@ -346,8 +430,11 @@ static void print_all_vsis(char *ibuf)
89f6b3
 		ilen -= 2 * sizeof(u16);
89f6b3
 		strncpy(tmp_ibuf, ibuf + offset, vsi_len);
89f6b3
 		tmp_ibuf[vsi_len] = '\0';
89f6b3
-		printf("%s %d:\n", "VSI ", vsi_cnt);
89f6b3
-		get_vsi_args(tmp_ibuf);
89f6b3
+		if (msg)
89f6b3
+			printf("%s\n", msg);
89f6b3
+		else
89f6b3
+			printf("%s %d:\n", "VSI ", vsi_cnt);
89f6b3
+		get_vsi_args(tmp_ibuf, err_code);
89f6b3
 		offset += vsi_len;
89f6b3
 		ilen -= vsi_len;
89f6b3
 		vsi_cnt++;
89f6b3
@@ -361,7 +448,7 @@ static void print_cmd_response(char *ibuf, int status)
89f6b3
 	int ioff;
89f6b3
 
89f6b3
 	if (status != cmd_success) {
89f6b3
-		printf("%s\n", print_status(status));
89f6b3
+		printf("FAILED: %s\n", print_status(status));
89f6b3
 		return;
89f6b3
 	}
89f6b3
 
89f6b3
@@ -385,7 +472,7 @@ static void print_cmd_response(char *ibuf, int status)
89f6b3
 
89f6b3
 	switch (cmd.cmd) {
89f6b3
 	case cmd_gettlv:
89f6b3
-		print_all_vsis(ibuf + ioff);
89f6b3
+		print_all_vsis(ibuf + ioff, false, NULL);
89f6b3
 		break;
89f6b3
 	case cmd_settlv:
89f6b3
 		printf("%s", ibuf + ioff);
89f6b3
@@ -423,6 +510,7 @@ static void vdp_print_response(char *buf, int status)
89f6b3
 static void vdp_print_event_msg(char *buf)
89f6b3
 {
89f6b3
 	printf("%s buf:%s\n", __func__, buf);
89f6b3
+	print_all_vsis(buf + CLIF_RSP_OFF, true, "Response from VDP");
89f6b3
 }
89f6b3
 
89f6b3
 /*
89f6b3
@@ -519,8 +607,8 @@ static const char *commands_help =
89f6b3
 "  -v|version show version\n"
89f6b3
 "  -p|ping    ping lldpad and query pid of lldpad\n"
89f6b3
 "  -q|quit    exit lldptool (interactive mode)\n"
89f6b3
-"  -t|get-tlv get tlvid value\n"
89f6b3
-"  -T|set-tlv set arg for tlvid to value\n";
89f6b3
+"  -t|get-vsi get VSI association(s)\n"
89f6b3
+"  -T|set-vsi set VSI association\n";
89f6b3
 
89f6b3
 static struct clif *clif_conn;
89f6b3
 static int cli_quit;
89f6b3
@@ -638,7 +726,7 @@ static int _clif_command(struct clif *clif, char *cmd, int print)
89f6b3
 	size_t len;
89f6b3
 	int ret;
89f6b3
 	int rc;
89f6b3
-	char reply[200];
89f6b3
+	char reply[MAX_CLIF_MSGBUF];
89f6b3
 	size_t reply_len2 = sizeof(reply);
89f6b3
 
89f6b3
 	print_raw_message(cmd, print);
89f6b3
@@ -653,7 +741,8 @@ static int _clif_command(struct clif *clif, char *cmd, int print)
89f6b3
 		printf("'%s' command timed out.\n", cmd);
89f6b3
 		return -2;
89f6b3
 	} else if (ret < 0) {
89f6b3
-		printf("'%s' command failed.\n", cmd);
89f6b3
+		printf("'%s' command failed with error %s.\n", cmd,
89f6b3
+			strerror(errno));
89f6b3
 		return -1;
89f6b3
 	}
89f6b3
 	if (print) {
89f6b3
@@ -662,10 +751,8 @@ static int _clif_command(struct clif *clif, char *cmd, int print)
89f6b3
 	}
89f6b3
 	if (cli_attached) {
89f6b3
 		rc = clif_vsievt(clif, reply, &reply_len2, 5);
89f6b3
-		printf("\nReturn from vsievt %d ret %d Reply %s\n", rc, ret,
89f6b3
-			reply);
89f6b3
 		if (!rc)
89f6b3
-			printf("\nMsg is %s\n", reply);
89f6b3
+			print_all_vsis(reply, true, "Response from VDP");
89f6b3
 	}
89f6b3
 
89f6b3
 	return ret;
89f6b3
@@ -739,10 +826,10 @@ static struct cli_cmd {
89f6b3
 	{ cmd_license,  "license",   cli_cmd_license },
89f6b3
 	{ cmd_version,  "version",   cli_cmd_version },
89f6b3
 	{ cmd_quit,     "quit",      cli_cmd_quit },
89f6b3
-	{ cmd_gettlv,   "gettlv",    vdp_cmd_gettlv },
89f6b3
-	{ cmd_gettlv,   "get-tlv",   vdp_cmd_gettlv },
89f6b3
-	{ cmd_settlv,   "settlv",    vdp_cmd_settlv },
89f6b3
-	{ cmd_settlv,   "set-tlv",   vdp_cmd_settlv },
89f6b3
+	{ cmd_gettlv,   "getvsi",    vdp_cmd_getvsi },
89f6b3
+	{ cmd_gettlv,   "get-vsi",   vdp_cmd_getvsi },
89f6b3
+	{ cmd_settlv,   "setvsi",    vdp_cmd_setvsi },
89f6b3
+	{ cmd_settlv,   "set-vsi",   vdp_cmd_setvsi },
89f6b3
 	{ cmd_nop,       NULL,       cli_cmd_nop }
89f6b3
 };
89f6b3
 
89f6b3
@@ -774,8 +861,8 @@ static struct option lldptool_opts[] = {
89f6b3
 	{"help", 0, NULL, 'h'},
89f6b3
 	{"version", 0, NULL, 'v'},
89f6b3
 	{"stats", 0, NULL, 'S'},
89f6b3
-	{"get-tlv", 0, NULL, 't'},
89f6b3
-	{"set-tlv", 0, NULL, 'T'},
89f6b3
+	{"get-vsi", 0, NULL, 't'},
89f6b3
+	{"set-vsi", 0, NULL, 'T'},
89f6b3
 	{"get-lldp", 0, NULL, 'l'},
89f6b3
 	{"set-lldp", 0, NULL, 'L'},
89f6b3
 	{0, 0, 0, 0}
89f6b3
-- 
89f6b3
2.1.0
89f6b3