From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 13240A00E6 for ; Wed, 7 Aug 2019 15:29:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C2DB22C18; Wed, 7 Aug 2019 15:29:44 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00045.outbound.protection.outlook.com [40.107.0.45]) by dpdk.org (Postfix) with ESMTP id 043682C02 for ; Wed, 7 Aug 2019 15:29:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gh1msdmIC/y8HWOtRPxATXK+0gXsIoHlZo39HZAMm3bEIDcyphofkNVBnHyGUsRwQKTlVNDYjRlQUMUtGnn+RbqKz5bW27NjChGAK7vBsdn2SAyIfDnj+xqLpqCVgvdaQJMnnWg/nQGV9+xlzQcVDfq4OccZFagjdTW9CNR3FPfmr1RZSrzGSeTU2gBWiB3lUfg/RBJsmoCcftR4XqQ6GaTz0l3PIOukZ+/7hyz9LfsQDA2FCleEF55UA3vKibCaO4sNjKW4CdZNT6ErhsRcIyNuUpfZzSR/1Uhzs4uErIOrcz5RRmuqYTMdWbyhLnENfhxlKlGau66PNNDRzP9/1Q== 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=E1kMKHbbZZPoK7HS8rMTTezjtxO8+baO2vZXujRODUc=; b=Glqu1t9Fvkf35qzQreDqqrxgUnklLLwC3KLGil99siWu61at0cq36zXdxoPXlHWMB8WUH5cpzUHl7XUXkh/jDBgvLofOMRWoxLrfPeRDe37hUF8vDoobDZi4EGrqZfSQncI+1xtMnyTHi45nsU6sxgQyUXfHazaZ16I2/0qjFQ1QlzxKzIjosxgG/rVbl1+CzTDjSzQ40Xa9UiJXk0ls1oxc7WhxfFpLA4Lrdq0o1MyAi4ZGr1hi0/ouPKfiwG5Y73x7g0zVIs8FNuzEj648D+R6r+oIxNPctMEdhE8zcV5uXdPiGzsOAEtC0bH6Nw5lIBTfmftL1nmMiVkNqvSNNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=mellanox.com;dmarc=pass action=none header.from=mellanox.com;dkim=pass header.d=mellanox.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E1kMKHbbZZPoK7HS8rMTTezjtxO8+baO2vZXujRODUc=; b=cWJV5/H+/gB4XCsSzZUat39+FtMKqp9WkW7WfuAyzTiWmJggr3q2Rg6e2fpeHQzRuUNDvML6edaWj66bO0dPmpch6GdMPE8xRflIywJwIsJ07PlTqBZh9r+FYVNaIiBuyInTNwXNZTVaE6wjCFlUBGZeICkboScFg18xqhlwt4o= Received: from DB3PR0502MB3964.eurprd05.prod.outlook.com (52.134.65.161) by DB3PR0502MB3962.eurprd05.prod.outlook.com (52.134.67.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.17; Wed, 7 Aug 2019 13:29:42 +0000 Received: from DB3PR0502MB3964.eurprd05.prod.outlook.com ([fe80::b4f2:f531:d3ff:b7e3]) by DB3PR0502MB3964.eurprd05.prod.outlook.com ([fe80::b4f2:f531:d3ff:b7e3%5]) with mapi id 15.20.2136.018; Wed, 7 Aug 2019 13:29:42 +0000 From: Raslan Darawsheh To: Slava Ovsiienko , "dev@dpdk.org" CC: Yongseok Koh , Shahaf Shuler Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix completion request for multi-segment packets Thread-Index: AQHVTR/M3IeJ07bwEkmBg3haNbUbiKbvrfsw Date: Wed, 7 Aug 2019 13:29:41 +0000 Message-ID: References: <1565182690-10740-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1565182690-10740-1-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; x-originating-ip: [212.29.221.74] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8d77c8d3-85d5-4218-ee5b-08d71b3b4de7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:DB3PR0502MB3962; x-ms-traffictypediagnostic: DB3PR0502MB3962: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 01221E3973 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(346002)(39860400002)(376002)(396003)(366004)(13464003)(189003)(199004)(71190400001)(476003)(486006)(33656002)(2906002)(8936002)(25786009)(68736007)(14454004)(446003)(6116002)(3846002)(478600001)(186003)(11346002)(71200400001)(26005)(4326008)(256004)(14444005)(66476007)(66556008)(64756008)(86362001)(66946007)(229853002)(55016002)(76116006)(6246003)(53936002)(99286004)(9686003)(316002)(54906003)(110136005)(107886003)(102836004)(76176011)(6506007)(6436002)(66066001)(53546011)(305945005)(7736002)(74316002)(52536014)(2501003)(66446008)(81166006)(81156014)(7696005)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3962; H:DB3PR0502MB3964.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: IyhOzU4tzN7jT3B4FWmAAUA1lWRNRdHofyayKT1SqOG+jTqMO3+b23Kp5VQ1cjcFYyMBQFG5DvC4ajjtxNaekfW+gPVIGCaDSJiq2qSsEI8+1D296LIsdJXgzokuJmlGAi5Qqic/f/P/CTokNMvVIkWtDB2SDlqgXWm2i2VbKvmselTH9hVRV8og4zgH9C1U9ejvXmtyH2+65Tl357MpByfsIJStCre1ggrTK/SeP6Uxv7m7YECHIo4v3BmM0laiZHODkOJif8z07+zInCMzf/tagczhGrgD28+b5D0W+rPuzCZDeN8OoDuB2SqWwwcmAsHfq9cds3xgAt3OCwmiI9DVSMvOuC44isMictKA7R/QQfVlbhLZlwodie1R5OFLjUitncoRlRrrwBpOrafCL004ul8YML7DY+smJM890OY= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d77c8d3-85d5-4218-ee5b-08d71b3b4de7 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Aug 2019 13:29:41.8911 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rasland@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3962 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix completion request for multi-segment packets 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, > -----Original Message----- > From: dev On Behalf Of Viacheslav Ovsiienko > Sent: Wednesday, August 7, 2019 3:58 PM > To: dev@dpdk.org > Cc: Yongseok Koh ; Shahaf Shuler > > Subject: [dpdk-dev] [PATCH] net/mlx5: fix completion request for multi- > segment packets >=20 > The copying of sent mbufs pointers might be deferred to the end of > tx_burst() routine to be copied in one call of rte_memcpy. > For the multi segment packets this optimization is not applicable, > because number of packets does not match with number of mbufs and > we do not have linear array of pointers in pkts parameter. >=20 > The completion request generating routine wrongly took into account > the inconsistent (for multi-segment packets) deferred pointer copying. >=20 > Fixes: 5a93e173b874 ("net/mlx5: fix Tx completion request generation") >=20 > Signed-off-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_rxtx.c | 23 ++++++++++++++--------- > 1 file changed, 14 insertions(+), 9 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c > index 3e51bb0..4c01187 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.c > +++ b/drivers/net/mlx5/mlx5_rxtx.c > @@ -2130,6 +2130,9 @@ enum mlx5_txcmp_code { > * Pointer to TX queue structure. > * @param loc > * Pointer to burst routine local context. > + * @param multi, > + * Routine is called from multi-segment sending loop, > + * do not correct the elts_head according to the pkts_copy. > * @param olx > * Configured Tx offloads mask. It is fully defined at > * compile time and may be used for optimization. > @@ -2137,12 +2140,14 @@ enum mlx5_txcmp_code { > static __rte_always_inline void > mlx5_tx_request_completion(struct mlx5_txq_data *restrict txq, > struct mlx5_txq_local *restrict loc, > + bool multi, > unsigned int olx) > { > uint16_t head =3D txq->elts_head; > unsigned int part; >=20 > - part =3D MLX5_TXOFF_CONFIG(INLINE) ? 0 : loc->pkts_sent - loc- > >pkts_copy; > + part =3D (MLX5_TXOFF_CONFIG(INLINE) || multi) ? > + 0 : loc->pkts_sent - loc->pkts_copy; > head +=3D part; > if ((uint16_t)(head - txq->elts_comp) >=3D MLX5_TX_COMP_THRESH > || > (MLX5_TXOFF_CONFIG(INLINE) && > @@ -3091,7 +3096,7 @@ enum mlx5_txcmp_code { > txq->wqe_ci +=3D (ds + 3) / 4; > loc->wqe_free -=3D (ds + 3) / 4; > /* Request CQE generation if limits are reached. */ > - mlx5_tx_request_completion(txq, loc, olx); > + mlx5_tx_request_completion(txq, loc, true, olx); > return MLX5_TXCMP_CODE_MULTI; > } >=20 > @@ -3201,7 +3206,7 @@ enum mlx5_txcmp_code { > txq->wqe_ci +=3D (ds + 3) / 4; > loc->wqe_free -=3D (ds + 3) / 4; > /* Request CQE generation if limits are reached. */ > - mlx5_tx_request_completion(txq, loc, olx); > + mlx5_tx_request_completion(txq, loc, true, olx); > return MLX5_TXCMP_CODE_MULTI; > } >=20 > @@ -3359,7 +3364,7 @@ enum mlx5_txcmp_code { > txq->wqe_ci +=3D (ds + 3) / 4; > loc->wqe_free -=3D (ds + 3) / 4; > /* Request CQE generation if limits are reached. */ > - mlx5_tx_request_completion(txq, loc, olx); > + mlx5_tx_request_completion(txq, loc, true, olx); > return MLX5_TXCMP_CODE_MULTI; > } >=20 > @@ -3570,7 +3575,7 @@ enum mlx5_txcmp_code { > ++loc->pkts_sent; > --pkts_n; > /* Request CQE generation if limits are reached. */ > - mlx5_tx_request_completion(txq, loc, olx); > + mlx5_tx_request_completion(txq, loc, false, olx); > if (unlikely(!pkts_n || !loc->elts_free || !loc->wqe_free)) > return MLX5_TXCMP_CODE_EXIT; > loc->mbuf =3D *pkts++; > @@ -3728,7 +3733,7 @@ enum mlx5_txcmp_code { > txq->wqe_ci +=3D (ds + 3) / 4; > loc->wqe_free -=3D (ds + 3) / 4; > /* Request CQE generation if limits are reached. */ > - mlx5_tx_request_completion(txq, loc, olx); > + mlx5_tx_request_completion(txq, loc, false, olx); > } >=20 > /* > @@ -3772,7 +3777,7 @@ enum mlx5_txcmp_code { > txq->wqe_ci +=3D (len + 3) / 4; > loc->wqe_free -=3D (len + 3) / 4; > /* Request CQE generation if limits are reached. */ > - mlx5_tx_request_completion(txq, loc, olx); > + mlx5_tx_request_completion(txq, loc, false, olx); > } >=20 > /** > @@ -3965,7 +3970,7 @@ enum mlx5_txcmp_code { > loc->wqe_free -=3D (2 + part + 3) / 4; > pkts_n -=3D part; > /* Request CQE generation if limits are reached. */ > - mlx5_tx_request_completion(txq, loc, olx); > + mlx5_tx_request_completion(txq, loc, false, olx); > if (unlikely(!pkts_n || !loc->elts_free || !loc->wqe_free)) > return MLX5_TXCMP_CODE_EXIT; > loc->mbuf =3D *pkts++; > @@ -4440,7 +4445,7 @@ enum mlx5_txcmp_code { > ++loc->pkts_sent; > --pkts_n; > /* Request CQE generation if limits are reached. */ > - mlx5_tx_request_completion(txq, loc, olx); > + mlx5_tx_request_completion(txq, loc, false, olx); > if (unlikely(!pkts_n || !loc->elts_free || !loc->wqe_free)) > return MLX5_TXCMP_CODE_EXIT; > loc->mbuf =3D *pkts++; > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh