Message ID | 20201103141640.174043-1-hkalra@marvell.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Thomas Monjalon |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6FD8AA0521; Tue, 3 Nov 2020 15:18:10 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 58F21CB0A; Tue, 3 Nov 2020 15:17:17 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 1DB15CB3A for <dev@dpdk.org>; Tue, 3 Nov 2020 15:17:14 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A3EBKtN010984; Tue, 3 Nov 2020 06:17:13 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=pfpt0220; bh=Sg5iN72Q24Gkr/j4sictm6zsdJRN5Od+CE2gpKxlxlg=; b=bLPBor6lwAo1hJYlpuhP/qAD1UipIJvdKikBvk1cwFjtWrZw7JIMppRWfkiSVKB6QbyG 3h3DhHD1Ze2xNxVhYdVSbTIzxsORCD2f2maxUAgexopc7omoYzsCkldbdwQeQUOhxR4a pC6qM2DwRmgIrkBD1xFFN1y+UOEK6WeeejEVlZ+/2PsYoCUyE3UuzZgjyY8A0IoOVoNi JsHoEorBSqxpcsuSdWlnBO0onj0n0lBfLk09237OPhfQXMjrNluZ/ffEV2iNL0g5liRp Xxdj6wr2e05gjtAgcnFR14jeaAaVD8h9VDO4L5JXcMLpBHTdtejVuPM9+9EddTnoY7gL ig== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 34h59mwwk9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 03 Nov 2020 06:17:12 -0800 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 3 Nov 2020 06:17:12 -0800 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 3 Nov 2020 06:17:11 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.105) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Tue, 3 Nov 2020 06:17:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YFOcJ5a6ULoqqJYVB1lsF20+E3Kj14L8aI9L2K01pgm6G5x7Xbea6ApPMUvnZ/EWKt4ICbNPOgWoTpU/PfrC853RYw+7jEIY6jcbyhbSEBhBopR43RccV5nIZ834shd/8bqLzqwrzi7P7vLBF7wMNt4A48T2ShhJC7C0wvIrSSbPwuhhWYwqmgS28/Y6yvZLHcO8HMnFgw9WWcbM94IOb3AMrKUtw/1JPLPzuDovTYgqbk1XCCfStdN4zclu5n7u2pKV7hrJ6KXTHYlVa1r/03EW+3Dae+EVHuCjKNdbZ4WJ+SYy31b9UsvmZM70IGa39NALPYFKU3f8CZEIw0wbdA== 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=Sg5iN72Q24Gkr/j4sictm6zsdJRN5Od+CE2gpKxlxlg=; b=h+sXd1+hyyCG9WDvw4927nOZ8Fx0UEm8fvft8Mtf7oocds9veKeX04/0toNCtO/S++3lDLmIiHn/wygGKJHmD8CEtfq6TD9c8AHYVCBF0XN0mzoCq+dMQ2weetdQLDzeIvoACYGqlhH9zTdmU6KR+dSqn0gJaaW6+nJfn9gIBu3WCbziOirZIF9eyy8+RQq6R8Dve8UOkdngfZW2tjMwld/rRZwgQjKVNElAOFxtS3QWSOet3DbOgWuN0T2czU3PGA58cd1EK6bzqTgCgdnycWD644C0Uxmzy8HsYizuzu/nBaVuiRB75fCnnOSlZD3m5ifLpF0YdY3t3eb1mmnuSQ== 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=Sg5iN72Q24Gkr/j4sictm6zsdJRN5Od+CE2gpKxlxlg=; b=tIEsOuaQNJxA0WHfajkPzqNnnwozqbSvE8QtIMDX1wW9K24XJfukz1L2AQ/NDESulIAcjAfGWvUOOP7dYXNcSfhrLnk5hFmVC2EfTuAYGDJl/pdyTMsAcU0Rj47zY53XuSV1niOjhjDQvNau6LNzgLkEpPEgFjL6MB1tu1WThDI= Authentication-Results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=marvell.com; Received: from CO6PR18MB3842.namprd18.prod.outlook.com (2603:10b6:5:341::16) by MW3PR18MB3452.namprd18.prod.outlook.com (2603:10b6:303:58::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Tue, 3 Nov 2020 14:17:07 +0000 Received: from CO6PR18MB3842.namprd18.prod.outlook.com ([fe80::b960:6770:a1:2a19]) by CO6PR18MB3842.namprd18.prod.outlook.com ([fe80::b960:6770:a1:2a19%7]) with mapi id 15.20.3499.032; Tue, 3 Nov 2020 14:17:07 +0000 From: Harman Kalra <hkalra@marvell.com> To: <thomas@monjalon.net>, Jerin Jacob <jerinj@marvell.com>, Nithin Dabilpuram <ndabilpuram@marvell.com>, Kiran Kumar K <kirankumark@marvell.com> CC: <dev@dpdk.org>, Harman Kalra <hkalra@marvell.com> Date: Tue, 3 Nov 2020 19:46:40 +0530 Message-ID: <20201103141640.174043-1-hkalra@marvell.com> X-Mailer: git-send-email 2.18.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [1.6.215.26] X-ClientProxiedBy: BMXPR01CA0074.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::14) To CO6PR18MB3842.namprd18.prod.outlook.com (2603:10b6:5:341::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (1.6.215.26) by BMXPR01CA0074.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Tue, 3 Nov 2020 14:17:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ac342497-9e02-457f-52cd-08d88003257e X-MS-TrafficTypeDiagnostic: MW3PR18MB3452: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <MW3PR18MB345291DA87F90749EAF54358C5110@MW3PR18MB3452.namprd18.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yGUJyIWQ/oTS5D4wJF3QRcbG2UjoVYL0xgzoWRBGHu6U1GUDtRepR+DiYb/9daDyiRAHz75LCT6lUB4OYTxR1yUdieHRIvl1S2Fz0jeLsMCP4ddfInOg4ehMJNDX58JIAVmqsfHEypgwox6JrA4Q01ByLAea8QCs7CwvfbhFwbjBUvlVxLTMnGetz9Bvxie/gUHPekMHM9SpjChtkD7ukS/oL0mvFY0PKAUEjtza03eS95fRYmeWoj495umvgF0dwjiBgCwKIciMLEJr26MvNMag7Ka7toceA9EkUflKL3Dp55gDBmey/8zSdF0ZXpMJVyakkRyJXm+abSsrFcT0+amJ2jjLteBtjfAoU2FEt5wdtmv6nZUEdNziXm4hvBZX8MIqQwFSqkslV+DlEPXudA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB3842.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(346002)(366004)(396003)(136003)(376002)(69590400008)(16526019)(110136005)(316002)(186003)(4326008)(2906002)(6666004)(1006002)(6506007)(956004)(2616005)(26005)(478600001)(6636002)(86362001)(107886003)(52116002)(1076003)(8936002)(6512007)(5660300002)(83380400001)(36756003)(66946007)(66556008)(66476007)(6486002)(8676002)(36456003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: CAsO1WN82VrZHFSHu0i8VkGyjYdQ1VSaYYf5IDrJ4ExM6Chdzj3PHKILLngSAVLO/k7OMl5GU4OWuqbnv96ALsGchx8/H2p6ikoe9LCFJwSD/xsHo+yfnBiqv4ZndpzM3g/8KkkqdkRQS2GCusjJhvOPlJ+e+O3wWuTmi/zGs3gERfUm/wQpIhmNwhbuDSn5PTolbdSqF6yVw9/v5qodrXmEMBuODw8gkybdN5rSuVn9kNnsYAEZh5RV5PNxSp4pMYwGQgPZnTwycsE60eUz22O6k/F/C5LxTtMDbBn29Qa/iDnEpf/TKJkUgIosIglEUfXZD8JPd2iZmABgiqA3JwJV4syH4BIg2Dk5EvXkZzUrWtjz4JdD/P0ZYxD6ZxZNjxzT40ZbmxWf0XpoxjnmhTdZiOXBieU78axLT6M8wm/T65Dx3DrQ4PPQyKJC4am46Gahb7/FekTSUESDUfzZJOafXJn6oLWQbjWhYDyw2iPCUwqEVQ4e3QGblJFd6mu4QICKL06vtECeXO2MucoqjYnlHeqyd97fcTOzopOdLLiL2mXVsOYzqXoJOa4hJ7uE59sBiZf5WNmHPg9fW6pCcUwVDhv//WM3HKsQmuY28WgRhE3O7vRN88BIc6aiGaAvTEL9o6ZuHkZE5pIoTgcgQg== X-MS-Exchange-CrossTenant-Network-Message-Id: ac342497-9e02-457f-52cd-08d88003257e X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB3842.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2020 14:17:07.6890 (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: F4yl/zjrjSFCw40qx//Bga8zDYlfbSH+1Z3h5tXVRmHuvyV47YoJ0BTEcYFDxl+s8BOzQ2SMMLHDHLXcB/ZihA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR18MB3452 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-03_08:2020-11-03, 2020-11-03 signatures=0 Subject: [dpdk-dev] [PATCH] net/octeontx2: register dynamic mbuf timestamp field X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
net/octeontx2: register dynamic mbuf timestamp field
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | warning | coding style issues |
ci/Intel-compilation | fail | apply issues |
Commit Message
Harman Kalra
Nov. 3, 2020, 2:16 p.m. UTC
A crash is observed if dynamic mbuf timestamp field is
registered in dev_start, as in most of the applications
rte_eth_timesync_enable is called after dev_start due
to which timestamp field did not get registered.
Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
drivers/net/octeontx2/otx2_ethdev.c | 10 ----------
drivers/net/octeontx2/otx2_ptp.c | 9 +++++++++
2 files changed, 9 insertions(+), 10 deletions(-)
Comments
03/11/2020 15:16, Harman Kalra: > A crash is observed if dynamic mbuf timestamp field is > registered in dev_start, as in most of the applications > rte_eth_timesync_enable is called after dev_start due > to which timestamp field did not get registered. So you are not reading your emails? I was waiting for you, so I looked at the ugly code of octeontx2 with Olivier and David, and we fixed it already. Not reading emails is wasting time of everybody. On the contrary, being available on IRC can speed up work. > Signed-off-by: Harman Kalra <hkalra@marvell.com> > --- a/drivers/net/octeontx2/otx2_ethdev.c > +++ b/drivers/net/octeontx2/otx2_ethdev.c > @@ -2219,16 +2219,6 @@ otx2_nix_dev_start(struct rte_eth_dev *eth_dev) > else > otx2_nix_timesync_disable(eth_dev); > > - if (dev->rx_offload_flags & NIX_RX_OFFLOAD_TSTAMP_F) { > - rc = rte_mbuf_dyn_rx_timestamp_register( > - &dev->tstamp.tstamp_dynfield_offset, > - &dev->tstamp.rx_tstamp_dynflag); > - if (rc != 0) { > - otx2_err("Failed to register Rx timestamp field/flag"); > - return -rte_errno; > - } > - } > - This is wrong, you still need to register for the case of DEV_RX_OFFLOAD_TIMESTAMP without timesync. In my v5, it is moved below after VF special config. > /* Update VF about data off shifted by 8 bytes if PTP already > * enabled in PF owning this VF > */
+Cc David and Olivier to make them laugh or cry. 03/11/2020 15:24, Thomas Monjalon: > 03/11/2020 15:16, Harman Kalra: > > A crash is observed if dynamic mbuf timestamp field is > > registered in dev_start, as in most of the applications > > rte_eth_timesync_enable is called after dev_start due > > to which timestamp field did not get registered. > > So you are not reading your emails? > > I was waiting for you, so I looked at the ugly code of octeontx2 > with Olivier and David, and we fixed it already. > > Not reading emails is wasting time of everybody. > On the contrary, being available on IRC can speed up work. > > > > Signed-off-by: Harman Kalra <hkalra@marvell.com> > > --- a/drivers/net/octeontx2/otx2_ethdev.c > > +++ b/drivers/net/octeontx2/otx2_ethdev.c > > @@ -2219,16 +2219,6 @@ otx2_nix_dev_start(struct rte_eth_dev *eth_dev) > > else > > otx2_nix_timesync_disable(eth_dev); > > > > - if (dev->rx_offload_flags & NIX_RX_OFFLOAD_TSTAMP_F) { > > - rc = rte_mbuf_dyn_rx_timestamp_register( > > - &dev->tstamp.tstamp_dynfield_offset, > > - &dev->tstamp.rx_tstamp_dynflag); > > - if (rc != 0) { > > - otx2_err("Failed to register Rx timestamp field/flag"); > > - return -rte_errno; > > - } > > - } > > - > > This is wrong, you still need to register for the case > of DEV_RX_OFFLOAD_TIMESTAMP without timesync. > > In my v5, it is moved below after VF special config. > > > /* Update VF about data off shifted by 8 bytes if PTP already > > * enabled in PF owning this VF > > */ >
On Tue, Nov 03, 2020 at 03:26:17PM +0100, Thomas Monjalon wrote: > External Email > > ---------------------------------------------------------------------- > +Cc David and Olivier to make them laugh or cry. > > 03/11/2020 15:24, Thomas Monjalon: > > 03/11/2020 15:16, Harman Kalra: > > > A crash is observed if dynamic mbuf timestamp field is > > > registered in dev_start, as in most of the applications > > > rte_eth_timesync_enable is called after dev_start due > > > to which timestamp field did not get registered. > > > > So you are not reading your emails? > > > > I was waiting for you, so I looked at the ugly code of octeontx2 > > with Olivier and David, and we fixed it already. > > > > Not reading emails is wasting time of everybody. > > On the contrary, being available on IRC can speed up work. > > My focus was to fix the issue ASAP to meet the deadline as well as well making sure that our performance nos are also not hampered with the change. By no means its a ugly code, its properly designed to cover many use cases. While the changes done as part of v5 are partially correct becasue if our kernel changes wrt PTP fails then its a unecessary registration. https://patches.dpdk.org/patch/83600/ Thats why my patch does the registration only if kernel changes are successful. > > > > > Signed-off-by: Harman Kalra <hkalra@marvell.com> > > > --- a/drivers/net/octeontx2/otx2_ethdev.c > > > +++ b/drivers/net/octeontx2/otx2_ethdev.c > > > @@ -2219,16 +2219,6 @@ otx2_nix_dev_start(struct rte_eth_dev *eth_dev) > > > else > > > otx2_nix_timesync_disable(eth_dev); > > > > > > - if (dev->rx_offload_flags & NIX_RX_OFFLOAD_TSTAMP_F) { > > > - rc = rte_mbuf_dyn_rx_timestamp_register( > > > - &dev->tstamp.tstamp_dynfield_offset, > > > - &dev->tstamp.rx_tstamp_dynflag); > > > - if (rc != 0) { > > > - otx2_err("Failed to register Rx timestamp field/flag"); > > > - return -rte_errno; > > > - } > > > - } > > > - > > > > This is wrong, you still need to register for the case > > of DEV_RX_OFFLOAD_TIMESTAMP without timesync. > > > > In my v5, it is moved below after VF special config. > > > > > /* Update VF about data off shifted by 8 bytes if PTP already > > > * enabled in PF owning this VF > > > */ > > > > > > >
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c index f6962be9b..cfb733a4b 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -2219,16 +2219,6 @@ otx2_nix_dev_start(struct rte_eth_dev *eth_dev) else otx2_nix_timesync_disable(eth_dev); - if (dev->rx_offload_flags & NIX_RX_OFFLOAD_TSTAMP_F) { - rc = rte_mbuf_dyn_rx_timestamp_register( - &dev->tstamp.tstamp_dynfield_offset, - &dev->tstamp.rx_tstamp_dynflag); - if (rc != 0) { - otx2_err("Failed to register Rx timestamp field/flag"); - return -rte_errno; - } - } - /* Update VF about data off shifted by 8 bytes if PTP already * enabled in PF owning this VF */ diff --git a/drivers/net/octeontx2/otx2_ptp.c b/drivers/net/octeontx2/otx2_ptp.c index ae5a2b7cd..4aa68f578 100644 --- a/drivers/net/octeontx2/otx2_ptp.c +++ b/drivers/net/octeontx2/otx2_ptp.c @@ -256,6 +256,15 @@ otx2_nix_timesync_enable(struct rte_eth_dev *eth_dev) /* Setting up the function pointers as per new offload flags */ otx2_eth_set_rx_function(eth_dev); otx2_eth_set_tx_function(eth_dev); + + /* Registering dynamic mbuf timestamp field and flag */ + rc = rte_mbuf_dyn_rx_timestamp_register( + &dev->tstamp.tstamp_dynfield_offset, + &dev->tstamp.rx_tstamp_dynflag); + if (rc != 0) { + otx2_err("Failed to register Rx timestamp field/flag"); + return -rte_errno; + } } rc = otx2_nix_recalc_mtu(eth_dev);