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 D634EA04E7; Mon, 2 Nov 2020 06:08:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0F0DB5AA6; Mon, 2 Nov 2020 06:08:33 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2085.outbound.protection.outlook.com [40.107.21.85]) by dpdk.org (Postfix) with ESMTP id 5F2BE5A8C for ; Mon, 2 Nov 2020 06:08:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OEwjwLV/v3AL4P/Cgz0PvwsRH/0OXnl5CW7xbK7wHPY=; b=tT/5jasuM/2gUh6wpypNqPlICfEvlt7uHF95p1ceQh7yFKShuCagq0SJLCBC7BTEwFwVJZMCujsD8Y4niDYeKvhDJ2J56WzX8Dh8pp7hA8qvrW0otYxF48ynb6E6GRuiDc6LMEO6AT1mERt+E3i3oYY4KhSGRWZStqEb/MU7b5k= Received: from DB6PR07CA0002.eurprd07.prod.outlook.com (2603:10a6:6:2d::12) by DB6PR0801MB2070.eurprd08.prod.outlook.com (2603:10a6:4:77::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Mon, 2 Nov 2020 05:08:25 +0000 Received: from DB5EUR03FT063.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:2d:cafe::ad) by DB6PR07CA0002.outlook.office365.com (2603:10a6:6:2d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.10 via Frontend Transport; Mon, 2 Nov 2020 05:08:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT063.mail.protection.outlook.com (10.152.20.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3520.15 via Frontend Transport; Mon, 2 Nov 2020 05:08:24 +0000 Received: ("Tessian outbound 68da730eaaba:v64"); Mon, 02 Nov 2020 05:08:24 +0000 X-CR-MTA-TID: 64aa7808 Received: from 611a5be68a9e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3370235E-E2E9-4801-B6B2-3C8D759C76C3.1; Mon, 02 Nov 2020 05:08:19 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 611a5be68a9e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 02 Nov 2020 05:08:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eYm63Hpnq0vz8maUX6eHKtBCle69TuQu/SOiz/8iXRlYJ45CniPyin1NZoRzxVosq2ABVdx9cRW/AFdDCqP7syYCE42oK2rOptG1f+pawXD6xhcC2dHYgZw3PaCbEuWViph2QwPq3YqgQ5MjUeIyNw4swLpJb8d3pIcJ+H3TDCN/c72tG99e5IjklrP83ECzH/qxa/53263plYpNdKit1Z29TgQlFLbkCH8Ag88xmdSJuTzk7Vc4GIvVwQre6O24pWrieEqQmZXV2XZNnyv+NJfNPKFHxQ/0+PR0NrIYCjscL6ulMshrD08ox7oAhWnmSvg+CgkkbKbh03uAatSZZg== 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=OEwjwLV/v3AL4P/Cgz0PvwsRH/0OXnl5CW7xbK7wHPY=; b=Xl2CPJuiaZ8Tjo0GnW2BN+u6LeBRA96nHsNLcp4OSnU89NRH28AZBZXiL+6a4Y3xx7zUsHyHzo76twtanyJ53AkuqNgEOIMZH+LKP+7Qs+VCXOsLSI2dy/nwMQW3nsPDC2cEQdpN31DkbQKEVfTGVlz8Rphk3kJkOq5VBSe3/MC5XttC8Wip3prynq3UlVgvQW9rXnAOFobJlvGwF+7EsTUIpizj9Ie1uFiXWuMx1aeJGDyla4nb+KLh7zHZ2wdXyHVHbOrA8rdr33eav7/vmLBt9wFu6aIjNjfvX84Q6C6xZy3ZlH+iW8yvZuMTjdS6L0AZ0M1QIUKLOO2KeuLnDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OEwjwLV/v3AL4P/Cgz0PvwsRH/0OXnl5CW7xbK7wHPY=; b=tT/5jasuM/2gUh6wpypNqPlICfEvlt7uHF95p1ceQh7yFKShuCagq0SJLCBC7BTEwFwVJZMCujsD8Y4niDYeKvhDJ2J56WzX8Dh8pp7hA8qvrW0otYxF48ynb6E6GRuiDc6LMEO6AT1mERt+E3i3oYY4KhSGRWZStqEb/MU7b5k= Received: from VI1PR0802MB2351.eurprd08.prod.outlook.com (2603:10a6:800:a0::10) by VI1PR08MB5456.eurprd08.prod.outlook.com (2603:10a6:803:12d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Mon, 2 Nov 2020 05:08:15 +0000 Received: from VI1PR0802MB2351.eurprd08.prod.outlook.com ([fe80::14d4:6ade:368a:204b]) by VI1PR0802MB2351.eurprd08.prod.outlook.com ([fe80::14d4:6ade:368a:204b%3]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 05:08:15 +0000 From: Ruifeng Wang To: "thomas@monjalon.net" , "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" , "viacheslavo@nvidia.com" , Matan Azrad , Shahaf Shuler , David Christensen , Konstantin Ananyev , nd Thread-Topic: [PATCH v2 08/14] net/mlx5: switch timestamp to dynamic mbuf field Thread-Index: AQHWsHnU8WddD85SfUOkOGGtPLaf56m0SzfA Date: Mon, 2 Nov 2020 05:08:15 +0000 Message-ID: References: <20201029092751.3837177-1-thomas@monjalon.net> <20201101180626.2198868-1-thomas@monjalon.net> <20201101180626.2198868-9-thomas@monjalon.net> In-Reply-To: <20201101180626.2198868-9-thomas@monjalon.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 8BAE0405CDBE504680AF0748B539ABAC.0 x-checkrecipientchecked: true Authentication-Results-Original: monjalon.net; dkim=none (message not signed) header.d=none; monjalon.net; dmarc=none action=none header.from=arm.com; x-originating-ip: [203.126.0.112] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 70f05569-3cd4-4f1c-c42c-08d87eed53aa x-ms-traffictypediagnostic: VI1PR08MB5456:|DB6PR0801MB2070: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:2803;OLM:2803; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: bnM0knDAZMvaOolbSzqpBLDw3+7VFQU9vc0V1yA+vqTkymqWZmvy18QZ7Y75s7k0OKnWI1XkjVt7b5Xjz6eheSChLZ/3zwcWHwyj6H6aN3fJdT2Nv9GXg4IXoOlISUOcYDVeDJ2wiN+8ViGTnH6ZVWmpBg+hLt07+fz6gl4BpkRkO+/KHo5dINFd9v+upUGzDNh8WCWMfLRjUS+/qG4wFfERtLAk5Ga2dKcZZjgiVhalNBPZxgDjxQVgVHxkw1SW131nVbspjSyYGGPt9xewZx50jCCx1daQuThLCbAPSHXG5ewNpAgMHdx0lWRlCIsWPNHMf4CsU8QcJHTETF9JOQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0802MB2351.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(136003)(366004)(346002)(376002)(8936002)(55016002)(66476007)(64756008)(7416002)(6506007)(52536014)(4326008)(30864003)(83380400001)(66446008)(66556008)(8676002)(478600001)(5660300002)(53546011)(33656002)(26005)(186003)(9686003)(54906003)(86362001)(71200400001)(76116006)(316002)(2906002)(110136005)(7696005)(66946007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: NvrkOZlVOdR2OI1q1mdNrXrBzre8ia8qZOo5XZpssgIVaf/1DrGXJG0gpYowRPsJji9rqjR1nzH3gaLolO2PrBmKkhgADXsjX/cq0HUNyVtxh1pZD6ikIYDfWqBxg7z5JXDD73YPoJNHIxxVbNdh/EArWI7M7fzy3SNOmezc6QOmobR+3EOh/3oQ2v393esCXDTItqV8Zw3UHhiRSvTkiuJNgnYlUWTZqcDxVjXITeELSz8KKKLzxEmiLNl5BZCtzky5DQ3uV9hUpgkgUlxLoOwzyckvjyTyyQmmxX/qg23OWmGOro/frrs18Zy4os9QuXukdApB8WJk2yCwLkp6woCYtO1An2TroSgUJxLu2v95LO+kolyvYMvnPzgkMM0GL1TI5nEbHKwZx4PlOBHLnUIgmK3pas4CT1ErvePR9AI18VuQfomUczrqbvHxeRF9elrXcwxa86rsXjBV/Je+bdDwHg78iWErLzP0hnqX7ycrFkawSptpylKx0QapYzSu4l3ggvTHk3VfI7oaFZeeVlRhj1ewfnOvSrUFv/D6juIf0MS6UfA5j1T9jn3rSDI5HU9E+027hFjkUR199wfg+qgElb02YsTQLuLgCYk80KSAGlFrGGCpFCgTTdZLdq6nV4VQJ7Hu0EgYw7NtEVQnsg== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5456 Original-Authentication-Results: monjalon.net; dkim=none (message not signed) header.d=none; monjalon.net; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 082d7ac0-0147-466f-5080-08d87eed4e45 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +LZWp7vXzzC18ZEs0sKQXBEWEla+rSVpXZ6XL1jIbXDMG1J8VWSk6JTKr6rvlvVXEW9UvpUGpNt9WburZiTFdHDLjJ5tlCV6449wpYT9HGM5jeRFKUnM9WSinhgmgqha0QtUqH6r/B4W/27Tj/YTj5CWWyem3EuNEADiz+n/inBlCx7LhOtjuUcRG23+gIb5B8V4T2NpNLlqAdzSwFFoIUSnyr3jSrH1ntUjffhB1IdCAhp9hDKNaY2jvKQ73vN+ef0MuTqSKK3lwRUoPMneE2NkHpKppEm99FvJKHSE0xBHaV93zPIUIf8diJJuUSzUKz9oDxa219cOfe716hZ0MaCtx8EAeURAR51jHazqd1b9PKtzlADhhB8zPlP9PAkWQ1XPfvWRQZs8/aif6skvLA== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(136003)(346002)(39850400004)(376002)(396003)(46966005)(8676002)(8936002)(82310400003)(83380400001)(33656002)(336012)(70206006)(47076004)(7696005)(2906002)(6506007)(186003)(316002)(52536014)(70586007)(82740400003)(81166007)(53546011)(30864003)(54906003)(5660300002)(26005)(55016002)(110136005)(86362001)(478600001)(356005)(9686003)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 05:08:24.8884 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 70f05569-3cd4-4f1c-c42c-08d87eed53aa X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB2070 Subject: Re: [dpdk-dev] [PATCH v2 08/14] net/mlx5: switch timestamp to dynamic mbuf field 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: Monday, November 2, 2020 2:06 AM > 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; > viacheslavo@nvidia.com; Matan Azrad ; Shahaf Shuler > ; David Christensen ; > Ruifeng Wang ; Konstantin Ananyev > > Subject: [PATCH v2 08/14] net/mlx5: switch timestamp to dynamic mbuf fiel= d >=20 > The mbuf timestamp is moved to a dynamic field in order to allow removal = of > the deprecated static field. > The related mbuf flag is also replaced. >=20 > Signed-off-by: Thomas Monjalon > --- > drivers/net/mlx5/mlx5_rxq.c | 36 ++++++++++++++++++++ > drivers/net/mlx5/mlx5_rxtx.c | 4 +-- > drivers/net/mlx5/mlx5_rxtx.h | 19 +++++++++++ > drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 41 +++++++++++----------- > drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 43 ++++++++++++------------ > drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 35 +++++++++---------- > 6 files changed, 118 insertions(+), 60 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c > index f1d8373079..877aa24a18 100644 > --- a/drivers/net/mlx5/mlx5_rxq.c > +++ b/drivers/net/mlx5/mlx5_rxq.c > @@ -1310,6 +1310,39 @@ mlx5_max_lro_msg_size_adjust(struct > rte_eth_dev *dev, uint16_t idx, > priv->max_lro_msg_size * MLX5_LRO_SEG_CHUNK_SIZE); } >=20 > +/** > + * Lookup mbuf field and flag for Rx timestamp if offload requested. > + * > + * @param rxq_data > + * Datapath struct where field offset and flag mask are stored. > + * > + * @return > + * 0 on success or offload disabled, negative errno otherwise. > + */ > +static int > +mlx5_rx_timestamp_setup(struct mlx5_rxq_data *rxq_data) { > + int timestamp_rx_dynflag_offset; > + > + rxq_data->timestamp_rx_flag =3D 0; > + if (rxq_data->hw_timestamp =3D=3D 0) > + return 0; > + rxq_data->timestamp_offset =3D rte_mbuf_dynfield_lookup( > + RTE_MBUF_DYNFIELD_TIMESTAMP_NAME, NULL); > + if (rxq_data->timestamp_offset < 0) { > + DRV_LOG(ERR, "Cannot lookup timestamp field\n"); > + return -rte_errno; > + } > + timestamp_rx_dynflag_offset =3D rte_mbuf_dynflag_lookup( > + RTE_MBUF_DYNFLAG_RX_TIMESTAMP_NAME, > NULL); > + if (timestamp_rx_dynflag_offset < 0) { > + DRV_LOG(ERR, "Cannot lookup Rx timestamp flag\n"); > + return -rte_errno; > + } > + rxq_data->timestamp_rx_flag =3D > RTE_BIT64(timestamp_rx_dynflag_offset); > + return 0; > +} > + > /** > * Create a DPDK Rx queue. > * > @@ -1492,7 +1525,10 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t > idx, uint16_t desc, > mlx5_max_lro_msg_size_adjust(dev, idx, max_lro_size); > /* Toggle RX checksum offload if hardware supports it. */ > tmpl->rxq.csum =3D !!(offloads & DEV_RX_OFFLOAD_CHECKSUM); > + /* Configure Rx timestamp. */ > tmpl->rxq.hw_timestamp =3D !!(offloads & > DEV_RX_OFFLOAD_TIMESTAMP); > + if (mlx5_rx_timestamp_setup(&tmpl->rxq) !=3D 0) > + goto error; > /* Configure VLAN stripping. */ > tmpl->rxq.vlan_strip =3D !!(offloads & > DEV_RX_OFFLOAD_VLAN_STRIP); > /* By default, FCS (CRC) is stripped by hardware. */ diff --git > a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index > e86468b67a..b577aab00b 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.c > +++ b/drivers/net/mlx5/mlx5_rxtx.c > @@ -1287,8 +1287,8 @@ rxq_cq_to_mbuf(struct mlx5_rxq_data *rxq, struct > rte_mbuf *pkt, >=20 > if (rxq->rt_timestamp) > ts =3D mlx5_txpp_convert_rx_ts(rxq->sh, ts); > - pkt->timestamp =3D ts; > - pkt->ol_flags |=3D PKT_RX_TIMESTAMP; > + mlx5_timestamp_set(pkt, rxq->timestamp_offset, ts); > + pkt->ol_flags |=3D rxq->timestamp_rx_flag; > } > } >=20 > diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h > index 674296ee98..e9eca36b40 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.h > +++ b/drivers/net/mlx5/mlx5_rxtx.h > @@ -151,6 +151,8 @@ struct mlx5_rxq_data { > /* CQ (UAR) access lock required for 32bit implementations */ > #endif > uint32_t tunnel; /* Tunnel information. */ > + int timestamp_offset; /* Dynamic mbuf field for timestamp. */ > + uint64_t timestamp_rx_flag; /* Dynamic mbuf flag for timestamp. */ > uint64_t flow_meta_mask; > int32_t flow_meta_offset; > } __rte_cache_aligned; > @@ -681,4 +683,21 @@ mlx5_txpp_convert_tx_ts(struct > mlx5_dev_ctx_shared *sh, uint64_t mts) > return ci; > } >=20 > +/** > + * Set timestamp in mbuf dynamic field. > + * > + * @param mbuf > + * Structure to write into. > + * @param offset > + * Dynamic field offset in mbuf structure. > + * @param timestamp > + * Value to write. > + */ > +static __rte_always_inline void > +mlx5_timestamp_set(struct rte_mbuf *mbuf, int offset, > + rte_mbuf_timestamp_t timestamp) > +{ > + *RTE_MBUF_DYNFIELD(mbuf, offset, rte_mbuf_timestamp_t *) =3D > timestamp; > +} > + > #endif /* RTE_PMD_MLX5_RXTX_H_ */ > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h > b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h > index 6bf0c9b540..171d7bb0f8 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h > @@ -330,13 +330,13 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data > *rxq, > vector unsigned char ol_flags =3D (vector unsigned char) > (vector unsigned int){ > rxq->rss_hash * PKT_RX_RSS_HASH | > - rxq->hw_timestamp * PKT_RX_TIMESTAMP, > + rxq->hw_timestamp * rxq- > >timestamp_rx_flag, > rxq->rss_hash * PKT_RX_RSS_HASH | > - rxq->hw_timestamp * PKT_RX_TIMESTAMP, > + rxq->hw_timestamp * rxq- > >timestamp_rx_flag, > rxq->rss_hash * PKT_RX_RSS_HASH | > - rxq->hw_timestamp * PKT_RX_TIMESTAMP, > + rxq->hw_timestamp * rxq- > >timestamp_rx_flag, > rxq->rss_hash * PKT_RX_RSS_HASH | > - rxq->hw_timestamp * PKT_RX_TIMESTAMP}; > + rxq->hw_timestamp * rxq- > >timestamp_rx_flag}; > vector unsigned char cv_flags; > const vector unsigned char zero =3D (vector unsigned char){0}; > const vector unsigned char ptype_mask =3D @@ -1025,31 +1025,32 @@ > rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t > pkts_n, > /* D.5 fill in mbuf - rearm_data and packet_type. */ > rxq_cq_to_ptype_oflags_v(rxq, cqes, opcode, &pkts[pos]); > if (rxq->hw_timestamp) { > + int offset =3D rxq->timestamp_offset; > if (rxq->rt_timestamp) { > struct mlx5_dev_ctx_shared *sh =3D rxq->sh; > uint64_t ts; >=20 > ts =3D rte_be_to_cpu_64(cq[pos].timestamp); > - pkts[pos]->timestamp =3D > - mlx5_txpp_convert_rx_ts(sh, ts); > + mlx5_timestamp_set(pkts[pos], offset, > + mlx5_txpp_convert_rx_ts(sh, ts)); > ts =3D rte_be_to_cpu_64(cq[pos + > p1].timestamp); > - pkts[pos + 1]->timestamp =3D > - mlx5_txpp_convert_rx_ts(sh, ts); > + mlx5_timestamp_set(pkts[pos + 1], offset, > + mlx5_txpp_convert_rx_ts(sh, ts)); > ts =3D rte_be_to_cpu_64(cq[pos + > p2].timestamp); > - pkts[pos + 2]->timestamp =3D > - mlx5_txpp_convert_rx_ts(sh, ts); > + mlx5_timestamp_set(pkts[pos + 2], offset, > + mlx5_txpp_convert_rx_ts(sh, ts)); > ts =3D rte_be_to_cpu_64(cq[pos + > p3].timestamp); > - pkts[pos + 3]->timestamp =3D > - mlx5_txpp_convert_rx_ts(sh, ts); > + mlx5_timestamp_set(pkts[pos + 3], offset, > + mlx5_txpp_convert_rx_ts(sh, ts)); > } else { > - pkts[pos]->timestamp =3D rte_be_to_cpu_64 > - (cq[pos].timestamp); > - pkts[pos + 1]->timestamp =3D > rte_be_to_cpu_64 > - (cq[pos + p1].timestamp); > - pkts[pos + 2]->timestamp =3D > rte_be_to_cpu_64 > - (cq[pos + p2].timestamp); > - pkts[pos + 3]->timestamp =3D > rte_be_to_cpu_64 > - (cq[pos + p3].timestamp); > + mlx5_timestamp_set(pkts[pos], offset, > + > rte_be_to_cpu_64(cq[pos].timestamp)); > + mlx5_timestamp_set(pkts[pos + 1], offset, > + rte_be_to_cpu_64(cq[pos + > p1].timestamp)); > + mlx5_timestamp_set(pkts[pos + 2], offset, > + rte_be_to_cpu_64(cq[pos + > p2].timestamp)); > + mlx5_timestamp_set(pkts[pos + 3], offset, > + rte_be_to_cpu_64(cq[pos + > p3].timestamp)); > } > } > if (rxq->dynf_meta) { > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > index d122dad4fe..436b247ade 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > @@ -271,7 +271,7 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data > *rxq, > uint32x4_t pinfo, cv_flags; > uint32x4_t ol_flags =3D > vdupq_n_u32(rxq->rss_hash * PKT_RX_RSS_HASH | > - rxq->hw_timestamp * PKT_RX_TIMESTAMP); > + rxq->hw_timestamp * rxq->timestamp_rx_flag); > const uint32x4_t ptype_ol_mask =3D { 0x106, 0x106, 0x106, 0x106 }; > const uint8x16_t cv_flag_sel =3D { > 0, > @@ -697,6 +697,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct > rte_mbuf **pkts, uint16_t pkts_n, > rxq_cq_to_ptype_oflags_v(rxq, ptype_info, flow_tag, > opcode, &elts[pos]); > if (rxq->hw_timestamp) { > + int offset =3D rxq->timestamp_offset; > if (rxq->rt_timestamp) { > struct mlx5_dev_ctx_shared *sh =3D rxq->sh; > uint64_t ts; > @@ -704,36 +705,36 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct > rte_mbuf **pkts, uint16_t pkts_n, > ts =3D rte_be_to_cpu_64 > (container_of(p0, struct mlx5_cqe, > pkt_info)->timestamp); > - elts[pos]->timestamp =3D > - mlx5_txpp_convert_rx_ts(sh, ts); > + mlx5_timestamp_set(elts[pos], offset, > + mlx5_txpp_convert_rx_ts(sh, ts)); > ts =3D rte_be_to_cpu_64 > (container_of(p1, struct mlx5_cqe, > pkt_info)->timestamp); > - elts[pos + 1]->timestamp =3D > - mlx5_txpp_convert_rx_ts(sh, ts); > + mlx5_timestamp_set(elts[pos + 1], offset, > + mlx5_txpp_convert_rx_ts(sh, ts)); > ts =3D rte_be_to_cpu_64 > (container_of(p2, struct mlx5_cqe, > pkt_info)->timestamp); > - elts[pos + 2]->timestamp =3D > - mlx5_txpp_convert_rx_ts(sh, ts); > + mlx5_timestamp_set(elts[pos + 2], offset, > + mlx5_txpp_convert_rx_ts(sh, ts)); > ts =3D rte_be_to_cpu_64 > (container_of(p3, struct mlx5_cqe, > pkt_info)->timestamp); > - elts[pos + 3]->timestamp =3D > - mlx5_txpp_convert_rx_ts(sh, ts); > + mlx5_timestamp_set(elts[pos + 3], offset, > + mlx5_txpp_convert_rx_ts(sh, ts)); > } else { > - elts[pos]->timestamp =3D rte_be_to_cpu_64 > - (container_of(p0, struct mlx5_cqe, > - pkt_info)->timestamp); > - elts[pos + 1]->timestamp =3D > rte_be_to_cpu_64 > - (container_of(p1, struct mlx5_cqe, > - pkt_info)->timestamp); > - elts[pos + 2]->timestamp =3D > rte_be_to_cpu_64 > - (container_of(p2, struct mlx5_cqe, > - pkt_info)->timestamp); > - elts[pos + 3]->timestamp =3D > rte_be_to_cpu_64 > - (container_of(p3, struct mlx5_cqe, > - pkt_info)->timestamp); > + mlx5_timestamp_set(elts[pos], offset, > + rte_be_to_cpu_64(container_of(p0, > + struct mlx5_cqe, pkt_info)- > >timestamp)); > + mlx5_timestamp_set(elts[pos + 1], offset, > + rte_be_to_cpu_64(container_of(p1, > + struct mlx5_cqe, pkt_info)- > >timestamp)); > + mlx5_timestamp_set(elts[pos + 2], offset, > + rte_be_to_cpu_64(container_of(p2, > + struct mlx5_cqe, pkt_info)- > >timestamp)); > + mlx5_timestamp_set(elts[pos + 3], offset, > + rte_be_to_cpu_64(container_of(p3, > + struct mlx5_cqe, pkt_info)- > >timestamp)); > } > } > if (rxq->dynf_meta) { > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > index 0bbcbeefff..ae4439efc7 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > @@ -251,7 +251,7 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data > *rxq, __m128i cqes[4], > __m128i pinfo0, pinfo1; > __m128i pinfo, ptype; > __m128i ol_flags =3D _mm_set1_epi32(rxq->rss_hash * > PKT_RX_RSS_HASH | > - rxq->hw_timestamp * > PKT_RX_TIMESTAMP); > + rxq->hw_timestamp * rxq- > >timestamp_rx_flag); > __m128i cv_flags; > const __m128i zero =3D _mm_setzero_si128(); > const __m128i ptype_mask =3D > @@ -656,31 +656,32 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct > rte_mbuf **pkts, uint16_t pkts_n, > /* D.5 fill in mbuf - rearm_data and packet_type. */ > rxq_cq_to_ptype_oflags_v(rxq, cqes, opcode, &pkts[pos]); > if (rxq->hw_timestamp) { > + int offset =3D rxq->timestamp_offset; > if (rxq->rt_timestamp) { > struct mlx5_dev_ctx_shared *sh =3D rxq->sh; > uint64_t ts; >=20 > ts =3D rte_be_to_cpu_64(cq[pos].timestamp); > - pkts[pos]->timestamp =3D > - mlx5_txpp_convert_rx_ts(sh, ts); > + mlx5_timestamp_set(pkts[pos], offset, > + mlx5_txpp_convert_rx_ts(sh, ts)); > ts =3D rte_be_to_cpu_64(cq[pos + > p1].timestamp); > - pkts[pos + 1]->timestamp =3D > - mlx5_txpp_convert_rx_ts(sh, ts); > + mlx5_timestamp_set(pkts[pos + 1], offset, > + mlx5_txpp_convert_rx_ts(sh, ts)); > ts =3D rte_be_to_cpu_64(cq[pos + > p2].timestamp); > - pkts[pos + 2]->timestamp =3D > - mlx5_txpp_convert_rx_ts(sh, ts); > + mlx5_timestamp_set(pkts[pos + 2], offset, > + mlx5_txpp_convert_rx_ts(sh, ts)); > ts =3D rte_be_to_cpu_64(cq[pos + > p3].timestamp); > - pkts[pos + 3]->timestamp =3D > - mlx5_txpp_convert_rx_ts(sh, ts); > + mlx5_timestamp_set(pkts[pos + 3], offset, > + mlx5_txpp_convert_rx_ts(sh, ts)); > } else { > - pkts[pos]->timestamp =3D rte_be_to_cpu_64 > - (cq[pos].timestamp); > - pkts[pos + 1]->timestamp =3D > rte_be_to_cpu_64 > - (cq[pos + p1].timestamp); > - pkts[pos + 2]->timestamp =3D > rte_be_to_cpu_64 > - (cq[pos + p2].timestamp); > - pkts[pos + 3]->timestamp =3D > rte_be_to_cpu_64 > - (cq[pos + p3].timestamp); > + mlx5_timestamp_set(pkts[pos], offset, > + > rte_be_to_cpu_64(cq[pos].timestamp)); > + mlx5_timestamp_set(pkts[pos + 1], offset, > + rte_be_to_cpu_64(cq[pos + > p1].timestamp)); > + mlx5_timestamp_set(pkts[pos + 2], offset, > + rte_be_to_cpu_64(cq[pos + > p2].timestamp)); > + mlx5_timestamp_set(pkts[pos + 3], offset, > + rte_be_to_cpu_64(cq[pos + > p3].timestamp)); > } > } > if (rxq->dynf_meta) { > -- > 2.28.0 Reviewed-by: Ruifeng Wang