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 37FC3A0521; Tue, 3 Nov 2020 16:21:17 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9643DCB93; Tue, 3 Nov 2020 16:21:15 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id A1236CB7A for ; Tue, 3 Nov 2020 16:21:13 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A3FGVwm021816; Tue, 3 Nov 2020 07:21:11 -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=0MXck1U1kOBucJSupbZVd8aNhc0E0GSbKweF6N1cuTc=; b=VpIX0OShbkutx6oPZMU3o+3+lux/iOVNn3062iYhCUZuBOI5oSND5mh8OS+nyXj4JjPa L8440Oamwd7X1c5vdjIXwfQ2Qrjvp3R87hfbsaHq8GxMR53dzq0SlR33PzLHiGKO9qM+ tjDpcmiOAHtOprpVpPd80fqdSHl7HhdeHiO09gYeX0FJhvup+8S+0RgNyrIANXneFmQy Oy7CmZDs21+CN6R9+gy2eAGk9ikJ/VpBBVoNJCp4MMAugIkzMpCHIGCITaDAazECfgn1 uQ4I2HAS585qEPoqFRVVNcjb8Egoq6yMy4i8i9YHH34EvFQIyQngk3HkaQBvUTFjCPlV kg== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 34h7enwgkp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 03 Nov 2020 07:21:11 -0800 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 3 Nov 2020 07:21:09 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) 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 07:21:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EeJO2cxRNMm09Xc8S+2R8M1Cteap6RRcISBJwULldUzGAVNVJXGB1429aFpPMc3J7OUkBkuFoMMpoqpFzF1njWjkCLhKBywEHhnBCjuJSLz3J6g+VF86iJ6LR/m83Yw1WhE9tkmhWPxIqgTDxaVcYFsYM8vde0sFh9QR7C23in8GQIzKEK9x82z4k28jJFjhv8mjeA8f5ZLFAv3n1FEIdRdeEiQawIwb9SHS9OHBQ3pXa0/RuAWWQc0D3PaNkKMC75tjyEbPzownYdsbupuDD6k9i8x3kkEytnWj8pqc0CvLnxEXvWCMtqMBkDIfoT81o8dEUdWEOoS/vQwTWt5bFQ== 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=0MXck1U1kOBucJSupbZVd8aNhc0E0GSbKweF6N1cuTc=; b=TXy77gyAmCAMw7jr9j3bBC9r+VePx1oca7408Yz78dFkRYQOU3hRRcGHCmhBBpJRT6WQo2R9CvB8XNa/29v3uDC7z2o2eZTmGQIOqF+PWipC0FIXZAkFtxFWg5QiXuxuMYVvGUlCKg5l2yIaHvgB8Z91rAc8QlWlwdPhY5cwEsumcJKHHvLZbYlfd9WBJIQn+BdWOmn6i1F84YEUQwq73eXZTUOV9GRCi0eEEWxOuj5r3Y3M40nf3R/dG/a102KotiQa55dVSPABxDHuBs62CaofDwDxIMegbugmlEM6rBil/MqTqdowcnnuD1UjrZPLlVJICp4/JU3Mjfry5K/8HQ== 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=0MXck1U1kOBucJSupbZVd8aNhc0E0GSbKweF6N1cuTc=; b=GQ1y51CfENOpIhOX7HmyCuXnV4N5hmaQvwOMGWjCGdZ6MYZCK/CD1clrNC6N2MPW9a1dBMAMML7p5n6d+oTrp3qTNzeqwU0qHSEfvijIBV6sN2UGXZHVtTQUwA0elUPy4u3qbP7wTDWrTUaj5KbhFD1JHzL/D52VzcEotP2Q3lA= Received: from CO6PR18MB3842.namprd18.prod.outlook.com (2603:10b6:5:341::16) by MW2PR18MB2299.namprd18.prod.outlook.com (2603:10b6:907:f::24) 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 15:21: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 15:21:06 +0000 From: Harman Kalra To: Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K CC: , , , , Harman Kalra Date: Tue, 3 Nov 2020 20:50:40 +0530 Message-ID: <20201103152040.17654-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: BMXPR01CA0044.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::30) 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 BMXPR01CA0044.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::30) 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 15:21:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5cbbb25-2e87-42fb-5ec3-08d8800c15be X-MS-TrafficTypeDiagnostic: MW2PR18MB2299: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1824; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +2T2+SHafrwDhskxmws6XPs00nspOFU/ovUPCzr9tUlnWEslkVcnwl8BxsqwuUdF5kMJ7h6JBDZQdO2PiszufHX1qzq9yVXRqkhZ+9oxlKAtaedpdq4w5E+J2oXEse+pSibt624rCuB1/JktnDbqSmiyZzwJozTY5FJaHcXKX82po4QOtmGk7S2U0IJqtqzI3N5bQYbkCPIjiPAD4B0A+f2byZHZEv2EYlHexsFa1ZgP7CmvTFEvcR/mosYY8BBVwViytxryMDqDcwN0VWK9ery6fOd3loZ3G7Pv+OUgFgWvziUSGXZj6rqpA9gi8CbPSdhx56dsTA9YYKOFqYTo7YzxFKopx1FqG3pRL/FdaJTjTpDavtRKrOO1xiq8+dkuBFKMMeXFVr0xTrW5IsAq2A== 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)(366004)(6512007)(8936002)(69590400008)(6666004)(6486002)(8676002)(66556008)(1076003)(5660300002)(83380400001)(1006002)(86362001)(110136005)(66946007)(66476007)(6636002)(52116002)(2906002)(16526019)(36756003)(6506007)(26005)(956004)(2616005)(186003)(498600001)(4326008)(107886003)(36456003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 163HpxJTWy/DfvxVII0HCxYS6rwp9oJGGuYDT0kFFySlU4TbKbEIl64ks43FyzLRv8Y3N4+ss3yTxKQ9B5i6Ge925sSQYKsHG44Q58LfASNbrC2c/lftkv7asOwhivpdU6hNbaqP6hFwVqZagQk/a8RwX8CB4P6ipKJs4g0JmMPNGHbOc8KP9Zy9FSFOnvYSqbs/+mkVQu4+hc8bpqYG5YTxZ+F1vkHg+tWOdr/7C0d6HZKPRf3NexI6cJQExujxQKbx2LzgIQ6rNa9BQfgHevlm37w+TzkQRjtJtTxeecP0dmnTOZlshfupvjyuBufgO8zZqRdb6djjWdQTDOVFxPzODQWEcZolBihkJKqlFOYS8UAt15ZJnRKM89/5HInaWOidQ9f0yeDGViHN+VGIvv2VfykPNy+mZ2594BvuhHThcA1Tn6fdwSArLIAAplqNWihxV/VqNbkm8NpBXuTULrXTVVmhTRxk8JHaUGmhw+H3RmjetkWNHaBwrflETSHcT0p9f+5tGDZUJ7Fg5b1uIHMq3iQwtqdMRySTIdd8LKHEb1VAwpXc5IyXEm5vNGamacJI8MG9Sp7ewMo0Cno5l/wCJMt51tk+QH7Jlct5MVmDA6b3dUksufHWqNGg0E1FvLJXhsbOL96ak+EqMb6bHA== X-MS-Exchange-CrossTenant-Network-Message-Id: d5cbbb25-2e87-42fb-5ec3-08d8800c15be X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB3842.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2020 15:21:06.8264 (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: x6oMrFsf8tzwIGZS+M/r2iHa5SevobzCxeJB/7E0inz21v6qccEVICSKvy0BxBjw/tBbkg877mhHojqFBtMgtg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR18MB2299 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: fix dynamic registration for timestamp 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" Registration of timestamp field should be done once and only when ptp kernel changes are successful. Fixes: 67b8f3220393 ("net/octeontx2: switch Rx timestamp to dynamic mbuf field") Signed-off-by: Harman Kalra --- drivers/net/octeontx2/otx2_ethdev.c | 10 ---------- drivers/net/octeontx2/otx2_ptp.c | 17 +++++++++-------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c index 6cebbe677..cfb733a4b 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -2225,16 +2225,6 @@ otx2_nix_dev_start(struct rte_eth_dev *eth_dev) if (otx2_ethdev_is_ptp_en(dev) && otx2_dev_is_vf(dev)) otx2_nix_ptp_enable_vf(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; - } - } - rc = npc_rx_enable(dev); if (rc) { otx2_err("Failed to enable NPC rx %d", rc); diff --git a/drivers/net/octeontx2/otx2_ptp.c b/drivers/net/octeontx2/otx2_ptp.c index b8ef4c181..4aa68f578 100644 --- a/drivers/net/octeontx2/otx2_ptp.c +++ b/drivers/net/octeontx2/otx2_ptp.c @@ -239,14 +239,6 @@ otx2_nix_timesync_enable(struct rte_eth_dev *eth_dev) dev->tstamp.tx_tstamp_iova = ts->iova; dev->tstamp.tx_tstamp = ts->addr; - 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; - } - /* System time should be already on by default */ nix_start_timecounters(eth_dev); @@ -264,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); -- 2.18.0