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 7936AA0521; Tue, 3 Nov 2020 09:13:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 58504C7EE; Tue, 3 Nov 2020 09:13:08 +0100 (CET) Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by dpdk.org (Postfix) with ESMTP id E21E0C7EC; Tue, 3 Nov 2020 09:13:05 +0100 (CET) Received: from HKMAIL101.nvidia.com (Not Verified[10.18.92.77]) by nat-hk.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 03 Nov 2020 16:13:03 +0800 Received: from HKMAIL103.nvidia.com (10.18.16.12) by HKMAIL101.nvidia.com (10.18.16.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 3 Nov 2020 08:12:53 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) by HKMAIL103.nvidia.com (10.18.16.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 3 Nov 2020 08:12:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kcUYtz1874yQ6BQYncnahAtxFCIkOqIKBNXGDDju/GLwh7wPDOemsjnBxIyDm19J9w7S6ixodRzi8WU5GXpVjFAXHtOIF+Yo7m6w3HMCt0zWjaPgspgHtMJg0g4qn6Oveq+zNFKEjSo8CO+S3TxUrHhx/0wSiyFY+nj3FeR2FDIo+3HVQxcwPzk3MgP2bfqEQDaxa/N1uR/l+0N78MmNj5bNXzYExBVhxJvOh3vyKWWu7gd85iK9jePYsAMlZBL3hG9D+DSPQnLlBFynwCtYUWHkgr8F3O9rUJfIjzPpjiBl6giIJCenP6qm5HikgAt1k7JG4o6PpAhukMObVfpLVQ== 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=cyEWudujvBGP/GFK7OeEryvcKhdLEPLHBc5Ct5As4Go=; b=V1flMmG7UpYgYc/v4bShoxm9Lbv1mer81FLZKHTHNcY/t1/5nuA7tm+bhm5o2FQxBwMVsMs5g9vg+BBeFRTTHcACG9ZeWJ+3y6mD2Cvt2LHIo5/Qwdu7QHImeySbu7vd8B64I7NksyT74e/BGzIxeI/UezUU9XivwXVBeGgtbqh5yZ2mka2gYw5qoudNwkOGCtPJPckXOzSreuAbBiMHYBzH9NoFjsV/XRdjUvbMqVgxV1pbXyD8ylfaBHR+XJqG66TOGPOqnGB9f1V5nBHmig6r9SD6kpZmjrQ1rse91BknzwUsAM4bt4Py8UNpc24tpCOeysmTaxjk8LtqqptYVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from MWHPR12MB1501.namprd12.prod.outlook.com (2603:10b6:301:f::18) by MW3PR12MB4538.namprd12.prod.outlook.com (2603:10b6:303:55::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Tue, 3 Nov 2020 08:12:51 +0000 Received: from MWHPR12MB1501.namprd12.prod.outlook.com ([fe80::ec4d:f17d:402c:78b4]) by MWHPR12MB1501.namprd12.prod.outlook.com ([fe80::ec4d:f17d:402c:78b4%6]) with mapi id 15.20.3499.030; Tue, 3 Nov 2020 08:12:51 +0000 From: Slava Ovsiienko To: NBU-Contact-Thomas Monjalon , "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , "david.marchand@redhat.com" , "bruce.richardson@intel.com" , "olivier.matz@6wind.com" , "andrew.rybchenko@oktetlabs.ru" , "jerinj@marvell.com" , "stable@dpdk.org" , Matan Azrad , Shahaf Shuler , Ori Kam Thread-Topic: [PATCH v3 06/16] net/mlx5: fix dynamic mbuf offset lookup check Thread-Index: AQHWsXZWs4CYZ+xn+0yGRB5TWo+TrKm2D0jQ Date: Tue, 3 Nov 2020 08:12:51 +0000 Message-ID: References: <20201029092751.3837177-1-thomas@monjalon.net> <20201103001407.2931963-1-thomas@monjalon.net> <20201103001407.2931963-7-thomas@monjalon.net> In-Reply-To: <20201103001407.2931963-7-thomas@monjalon.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: babd51e8-6db9-4bdd-d5ed-08d87fd0424c x-ms-traffictypediagnostic: MW3PR12MB4538: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RsBLVSA3/VQXdxMxdQXVZBBk4RW89b8PF2G4hQXii5dMv2sgplKGamkxTZH2kYgdrPdyww4aIh1KstzlPtLal1pyQZcLEmgvVN3Yq2j0RVK7yrBdHRGM4jaPvDjNDXlyHXQjYLdPNWXxXtG/PK72w7LfVWilc/G1cRsjBk+kwZxmBDE/lPXu53iKu40lN5VSk36T48oNGXDogBU9VQa5kRPiS03iMfsdQ6kU7XpnrYXli1c1Qp/4fWSZj/7ge129AvQ9eKKhjz2xROvhCwSBQWqlUoXpnDmH8NUwlbzaQYhq7pcTNFcW3zxSLGOeqsAbZVzWe5I028fXXIzyPvVdSg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR12MB1501.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(346002)(396003)(376002)(39860400002)(366004)(86362001)(2906002)(9686003)(54906003)(83380400001)(8936002)(110136005)(316002)(5660300002)(33656002)(52536014)(107886003)(8676002)(7696005)(4326008)(6506007)(53546011)(186003)(26005)(71200400001)(478600001)(76116006)(55016002)(66556008)(66476007)(64756008)(66446008)(66946007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: ewTrbfOPUITtsAYUozHg87JpcsFuk7TUBhfd9q0HfLnq0XbU23oxcLJRwUKU0bz7ukG2kHT4rRMldqS138L4k/nECG2bwI2Std3tpg6r6lwvlbQAymtAO8VDqvJDfFG1Kc+n13wEceiUFp8sBPTQLw4uZFf2uEodzTgfEjBMuoGdrHDxZ1nI+BYh0EiKho6eBbLscyPnzVRyHQQxCkPq/jMqw7StpmA3PSq/X1nEBbXsQgufS17sb1QcMpWIihtpS93dWD0CquuvCekGtZPl+u995sZFkh8R9kQSQqLoC3GOE+xJz4rYWTK0AaK6gzOnF1vEP9Iz/S0woIY8kNdxnwy3UpjNyv33RKUCciiuZZBusipCDjFNYBGJnel5ZApMPJKF7lUkNJwpMhkN6uTuS1qNC/T7bOCsWyWtdDNbFxP0lKIsS/cKrCEOu9ctJoaADBoRehfa9H8YsB+IL8ExXLW9DXQxq6APjAPJ+7gQjAe+gelrob7Bf0qU8DlTk6P1WDkcRtiH1cX9POCDFCd4h3hgj9KuuYwlQik+Jx415BqfSsNPH2jCCaYa/NmBYDq728rlqDXFXl+Z6VsJrJLkxz/NLUG9ObN0MZYuUwKkAFLEDJfoX/xB0LTy8SoV6XnMmL1aFOtSDL1/ITKSXwtTiQ== 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: MWHPR12MB1501.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: babd51e8-6db9-4bdd-d5ed-08d87fd0424c X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2020 08:12:51.4462 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0rFlzPTP0AaLvMefjkq1jmSTzFVm6iJa+Qaxy2xt389MaxUa4VCVCEzoLt9hw0FB79gAzO9nX7TZzvQ4EHzevA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4538 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1604391183; bh=cyEWudujvBGP/GFK7OeEryvcKhdLEPLHBc5Ct5As4Go=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To: CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-ld-processed: x-ms-exchange-transport-forked:x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers:x-ms-exchange-senderadcheck: x-microsoft-antispam:x-microsoft-antispam-message-info: x-forefront-antispam-report:x-ms-exchange-antispam-messagedata: Content-Type:Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=UBBoG8Y4JMNzdB0om2jOqA5hMjuzi08jasDnQZ0jzipKqQQ2Cw3gkdViGM9BNUeFM /r9OmcnIqTDlbrzj7seB/4EfJJQ10x1ZkYzcajH3JEMWnZRJJcRa0E4IJUJ5D8co3k gP2gTITRiKFnEBF2/1H4yzCCtW6ci7DNPQed/ds9kRdmNBkyTD23St8J1zZxyfa+pU QMftH6aktg90diX9LNE9p/C2hRVVp4wKFVtJtisBzeZBnNWKP2XXifwxAXJBweNVHB uCAmn93UqXza99sg1ulu/n3g6isRRO65v2DZwwd8oLGeic2tzDOabrxaLdGHUtnQ4O SGqefx5qnxAcA== Subject: Re: [dpdk-dev] [PATCH v3 06/16] net/mlx5: fix dynamic mbuf offset lookup check 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" > -----Original Message----- > From: Thomas Monjalon > Sent: Tuesday, November 3, 2020 2:14 > To: dev@dpdk.org > Cc: ferruh.yigit@intel.com; david.marchand@redhat.com; > bruce.richardson@intel.com; olivier.matz@6wind.com; > andrew.rybchenko@oktetlabs.ru; jerinj@marvell.com; Slava Ovsiienko > ; stable@dpdk.org; Matan Azrad > ; Shahaf Shuler ; Ori Kam > > Subject: [PATCH v3 06/16] net/mlx5: fix dynamic mbuf offset lookup check >=20 > The functions rte_mbuf_dynfield_lookup() and rte_mbuf_dynflag_lookup() ca= n > return an offset starting with 0 or a negative error code. >=20 > In reality the first offsets are probably reserved forever, but for the s= ake of > strict API compliance, the checks which considered 0 as an error are fixe= d. >=20 > Fixes: efa79e68c8cd ("net/mlx5: support fine grain dynamic flag") > Fixes: 3172c471b86f ("net/mlx5: prepare Tx queue structures to support > timestamp") > Fixes: 0febfcce3693 ("net/mlx5: prepare Tx to support scheduling") > Cc: stable@dpdk.org >=20 > Signed-off-by: Thomas Monjalon Acked-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_rxtx.c | 4 ++-- > drivers/net/mlx5/mlx5_trigger.c | 2 +- > drivers/net/mlx5/mlx5_txq.c | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c = index > b530ff421f..e86468b67a 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.c > +++ b/drivers/net/mlx5/mlx5_rxtx.c > @@ -5661,9 +5661,9 @@ mlx5_select_tx_function(struct rte_eth_dev *dev) > } > if (tx_offloads & DEV_TX_OFFLOAD_SEND_ON_TIMESTAMP && > rte_mbuf_dynflag_lookup > - (RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME, NULL) > > 0 && > + (RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME, NULL) > >=3D 0 && > rte_mbuf_dynfield_lookup > - (RTE_MBUF_DYNFIELD_TIMESTAMP_NAME, NULL) > > 0) { > + (RTE_MBUF_DYNFIELD_TIMESTAMP_NAME, NULL) >=3D > 0) { > /* Offload configured, dynamic entities registered. */ > olx |=3D MLX5_TXOFF_CONFIG_TXPP; > } > diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trig= ger.c > index 7735f022a3..917b433c4a 100644 > --- a/drivers/net/mlx5/mlx5_trigger.c > +++ b/drivers/net/mlx5/mlx5_trigger.c > @@ -302,7 +302,7 @@ mlx5_dev_start(struct rte_eth_dev *dev) > DRV_LOG(DEBUG, "port %u starting device", dev->data->port_id); > fine_inline =3D rte_mbuf_dynflag_lookup > (RTE_PMD_MLX5_FINE_GRANULARITY_INLINE, NULL); > - if (fine_inline > 0) > + if (fine_inline >=3D 0) > rte_net_mlx5_dynf_inline_mask =3D 1UL << fine_inline; > else > rte_net_mlx5_dynf_inline_mask =3D 0; > diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c in= dex > af84f5f72b..8ed2bcff7b 100644 > --- a/drivers/net/mlx5/mlx5_txq.c > +++ b/drivers/net/mlx5/mlx5_txq.c > @@ -1305,7 +1305,7 @@ mlx5_txq_dynf_timestamp_set(struct rte_eth_dev > *dev) >=20 > (RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME, NULL); > off =3D rte_mbuf_dynfield_lookup > (RTE_MBUF_DYNFIELD_TIMESTAMP_NAME, > NULL); > - if (nbit > 0 && off >=3D 0 && sh->txpp.refcnt) > + if (nbit >=3D 0 && off >=3D 0 && sh->txpp.refcnt) > mask =3D 1ULL << nbit; > for (i =3D 0; i !=3D priv->txqs_n; ++i) { > data =3D (*priv->txqs)[i]; > -- > 2.28.0