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 40DA6A046B for ; Sat, 27 Jul 2019 15:56:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 915481C293; Sat, 27 Jul 2019 15:56:30 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 7E5361C1BA for ; Sat, 27 Jul 2019 15:56:28 +0200 (CEST) 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 x6RDq5os002092 for ; Sat, 27 Jul 2019 06:56:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=hmmAN2znjilFye28MUYG5aT+rMQdwbBco+kmQE3rPRQ=; b=PAKjGXeqyOkEIgzRHfXN3lC2hDnluwIop4vag/jyV9EqBoEmij8Gh1E/LhBNXuti91M9 FaAknRi1ZNB+rt+H9Knl7WacG+BfJeKzoKGVen9KilO8BZGKZinsVWPjx51FOYIkhmDi q/zzxiIjeqiP4kWW5PBzQ/WAJN9TP4vsxNyMBSrauTYmvTQOtlD96DxUkH1JWtYx4d8D Yuo/BmMDQWH+OGgkE9mNmv5x2293KRRlWMeGzFx4uBIn6ddIF2uqkbv4PyWglPsTr6BP rNKb1sE64R3bJ03qKHDtl+ykf9+eiQGdzh2W/3Z03L3C3DAM2BmjM5Nrm1vVA09Jtz2I 2A== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2u0p4kra14-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sat, 27 Jul 2019 06:56:27 -0700 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.1367.3; Sat, 27 Jul 2019 06:56:25 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (104.47.32.59) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Sat, 27 Jul 2019 06:56:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A5aO5uP2KGIPt2ZZRmIBW3UFEg78CyrSorzPc5OeK8o/Nk4YYP+Pyd1V4xQYV38dHzH9NADIigay5Ap7HJuSe+soLQBrYYRA23XGF69JyjdS1ZLlackP8WwjwvsLKYcoQwWXUVHnVnuUtsc/ARvEBNhFDiN3vJdAU4CGUCQb8NZ6/7St87YqFrKPrLA5no5aU8SdW1LLB0hGE4+3YTh4tM+6rp+ATcoXKB4oy9Tjel1dlD65RkPWIw9MqxuI1KNPXTQ2wAWV8KzVdBvWD+81KewYVU1ybOx1F8bit6vaHU5BcgZZcj/3c0niL4vbvWW2AJrVrKaa4pOCMIDvA6Xyjw== 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=hmmAN2znjilFye28MUYG5aT+rMQdwbBco+kmQE3rPRQ=; b=NWC8HycQGuRH4ENz+wBEpIXMcRNiXbx2gOhimQTNm3aDBpzcFGxCOULq9kU25V1Mqelal2yH8mpl8Zl16Rm79d4jmaTL9ZYX9LRBm2X1xnSiNN59x2ufnwWDNLq/eeLYvkzjNFcCXNLEA5J+/37E61kkMHqN30mJXE8IPJIatl5MVF7fi7rI8urKa9JB/r3pog5hOVnX1hWlI8O/rci1BPRig/J39wOtGJvkoGG/fs3PPDFO5rl4moIOJ6hcBS7ABBbkQO+dD5oUqrNHtnA6TnUz351/Uy9H3ZkFBjl38kOmt/M560tKZbIWmBU+h3DZsOEOqBFCKGh3Km0/aKM1IQ== 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=hmmAN2znjilFye28MUYG5aT+rMQdwbBco+kmQE3rPRQ=; b=b5V4l3GviFr5dMMBVjvWt1QiUQqtZrSTzU6t5ADdGdutQ5SZXROz5vAs9vZ8eF5N8/X0LAhjOwnWejdJHDHSJ8xc9edyvmDXx4vN4+D1jXkH3D2KtsIQXjLNAGzupaoUKwNUALQ2YJL7gA3GD1FCyPpjxpFxs1iuy9fOslK/Aa4= Received: from MN2PR18MB2848.namprd18.prod.outlook.com (20.179.21.149) by MN2PR18MB3136.namprd18.prod.outlook.com (10.255.236.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2115.10; Sat, 27 Jul 2019 13:56:22 +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; Sat, 27 Jul 2019 13:56:22 +0000 From: Harman Kalra To: Jerin Jacob Kollanukkaran , Nithin Kumar Dabilpuram , Kiran Kumar Kokkilagadda CC: "dev@dpdk.org" , Harman Kalra Thread-Topic: [PATCH v2] net/octeontx2: fix PTP enable via Rx ofload flags Thread-Index: AQHVRIMSKat0N9sNoEKlg/4xXQoN3Q== Date: Sat, 27 Jul 2019 13:56:22 +0000 Message-ID: <1564235652-29983-1-git-send-email-hkalra@marvell.com> References: <1564068596-1231-1-git-send-email-hkalra@marvell.com> In-Reply-To: <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: PN1PR0101CA0037.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:c::23) 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: 661487ae-2d03-4977-d99e-08d7129a34f6 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:MN2PR18MB3136; x-ms-traffictypediagnostic: MN2PR18MB3136: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 01110342A5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39850400004)(396003)(376002)(346002)(136003)(366004)(189003)(199004)(64756008)(486006)(66446008)(66066001)(66476007)(53936002)(66556008)(316002)(66946007)(11346002)(476003)(99286004)(6636002)(6486002)(2616005)(8936002)(5660300002)(71200400001)(71190400001)(6512007)(446003)(86362001)(102836004)(36756003)(386003)(6506007)(8676002)(81166006)(81156014)(14444005)(256004)(6436002)(50226002)(76176011)(55236004)(52116002)(6116002)(3846002)(478600001)(68736007)(2906002)(54906003)(305945005)(7736002)(25786009)(110136005)(107886003)(4326008)(186003)(26005)(14454004); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB3136; H:MN2PR18MB2848.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: 8eM289XVFxbcNlW3S3YloWZShiIVdZg47rGybY1wheB/72zmLriZvp3xn7etRR5PKzkJpsYMUxvz1lNMwKJEtyo/RJYXpJqB5iEbfLaT/TxZJ0nOI8MYQooTEr+qUfRXogPFm5X/al2PugbWCzibGt8kUR8BuJ9AbkH4oEBo2CydpoyrgxhLL1H7Dp8e0uBSoABEBgkio7q/Yn9i52YXHPfC4J6WT7i5XeD09fIe4yRMqrnq8WwMeH36po8+daPbB9cNH1cOO+gLLM3HDlMtM3EqampKCMyxP5LCCcIejGURS/4aDXY4WfKhLuJBYkfvqQ9Df/IvIGVhortmnoQAk/GIKft+pMhRrrxzlGT8gHjC3qp/GZNScaIsokQHdfxOTDNV6C086HpqhMrN/jezVOJGv0CTOsOY//Nbq/JMmdk= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 661487ae-2d03-4977-d99e-08d7129a34f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jul 2019 13:56:22.1559 (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: MN2PR18MB3136 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-07-27_11:2019-07-26,2019-07-27 signatures=0 Subject: [dpdk-dev] [PATCH v2] 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 | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/ot= x2_ethdev.c index 725fb2431..b018b25b7 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -625,6 +625,9 @@ nix_tx_offload_flags(struct rte_eth_dev *eth_dev) if (conf & DEV_TX_OFFLOAD_MULTI_SEGS) flags |=3D NIX_TX_MULTI_SEG_F; =20 + if ((dev->rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP)) + flags |=3D NIX_TX_OFFLOAD_TSTAMP_F; + return flags; } =20 @@ -1333,16 +1336,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. @@ -1551,6 +1544,16 @@ otx2_nix_dev_start(struct rte_eth_dev *eth_dev) return rc; } =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); + rc =3D npc_rx_enable(dev); if (rc) { otx2_err("Failed to enable NPC rx %d", rc); --=20 2.18.0