From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id EE31CA0679 for ; Fri, 5 Apr 2019 14:04:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6208A1B4C1; Fri, 5 Apr 2019 14:04:16 +0200 (CEST) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by dpdk.org (Postfix) with ESMTP id DBFD81B4C0 for ; Fri, 5 Apr 2019 14:04:14 +0200 (CEST) Received: by mail-pg1-f176.google.com with SMTP id y3so2959825pgk.12 for ; Fri, 05 Apr 2019 05:04:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=65PTcDOdVrZIcIX1O98NQobb5V8SL1pSTJyI2KBJcgo=; b=un41f30/hFq9ioYria6ofGM+2ZDlq49Zw5bsWtGK8/w2nK8nMZLaCwB3T5nTxDy1zK 5EAEUMcAbT/SQm9zj4wd0nF9LJS1xLuVXojYzGXeAJtVMPfNnB1Ar4KzI/iOnqEUxIP+ K5LHo9Okol75BNYI4W+WBq4QOm8VJwb9qhfygRWsyAtb63G+d0B6dTv4GOW/0BwGeXV6 PlU8/rO6GqDKv/B33vrtLoOpY6mEyAeKDRJcPHtPfOnDFSJ+86GFf6qM8iUToIDlulsT A29ejtE+tpp6t2gTcOuFvUVO10WIOW/7BsPnMuslyYSJ8FUOVUfZskw5FrqUkSAuELXu MaGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=65PTcDOdVrZIcIX1O98NQobb5V8SL1pSTJyI2KBJcgo=; b=BjXDq0UbiaO+Kxa5ZcJrIOGlBdg4TtIgwZ042dyIoQhEMil0A2EyIPY7UBYKUMO9o3 pphCcYOsxnP6mdi3aMyKeWfHxDms1qWPqjWmdom83HA7TSo8QglYxxYXA6Kpl0n8nUO+ iR3rYf7vvmbuMhCgePZ9Hp215WiC03AVDw0ULPJ6DWMl6rogd6hLtg0dkIn1aj/UCUAI yDrGxk6nkM4VZgXIF6ORUA1eesdZHJHKcj1HsJLjRXFJD7I0cU5lJwB5q2NDqsylcl6w 4QUW6bWaN6NALNdG7Xpfjma3CtUYSYCW7JauOEeRxR7DdPMARZGrdAald7ZG/LEptI2H vbng== X-Gm-Message-State: APjAAAWjgFmmZyTUinZCx0oRiwUi78nM6JI7s2YEVGjz1kmyMD2vjgi2 tj3XZfer3c9GAL60JJ/aAic= X-Google-Smtp-Source: APXvYqwjho5/vwe5Zh9fjc6CpewpUviT60fcE0PwbcTZwMgxoUsFiveQW29PsRQQ7Fypm2yy/ShIgg== X-Received: by 2002:a65:65c5:: with SMTP id y5mr11380474pgv.192.1554465854012; Fri, 05 Apr 2019 05:04:14 -0700 (PDT) Received: from hyd1434t5810.caveonetworks.com ([115.113.156.2]) by smtp.gmail.com with ESMTPSA id r87sm33786816pfa.71.2019.04.05.05.04.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Apr 2019 05:04:13 -0700 (PDT) From: Nithin Dabilpuram To: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger Cc: Ferruh Yigit , dev@dpdk.org, Wang Xiao W , Nithin Dabilpuram Date: Fri, 5 Apr 2019 17:34:02 +0530 Message-Id: <20190405120403.5446-1-nithind1988@gmail.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20190219064840.12046-1-ndabilpuram@marvell.com> References: <20190219064840.12046-1-ndabilpuram@marvell.com> Subject: [dpdk-dev] [PATCH v4 1/2] app/testpmd: fix Tx VLAN and QinQ dependency X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190405120402.M8PAhqGLDofCy9KCczudZxILNLTv5X5uhTF4gJXz6LU@z> From: Nithin Dabilpuram Tx VLAN & QinQ insert enable need not depend on Rx VLAN offload ETH_VLAN_EXTEND_OFFLOAD. For Tx VLAN insert enable, error check is now to see if QinQ was enabled but only single VLAN id is set. Fixes: 6a34f91690d0 ("app/testpmd: fix error message when setting Tx VLAN") Cc: xiao.w.wang@intel.com Signed-off-by: Nithin Dabilpuram Acked-by: Bernard Iremonger --- v4: * Resend v3 from different mailserver to avoid CRLF v3: * Add back error check in tx_vlan_set() to check if QinQ is already enabled. Also fix headline. v2: * Split change into two seperate patches as suggested. app/test-pmd/config.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index cadcb51..010e26d 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2962,7 +2962,6 @@ vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type, uint16_t tp_id) void tx_vlan_set(portid_t port_id, uint16_t vlan_id) { - int vlan_offload; struct rte_eth_dev_info dev_info; if (port_id_is_invalid(port_id, ENABLED_WARN)) @@ -2970,8 +2969,8 @@ tx_vlan_set(portid_t port_id, uint16_t vlan_id) if (vlan_id_is_invalid(vlan_id)) return; - vlan_offload = rte_eth_dev_get_vlan_offload(port_id); - if (vlan_offload & ETH_VLAN_EXTEND_OFFLOAD) { + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_QINQ_INSERT) { printf("Error, as QinQ has been enabled.\n"); return; } @@ -2990,7 +2989,6 @@ tx_vlan_set(portid_t port_id, uint16_t vlan_id) void tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer) { - int vlan_offload; struct rte_eth_dev_info dev_info; if (port_id_is_invalid(port_id, ENABLED_WARN)) @@ -3000,11 +2998,6 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer) if (vlan_id_is_invalid(vlan_id_outer)) return; - vlan_offload = rte_eth_dev_get_vlan_offload(port_id); - if (!(vlan_offload & ETH_VLAN_EXTEND_OFFLOAD)) { - printf("Error, as QinQ hasn't been enabled.\n"); - return; - } rte_eth_dev_info_get(port_id, &dev_info); if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_QINQ_INSERT) == 0) { printf("Error: qinq insert not supported by port %d\n", -- 2.8.4