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 507F7A0521; Tue, 3 Nov 2020 09:12:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F0E31BE97; Tue, 3 Nov 2020 09:12:43 +0100 (CET) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by dpdk.org (Postfix) with ESMTP id F3E3EBE7D for ; Tue, 3 Nov 2020 09:12:40 +0100 (CET) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 03 Nov 2020 00:12:43 -0800 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 3 Nov 2020 08:12:26 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 3 Nov 2020 08:12:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EtLHVY1Lz35P2criSlMcOfpLMy4C8tbVFrT+4/Tdiz0PknxjJsOmCmBHiIv2uoFmM4idoN/SuYVrMMODHg4QXoUgIYwklYEWHVD0przC7a3waa85iP1hlNeEGJd8zYfI5rJpfGlWFKyGbzwwBlyTxUs1EUjZA2qt+CrqvFfO6jDX2fIMp9yQszWHJRTuQ0NqV+3T8lRnmYLtUNe5/oVzxcfjdJJ///Z++0v86Gc99qV7yiutKKzOxrPpb9spsMUuIIp55tgR7B0pqirfdwHp06SWdv0SK6Q/IJNRTSfyQEtm7XrNI+K+2pHoUnto35V13gU8KL3Mbe8ZowoY0nrUMA== 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=lOHmz7vmgjaI2bgE3Umtk8jr8uvJm5Gaod9qvmckFpM=; b=jZl/yhrJD9GepbyKw37qY2vIIMwNjUT+wSgLOAcaFm998L2TaLKYeV6Z2YEwuU1nxsu2Btiol7BcyXMloRsdREP5g2eIwnMv7AUO7vHUz6pWtPtNNBiBYJYVzoP0y05FSSsYh52YP0w6QtxxBgdb4LYHp5Jz9sWxKEKDCd5QwKOOiVZ01rVQX4VB1E+lwQ+/houzxvQVEuVkgbxMRl0i//0h0XqcULXYiskJkf05hKW44ShHkJJvOJroPGeep4N99ngFS7SXzWY7U6oLGSgK3PXO951QJkYX1H0Ntxy0anpuWiuyV/Hapi2qRRIHBl8zEnJLP+1VtnT3WXfrHrZKjQ== 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:25 +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:25 +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" , Ruifeng Wang , David Christensen , "Matan Azrad" , Shahaf Shuler , "Konstantin Ananyev" Thread-Topic: [PATCH v3 07/16] net/mlx5: switch Rx timestamp to dynamic mbuf field Thread-Index: AQHWsXZgjI6T4/L0F0SAOqxfCm36I6m2DtAA Date: Tue, 3 Nov 2020 08:12:25 +0000 Message-ID: References: <20201029092751.3837177-1-thomas@monjalon.net> <20201103001407.2931963-1-thomas@monjalon.net> <20201103001407.2931963-8-thomas@monjalon.net> In-Reply-To: <20201103001407.2931963-8-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: 7acfc07d-99f2-4158-a259-08d87fd032a1 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:5516; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8rHujug3+ImtfEY4gVh3oz4+o5seIl7F9kkSobnDob4c4Zru2QgpeTuJA28C7Ul+ORfsl5TPSXa0d70qB4vdqMj6EXxzDrKS/Kkg9VtetOJsZ/7G6ZAbAaJQbFZJ3WxibFKN8jP7IXMBI062jLFSbyq0cAwVmWFB9je8H8y7+jnXgvojj/bcdr05rNtrrqpbsy7iNuwkDU0XPV2NeBIrmFZY0OaHDToo6t8GqJYQV8RiPvYl65tQEO+1mEa4M5yMso2ESjE6ItmW1HB/rnbAeSpXNllj6aJ6k3gsNAKfk2DXe4yyz8JvO+1OwfLruARQcWPZYKHJQTm+2N2b1s2+4w== 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)(7416002)(316002)(5660300002)(33656002)(52536014)(30864003)(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: +9H2sYkQ/xMvLN4Z3FjYuzTUP47PVJJ4uerc0HYKs0ADPaMdpcifbTOITb7SXHXr2VZZm286mhEtMtSz+VnTQsJ8ixgbtFCV0kIuIyFNMQUh1mYP11eUclYWiUG6Op9LdcKAgy3x/nAYaB6Ru6/WDE+Nvsdn/onT5yJGzI9XUS1iBfnT7km49Kve2VAFSFdxa0VQWv0Lez7T5aut8rqX6WxhQe+AGCQ29qIlayX6Gwve6rUQnrFRo1CfcTUJntTPXSIUkUeCKF0pcg/qZdD864GLxzFOnqgA/wuvwvcG0uS1dyTGZdKOvNQKWxWg7Ta7uRbbZH/OKFat1UMmVhSUggpOqPeYOKT2nMbxAPRjfEtSXiqkWxTFQCB5myo1VS2bqTaGrRej3UcwyblCw0UDF8nJpRLg1XYy8dUWaHS9BLeYCaSfSWVKfVtzHvLTpB0fhJD85c/6UIaoa3WgOMPeeA/3qjc8sdJkIBPCGPMx5QiZyQON+ROsaX/pjQJWd930ZR8Rx/zAUKpIGVs1Lvc1sgHvZAuFuaYh3dQ51Q2Rw57I5DozrI6FmrdGLyxFkq5Zs9TOkoMWa5XpoDuEHeH/GGxVG/rUEmi1RGO4EC47usMxy8wR/8Ttn5UOZi5BdzJQ+d9C7nm4BYq6H4COyN6pJg== 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: 7acfc07d-99f2-4158-a259-08d87fd032a1 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2020 08:12:25.1414 (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: vqbJ5kQlHxHNSg0zPEG7bi6UoqLM+nGY7ktC46Ss+q5oZbtNYQgoOjAakN5TbtuwsekrDLDggf/2K4sjLMGaiA== 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=1604391163; bh=lOHmz7vmgjaI2bgE3Umtk8jr8uvJm5Gaod9qvmckFpM=; 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=JTSmErHCC9XmQMTgqaf4btbUC1sAzZgitL33jsBlytK0EKsWMLU1Qufn1X7SQczqH Ruhn5su5TM4a4iX7QhdxeU9oAyi5Oc0fnpc48A7w85924w0EjUCo8k/Fw+CrrP/RQl QChBZUetYXQoBncTa1EYuCuPuEJelGHQbCrdsjTrDVHyy7pdmB0K8UcjUjrYrXVAui KGwUQvcOXWEQBUbUj3tc5VNxVrqPFctfbVW5oh8LXAwHMYzFuIkd5g0vH08Dkoau6p J9EULxGh/rf9LB48a1Z5cLbzrqEyRFoURZr0V94dDWR9Dx90gIqG3Fqr2KMOJy3GHa RADjUAy/qLGlw== Subject: Re: [dpdk-dev] [PATCH v3 07/16] net/mlx5: switch Rx 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: 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 > ; Ruifeng Wang ; David > Christensen ; Matan Azrad ; > Shahaf Shuler ; Konstantin Ananyev > > Subject: [PATCH v3 07/16] net/mlx5: switch Rx timestamp to dynamic mbuf > field >=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 > The dynamic offset and flag are stored in struct mlx5_rxq_data to favor c= ache > locality. >=20 > Signed-off-by: Thomas Monjalon > Reviewed-by: Ruifeng Wang > Reviewed-by: David Christensen Reviewed-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_rxq.c | 8 +++++ > 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, 90 insertions(+), 60 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c in= dex > f1d8373079..52519910ee 100644 > --- a/drivers/net/mlx5/mlx5_rxq.c > +++ b/drivers/net/mlx5/mlx5_rxq.c > @@ -1492,7 +1492,15 @@ 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); > + tmpl->rxq.timestamp_rx_flag =3D 0; > + if (tmpl->rxq.hw_timestamp && > rte_mbuf_dyn_rx_timestamp_register( > + &tmpl->rxq.timestamp_offset, > + &tmpl->rxq.timestamp_rx_flag) !=3D 0) { > + DRV_LOG(ERR, "Cannot register Rx timestamp field/flag"); > + 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