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 DF3F2A046B for ; Thu, 25 Jul 2019 17:30:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 160981C310; Thu, 25 Jul 2019 17:30:19 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id A36D61C30E for ; Thu, 25 Jul 2019 17:30:16 +0200 (CEST) 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 x6PFUC9d009886 for ; Thu, 25 Jul 2019 08:30:15 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=pE6ySGXxWG1LMykRvknAx3Dj+U79wNsmWc4APwU+JyU=; b=MqP5JkWMo0T0afihAfXndXAj+e+a5hypcp0ygcUo1FsluTeONy3YjF5MUIrpE7GGcUeB yerWgQGlcYU8mtwxZGyfTtI8MnHwnVDO1uNJHI0SgcoP2osTMLEi9FnBZfs1/O11kPog WQXacczg7U+41JD7nKWx2Y4yUNlKbyfDWleKJHOFPM3GWvi2CcuQcZzwaNdtTjA0Oei9 +EsmQ7AfbdvjopGSSID35QxZZvD7zj8lapVzFrK4/O99vKhTTHMJGDapT/4rnok2pKGg yW1rxJOLl0/d7w+gjyS8N8iTCmm+Vm4oZbwM2pdtOgh7T7s3FEROwY+pIDPUIOceMs1r CQ== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2tx61rj65x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 25 Jul 2019 08:30:15 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 25 Jul 2019 08:30:14 -0700 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (104.47.40.58) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Thu, 25 Jul 2019 08:30:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Psd90KGU4G/U+iXSQ6vwyG19f7CzQRZyBd7aeZcN0tEzhzFD+jJpMTmzhIO5m2V1Y8n2TcitsGvm353EuRpp+2niT7spaqesVmE4nsijx2efnTjSey/B7l7Pm16qb1HeLMQM7HdzEegR8LWKz26pNoinECVTtbadJ+ehcnPCd8JlL2TNMpHhVQbXzt6g2Wm8PaHBizG852eBGgYh0uFh8rA4D7ei2Fcp7boYHD4g61ZMr663jwbGtDgoTVZgRz9meAUemedjlNumF3rsgYSS2TBETEp0tO06o289bX2aruqZj0r3bIxmRF7b8RVASqQVNWNt/Fi6+v4GgWD0R/gkJw== 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=pE6ySGXxWG1LMykRvknAx3Dj+U79wNsmWc4APwU+JyU=; b=VElRpqq72R5+M0wQjvmPV++252eD0ovHdZFFERBHiXmToHCXUxotNFsKnp7KwFgKmrirNu1mQNh9AlrXBGlXhmKubOTy1PaTYm7tpjw+IrHj58T3HkZk2ZJskeyK98u8g+IBifHwkMQk/ML+QKz77vCD936okLUzroO1qsGX+QKSZoB8f7PVS9NWVIpiwOTGT8Ob6RJDNkU7BVoxRGfMtXDZOmXpM1y85WXVwYq1VOV2nC6ZOZpqZUJlExzE5ZPn0r4Wqnd089lEUcyHu/P+Tii7luCGTTXP2m3Woqt4TXZCe2/ew/fNoZZijvf1doiE47sL/2CdbpTeAGkuDYFFsg== 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=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pE6ySGXxWG1LMykRvknAx3Dj+U79wNsmWc4APwU+JyU=; b=nHTQgz1H57edAmifJI0tsaXRpW1AI8IvbZ5Hszb7FmpQ1UGwsOpw2p3r3iGNqUcCRh7VbK2WMFvsgxdzCwutQ7nDB4e5f/TijZvTrVs+jROzG5oXNcTpoX9mfSq3JDq8rCOUIpTJq5NjYvR3MgZrWWbsTeVsE9rUA6L7dvCW3bs= Received: from MN2PR18MB2848.namprd18.prod.outlook.com (20.179.21.149) by MN2PR18MB2813.namprd18.prod.outlook.com (20.179.21.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2115.10; Thu, 25 Jul 2019 15:30:11 +0000 Received: from MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::4447:9459:5386:2e18]) by MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::4447:9459:5386:2e18%7]) with mapi id 15.20.2115.005; Thu, 25 Jul 2019 15:30:11 +0000 From: Harman Kalra To: Jerin Jacob Kollanukkaran , Nithin Kumar Dabilpuram , Kiran Kumar Kokkilagadda CC: "dev@dpdk.org" , Harman Kalra Thread-Topic: [PATCH] net/octeontx2: fix PTP enable via Rx ofload flags Thread-Index: AQHVQv3Zp+GRkn9Ox0e0Sh60KVOjfg== Date: Thu, 25 Jul 2019 15:30:11 +0000 Message-ID: <1564068596-1231-1-git-send-email-hkalra@marvell.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0021.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::31) To MN2PR18MB2848.namprd18.prod.outlook.com (2603:10b6:208:3e::21) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 44e03698-8d0d-4d3b-fdc0-08d71114fb9e x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MN2PR18MB2813; x-ms-traffictypediagnostic: MN2PR18MB2813: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 0109D382B0 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(396003)(366004)(346002)(136003)(39860400002)(199004)(189003)(53936002)(6486002)(14454004)(6436002)(86362001)(66556008)(486006)(25786009)(6636002)(66446008)(64756008)(66946007)(66476007)(55236004)(71200400001)(50226002)(71190400001)(476003)(316002)(52116002)(99286004)(102836004)(26005)(6506007)(4326008)(36756003)(386003)(8676002)(5660300002)(8936002)(305945005)(81166006)(2616005)(478600001)(3846002)(6116002)(186003)(14444005)(256004)(54906003)(7736002)(6512007)(2906002)(68736007)(81156014)(107886003)(66066001)(110136005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2813; H:MN2PR18MB2848.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: HfEKFIBk2OST6BxPOtS0BWebnghBjfEONvxgt+WlQgPNUUN72KS7Vol7OasihVLqMktXyU6zE2Xl235cKsONZ86xArTZRBT7gAhIe+r5QXH93aXBtU6EqEPeFNNvod2F16+N7yQQWmlSs2cJ44kwe05i74ujfG3xF2NmVg3E9C21TaegDSZ23fKU/To8J6JjlolUlwI6cbvs0YDjofrEwmBfDrIOIzxZrw2xK73g0pfz8evSE0b45Smps+Ahxh3wbtPc5ESV20GH/Mw6yWnKMAYKRfsjHqlrBlXEXHrlx2zUYAhhbyejcPAyM6oWXcNH51YiAW6iTOTxqL0wKCvJnXAe1aatiEqFT2CzVw4EDpPCrV9Wnq/BomHtwl3cmne+Jv2QhHwe6Z78zVOWRw1tv7IBFuMFDjvD0fxWI2ISUDA= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 44e03698-8d0d-4d3b-fdc0-08d71114fb9e X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jul 2019 15:30:11.6892 (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: hkalra@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2813 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-07-25_06:2019-07-25,2019-07-25 signatures=0 Subject: [dpdk-dev] [PATCH] net/octeontx2: fix PTP enable via Rx ofload flags 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" Earlier implementation for enabling ptp via RX offload flag was causing segmentation fault as it was getting executed in the device configuration stage where RX and TX queues were not configured. As in the ptp enable process rx queues are used for mbuf setup while tx queues are used for send descriptor setup. Moving the logic in dev start as all the resources will be configured. Fixes: b5dc3140448ee ("net/octeontx2: support base PTP") Signed-off-by: Harman Kalra --- drivers/net/octeontx2/otx2_ethdev.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/ot= x2_ethdev.c index 725fb2431..f6774d01d 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -1333,16 +1333,6 @@ otx2_nix_configure(struct rte_eth_dev *eth_dev) goto q_irq_fini; } =20 - /* Enable PTP if it was requested by the app or if it is already - * enabled in PF owning this VF - */ - memset(&dev->tstamp, 0, sizeof(struct otx2_timesync_info)); - if ((dev->rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP) || - otx2_ethdev_is_ptp_en(dev)) - otx2_nix_timesync_enable(eth_dev); - else - otx2_nix_timesync_disable(eth_dev); - /* * Restore queue config when reconfigure followed by * reconfigure and no queue configure invoked from application case. @@ -1569,6 +1559,16 @@ otx2_nix_dev_start(struct rte_eth_dev *eth_dev) otx2_eth_set_tx_function(eth_dev); otx2_eth_set_rx_function(eth_dev); =20 + /* Enable PTP if it was requested by the app or if it is already + * enabled in PF owning this VF + */ + memset(&dev->tstamp, 0, sizeof(struct otx2_timesync_info)); + if ((dev->rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP) || + otx2_ethdev_is_ptp_en(dev)) + otx2_nix_timesync_enable(eth_dev); + else + otx2_nix_timesync_disable(eth_dev); + return 0; =20 rx_disable: --=20 2.18.0