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 ECFD2A0C40; Tue, 8 Jun 2021 14:04:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7135440689; Tue, 8 Jun 2021 14:04:49 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id ADF064067A for ; Tue, 8 Jun 2021 14:04:48 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 158BtTqK007488 for ; Tue, 8 Jun 2021 05:04:47 -0700 Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2102.outbound.protection.outlook.com [104.47.70.102]) by mx0b-0016f401.pphosted.com with ESMTP id 39262bregf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 08 Jun 2021 05:04:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jcxXMPWSc5vux2bK/gXS8reJNsyvJw0nclmTINodkj7SUHa0C7m9kddr86UIsSKZsy5LpN+RZqZX3wAxTLXvfLh11ogNLUIxL3sjGNTWZzqptmR7CO7VYP4EOwSfAF138/LUgYnmTTD78pB75y1CZvE6Ih2+t5vvUndNXiuQiUJhoGlu1ygx6TASqzOckS6vsTnK2mH3DcBBENPV31i2T1YQGLJ2G1UeW6JQzllxTS/8GbO1aCfjzKUuECYatuAu9ZTSV5HqBi0MEM9Gu4rOU5DtsRKLOxeNh7tf2gwp2MmfTsvm9gF+fsRpwUlkQBOy1+WOxoBhLQkth8+MDy1yUg== 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=SJblENMsS5uHvw9XqQSboNSK6z6HlKjGWhLha1fuCq4=; b=aVrSQ/j6SUrAfrKxYSkQPIGH35h4zOMRgOZ8hBGsPQtmHEVSg6N6BKGg8UIbOBpnh8j2OL1LL233VLVWCYTmF1ZaIS+5h4wOqQGqJySo9OR8BetPOmi7aOpwwwdQQ5FzQ6HqbWAol/sTC6SQsXwfMkkOpbM+MUdYuqNhFdm2gBFlHJNJd+DaWfPojwEYM+sGw1b6ygqOfHRsGpSEmiedvNrD9/8Ek4b++7d+rY3IlM9jcZ8L0TKnIbeuMpMBJoF0kYEC/iM51vFHBehG/7HXdUZqdD6hbX3yjT0Btj4H7R1pTbBoDfvFAbcP+us2W8rOumcscPVG0VQ7pILYuSrgGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SJblENMsS5uHvw9XqQSboNSK6z6HlKjGWhLha1fuCq4=; b=TvuxX4iqs64Fd7PlsW/a74J82DyhI1/b5ZD+jxjZTqtsj6dQcHm2i4xzK77ZGcb7c5jEYmeSj3Dbh1DaUTDhyPZTHrmys9de7DkAuduuDdccWOu/sP6ggGsb8ia1ThqcTr+kEX3fw2ilFHnj8loxKDgkaxHMIS5OEdpo9FjeTo0= Received: from PH0PR18MB4086.namprd18.prod.outlook.com (2603:10b6:510:3::9) by PH0PR18MB4024.namprd18.prod.outlook.com (2603:10b6:510:2c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.23; Tue, 8 Jun 2021 12:04:45 +0000 Received: from PH0PR18MB4086.namprd18.prod.outlook.com ([fe80::a187:4890:1cd6:30d2]) by PH0PR18MB4086.namprd18.prod.outlook.com ([fe80::a187:4890:1cd6:30d2%7]) with mapi id 15.20.4195.030; Tue, 8 Jun 2021 12:04:45 +0000 From: Pavan Nikhilesh Bhagavatula To: Nithin Kumar Dabilpuram , "dev@dpdk.org" CC: Jerin Jacob Kollanukkaran , Sunil Kumar Kori , Satha Koteswara Rao Kottidi , Kiran Kumar Kokkilagadda , Satheesh Paul , Ashwin Sekhar Thalakalath Kottilveetil Thread-Topic: [PATCH v2 55/62] net/cnxk: add base PTP timesync support Thread-Index: AQHXW8fG1Xad1S/Krk6XQe9QjGC4zKsKBITw Date: Tue, 8 Jun 2021 12:04:45 +0000 Message-ID: References: <20210306153404.10781-1-ndabilpuram@marvell.com> <20210607175943.31690-1-ndabilpuram@marvell.com> <20210607175943.31690-56-ndabilpuram@marvell.com> In-Reply-To: <20210607175943.31690-56-ndabilpuram@marvell.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2405:201:d009:304d:b02b:9c5b:48ba:2417] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 77a36105-9c3f-4ba0-6457-08d92a759b91 x-ms-traffictypediagnostic: PH0PR18MB4024: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2043; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kSTzjAjXwSnetzTLdh66s9RKDL3NBEAcEi91DCHNcxf3Or6ku0wFU1FbE9KfBDC3k51OJgzKR9RCyGPa/qvHiSYad68iE+V8R3TDgOYLNOuV+oXWgN+QuebSAXMVkb51SxjrV6fcwhciazHJuxupZXIxSJyGLjypH2p5JeaSgsyTwa+elr0XIZqxbcumMZt7KaBMqm7YUgDJZKT3vjAY/WilqKpML80nSerqNBaO2Lend10yyGtED2iijr1ZzEzq7LAHCRYy59Ux91nSf+fVnLp9zUiAU++9Il6//Md+R8xh5hMKGC5PD43WNV0ydjUdr9gSFi9WV9g1VgdanjDWYuk/n4u5uoI9PSfDxjsjAyALX6mtHXg5rD/ddbGVuE/SS0jOrkaykyGT/D1NRl3uifcoMt5AES+x7LqTdV5i8Yps5c8Xb5ElcHSfAq7j9rAQwg8tgj9C4p+NMZGe4ZocPIPQE/dqb757AYfMMayWNA/dJjLr4aKB7oonD9j8VNgWHKRr35ATfMA+AoIu5Zxs0CDsLjYqnQCxndXVQFQc9UZsdQU686nntgpVZaBgK/uMRYhJ782t7FohqTbkVaQhDXod4iHUAnmwPT6RAS1c804= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB4086.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(54906003)(9686003)(110136005)(55016002)(86362001)(122000001)(66556008)(71200400001)(107886003)(7696005)(186003)(2906002)(4326008)(498600001)(33656002)(52536014)(66446008)(64756008)(66476007)(76116006)(66946007)(8676002)(8936002)(6506007)(38100700002)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Xwtk6f4rqdjzjYkEJnk+JvRcB4tFYQjXCJ8rVmdAeRvkTR/rKpl0QdsIe+h6?= =?us-ascii?Q?nv+fRzdTIIpz7C3kcj7EZIYx75QiFbSDu21rwat0prSAFhBrmuIi4vZHUXgn?= =?us-ascii?Q?6Z4UsaeOQbKn2jFfD1a6Nskmmwcbl4qJWmT+CEJv0kxbSbbEVt2HV/tx5IZN?= =?us-ascii?Q?m7FTJYe6sLKkZjgAVkSqpoQE1j73tzIo8xWEMWpL38DfEJV3lw1MKQ+SSzSj?= =?us-ascii?Q?k5WbBWNPrRzGHc2mUuTy1m6hk4XAyppQFt+WuuU+LJG8dC3DE7tmo6qcbkFt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UEmx8PqiNixQkw?= =?us-ascii?Q?sxNbAIFEdMOQLJtVesom2dNQGeCm14GZefVweWj2uiJs1yHEwABLhPAFjhzs?= =?us-ascii?Q?oQbRGPikyrrxskGq/J+/6EIdaniHg/Z6FQyEkE7jQXSSEGK9d/2mEEqdXOt6?= =?us-ascii?Q?7Wu2d7mqET2S7zd2AILStB1jHPx/Hi4XmvO54JtGH2LuMhpSZ/V0+MOkVfC+?= =?us-ascii?Q?Krv7cmPZvV9tdqLflawlXK9N6/sV?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB4086.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77a36105-9c3f-4ba0-6457-08d92a759b91 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2021 12:04:45.8037 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gbEu5Mwd8jGGLo+3CIR1SpRxHhXDXgK/y8753eU0+kMBCfxYgOgMbGDZqWsZ5/CPjHEzbJ/gFVm3eBgHle5XZm95C6i5BA1EmBzCzsnn7u8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR18MB4024 X-Proofpoint-ORIG-GUID: mg04gs6qsmSxud9XMt5s7pYioBGG767b X-Proofpoint-GUID: mg04gs6qsmSxud9XMt5s7pYioBGG767b X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-08_09:2021-06-04, 2021-06-08 signatures=0 Subject: Re: [dpdk-dev] [PATCH v2 55/62] net/cnxk: add base PTP timesync support 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" > >+static __rte_always_inline void >+cn10k_nix_xmit_prepare_tstamp(uintptr_t lmt_addr, const uint64_t >*cmd, >+ const uint64_t ol_flags, const uint16_t >no_segdw, >+ const uint16_t flags) >+{ >+ if (flags & NIX_TX_OFFLOAD_TSTAMP_F) { >+ const uint8_t is_ol_tstamp =3D !(ol_flags & >PKT_TX_IEEE1588_TMST); >+ struct nix_send_ext_s *send_hdr_ext =3D >+ (struct nix_send_ext_s >*)lmt_addr + 16; >+ uint64_t *lmt =3D (uint64_t *)lmt_addr; >+ uint16_t off =3D (no_segdw - 1) << 1; >+ struct nix_send_mem_s *send_mem; >+ >+ send_mem =3D (struct nix_send_mem_s *)(lmt + off); >+ send_hdr_ext->w0.subdc =3D NIX_SUBDC_EXT; >+ send_hdr_ext->w0.tstmp =3D 1; >+ if (flags & NIX_TX_MULTI_SEG_F) { >+ /* Retrieving the default desc values */ >+ lmt[off] =3D cmd[2]; >+ >+ /* Using compiler barier to avoid voilation of C >+ * aliasing rules. >+ */ >+ rte_compiler_barrier(); >+ } >+ >+ /* Packets for which PKT_TX_IEEE1588_TMST is not set, >tx tstamp >+ * should not be recorded, hence changing the alg type >to >+ * NIX_SENDMEMALG_SET and also changing send mem >addr field to >+ * next 8 bytes as it corrpt the actual tx tstamp >registered >+ * address. >+ */ >+ send_mem->w0.subdc =3D NIX_SUBDC_MEM; >+ send_mem->w0.alg =3D NIX_SENDMEMALG_SETTSTMP - >(is_ol_tstamp); >+ send_mem->addr =3D (rte_iova_t)((uint64_t *)cmd[3]); Missing address increment for non-tstmp packets here. >+ } >+} >+ > static __rte_always_inline void >+cn9k_nix_xmit_prepare_tstamp(uint64_t *cmd, const uint64_t >*send_mem_desc, >+ const uint64_t ol_flags, const uint16_t >no_segdw, >+ const uint16_t flags) >+{ >+ if (flags & NIX_TX_OFFLOAD_TSTAMP_F) { >+ struct nix_send_mem_s *send_mem; >+ uint16_t off =3D (no_segdw - 1) << 1; >+ const uint8_t is_ol_tstamp =3D !(ol_flags & >PKT_TX_IEEE1588_TMST); >+ >+ send_mem =3D (struct nix_send_mem_s *)(cmd + off); >+ if (flags & NIX_TX_MULTI_SEG_F) { >+ /* Retrieving the default desc values */ >+ cmd[off] =3D send_mem_desc[6]; >+ >+ /* Using compiler barier to avoid voilation of C >+ * aliasing rules. >+ */ >+ rte_compiler_barrier(); >+ } >+ >+ /* Packets for which PKT_TX_IEEE1588_TMST is not set, >tx tstamp >+ * should not be recorded, hence changing the alg type >to >+ * NIX_SENDMEMALG_SET and also changing send mem >addr field to >+ * next 8 bytes as it corrpt the actual tx tstamp >registered >+ * address. >+ */ >+ send_mem->w0.cn9k.alg =3D >+ NIX_SENDMEMALG_SETTSTMP - >(is_ol_tstamp); >+ >+ send_mem->addr =3D (rte_iova_t)((uint64_t >*)send_mem_desc[7] + >+ (is_ol_tstamp)); Need to increment by at-least 8 bytes. >+ } >+} >+