From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0047.outbound.protection.outlook.com [104.47.41.47]) by dpdk.org (Postfix) with ESMTP id A434C201; Mon, 12 Nov 2018 19:19:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IFE9vV3FaqaF3zKAxejuwKUSHfxbiFqkfO1PX/RiHcM=; b=eURM7XwIbJ0dkajiyHTW6Fa9L4INg+mb593yhKudfoMQR/5ogsypE4AdcPRjCTvp9XgJvwequMO/nYnxOQWFHD10CnH+H37Kv3NmILj8khAZ7AheLCyOfu5ZdHvkc8CV6movwNKnIwEhNaHMjafWVyOx2235gs4LOg5PyVBsp6w= Received: from BYAPR07MB5365.namprd07.prod.outlook.com (20.177.125.18) by BYAPR07MB4840.namprd07.prod.outlook.com (52.135.204.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Mon, 12 Nov 2018 18:19:38 +0000 Received: from BYAPR07MB5365.namprd07.prod.outlook.com ([fe80::4012:e217:427e:320b]) by BYAPR07MB5365.namprd07.prod.outlook.com ([fe80::4012:e217:427e:320b%3]) with mapi id 15.20.1294.044; Mon, 12 Nov 2018 18:19:38 +0000 From: "Mody, Rasesh" To: "dev@dpdk.org" CC: "Shaikh, Shahed" , "ferruh.yigit@intel.com" , Dept-Eng DPDK Dev , "stable@dpdk.org" Thread-Topic: [PATCH] net/qede: fix Tx tunnel offload notsup mask Thread-Index: AQHUerRFQlogmFsj40ia9Btkt0YwTQ== Date: Mon, 12 Nov 2018 18:19:38 +0000 Message-ID: <1542046761-2895-1-git-send-email-rasesh.mody@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR01CA0017.prod.exchangelabs.com (2603:10b6:a02:80::30) To BYAPR07MB5365.namprd07.prod.outlook.com (2603:10b6:a03:64::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Rasesh.Mody@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [198.186.1.5] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BYAPR07MB4840; 6:WsHVK9lLhaT7zdEtpejh7aAYnpelXkEykHy4ybdlEmJ53DJCZNLucITKwypIQOIte3ty6cLKWBr4+l6m32aolGXaRhPUK+Xlp6/wgUyr+awlwCGtcnMKX23C3yXz5h8cFNOGBOmeeRnXRy7ifPpxrx85KBM3nxbGw+SF/xblRua8S+Rzdrv5HiaBMCvZabbnDEE3ve9+bhV5uQ4gR/SxOxPGAgH90CQjyhf28w+Ha+kHyOf/PNyCMzOrqezA0Ug3IE5OKstltBDkAY3sOyrLC2k/Z/e4wKbKah03LrnyfuIpYlNs6Y9a1oZF4YyMMBE02iVUcUOVbCmtFzCDNMfBsAk6KJtN5lJhYZVzfg20a4Xa48zvcQVPYKzqSel8hjblOmARUHIg3Lzll2qjppW9131cj8tOe9V7rhDuCV8u/g1MV8LUmZUpvV4azyJzSdULwMB3vTFK/rYFrvXWyKocRg==; 5:Pi+Yziuq86cw2A14aLA7evMhjkeL43m1KB6JWrxT4gFdEF1d7o1Ak4o9tGKKMNFaccuzs+CE6N554oLYNkd2nZ55MfiAEiGu3qxDPJYeele77JIwDdH0cMOdm2Y2dtTe7Bq3q/ZcLdDiUC6vN6xl9lQOO6+7sKKQQiQzMak/Wf8=; 7:nwMPVZsp9eFTaN1fG17oE/Fewme0iKVMkyn/QRvI/F/AJOEtSyJTdHe0Fb3bJx8Vl2XPOpH5GXlyyWh86TV4YMhsaSHFzaISD/FRjoYa08tVYxfhsBktiKGo79nmKStIco+YUtbxhCcKPokyn4q1yQ== x-ms-office365-filtering-correlation-id: c04b25a8-f758-4297-0346-08d648cb67c5 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB4840; x-ms-traffictypediagnostic: BYAPR07MB4840: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823302103)(3231382)(944501410)(52105112)(3002001)(93006095)(93001095)(10201501046)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:BYAPR07MB4840; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB4840; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(366004)(396003)(39860400002)(136003)(199004)(189003)(99286004)(66066001)(2351001)(2906002)(54906003)(6506007)(5640700003)(6436002)(71200400001)(71190400001)(478600001)(256004)(386003)(2501003)(97736004)(102836004)(2616005)(3846002)(52116002)(6486002)(6116002)(316002)(476003)(36756003)(486006)(72206003)(106356001)(305945005)(1857600001)(14454004)(7736002)(6512007)(25786009)(26005)(53936002)(4326008)(6916009)(8936002)(186003)(68736007)(5660300001)(8676002)(105586002)(2900100001)(1730700003)(81166006)(86362001)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB4840; H:BYAPR07MB5365.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: /vq9wpmKHlnyc+jMFmLuFJOoAdUYHjuz/kAwO7m03rntnKx7uSu/U2isBWwJhVF8rJpqXLOL0xLaJEqKVZf3b0qtu6OVWNg/hXEaq0yEVzvD5E03jFhgKiMRSHF174T+Qvj2RkL1mA75qCeOpvCDfc/AvDLfS7CmprdyvLRkRGUWnogO1tF2b4JFg/mRytMUaCj5ira1J9SGCVZr4Z1RoldwB0MPRLbR6kisYq8GvLX24oCr5uNPmqbzPTNkfr+z5WbuifBQgqu5eeEVqOs7nrCrYX59PZ2irYPSdocQcO1hMLUgQsfUwbvso0b1DQpVzqrLaUh4c13qTE9oktPhuNFdPnVWZ4UH3SiZqK3YfKg= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: c04b25a8-f758-4297-0346-08d648cb67c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 18:19:38.1673 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4840 Subject: [dpdk-dev] [PATCH] net/qede: fix Tx tunnel offload notsup mask 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: Mon, 12 Nov 2018 18:19:42 -0000 From: Shahed Shaikh Tunneling offloads are represented by multi-bit values. So, feature wise tunneling offload can only be entirely supported/unsupported using PKT_TX_TUNNEL_MASK. Its upon PMDs to further isolate which of the tunneling offload types are supported by respective PMD. Using subset of bits from PKT_TX_TUNNEL_MASK to indicate supported vs unsupported offloads can lead to undesired result. Use PKT_TX_TUNNEL_MASK in QEDE_TX_OFFLOAD_MASK and use independent value of supported PKT_TX_TUNNEL_* in .tx_pkt_prepare() to mark supported tunnel offloads. Fixes: 44346c24b790 ("net/qede: fix VXLAN tunnel Tx offload flag setting") Cc: stable@dpdk.org Suggested-by: Ferruh Yigit Signed-off-by: Shahed Shaikh Reviewed-by: Rasesh Mody --- drivers/net/qede/qede_rxtx.c | 12 ++++++++++++ drivers/net/qede/qede_rxtx.h | 5 +---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index 8a4772f..7d24742 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -1759,6 +1759,18 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(= uint16_t flags) } } if (ol_flags & QEDE_TX_OFFLOAD_NOTSUP_MASK) { + /* We support only limited tunnel protocols */ + if (ol_flags & PKT_TX_TUNNEL_MASK) { + uint64_t temp; + + temp =3D ol_flags & PKT_TX_TUNNEL_MASK; + if (temp =3D=3D PKT_TX_TUNNEL_VXLAN || + temp =3D=3D PKT_TX_TUNNEL_GENEVE || + temp =3D=3D PKT_TX_TUNNEL_MPLSINUDP || + temp =3D=3D PKT_TX_TUNNEL_GRE) + break; + } + rte_errno =3D -ENOTSUP; break; } diff --git a/drivers/net/qede/qede_rxtx.h b/drivers/net/qede/qede_rxtx.h index d3a41e9..0afadd8 100644 --- a/drivers/net/qede/qede_rxtx.h +++ b/drivers/net/qede/qede_rxtx.h @@ -153,10 +153,7 @@ =20 #define QEDE_TX_OFFLOAD_MASK (QEDE_TX_CSUM_OFFLOAD_MASK | \ PKT_TX_VLAN_PKT | \ - PKT_TX_TUNNEL_VXLAN | \ - PKT_TX_TUNNEL_GENEVE | \ - PKT_TX_TUNNEL_MPLSINUDP | \ - PKT_TX_TUNNEL_GRE) + PKT_TX_TUNNEL_MASK) =20 #define QEDE_TX_OFFLOAD_NOTSUP_MASK \ (PKT_TX_OFFLOAD_MASK ^ QEDE_TX_OFFLOAD_MASK) --=20 1.7.10.3