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 359F1459DD; Fri, 20 Sep 2024 08:48:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2474A433E3; Fri, 20 Sep 2024 08:48:57 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2109.outbound.protection.outlook.com [40.107.22.109]) by mails.dpdk.org (Postfix) with ESMTP id EA90640669 for ; Fri, 20 Sep 2024 08:48:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=r83DghlIwP0x/AwdkCxjyUzGFGZEdH3n99bSVdKu7/QE1YFngFCrXPSzWWIi/6Se9xiisTL0n5cGH2bmUdX3aqblyiYSj+GqwhvokQqiBpOGaW7aK1HtRshfnwlB6K48UAzzHtKezWfIREElo+26Gui2hD5Y0yFDI5idwu9na+Yjn6J9izIGOoaLvXSBdFs0lOOG0izULmduk4EdlsmKiEmEH/RhzHMmmtb235u14wB6z0UMW0kjDxc3uaRXBVAmAGos/NpcOZlUt8/6a7pnZeOHS2vkle0D7c14r9JMvN1nvJT/VUea3YoqtGs01n0/9Fs+QwOY34HOjZK3sOQHdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=y9fDXWoBOOCkP5U0ghx9MYsJjFMOYjrvR087w65B6KA=; b=Ds7Kckz+au1hW8EVS4AWupY5vCOKh2gUqHxRxeGzrPTXr7uSJ71TO7+iL/HWxhrIL3ASYoHyLzG42fOJvsrdnaQBFAprCtwAJpve34xVYFfcYz4ffTlv4aYXBY6WWRPdJ/M8rg4Hu+XjuYUPZUqK+PHpkl9Ce4zLs3wA2v466gatun4F71u6EPx5WHdD0vBbuU6aunsikHSDRTqZIXVEUlm6Q3Sn2qqBVz1nZD8R96+XFPecPDs/XDOWuFsDQO9sjAc1mNV510J7/Xr/BshSlGMzqUEIJz+iI4sENZ5ohNaVJPQ+MboehpP9KXluuFWAyui3UuRuhAFU0Vj4h0GApg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=omicronenergy.com; dmarc=pass action=none header.from=omicronenergy.com; dkim=pass header.d=omicronenergy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=omicronenergy.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y9fDXWoBOOCkP5U0ghx9MYsJjFMOYjrvR087w65B6KA=; b=YaDEGpk15/4N9cR6b9Mmcdutm3P+PrstdQ4oLko6hhXfxBDz3wFqYcsybifwJWZKC20Nks39KVCSDwXz60eb2EYpMf0DGC6K3TIbwprrTrH4I8qsFlDwf37Siq6CP8n5cUEyp3B94yF+SaMPeJj0qm2UHtRU0dv0qi09+VYbTvY= Received: from AM0PR03MB6275.eurprd03.prod.outlook.com (2603:10a6:20b:154::17) by GV2PR03MB8826.eurprd03.prod.outlook.com (2603:10a6:150:be::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.16; Fri, 20 Sep 2024 06:48:51 +0000 Received: from AM0PR03MB6275.eurprd03.prod.outlook.com ([fe80::7ab2:814:12eb:1c8d]) by AM0PR03MB6275.eurprd03.prod.outlook.com ([fe80::7ab2:814:12eb:1c8d%7]) with mapi id 15.20.7962.017; Fri, 20 Sep 2024 06:48:51 +0000 From: =?Windows-1252?Q?Stefan_L=E4sser?= To: =?Windows-1252?Q?Morten_Br=F8rup?= CC: "dev@dpdk.org" Subject: RE: [PATCH] net/af_packet: add timestamp offloading support Thread-Topic: [PATCH] net/af_packet: add timestamp offloading support Thread-Index: AQHa/faIgXyAWopV9kGrv4mtbbKJvrJSNFAAgA4hg+A= Date: Fri, 20 Sep 2024 06:48:51 +0000 Message-ID: References: <20240903114306.2336633-1-stefan.laesser@omicronenergy.com> <98CBD80474FA8B44BF855DF32C47DC35E9F6CC@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F6CC@smartserver.smartshare.dk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=omicronenergy.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM0PR03MB6275:EE_|GV2PR03MB8826:EE_ x-ms-office365-filtering-correlation-id: 3fcb73d7-8368-4a58-1b84-08dcd940497d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?Windows-1252?Q?Okyf5FlCgVF1QQX9YTs1LeqIIMnqdIA01x8avgF2Fuf8dsDf97ehOrK7?= =?Windows-1252?Q?zjpRs15+IR8rEQQg2mu2r7wPmw/m/DLUJ0sEpOi+ELrJv6TwGz555TUY?= =?Windows-1252?Q?NfXzAI/bP1LqA4rAbXdir/STLVDGwUSXXSFY9O68zrsEbt9/0rp4dZA/?= =?Windows-1252?Q?ndVjrIiKSKYdE4iGBLWwZ2+A+0cfwZIu3ebWb6z/qmgBPZQAbR0b9suh?= =?Windows-1252?Q?weJaDfTOXXsybMGwbzWzTyczBGth4ki0sNO3Hf57G4Jj+Ubl/3shfST0?= =?Windows-1252?Q?unh/3y8oZfNN29lXEKYfADsdiYGZNutU6WxeViK1uhEGvYrOI+Jyfp9h?= =?Windows-1252?Q?ol8tZG2rsNIGxMgVtCLyKRxz8Cn/IXE7ymHBP85CJiXgySq3TQMewbrF?= =?Windows-1252?Q?tgT7NJ6r5LWjBUJ2NARzcZjE1pNTis7YOTVukxTUGUbdvxuhwtkJFLhk?= =?Windows-1252?Q?fURpe+fcOTRBsZ/Z8HsPSkuIgyBK0z0LVgQ3EBNzKkZbpPwUsctSqAMO?= =?Windows-1252?Q?NOelr04wkGKPwGNl+LplbHAfdWQ5Ps6idXKrAoU4SG6kpxzhXfNG/Xg+?= =?Windows-1252?Q?aghcXOMhwhNpPXnmLpBXpL+F3Dicv9b1LTT9idszzZg81/Xvv1VcvFPG?= =?Windows-1252?Q?rnbuaxUnUv+lrPMynIIesKcmRYdgPZTFFHvaduL1ICK17FUJmFZoN2QK?= =?Windows-1252?Q?kzAKuF+mIfZaFX6vW7T+AkO2tpbunHaVKk0IecxdT9aQrIW2F7b/gW4U?= =?Windows-1252?Q?6lfUiTMIhydQJbAp3x22O3uDtDRAfpWnun2CVkar2E+w6S9SJmt+spcY?= =?Windows-1252?Q?olU74el0O8DvTtvW6pqcvUd362dChsH1pSfjbNpCyb8V5vN3WoSlVolv?= =?Windows-1252?Q?vDWhKSIEUKiKB0KMZdxc7zIzGMlNVsUPDYetPphZcO2T/7dHoefg5zjJ?= =?Windows-1252?Q?ewYH5QRWL1KzrmQkr3wSDFFjdmcZf6ZfIkp8X092sp71ij4Q2SgdgLkJ?= =?Windows-1252?Q?Z1NH7AdHrinFpcQcbQYZAXxiKFG4vy9uuTh/a2oMaUCDcIMHBdIoTMMK?= =?Windows-1252?Q?LXjkl17nEV+CL03Dwu0WzQrOEsZNZI1p5drB20qg8ftzELKYN/1jKWG0?= =?Windows-1252?Q?Rw/wO7FdgIDl1nWCUy+qxqbe5s+gVwH6NLsJAQobAbpj66UVSQMggzeq?= =?Windows-1252?Q?3S4/DCKjmmCmnQlg1OPevCr+BAHY9s44NQbrgJc354CZXx2/4UeI5oSl?= =?Windows-1252?Q?714saWszVKlx49J3wskWOSGa+El+wVvJMKvW39eiiMUrXq+jkfdQo4xJ?= =?Windows-1252?Q?qVKvy6qsBPkUUbeCvOsUzHQwRRxP04G0WRhFkEuuKFXp4L1HLTEj76t1?= =?Windows-1252?Q?o4BcbbXGsLA2oBhQnCBiQgJsmIHh8PfAYyQJovbF+F580cjVuDVA+WXG?= =?Windows-1252?Q?meH5JnQsE0JzHGyquB9OAA=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR03MB6275.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?LYaupU86xv4dADhlE75Zixg+sin2MwW6wKtDX/KX20jVjp4tXDOucSv2?= =?Windows-1252?Q?5IHk7yotW41cNjJKuIEJAFT/emQGxacFBYTjbqQbCh67kCsJ3F5W3vmI?= =?Windows-1252?Q?onXLH0ycoCvJOQt7NF4mD6Ol46eMbDEZ2vYkmbBgLTxgokkoJDUctV3o?= =?Windows-1252?Q?m3LxjfRWI2hEbL/2Rx71Y3p49/wuDWiOwuqxv/mJR2N09HmV4CCoQ2Ih?= =?Windows-1252?Q?o0cLmLgKe4aL+79HcjhubLQNwJ/eQSzU9LbhzpyB3mOukfuvtkuS+tR1?= =?Windows-1252?Q?lVoB2A60qQQgL4zFk07hfgiU0y+12eBa4mjvtbR5AXF61RM7nJHNs4er?= =?Windows-1252?Q?AHXcrsYzMFSK+K363cRHW6luPof8aExTJ4q7V5GGD8upYsdq3uYGRVFh?= =?Windows-1252?Q?4p+hQp2EacKysabeMkcY9dqVAlUuoLp9iZMlOVk1oN3dlIjf2zJr0Myg?= =?Windows-1252?Q?LDNkGLRrCrJboWzW0owMdQPrj9SAtzt9JQvVmiKId3pCzipYSbSmv8WZ?= =?Windows-1252?Q?j+CKfMnV0++9kXpqEDSZwbm1HmS4ad2rhnjXtz7WpkjU0zR2c0wtrnLr?= =?Windows-1252?Q?5anmyNLsi1gJCiIZ8qqhmXVERrf0fnpC0Ew3hF3vA23GeME44+Sz3Hrt?= =?Windows-1252?Q?KsSs+aSd63jBrCRt+DQxooVDis2YLoabuQM0Am45D8Py59lpVgtMgtKl?= =?Windows-1252?Q?Ak7Yi1U6Ex2Fqlhw3UpiSPhUZ1QEOy/9RtnMovWBcQ8cOQ0gbYarZ9w6?= =?Windows-1252?Q?v8dK3Tyz/n/cuKy/h0dc9d3sq+FWlCWpwcZxBb5APRA8HdsiZI/fZUHe?= =?Windows-1252?Q?aFaqcbBglWW0/a9yvxYz6qhYYWJ8E91SP1v2TkWgdAxdbNKDdmMiPv74?= =?Windows-1252?Q?/QqTr/WkruwIq9yetdRmb0hORtmMDwFCEpsRAX9+2rWqqxut8lJ2pbui?= =?Windows-1252?Q?BObfJS1Y2HLjUg1+tyyk4XmSnwu4K5JNcRytNzIbNsCyFCjIsztWV/F5?= =?Windows-1252?Q?gX1ZbCc0LTS1mDrkumNQ4TugD3XEWBX59CRF4NhNe+azh90OMkRMj3RO?= =?Windows-1252?Q?1CGA8Ly4YNiVA6VAaCmeu3joDw2fM6ljg+hATrSUtMlocVkvIEsMK2dL?= =?Windows-1252?Q?mPRO8Slq1/oOqBYc4YEfj+HL96KRsRdDRKGvUw1Jn2l3LmGi9gZS8j69?= =?Windows-1252?Q?TXvMyuqPXGSqxGBl3XhzNnqZUBEZtJjUrdIQIw+SXNt4P3UVXqF2ZtaU?= =?Windows-1252?Q?9C8RkIECnz6R4GGI3DCk12qTljBn3g2j74DmXIbn4F684mtzxzffB/uP?= =?Windows-1252?Q?TVQiUD1MI08uexQn9x8KY3bqaNQVuJE+tTA1eGw20HOHJ0Dzd0cOtIgs?= =?Windows-1252?Q?NbInmegs7WJ84Kbh9Qh6RGfvflrJ2MspovWm2WKt/a9b7ZR48cuX5hr9?= =?Windows-1252?Q?6gq3Pl3RhX3HSzILa4zGpIdGCistBp5yeNt7d9jfKujfKMD4sUb1Yh4k?= =?Windows-1252?Q?NQtxlHVcKySZDj+De+123F/uVs/o7HIKqxCN++9Dugg+wMZJZa5LAsib?= =?Windows-1252?Q?eLToix5eanciKHcPG4aUUhNXXvpGC61P8HVF+Qm37JNvFllAlcw2/+a4?= =?Windows-1252?Q?zBbjcSf5uergLjvbNf5rLPbvHVxvU78Rc23jMhwriWKsj0O5feSuvegQ?= =?Windows-1252?Q?0hag50Iw1F0/aDCl0iO5U9Zs1ZGnrX6zpFmIKBR2tl/Qmh9sfwDsHQ?= =?Windows-1252?Q?=3D=3D?= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: omicronenergy.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM0PR03MB6275.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3fcb73d7-8368-4a58-1b84-08dcd940497d X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Sep 2024 06:48:51.3467 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 1357ca9e-a1a5-404b-bb16-554d5d05c5c9 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: zO/Tu41jkXS/GgxGxUHXXRBeLajf7DVV1u1uzxRz15HzUl5Wu5WcCMqE31g41yK1MLweUV3SvvXYd0MI5dtkRXqMDFSXlTcauqwogR46aRguvsvWqcI+Kj9MaNB7Pnj4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8826 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 > > +uint64_t af_packet_timestamp_dynflag; int > > +af_packet_timestamp_dynfield_offset =3D -1; >=20 > No need to expose these publicly, they should be static. > This also means that you can remove the af_packet_ prefix. > > eth_dev_start(struct rte_eth_dev *dev) { > > struct pmd_internals *internals =3D dev->data->dev_private; > > - uint16_t i; > > + > > + if (internals->timestamp_offloading) { > > + /* Register mbuf field and flag for Rx timestamp */ > > + int rc =3D > > > rte_mbuf_dyn_rx_timestamp_register(&af_packet_timestamp_dynfield_offs > e > > t, > > + &af_packet_timestamp_dynflag); > > + if (rc) { > > + PMD_LOG(ERR, "Cannot register mbuf field/flag for > > timestamp"); > > + return rc; > > + } > > + } > > > > dev->data->dev_link.link_status =3D RTE_ETH_LINK_UP; > > + > > + uint16_t i; >=20 > No need to move this down here. Please leave it where it was. >=20 > Alternatively, minimize its scope by moving it inside the for loop: > - for (i =3D 0; i < internals->nb_queues; i++) { > + for (uint16_t i =3D 0; i < internals->nb_queues; i++) { >=20 >=20 > With the two variables made local, >=20 > Acked-by: Morten Br=F8rup Thank you very much for your feedback! I have submitted a patch including y= our recommendations. I will start with the other patches now.