From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 2CCB35B12 for ; Tue, 19 Feb 2019 07:49:06 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1J6ioTf012264; Mon, 18 Feb 2019 22:49:05 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=GvQXhMib5i7SutHmS1Hdb0mmoDMeg8XApvtuyhLi2Tk=; b=ItLdhmRhBoV1NAwBlDg2bPlYWS91fBah4oDndOLVcQI34GA2kWEbvOiDarsUCkE8Q3cf 5N3Elc3FwgS0wUVNttYajwu8tlH2tMzycJSeci4+EBFIuO8sdDbmB//ia+cB+MDVDYBD KLo7KnvFUInfH6H0/txwfaRn/IPhlLl8NMNnitywcWeFf8j0UWJxpThwtIBpzD9Htkyg OuxKd8QuC7CxXss7/Ieol9hX7OmyFvOTbXTW+H4VEknm6mTXct9jnAd/+BHtRZ2k06q3 msMVc7X5kBR2ublqyVYyYzdLpAusNjNwKXKNHRX8HLsVMiBiWKg81R5P3zZ3jrTdYoMm rA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2qqvcpk323-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 18 Feb 2019 22:49:04 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 18 Feb 2019 22:49:04 -0800 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.51) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 18 Feb 2019 22:49:03 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GvQXhMib5i7SutHmS1Hdb0mmoDMeg8XApvtuyhLi2Tk=; b=TsNuQ1rzzVUNZcPdVbuo/eBtG4dkCcwGkXw1IZ/1IBzkw/oaMujHn70SWlPkJESaVnVUKjsLL8Kwc+FTlF97rrAgfCJHWrQXcBFCKxZG063QFSrnU05ziOuFcnp7zMFMceLYz+Mna538RBSlSipXWB/q0wtRQH2N7vgn+95Pvco= Received: from DM6PR18MB2427.namprd18.prod.outlook.com (20.179.104.21) by DM6PR18MB2441.namprd18.prod.outlook.com (20.179.104.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Tue, 19 Feb 2019 06:48:59 +0000 Received: from DM6PR18MB2427.namprd18.prod.outlook.com ([fe80::74b7:e3be:245b:939b]) by DM6PR18MB2427.namprd18.prod.outlook.com ([fe80::74b7:e3be:245b:939b%2]) with mapi id 15.20.1622.016; Tue, 19 Feb 2019 06:48:59 +0000 From: Nithin Kumar Dabilpuram To: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger CC: "dev@dpdk.org" , Jerin Jacob Kollanukkaran , Nithin Kumar Dabilpuram Thread-Topic: [PATCH] app/testpmd: fix tx vlan and qinq insert enable Thread-Index: AQHUyB8xvPsY7XJ5Z06xHDvRcovRww== Date: Tue, 19 Feb 2019 06:48:59 +0000 Message-ID: <20190219064840.12046-1-ndabilpuram@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PN1PR01CA0085.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::25) To DM6PR18MB2427.namprd18.prod.outlook.com (2603:10b6:5:180::21) x-mailer: git-send-email 2.8.4 x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 345baffd-1650-4055-c3af-08d696365374 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:DM6PR18MB2441; x-ms-traffictypediagnostic: DM6PR18MB2441: x-microsoft-exchange-diagnostics: 1; DM6PR18MB2441; 20:/WIuaycOCTpVKkXJXebteO8c/3DX4rqe2BTaEyU84L7fFA0D3+4H1zHOONXJxsnqobKVkyRYpHHhoKBNTt+87kLZRS6JGl5kLs0PsIebZdpDGO7wNzCmygAgFpZ69ZUREmRJMTrd1DR39BevDUvEMclmH+05FBfkTy3wV38yMsE= x-microsoft-antispam-prvs: x-forefront-prvs: 09538D3531 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(256004)(102836004)(6512007)(486006)(110136005)(97736004)(2616005)(50226002)(305945005)(316002)(476003)(6506007)(26005)(36756003)(99286004)(81156014)(8936002)(66066001)(81166006)(54906003)(53936002)(186003)(1076003)(2906002)(105586002)(52116002)(5660300002)(55236004)(6116002)(106356001)(8676002)(478600001)(86362001)(107886003)(386003)(6436002)(71200400001)(25786009)(68736007)(14454004)(6486002)(71190400001)(3846002)(7736002)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR18MB2441; H:DM6PR18MB2427.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: V0x3+ax0uwXH7B0eCBQfoOAHiJUPHu/taAyIUEzuB54XPeIBvByIjZjEJXaR1SxnV6jyNR7aLlY6+G7ZrropuYlAFC8DIeCvZgpiY5Bs5iaBhpGs/aUUvCcXLxt1/fEH9rHRwvd9bYrI2JeOSNpyUrILQFXNgGkQ0O4BIgEzVYZ4zR/xchnxsCLqSXs3Btlf6RcLEcZCIaKOA0rubf5oRA3/w5C7+m3C36lc6Skz27ozLKmPIwhExKEGgrT+ytqDg3TlkWdpSvMPHKlVzbCoQwcBIsFyo3avSZSnFJa8rnuG1ilAS05pXER2dK1tITlfV3Ebs+la/0uuKy2SCRts/CJG2a5wdDx1jnPzDCCtx84lOv+Ubzc610/rcGBa7jHjIn+ZiBk/ZDHrsGUASFZIvttdEV9+xHEHByYfahlcqJI= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 345baffd-1650-4055-c3af-08d696365374 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2019 06:48:57.0520 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB2441 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-19_04:, , signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902190052 Subject: [dpdk-dev] [PATCH] app/testpmd: fix tx vlan and qinq insert enable 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: , X-List-Received-Date: Tue, 19 Feb 2019 06:49:06 -0000 Tx VLAN & QinQ insert enable need not depend on Rx VLAN offload ETH_VLAN_EXTEND_OFFLOAD. Also enable DEV_TX_OFFLOAD_VLAN_INSERT for tx_qinq_set() as it takes both vlan id's. Signed-off-by: Nithin Dabilpuram --- app/test-pmd/config.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index b9e5dd9..0243f07 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2955,7 +2955,6 @@ vlan_tpid_set(portid_t port_id, enum rte_vlan_type vl= an_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; =20 if (port_id_is_invalid(port_id, ENABLED_WARN)) @@ -2963,11 +2962,6 @@ tx_vlan_set(portid_t port_id, uint16_t vlan_id) if (vlan_id_is_invalid(vlan_id)) return; =20 - vlan_offload =3D rte_eth_dev_get_vlan_offload(port_id); - if (vlan_offload & ETH_VLAN_EXTEND_OFFLOAD) { - printf("Error, as QinQ has been enabled.\n"); - return; - } rte_eth_dev_info_get(port_id, &dev_info); if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VLAN_INSERT) =3D=3D 0) { printf("Error: vlan insert is not supported by port %d\n", @@ -2983,7 +2977,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; =20 if (port_id_is_invalid(port_id, ENABLED_WARN)) @@ -2993,11 +2986,6 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint= 16_t vlan_id_outer) if (vlan_id_is_invalid(vlan_id_outer)) return; =20 - vlan_offload =3D 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) =3D=3D 0) { printf("Error: qinq insert not supported by port %d\n", @@ -3006,7 +2994,8 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint1= 6_t vlan_id_outer) } =20 tx_vlan_reset(port_id); - ports[port_id].dev_conf.txmode.offloads |=3D DEV_TX_OFFLOAD_QINQ_INSERT; + ports[port_id].dev_conf.txmode.offloads |=3D (DEV_TX_OFFLOAD_VLAN_INSERT = | + DEV_TX_OFFLOAD_QINQ_INSERT); ports[port_id].tx_vlan_id =3D vlan_id; ports[port_id].tx_vlan_id_outer =3D vlan_id_outer; } --=20 2.8.4