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 20B81A00C2; Fri, 14 Oct 2022 11:19:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1DF242D3A; Fri, 14 Oct 2022 11:19:11 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id B083742D32 for ; Fri, 14 Oct 2022 11:19:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665739148; x=1697275148; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=gtOr/EGJFx4ONleLas/J8oLCYRhwK2I2pOAmh8XkH18=; b=RNhkOO5ANo3BIUPa8QlnHNkQP1y9YRdRl8ZhltQicKb9RgqyaOvvfxu4 mYjbju1jvFf/l5jEan+OdI/05z10zxwZnBjNie6+rXm7zLQYaiCLawSn5 lvLtxWlpPLuCI+gNkGlqsQ3vXyKvQgqu9qh5kE+f9i34cUVXmBFkp0Xsh GpWvlD2Q9PyYrCMrR4PU76ysmexP0NoAhR0gA0UQjuxasgL1/CKeuPpzJ TItJwM5JzKTKApDdYoDRXkin639T5nhPWd7xUkD60DroFWx488IO/hH3q cdt04q22jKhQ6Ks1Ij836q+vxI9VDi2HiBSbps40fSFCj0CfZFMSBDVdW Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="285061009" X-IronPort-AV: E=Sophos;i="5.95,182,1661842800"; d="scan'208";a="285061009" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2022 02:19:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="802566888" X-IronPort-AV: E=Sophos;i="5.95,182,1661842800"; d="scan'208";a="802566888" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga005.jf.intel.com with ESMTP; 14 Oct 2022 02:19:07 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 02:19:07 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Fri, 14 Oct 2022 02:19:07 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Fri, 14 Oct 2022 02:19:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NpsmQrGmNiwpgjWvHy0yjpJtXSfTKHpxfyDFjeivemJNVfeUDnjzEcg6R+8jmPbwf93haxy7ZBma9ww8HtGzDy1r4VUXp88dsPjP6Qwfavd6HSEsf4GJJhEYjMtcVtTamF7Ga2T7JDW2brzI20v18msTkByCxwkRCPhxfib5IN1u6Vlx9Gj1nH88StxedsUoMGlcnpNiqXPoVdROICPe89KWJUz9gKnQY0OaD7vMxRDZi1yZiZ9P0cm6HmH+sqJofO1V7nnoIIGYxSN4c9abVv5V26Zi/USUnKL2Kb1jvyV7NJAq+/I61DS1fDSJ76BXrXU2GNXAiIThSjTLjvxa3w== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GVyXseErKhz16Al5BhE8RMhmaVPyi5zE1a2ZBTMTYDI=; b=nWpkZ2rVga84IOdrlM7XFUIdb71BORI8YrKhKV7mD27yWipL1+VXxiu0RuoQNl37G7vNFj9RpSRcmj5mPQBoHw9LOaiba8PhkDrTmtxO+dEcRuYK8cfvqnX+BvJaZc4RLLnC02nxjbq/jnrQdf6KduVM3tI4AkCme1XuTdPSSXrObPQL+k6LQ9/RYRNH1fN0hTvbqjUM1TwwP6pJkJRRcCQLVzvAw2FRLL7DOdqlpSGiqgzai60s2AsqFucv9Fj+QpS5Ui3mzCzbMTW05+E7VVz3F8XCSmHh+ROq3lE63vM9yFrxMGQlhQ3tkGQE1r4ijN90XQ0apOibhPqqYNAARw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB3723.namprd11.prod.outlook.com (2603:10b6:5:13f::25) by SJ0PR11MB5152.namprd11.prod.outlook.com (2603:10b6:a03:2ae::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Fri, 14 Oct 2022 09:19:05 +0000 Received: from DM6PR11MB3723.namprd11.prod.outlook.com ([fe80::126d:f905:c1d6:dcb9]) by DM6PR11MB3723.namprd11.prod.outlook.com ([fe80::126d:f905:c1d6:dcb9%5]) with mapi id 15.20.5723.026; Fri, 14 Oct 2022 09:19:05 +0000 From: "Guo, Junfeng" To: Andrew Rybchenko , "Zhang, Qi Z" , "Wu, Jingjing" , "Xing, Beilei" CC: "dev@dpdk.org" , "Wang, Xiao W" , "Qiao, Wenjing" Subject: RE: [PATCH v2 14/14] net/idpf: add support for timestamp offload Thread-Topic: [PATCH v2 14/14] net/idpf: add support for timestamp offload Thread-Index: AQHYwRaIPnNBlr3byEWIWWJ93YOG5a385OYAgBDY+ZA= Date: Fri, 14 Oct 2022 09:19:05 +0000 Message-ID: References: <20220803113104.1184059-1-junfeng.guo@intel.com> <20220905105828.3190335-1-junfeng.guo@intel.com> <20220905105828.3190335-15-junfeng.guo@intel.com> <3f418586-58b0-6ce6-5e75-a8b6b5e34b7d@oktetlabs.ru> In-Reply-To: <3f418586-58b0-6ce6-5e75-a8b6b5e34b7d@oktetlabs.ru> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.500.17 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB3723:EE_|SJ0PR11MB5152:EE_ x-ms-office365-filtering-correlation-id: 87139619-b59b-4771-c1f1-08daadc5241c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XvEeyiQO6KomNGbIF0G0P28CticiiOr0SKwdIBr3PfBxPtKc0NVm5m6qnpCXx6Fu6/bkuLh3WhuBAbqdad6pY0Y1tu2vJCPFGkhVJWU4iJog/7Dk7lD5GhtpVJoHQZu5hoF8xe2SZVaoC3wmcm59zcuaQmoblc7UFOumQL8JSiUvXs5StMewpOt4dULjs/FBL/hQtqXgA8ZuHm8Wc2u3anJkJjY9vM7pkfUZP5IVmYIg2ZJScP3388/9LHifcc5eD+0A1ADHNpAt8wofjQMaGosoA3D5RlEXF6bkMjCW6Ptp32uepeRxtVD32yU+InrIX31FtbIu4GekQWLje+YnqGIpT1ePZICBwdp4+KPTnVVN3NIViQi7YEw+z97r/c+fg62hsSIG9OA5iVMfKVJW3sQysk6N3acYTRPVjP7iAe22NSm3tmilDR4hDd93IiaoEvSHpjSUBncKmdLvZMBLw61Zv205D0pr75vTARo/pJU0iISjrvfjd+ZQcVP6+mqn1zGoNCUFLw4Or+uSBn44S3IaWjoEoWUe2bx7m+xOllesG3bpDRWAPQQ9i3zaL6yTBJQe0udHXVbuEUiDOoFD3WxSxEzFsQ2m4icLzmPYq1M+wVQErVZzlOvY/+zAavtJ36kp94CTGpwptdZuqc5R/3gPG1dzgITAGD8kvVIBIJS21LygS8T+B7nIGRleUigqH8YMrdIdjgc1kfAPt6bcXQ9IptMUd1Qmc7rQoAM5/660JFx4fUm00cMt0HkrMADqY1wCOBxtcgoAxjXFlCcAHA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3723.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(346002)(376002)(39860400002)(366004)(396003)(451199015)(76116006)(110136005)(54906003)(316002)(6636002)(478600001)(107886003)(71200400001)(66556008)(66476007)(64756008)(66446008)(4326008)(8676002)(66946007)(52536014)(26005)(9686003)(8936002)(186003)(41300700001)(53546011)(7696005)(5660300002)(6506007)(2906002)(33656002)(83380400001)(38070700005)(55016003)(122000001)(82960400001)(38100700002)(86362001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?PjmMNGCDpFQ9NugmC8f3AP9TAoVT4lux74iQ1MsQXXboE2bwTFdHQAYjUOg7?= =?us-ascii?Q?l/Kr7crvBT5tYwU5TwAlE009T94qtquN9UnUoH66zhzDA410AT17iEO08H9L?= =?us-ascii?Q?vWwP/sWcKaFymXyW1rNBI0gxB/jhHjhmlqgDS41T2GicVF410Wf8fo+vJnJ0?= =?us-ascii?Q?Kgsbj9ifOUJ8AYu+4huahqVWZVM991Re/icCafqYT0N776fxE3p7Odd/5Oxt?= =?us-ascii?Q?t0qemWu21jOHoVUhMwmDfKj1h22ZQUPd6x2nP2/eYepIzqZw4f+SOjtLFJtA?= =?us-ascii?Q?FhrCEKD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MZYt?= =?us-ascii?Q?BrBOPOJs/vRe46iKK78/soecDO6FI5erOiTRPmX+UL6trPlyux/0EjIfh17Y?= =?us-ascii?Q?K3/W3UINmld7rA/NYK3wVzlolkCej73KQmQTtfTn2GbwMY/E7sOYmMQP3m7+?= =?us-ascii?Q?9Y85O9/hWr9VGIxEIbi/jchUFwPumjYQd6lnaDmnFuQVpy7WmCjlXk8OR4PW?= =?us-ascii?Q?75he+dFXg4c1vtabAxY6b6hA9PqEjFPQbnRaXWTmodzHlHljj3nAlo+6dOUE?= =?us-ascii?Q?Kx+DCf0j5eDCDFof+7bgZvR+aW4c0/ugMbc49KvzPNxyKDkgdbivAVRJPWGz?= =?us-ascii?Q?4PAJWe4MDOY4Ubit2qHyP4icZm/C7O6ositTtsCC9O7b4yLtRC1ZSTbJ2Idr?= =?us-ascii?Q?vvcR7N+GJ6FOf45amMC8QTDcsCa4sW37EP6jRY4l?= 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: DM6PR11MB3723.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87139619-b59b-4771-c1f1-08daadc5241c X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2022 09:19:05.2217 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ZVGmYDuOvQgeuh6CXnSpxYY++I/Wj+HWPHnRh/jushBxmUP20VXH8itAwu9K/a593fpqH4NDV9dIhd5GuACm1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5152 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Andrew Rybchenko > Sent: Monday, October 3, 2022 22:22 > To: Guo, Junfeng ; Zhang, Qi Z > ; Wu, Jingjing ; Xing, > Beilei > Cc: dev@dpdk.org; Wang, Xiao W ; Qiao, > Wenjing > Subject: Re: [PATCH v2 14/14] net/idpf: add support for timestamp > offload >=20 > On 9/5/22 13:58, Junfeng Guo wrote: > > Add support for timestamp offload. > > > > Signed-off-by: Wenjing Qiao > > Signed-off-by: Junfeng Guo >=20 > [snip] >=20 > > +/* Helper function to convert a 32b nanoseconds timestamp to 64b. */ > > +static inline uint64_t > > +idpf_tstamp_convert_32b_64b(struct iecm_hw *hw, struct > idpf_adapter *ad, > > + uint32_t flag, uint32_t in_timestamp) > > +{ > > +/* TODO: timestamp for ACC */ > > +#ifdef RTE_ARCH_ARM64 > > + return 0; > > +#endif /* RTE_ARCH_ARM64 */ > > + > > +#ifdef RTE_ARCH_X86_64 > > + const uint64_t mask =3D 0xFFFFFFFF; > > + uint32_t hi, lo, lo2, delta; > > + uint64_t ns; > > + > > + if (flag) { > > + IECM_WRITE_REG(hw, GLTSYN_CMD_SYNC_0_0, > PF_GLTSYN_CMD_SYNC_SHTIME_EN_M); > > + IECM_WRITE_REG(hw, GLTSYN_CMD_SYNC_0_0, > PF_GLTSYN_CMD_SYNC_EXEC_CMD_M | > > + PF_GLTSYN_CMD_SYNC_SHTIME_EN_M); > > + lo =3D IECM_READ_REG(hw, PF_GLTSYN_SHTIME_L_0); > > + hi =3D IECM_READ_REG(hw, PF_GLTSYN_SHTIME_H_0); > > + /* > > + * On typical system, the delta between lo and lo2 is > ~1000ns, > > + * so 10000 seems a large-enough but not overly-big > guard band. > > + */ > > + if (lo > (UINT32_MAX - > IDPF_TIMESYNC_REG_WRAP_GUARD_BAND)) > > + lo2 =3D IECM_READ_REG(hw, > PF_GLTSYN_SHTIME_L_0); > > + else > > + lo2 =3D lo; > > + > > + if (lo2 < lo) { > > + lo =3D IECM_READ_REG(hw, > PF_GLTSYN_SHTIME_L_0); > > + hi =3D IECM_READ_REG(hw, > PF_GLTSYN_SHTIME_H_0); > > + } > > + > > + ad->time_hw =3D ((uint64_t)hi << 32) | lo; > > + } > > + > > + delta =3D (in_timestamp - (uint32_t)(ad->time_hw & mask)); > > + if (delta > (mask / 2)) { > > + delta =3D ((uint32_t)(ad->time_hw & mask) - in_timestamp); > > + ns =3D ad->time_hw - delta; > > + } else { > > + ns =3D ad->time_hw + delta; > > + } > > + > > + return ns; > > +#endif /* RTE_ARCH_X86_64 */ >=20 > Conditional compilation is rather strange above. > Will it break build on some architectures? > Non-x86-64 and non-ARM64. Actually the timestamp feature currently is only supported on x86_64 architecture. On the rest conditions will just return 0. We will update this part in the coming version. Thanks! >=20 > > +} > > > > +#endif /* _IDPF_RXTX_H_ */