From patchwork Mon Apr 23 11:32:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ophir Munk X-Patchwork-Id: 38690 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4D83D1DBA; Mon, 23 Apr 2018 13:33:02 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0073.outbound.protection.outlook.com [104.47.2.73]) by dpdk.org (Postfix) with ESMTP id 793161DB9 for ; Mon, 23 Apr 2018 13:33:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=kHQ/l+bBH5scnvkR4Z0iBN2BBV9is2x1PRiD286mBic=; b=g7chLyHiz4st0ryMDmZE+wkHNokyaW8nW2C1erUEwjNoQ4JfSFSbCxjk1fNMjjvircSWU81rUAr0d9ZJMYNP7Tk43m1DUweTSpPvbOAntgiAxSnAAdIlXPlIubvwJ4pWRc4iEFau9tiDx0BL5yDsv3ei/zOkwCO2G5CLhNa2lm4= Received: from HE1PR0501MB2314.eurprd05.prod.outlook.com (10.168.34.19) by HE1PR0501MB2794.eurprd05.prod.outlook.com (10.172.125.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.15; Mon, 23 Apr 2018 11:32:56 +0000 Received: from HE1PR0501MB2314.eurprd05.prod.outlook.com ([fe80::d405:aec8:cd2f:85cc]) by HE1PR0501MB2314.eurprd05.prod.outlook.com ([fe80::d405:aec8:cd2f:85cc%18]) with mapi id 15.20.0675.018; Mon, 23 Apr 2018 11:32:56 +0000 From: Ophir Munk To: Ferruh Yigit , Thomas Monjalon , 'Pascal Mazon' , "Mordechay Haimovsky" CC: "'dev@dpdk.org'" , Shahaf Shuler , Olga Shern , Raslan Darawsheh Thread-Topic: [dpdk-dev] [PATCH] net/tap: remove queue specific offload support Thread-Index: AQHTwgulVh6Szfl2KkaDY6VqSunfTqPyiLmAgArocYCACPHZAIAACtOwgAAVgoCABp108IABFj6AgAAC5vCAABlwgIAAEyzg Date: Mon, 23 Apr 2018 11:32:56 +0000 Message-ID: References: <20180322182843.105732-1-ferruh.yigit@intel.com> <2913888.DGWfva7bOG@xps> <33d0cd29-855e-58dd-683d-e540a7978515@intel.com> <67998c63-84fe-4c21-3ca5-df25d47929e6@intel.com> In-Reply-To: <67998c63-84fe-4c21-3ca5-df25d47929e6@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR0501MB2794; 7:/EvNbQ5EuOdHa4S86uQ2LIDiFBKJhI2hOb/td4AnKRvsRH1BCoKQoPsgWEZDoRSADf1GXAhGf5DGmerJ9W8mktC8Wqb7D8xsabbymuzUZFavQJDa3MmAJUAxwdFwiLYFvLrIj2NLCCO6Z6AGQj1n2LYe3dOCfGLCjRxdLlf18++cqthHhPpOcaUk7JdiwfL89yZZ8GOha6PpnZdtU6O7HAnjf9xjGEHLRT2BQRp65e7HxbsWfzGmIniNWGNVppMZ x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:HE1PR0501MB2794; x-ms-traffictypediagnostic: HE1PR0501MB2794: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(72170088055959)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231232)(944501410)(52105095)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:HE1PR0501MB2794; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2794; x-forefront-prvs: 06515DA04B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(39380400002)(346002)(396003)(366004)(13464003)(69234005)(6506007)(5660300001)(53546011)(74316002)(3846002)(6116002)(229853002)(59450400001)(305945005)(8936002)(8676002)(76176011)(81166006)(110136005)(26005)(5250100002)(316002)(54906003)(478600001)(6436002)(66066001)(25786009)(7736002)(6636002)(6246003)(186003)(4326008)(33656002)(55016002)(2900100001)(53936002)(107886003)(9686003)(7696005)(102836004)(86362001)(3660700001)(446003)(476003)(11346002)(3280700002)(2906002)(93886005)(575784001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2794; H:HE1PR0501MB2314.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; MLV:sfv; x-microsoft-antispam-message-info: XbtTpbvNi5qektS+z3KcmEkuIDC+KeFyW2NfbWyhaGSMwoVHwGmCI+k0CKw2SJY8j9Y0MzJqIpfZLfviCaOg8qrZ0WYnQLbQoTDJyMh9TrgIq6LPRtDTVwppmHWmpT/MJ7fpb+5u6hlY0gNmu84V/PndYgsoB9nSP1s6nuRXA/GAVr8cYlLxQ8ntol84DWIR spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 3f9f16ef-844e-4cbf-99ae-08d5a90df5e6 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f9f16ef-844e-4cbf-99ae-08d5a90df5e6 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2018 11:32:56.6273 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2794 Subject: Re: [dpdk-dev] [PATCH] net/tap: remove queue specific offload support 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" Hi Ferruh, The exact same setup works without your patch (done before sending my first email). I started debugging your patch and noticed you have dropped the setting of txq->csum which always remains 0 therefore [1] is never executed. I am adding a patch on top of yours which fixes this issue. FYI - I plan doing more tests to confirm that everything works as expected, then will update. Regards, Ophir > -----Original Message----- > From: Ferruh Yigit [mailto:ferruh.yigit@intel.com] > Sent: Monday, April 23, 2018 1:14 PM > To: Ophir Munk ; Thomas Monjalon > ; 'Pascal Mazon' ; > Mordechay Haimovsky > Cc: 'dev@dpdk.org' ; Shahaf Shuler > ; Olga Shern ; Raslan > Darawsheh > Subject: Re: [dpdk-dev] [PATCH] net/tap: remove queue specific offload > support > > On 4/23/2018 10:17 AM, Ophir Munk wrote: > > Hi Ferruh, > > A quick feedback to your patch on top of next-net/master: the IP and TCP > offloaded checksums are turned incorrect. > > Hi Ophir, > > Thanks for testing. > This patch removes queue specific offloads for tap but nothing touched on > port offloads, and in below test you are already using single queue. > > This may mean something is wrong in tap for port offloading configuration. > > Tap does csum calculation in Tx path [1], which does not even checks the > offloading flags, but mbuf->ol_flags. Any chance that mbuf->ol_flags is not > set correct? Can you able to make exact same setup work without this > patch? > > > [1] > if (txq->csum && > ((mbuf->ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_IPV4) || > (mbuf->ol_flags & PKT_TX_L4_MASK) == PKT_TX_UDP_CKSUM || > (mbuf->ol_flags & PKT_TX_L4_MASK) == PKT_TX_TCP_CKSUM))) { > /* Support only packets with all data in the same seg */ > if (mbuf->nb_segs > 1) > break; > /* To change checksums, work on a copy of data. */ > rte_memcpy(m_copy, rte_pktmbuf_mtod(mbuf, void *), > rte_pktmbuf_data_len(mbuf)); > tap_tx_offload(m_copy, mbuf->ol_flags, > mbuf->l2_len, mbuf->l3_len); > iovecs[1].iov_base = m_copy; > } > > > > > > Detailed description > > ================ > > A traffic generator is sending to a dpdk device one TCP packet and expects > to receive it back after the IP and TCP checksums have been calculated by > TAP. > > > > Testpmd parameters > > ================= > > testpmd -c 0x0f -n 4 --vdev="net_tap0,iface=net_vsc0,remote=ens2" -w > > 0000:00:00.0 -- --burst=64 --mbcache=512 --portmask 0x1 -i --txd=256 > > --rxd=256 --rxq=1 --txq=1 --coremask 0x008 --forward-mode=csum > > --eth-peer=0,00:15:5d:10:66:02 > > > > Testpmd CLI commands > > =================== > > testpmd> port stop all > > testpmd> csum set ip hw 0 > > testpmd> csum set tcp hw 0 > > testpmd> port start all > > testpmd> start > > > > On Traffic generator side > > ===================== > > A traffic generator (scapy) is sending 1261 bytes of a TCP packet > > > > Monitoring the traffic: > > > > tcpdump -i -envvv & > > > > The tcpdump output shows the sent packet followed by the received > packet. > > Please note the received packet has incorrect IP & TCP checksums (both > > are 0) > > > > 11:51:03.058623 00:15:5d:10:66:02 > f4:52:14:7a:59:81, ethertype IPv4 > (0x0800), length 1261: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto TCP > (6), length 1247) > > 127.0.0.1.1 > 127.0.0.1.1: Flags [S], cksum 0xdba5 (correct), seq > > 0:1207, win 8192, length 1207 > > > > 11:51:03.058836 f4:52:14:7a:59:81 > 00:15:5d:10:66:02, ethertype IPv4 > (0x0800), length 1261: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto TCP > (6), length 1247, bad cksum 0 (->7816)!) > > 127.0.0.1.1 > 127.0.0.1.1: Flags [S], cksum 0x0000 (incorrect -> > > 0xdba5), seq 0:1207, win 8192, length 1207 > > > > Regards, > > Ophir > > > >> -----Original Message----- > >> From: Ophir Munk > >> Sent: Monday, April 23, 2018 11:39 AM > >> To: 'Ferruh Yigit' ; Thomas Monjalon > >> ; Pascal Mazon ; > >> Mordechay Haimovsky > >> Cc: 'dev@dpdk.org' ; Shahaf Shuler > >> ; Olga Shern ; Raslan > >> Darawsheh > >> Subject: RE: [dpdk-dev] [PATCH] net/tap: remove queue specific > >> offload support > >> > >> Hi Ferruh, > >> I was able to apply your patch with Thomas help: > >> 1. git am --reject > >> 2. 3. git am --continue > >> > >> Regards, > >> Ophir > >> > >>> -----Original Message----- > >>> From: Ophir Munk > >>> Sent: Sunday, April 22, 2018 7:05 PM > >>> To: Ferruh Yigit ; Thomas Monjalon > >>> ; Pascal Mazon ; > >>> Mordechay Haimovsky > >>> Cc: dev@dpdk.org; Shahaf Shuler ; Olga Shern > >>> ; Raslan Darawsheh > >>> Subject: RE: [dpdk-dev] [PATCH] net/tap: remove queue specific > >>> offload support > >>> > >>> Hi Ferruh, > >>> I am not able to apply your patch on next-net/master branch. > >>> I am failing to apply it both on latest commit or just before > >>> 22-Mar-18 (commit's date). > >>> > >>> $ git am > >>> dpdk-dev-net-tap-remove-queue-specific-offload-support.patch > >>> Applying: net/tap: remove queue specific offload support > >>> error: patch failed: drivers/net/tap/rte_eth_tap.c:269 > >>> error: drivers/net/tap/rte_eth_tap.c: patch does not apply Patch > >>> failed at > >>> 0001 net/tap: remove queue specific offload support > >>> > >>> Please advise. > >>> > >>> Once this error is fixed I can verify your patch with high priority > >>> and send you my feedback. > >>> > >>> Regards, > >>> Ophir > >>> > >>>> -----Original Message----- > >>>> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com] > >>>> Sent: Wednesday, April 18, 2018 1:55 PM > >>>> To: Ophir Munk ; Thomas Monjalon > >>>> ; Pascal Mazon ; > >>>> Mordechay Haimovsky > >>>> Cc: dev@dpdk.org; Shahaf Shuler ; Olga > Shern > >>>> > >>>> Subject: Re: [dpdk-dev] [PATCH] net/tap: remove queue specific > >>>> offload support > >>>> > >>>> On 4/18/2018 10:40 AM, Ophir Munk wrote: > >>>>> Hi Ferruh, > >>>>> Sorry for the delayed response. > >>>>> > >>>>> I would like to verify the correctness of this patch by running > >>>>> several > >>>> internal tests. > >>>>> Is a reply by Monday OK with you? > >>>> > >>>> Monday can be late to include patch into rc1, any chance to do earlier? > >>>> > >>>>> > >>>>> Regards, > >>>>> Ophir > >>>>> > >>>>>> -----Original Message----- > >>>>>> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com] > >>>>>> Sent: Wednesday, April 18, 2018 11:59 AM > >>>>>> To: Thomas Monjalon ; Pascal Mazon > >>>>>> ; Mordechay Haimovsky > >>>> ; > >>>>>> Ophir Munk > >>>>>> Cc: dev@dpdk.org; Shahaf Shuler ; Olga > >>>>>> Shern > >>>>>> Subject: Re: [dpdk-dev] [PATCH] net/tap: remove queue specific > >>>>>> offload support > >>>>>> > >>>>>> On 4/12/2018 5:23 PM, Ferruh Yigit wrote: > >>>>>>> On 4/5/2018 6:49 PM, Thomas Monjalon wrote: > >>>>>>>> Pascal, Moti, Ophir, > >>>>>>>> please comment. > >>>>>>> > >>>>>>> Hi Moti, > >>>>>>> > >>>>>>> Any comment? This has been asked many times now. > >>>>>> > >>>>>> Hi Moti, Ophir, > >>>>>> > >>>>>> You have not responded why queue specific offload added in other > >>>> thread. > >>>>>> And you are not responding to this patch... > >>>>>> > >>>>>> Hi Pascal, > >>>>>> > >>>>>> If you also have no objection, this patch is going in. > >>>>>> > >>>>>> Thanks, > >>>>>> ferruh > >>>>>> > >>>>>> > >>>>>>> > >>>>>>>> > >>>>>>>> 22/03/2018 19:28, Ferruh Yigit: > >>>>>>>>> It is not clear if tap PMD supports queue specific offloads, > >>>>>>>>> removing the related code. > >>>>>>>>> > >>>>>>>>> Fixes: 95ae196ae10b ("net/tap: use new Rx offloads API") > >>>>>>>>> Fixes: 818fe14a9891 ("net/tap: use new Tx offloads API") > >>>>>>>>> Cc: motih@mellanox.com > >>>>>>>>> > >>>>>>>>> Signed-off-by: Ferruh Yigit > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>> > >>>>> > > diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index a0b8922..19c7ba0 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -1108,7 +1108,13 @@ enum ioctl_mode { return -1; dev->data->tx_queues[tx_queue_id] = &internals->txq[tx_queue_id]; txq = dev->data->tx_queues[tx_queue_id]; - + if (tx_conf != NULL && + !!(tx_conf->txq_flags & ETH_TXQ_FLAGS_IGNORE)) { + txq->csum = !!(tx_conf->offloads & + (DEV_TX_OFFLOAD_IPV4_CKSUM | + DEV_TX_OFFLOAD_UDP_CKSUM | + DEV_TX_OFFLOAD_TCP_CKSUM)); + } ret = tap_setup_queue(dev, internals, tx_queue_id, 0); if (ret == -1) return -1;