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 DEA79A0487 for ; Tue, 30 Jul 2019 09:46:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5E8761BF53; Tue, 30 Jul 2019 09:46:51 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 566281BDF1 for ; Tue, 30 Jul 2019 09:46:49 +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 x6U7ieB4002026; Tue, 30 Jul 2019 00:46:48 -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=XsHxopUVBC3W4Ff1fbSKrGthdbib2Bo32tRkGqpncNw=; b=stKXPUjRaVxi11kpiKnSIPufzSRDJYS0RyGb4V2itYTuLGix5LwgT5WmF56RTcKSLOZO cPx0ZIqeG+MYPjzFgtuVeo6M2NNEOkwOgJZCLav29jpW7Pm+iAVOlGOS9WZk+NjON2Al Uho8IA4+MG7LrHJZjZ5HFB9e8Jrdo2T2/eGRgF8j0LAgp3bLYAgQI8NCFwDuvcCi5A99 CcuVcpQkAgN5FgZwyltz4TJCRKgETaAdW9FzExsccLmH1d9kybf+6xFk554Tq/KTXQD+ DQsdEHxKKBl1jnXsYj9n+1ULJDbKOVTSht10VyCh0T9BcX8kmv6IEo16CLdTL9opeypR bQ== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2u0kyq3uvk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 30 Jul 2019 00:46:48 -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; Tue, 30 Jul 2019 00:46:47 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.56) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 30 Jul 2019 00:46:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d5DDbSHG57+vzk5997TD6xwp/mGH4mOybHpWOt6u+oqLs8oEAHTCI5kFOSgZdi4miXgLFn8aRadGPfrKPnKS74IHw+27vkWcrQ/vRjMGeWtl1xJDb1/y6uvji7fPwIqxtbvEaQ0NH459dpzkQrLbCWaqJZQMzTPE4X9UC0ldUuFUfu445eNU5lg7zjrJlJihA34FIEVU4OQTotOiON8E/hDva16iEla/pnFlEV63Rw5xqFb1/fDnLNbA1mjpm0iRE9blE2zNmXh0YHqt+EGjV6pGCN5D+HXAMwXrG/pIVRRnVjmsJhQa/7PRsb+HuMa2VSqdhhG1MtDkDdQ+rSqKgg== 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=XsHxopUVBC3W4Ff1fbSKrGthdbib2Bo32tRkGqpncNw=; b=ZTXDSmTt8Lqy/vJX9PuESVFVeTy5kkYGtuhwnI+CFylwq8w4MlHOTzUnpDtVzUOnwETldioR1KsNbnoh5i5xzC0YdZGF9L0pu2YUhx+PvSlZC4OHPKkJF9ceZnN+nzgJL32J5gjpl7tu44FGvMXCg0jMmNDFj3Na7i2/gT/MWKrmklLD16SeCw8KKOZ/o2h+YSvbMy9Nhru97Nlv6c1wXRhZMYD0iFprmbA3m6Qsx2NYihbSyBgvogN8TSJznyVO/109mzYENE+Wqi9arNxegxvmIHqXauPHfOEWftD3YFO81TeHQu77sT1jUdgYtODaGIOv9XezMgHcBG5JNwsRqA== 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=XsHxopUVBC3W4Ff1fbSKrGthdbib2Bo32tRkGqpncNw=; b=hsW3/tMecmv7ZvH0Nd0XpFl3OSV2Kl2fj3Bpku215/z3bqKZIwiJjxJAw/6OEhQzhESpvm0vyGVv5pwdrnmuUitc+egQ1IRazoNHnlhb9ay98ohjqFnrLe8gZsKn3ibCRFQ0oO2RZOmVKIZCq8ZwXX0CVdeF93ZpqExTk5SuoOE= Received: from MN2PR18MB2848.namprd18.prod.outlook.com (20.179.21.149) by MN2PR18MB3248.namprd18.prod.outlook.com (10.255.237.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2115.15; Tue, 30 Jul 2019 07:46:45 +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; Tue, 30 Jul 2019 07:46:45 +0000 From: Harman Kalra To: John McNamara , Pablo de Lara , Bruce Richardson , Harry van Haaren , Xiaoyun Li CC: "dev@dpdk.org" , Harman Kalra , "barbette@kth.se" Thread-Topic: [PATCH v2] examples/rxtx_callbacks: fix HW timestamp enable Thread-Index: AQHVRqrv6uzdDlI68UCdnnhcTbQ5aw== Date: Tue, 30 Jul 2019 07:46:45 +0000 Message-ID: <1564472662-31089-1-git-send-email-hkalra@marvell.com> References: <5296418.QIOJa9lHfJ@xps> In-Reply-To: <5296418.QIOJa9lHfJ@xps> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::14) 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: 380d0874-d658-47a1-7b40-08d714c211be 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:MN2PR18MB3248; x-ms-traffictypediagnostic: MN2PR18MB3248: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:404; x-forefront-prvs: 0114FF88F6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(346002)(376002)(366004)(396003)(136003)(189003)(199004)(66476007)(102836004)(6116002)(71190400001)(55236004)(52116002)(6506007)(3846002)(386003)(71200400001)(66066001)(99286004)(486006)(5660300002)(6512007)(66946007)(76176011)(186003)(36756003)(64756008)(66556008)(66446008)(305945005)(53936002)(54906003)(110136005)(256004)(6436002)(11346002)(81166006)(81156014)(4326008)(50226002)(8676002)(68736007)(14454004)(26005)(316002)(2906002)(2616005)(8936002)(6486002)(446003)(478600001)(7736002)(476003)(25786009)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB3248; 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: lrpWM1KfVqfjWrXC75bUjEwi1DU7r27a+YYAk8m+Tk8q8vU/ZpI5pq6r8IklrpXaPBvy4qik3Eov1ZjkxpC8eAAKIWc6TLq56Wniws5mhDfMKSaVNEhoIfgH3dVfrkYeyirLPvJOEQjWChCdaW1QSKHtNmO3qBMovucSZkLEtL5LYng/GaEoApzMe7XrYOj+/MFGB8Jjzigjgu0/qz8HQboEa2Y9OM08ldzM2QPvjg0UFHBhAQAUU0oJflhEDlzINFKZDqZc7GDMQwed2T2kZ3R8WqjMafEqKJr6lGOluKY0ErOENqcEA9rlaUmpQFMihaoXSgNAWjmEtL7W7n/7gielU76O/lsfwkwvRzeVR/YBIu8bnaZ9lhStxWx8yLGJRZGQa57Xa1AjMfjf7qWvA24GCpVJPI5rYHijIR1Nd3c= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 380d0874-d658-47a1-7b40-08d714c211be X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jul 2019 07:46:45.1530 (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: MN2PR18MB3248 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-07-30_03:2019-07-29,2019-07-30 signatures=0 Subject: [dpdk-dev] [PATCH v2] examples/rxtx_callbacks: fix HW timestamp enable 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" Since all PMDs doesn't implement per queue offload capabilities but supports RX timestamping and also since rx_offload_capa includes all rx_queue_offload_capa's. Hence moving the logic to enable HW timestamp via DEV_RX_OFFLOAD_TIMESTAMP flag before device configuration so that this application can work with all PMDs. Fixes: cd1dadeb9b2a ("examples/rxtx_callbacks: support HW timestamp") Cc: barbette@kth.se Signed-off-by: Harman Kalra Reviewed-by: Jerin Jacob --- V2: * More detailed commit message. examples/rxtx_callbacks/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.= c index c1abe9e1a..dbcd9f4fc 100644 --- a/examples/rxtx_callbacks/main.c +++ b/examples/rxtx_callbacks/main.c @@ -117,6 +117,15 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool= ) port_conf.txmode.offloads |=3D DEV_TX_OFFLOAD_MBUF_FAST_FREE; =20 + if (hw_timestamping) { + if (!(dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TIMESTAMP)) { + printf("\nERROR: Port %u does not support hardware timestamping\n" + , port); + return -1; + } + port_conf.rxmode.offloads |=3D DEV_RX_OFFLOAD_TIMESTAMP; + } + retval =3D rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); if (retval !=3D 0) return retval; @@ -127,15 +136,6 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool= ) =20 rxconf =3D dev_info.default_rxconf; =20 - if (hw_timestamping) { - if (!(dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TIMESTAMP)) { - printf("\nERROR: Port %u does not support hardware timestamping\n" - , port); - return -1; - } - rxconf.offloads |=3D DEV_RX_OFFLOAD_TIMESTAMP; - } - for (q =3D 0; q < rx_rings; q++) { retval =3D rte_eth_rx_queue_setup(port, q, nb_rxd, rte_eth_dev_socket_id(port), &rxconf, mbuf_pool); --=20 2.18.0