From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 05E5B2A62; Mon, 24 Apr 2017 12:24:47 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP; 24 Apr 2017 03:24:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,244,1488873600"; d="scan'208";a="960393099" Received: from sivswdev01.ir.intel.com (HELO localhost.localdomain) ([10.237.217.45]) by orsmga003.jf.intel.com with ESMTP; 24 Apr 2017 03:24:44 -0700 From: Bernard Iremonger To: dev@dpdk.org Cc: beilei.xing@intel.com, qi.zhang@intel.com, Bernard Iremonger , stable@dpdk.org Date: Mon, 24 Apr 2017 11:24:37 +0100 Message-Id: <1493029477-27106-1-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1492701258-7968-1-git-send-email-bernard.iremonger@intel.com> References: <1492701258-7968-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-stable] [PATCH v2] app/testpmd: check port is stopped for QinQ setup X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Apr 2017 10:24:48 -0000 Check port is stopped before configuring it for QinQ, with the "vlan set qinq on " command. The above command sets the hw_vlan_extend flag. When the port is started it calls the i40e_rx_vec_dev_conf_condition_check_default function to decide whether or not to select the vector mode driver depending on the state of the hw_vlan_extend flag. Fixes: a47aa8b97afe ("app/testpmd: add vlan offload support") Cc: stable@dpdk.org Signed-off-by: Bernard Iremonger Acked-by: Beilei Xing --- Changes in v2: Rebased to latest dpdk-next-net revised commit message. add Fixes and Cc lines. app/test-pmd/cmdline.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index f6bd75b78..a96b8b67c 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2017 Intel Corporation. All rights reserved. * Copyright(c) 2014 6WIND S.A. * All rights reserved. * @@ -3036,6 +3036,7 @@ cmd_vlan_offload_parsed(void *parsed_result, int i, len = 0; portid_t port_id = 0; unsigned int tmp; + struct rte_port *port; str = res->port_id; len = strnlen(str, STR_TOKEN_SIZE); @@ -3053,6 +3054,7 @@ cmd_vlan_offload_parsed(void *parsed_result, if(tmp >= RTE_MAX_ETHPORTS) return; port_id = (portid_t)tmp; + port = &ports[port_id]; if (!strcmp(res->on, "on")) on = 1; @@ -3079,9 +3081,13 @@ cmd_vlan_offload_parsed(void *parsed_result, } else if (!strcmp(res->what, "filter")) rx_vlan_filter_set(port_id, on); - else + else { + if (port->port_status != RTE_PORT_STOPPED) { + printf("Please stop port %d first\n", port_id); + return; + } vlan_extend_set(port_id, on); - + } return; } -- 2.11.0