From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D894EA0C53; Wed, 25 Aug 2021 12:48:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC89E40041; Wed, 25 Aug 2021 12:48:50 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 30C614003D; Wed, 25 Aug 2021 12:48:49 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10086"; a="217502220" X-IronPort-AV: E=Sophos;i="5.84,350,1620716400"; d="scan'208";a="217502220" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2021 03:48:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,350,1620716400"; d="scan'208";a="527211915" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP; 25 Aug 2021 03:48:48 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Wed, 25 Aug 2021 03:48:47 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Wed, 25 Aug 2021 03:48:47 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.47) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Wed, 25 Aug 2021 03:48:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n1jza9VS+nnmiuMx2wsk3/9XMokF+k+Ma0erT24wLQCdffBK+Pqx3Y/pgjm0cHovoT4sFvXtwff2ld/JkEKIx75WZkRhiFSb6ij/WGw7BfZKNAkx6vaTFlyXZrGUyx6d3kzLTZCKT9bd1FXMzdSuU3hKK4FALHrGogxyTAyQHBsYBjUbe87dg/OTzruFGoJclxDr/TCEhb5Q57qX+TufeMsGYGpSCibgS8KJhCBJjHmf5pkhsTOPXB08ScD2RWYdMw7/71eCdmqmEvMWCaQT3UMBtfsNWBPuWdHK9nZaq6D9eSoLmMYg/6Q2surD25Ha8DXIO/GNeR1TeH5ixkLKsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sdeezz7Q42jH6NIkJ9zlY9OLhsvf6XJO3Ed8yjZQat8=; b=Rq5MfFMC9QLiB18p+MxU2HkS41XyucDyzLVExqUEFd99LEc9U2ee0/RGP3EqVUdUBbdsfWW9A5Ri8ogyWZHHANYDB4EMlbOzKx8e+KdP0SRjq6zVbaxtrU7WekLucLXr+Tvow8uyQf4gMgZ0p2QWJKmjcHXnHWlxZXtyIkNh+avx80ItOua7l2trVKPFUteNQX9jHADn+mT/nUcV9p651nsUZk75TS3a7tHgc9dYxcfu3hydstjzodW2kQe4gEtBEfu0MrXSf/XMG/YI2s7YBjVQYePBdnDtW9tgg8CZOEF9bbEAd7LZV94dWR8I1WaXLgLvzN7fxJolBc64AEyw/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sdeezz7Q42jH6NIkJ9zlY9OLhsvf6XJO3Ed8yjZQat8=; b=GbIcH4CAWVu9wFNi8cdt4wpsb3s233Kd4PauoIkoIf/sBykClcmMadqoTWHa+6nYM+v8dRPrZPMDlofNsQn42z4P4vFbXv6tkSpFzfGf9xSj2rGXk0uCSa2SfhN6IfjEiRCHnvAgeJJQbX/YByDBFDZ1ihTuPuu1bafdVJqNsu0= Received: from PH0PR11MB4791.namprd11.prod.outlook.com (2603:10b6:510:43::10) by PH0PR11MB5174.namprd11.prod.outlook.com (2603:10b6:510:3b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Wed, 25 Aug 2021 10:48:43 +0000 Received: from PH0PR11MB4791.namprd11.prod.outlook.com ([fe80::dc7a:b39d:76db:2a4d]) by PH0PR11MB4791.namprd11.prod.outlook.com ([fe80::dc7a:b39d:76db:2a4d%5]) with mapi id 15.20.4436.027; Wed, 25 Aug 2021 10:48:43 +0000 From: "Loftus, Ciara" To: Baruch Siach , "Zhang, Qi Z" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v2] net/af_xdp: fix zero copy Tx queue drain Thread-Index: AQHXmZj4nxl18rmyOE2lS54yD8pn46uECS4g Date: Wed, 25 Aug 2021 10:48:43 +0000 Message-ID: References: <8a03128cb9edeeaa747f74aca60d6a8b9f5c4f8e.1629885944.git.baruch@tkos.co.il> In-Reply-To: <8a03128cb9edeeaa747f74aca60d6a8b9f5c4f8e.1629885944.git.baruch@tkos.co.il> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: tkos.co.il; dkim=none (message not signed) header.d=none;tkos.co.il; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4bf67686-6cd9-4cdd-38c5-08d967b5e85a x-ms-traffictypediagnostic: PH0PR11MB5174: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: eFGjVslBPS4uSOnM9oY1xW3Su6YPMpKc5eJ4XGcyaD8UBuK9gN+OuMf1MSzEevxAxMTINvc/FcdwhJCizi8vAWFqE5X7EWi2WXQK/aHlVob0/h3qMc/6GKfNsg+bSniKhzwNdqJBqGlv7/l0kQkdbDvDOFAbxUhQNOitqVTHTsBbGYNSTYYWDCgVx5HTwJ+GAoLghBbZWLqqQm1YslZth7djPC278yNfdkH422KWbTjrPEOgAGrElojzANw0yuzpY206LHZAHsz4Rpuhj56nuylmZgK8X48aZi81EWaH4T12KkeZCPUn7gB4K1Bu/yxKrvMqMIcIVeu2laXYCbwdye3hHNU1qU2z3wHnKo8SJIQlKUK72Zh5c8hNCZw7Wxx2HsSDMS43xk4C2M9ee5i1/X9FbyTGZUjvHpDTt51YOMgLgOre0XirlAD21otMLyFACMCm7VMz7B0YniaSg/0d8J2OzCF8WYh6YqcyIaybj19Uftd4BriYu2ubT5GBH+5GxPjvQN4I2vz8S0JnXOTk0M1Xc+iRUzJiZvpfTjnyjPgoMysAcqgfJ3/GLQ6+U3zpIzVUSmj7UDcyG+nfZ91n4FddcuWabhEv1+GVufMGerTw3jvdTiYSb7pzJmag6QBwDpZ/wp+5Ah3zY2m3eCj63GnapYvwIp6EksxDhX6KeCtxAyTeGih7DkTPMVdfgBW3apg3t+EbpAEoA0g+i1xm7Q== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB4791.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(8676002)(66476007)(55016002)(76116006)(4326008)(66446008)(64756008)(83380400001)(66556008)(122000001)(508600001)(38100700002)(52536014)(86362001)(26005)(33656002)(2906002)(6636002)(7696005)(71200400001)(6506007)(110136005)(8936002)(5660300002)(54906003)(316002)(66946007)(38070700005)(9686003)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?pXvifCPEW+0D+Vu5I1jfvBgkUdOfxg/dLRk5DwgP8OGzIIbXtBOpeWjX/yoY?= =?us-ascii?Q?J4qdE/zZ4pU8VSXyGYeSvtPx+dG+YhbdqbmC6ZdUNtZ/fMx7AOumaufotmtf?= =?us-ascii?Q?ApmoYjSm5k4J8GgWW7udvQhX9cG36x0tDWvNk8n1B9Tt8sZWJ0GVN+ybCHeg?= =?us-ascii?Q?9LKwjeiIvCFUgovHjKoAKkmmigJl95t8+NTJd3MBs4zKKgoPRhlgMj5jcXoT?= =?us-ascii?Q?6/WvC9m8fF3OWkupr0Wh109RyOOocKSean99D1PsGCbLNnwe+FsZD9U7D0Fa?= =?us-ascii?Q?EEeImgbjqVgr824XAHHVKb7y3hhw5ESS/oPP5nmzIJLgAofsZEk2rUea80KT?= =?us-ascii?Q?FGsQX+Tllrlhr8ow7Eyb9getm3hNRbfnvlO4WuNyW4W18LejgZLYMVklFlRq?= =?us-ascii?Q?B/d6qAF/l858YKDucZfdI7JpvTfNnHXrb0p8j1u65nmvz8ktmHmfrCEb/wmy?= =?us-ascii?Q?M7VtQi0j2VAU3ALHlrzN2kpVbssZ4Fzutc1PRegw9OIQDvz/PpX1WZj2myq1?= =?us-ascii?Q?ruWk+qU590bYYjF4trJvq3xwTEmE5Kfx6gFEFdxIrJJ0U8Cz3pu5OQrc4zhW?= =?us-ascii?Q?JKC2nVdCuy5Abgyff+iVUeUfpQA4SIjSi98Iw8Wp5bos9zqGKYLvsT5SoFzh?= =?us-ascii?Q?qgLB1dOY4XpbNFaDLZyPUCcQbvyuOYW0JSEHn16fVWa7jBMgec45od7RpD29?= =?us-ascii?Q?EEHKlasZfvI7lT8xDGghps/elyTee4CMZJMMgQPRwr42oXl/ZfHJRFOXVSer?= =?us-ascii?Q?wshQaFpQFZ7l6rSdKuNawVp79res9b8+igLyiyUafMTj/LVPjGx5HdLXv10s?= =?us-ascii?Q?lnUhBeOaw3wnhsgDAdPCPwU6HDcXb3PxrjiEn3DVuLbLKtST+gTUV3TaN0c/?= =?us-ascii?Q?/VVs7DC80VOITUxqt81L4yk05rxhy3TxbPBmUJ+XjiO7oJGTN5zA9AFUoTbf?= =?us-ascii?Q?e5J8A1jk7VOm2Ixmepyo2JUKIBn+zg2X9eS4h4h5PvTKSUUscoO2/UTyTxW5?= =?us-ascii?Q?DtmY/bC4cUGFc9Z0ZCAQ84HzpW2uwft/AM/pr6KACipoxaOllPIJv6Gs4r02?= =?us-ascii?Q?ASXuS0ZtRDLdQHD5GmoQs7WmzYeU65ARJ9WkcKwyrXe5CHePSKGe2ccnJUsS?= =?us-ascii?Q?+SZVbE4rIkUBqVJ5nYSAqegMMPWYZpJSwxtVeyh7IZUDd7hG4+qAHj0u1Vb5?= =?us-ascii?Q?RtdaKM+xlPI7slwUi1eQikqyvgOKSS38GwQ3HvO125TNauFK1aOh8+J4IpnB?= =?us-ascii?Q?1qDf85d4JH3tX03qLMrfUfhSlGs5+SGNCV7b0kGyYHv52/wfjPZ9K1o3t9oQ?= =?us-ascii?Q?B3MbefLQos/9TIpXLX9t5YOG?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB4791.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4bf67686-6cd9-4cdd-38c5-08d967b5e85a X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Aug 2021 10:48:43.3011 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yDChdswLxvirJR4i4DDoUkisAEQKTU+bZfIi4WGzXwt1pbvL6ytFc6bU2Dw5Wo9HQSGA1KRAn35hPtQ5wrw+IA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5174 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2] net/af_xdp: fix zero copy Tx queue drain X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" >=20 > Call xsk_ring_prod__submit() before kick_tx() so that the kernel > consumer sees the updated state of Tx ring. Otherwise, Tx packets are > stuck in the ring until the next call to af_xdp_tx_zc(). >=20 > Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks") > Cc: stable@dpdk.org >=20 > Signed-off-by: Baruch Siach Thanks for respinning. I tested it out and it looks good to me. Acked-by: Ciara Loftus > -- > v2: >=20 > Don't call xsk_ring_prod__submit() when kick_tx() is only used to > drain the completion queue (Ciara Loftus) > --- > drivers/net/af_xdp/rte_eth_af_xdp.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >=20 > diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c > b/drivers/net/af_xdp/rte_eth_af_xdp.c > index 74ffa4511284..9bea0a895a3e 100644 > --- a/drivers/net/af_xdp/rte_eth_af_xdp.c > +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c > @@ -527,7 +527,6 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs, > uint16_t nb_pkts) >=20 > if (!xsk_ring_prod__reserve(&txq->tx, 1, &idx_tx)) { > rte_pktmbuf_free(local_mbuf); > - kick_tx(txq, cq); > goto out; > } >=20 > @@ -551,10 +550,9 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs, > uint16_t nb_pkts) > tx_bytes +=3D mbuf->pkt_len; > } >=20 > - kick_tx(txq, cq); > - > out: > xsk_ring_prod__submit(&txq->tx, count); > + kick_tx(txq, cq); >=20 > txq->stats.tx_pkts +=3D count; > txq->stats.tx_bytes +=3D tx_bytes; > -- > 2.32.0