From patchwork Wed Oct 19 14:47:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Iremonger, Bernard" X-Patchwork-Id: 16722 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 522447F18; Wed, 19 Oct 2016 16:47:48 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 273B67EEF for ; Wed, 19 Oct 2016 16:47:45 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP; 19 Oct 2016 07:47:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,514,1473145200"; d="scan'208";a="181477657" Received: from sivswdev01.ir.intel.com (HELO localhost.localdomain) ([10.237.217.45]) by fmsmga004.fm.intel.com with ESMTP; 19 Oct 2016 07:47:43 -0700 From: Bernard Iremonger To: dev@dpdk.org, daniels@research.att.com, wenzhuo.lu@intel.com, az5157@att.com Cc: Bernard Iremonger Date: Wed, 19 Oct 2016 15:47:34 +0100 Message-Id: <1476888454-13859-3-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1476818007-13659-1-git-send-email-daniels@research.att.com> References: <1476818007-13659-1-git-send-email-daniels@research.att.com> Subject: [dpdk-dev] [PATCH v2 2/2] app/test_pmd: change to the VF VLAN insert command X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The third parameter to the function rte_pmd_ixgbe_set_vf_vlan_insert has changed to vlan_id from on|off. The testpmd doc file has been changed to reflect this change. Signed-off-by: Bernard Iremonger --- app/test-pmd/cmdline.c | 19 +++++++++---------- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index e0e4fe4..15dbd2c 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -286,7 +286,7 @@ static void cmd_help_long_parsed(void *parsed_result, "set vf vlan stripq (port_id) (vf_id) (on|off)\n" " Set the VLAN strip for all queues in a pool for a VF from the PF.\n\n" - "set vf vlan insert (port_id) (vf_id) (on|off)\n" + "set vf vlan insert (port_id) (vf_id) (vlan_id)\n" " Set VLAN insert for a VF from the PF.\n\n" "set vf vlan antispoof (port_id) (vf_id) (on|off)\n" @@ -11017,7 +11017,7 @@ struct cmd_vf_vlan_insert_result { cmdline_fixed_string_t insert; uint8_t port_id; uint16_t vf_id; - cmdline_fixed_string_t on_off; + uint16_t vlan_id; }; /* Common CLI fields for vf vlan insert enable disable */ @@ -11045,10 +11045,10 @@ cmdline_parse_token_num_t cmd_vf_vlan_insert_vf_id = TOKEN_NUM_INITIALIZER (struct cmd_vf_vlan_insert_result, vf_id, UINT16); -cmdline_parse_token_string_t cmd_vf_vlan_insert_on_off = - TOKEN_STRING_INITIALIZER +cmdline_parse_token_num_t cmd_vf_vlan_insert_vlan_id = + TOKEN_NUM_INITIALIZER (struct cmd_vf_vlan_insert_result, - on_off, "on#off"); + vlan_id, UINT16); static void cmd_set_vf_vlan_insert_parsed( @@ -11058,14 +11058,13 @@ cmd_set_vf_vlan_insert_parsed( { struct cmd_vf_vlan_insert_result *res = parsed_result; int ret; - int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0; - ret = rte_pmd_ixgbe_set_vf_vlan_insert(res->port_id, res->vf_id, is_on); + ret = rte_pmd_ixgbe_set_vf_vlan_insert(res->port_id, res->vf_id, res->vlan_id); switch (ret) { case 0: break; case -EINVAL: - printf("invalid vf_id %d or is_on %d\n", res->vf_id, is_on); + printf("invalid vf_id %d or vlan_id %d\n", res->vf_id, res->vlan_id); break; case -ENODEV: printf("invalid port_id %d\n", res->port_id); @@ -11078,7 +11077,7 @@ cmd_set_vf_vlan_insert_parsed( cmdline_parse_inst_t cmd_set_vf_vlan_insert = { .f = cmd_set_vf_vlan_insert_parsed, .data = NULL, - .help_str = "set vf vlan insert port_id vf_id on|off", + .help_str = "set vf vlan insert port_id vf_id vlan_id", .tokens = { (void *)&cmd_vf_vlan_insert_set, (void *)&cmd_vf_vlan_insert_vf, @@ -11086,7 +11085,7 @@ cmdline_parse_inst_t cmd_set_vf_vlan_insert = { (void *)&cmd_vf_vlan_insert_insert, (void *)&cmd_vf_vlan_insert_port_id, (void *)&cmd_vf_vlan_insert_vf_id, - (void *)&cmd_vf_vlan_insert_on_off, + (void *)&cmd_vf_vlan_insert_vlan_id, NULL, }, }; diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index c04805b..9a45932 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -533,7 +533,7 @@ vlan set insert (for VF) Set VLAN insert for a VF from the PF:: - testpmd> set vf vlan insert (port_id) (vf_id) (on|off) + testpmd> set vf vlan insert (port_id) (vf_id) (vlan_id) vlan set antispoof (for VF) ~~~~~~~~~~~~~~~~~~~~~~~~~~~