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 CB0C6A046B for ; Thu, 25 Jul 2019 17:52:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CF4DF1C37C; Thu, 25 Jul 2019 17:52:04 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 869051C36E for ; Thu, 25 Jul 2019 17:52:03 +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 x6PFpNSb026918; Thu, 25 Jul 2019 08:52:02 -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=WSMB9Gh66V7Y0aCbEIbGf9BB0brx0S1gO5tZxdgIPNY=; b=WTub+8/YDOAojIJFPQwdW6OFZHv2K9ThTfEAqXO55aU09jcetVZNuMiM3KZ++UgWuiVS RZotL+judsBBUCCS8vysmZzNdtnKAbRBF7R/9G8HkNdHASTr1/NC8k+iG2IcOO5pxrUX bQaCNbXNF8WzXoOIFIApJSng6sQdkXByv0cMpeRm930Pwnl4JYl2IiU1ApMP89BWHAcT PmsFYJ/IzQcWUVnFaK1OiBc9ZLy7tk0nzgJiSOCy86zJKcZzewLI/VE6ySrEQZA4eUfl dg3BbZTMm1XmZHmgTRrhwGgfUSPknJsSS4A5McFF+xc8i3FMNOBSJRX4NuWZcJvsCgEL 7Q== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2tx62520js-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 25 Jul 2019 08:52:02 -0700 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.1367.3; Thu, 25 Jul 2019 08:52:00 -0700 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (104.47.40.56) 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:52:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cWLuQkB9paQDUzKh0nhCgwlkrYKItjlZL1tPgEGe2dnZQaoAAnUGjQUPMXaoXomTXJzx6tQvt4TmUUXPHLA0JNpZtpeImnwAil1G7lEI/IFvrVvA93O/b3PD+n0+30eiekxYypMzzrP4C5HQE1bklKH9m1q8lcASJd1C0j3hY7G6u5W+zr0PjHYdH9IY0nLetpiEx4vT5nGeAm2lz/OxiE2OxTcZW+HixM2uePNqqwYvMXdhc6h/9rjdGTxsbaEye+Up0/UgFQgU6/kL1IUAJH6aDEQyoxikz//DCxiG9VtCg0SDCI3fTryqcE5PvvHP7Nwqkq/IUjVpYm+RbV/0Iw== 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=WSMB9Gh66V7Y0aCbEIbGf9BB0brx0S1gO5tZxdgIPNY=; b=BLr38g82SEw5jeipYz2S9Y97C+0piPw7W0lf1p/9UqIG8FNtX93iLQYXBGw7DzQY6WGp1Pxpl28j6gniqPLdAgZ0ba5Zqw5iG+usWCuXfwJS6eZrfsedVHjOl4mZVD2iS2GtcxyxnVV7T0sIWrFZ1ZgtVx0ugFDs9GmOuHTZdAieTOOPdwviM+U/lo5sxv0iKSSA//lOsTz3cjqlPOfGOS8qcP8zvTVuotTYjtvO6YmWPMDZG557tK88vw4TQfvTa8peGx7sguTdYFbJYHA4qRM3CNLZKaOUJkQmvqhb9VcvCG/0fWR26OowjxsFO6hUHLclG7jvgOcefEBP7x0+jw== 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=WSMB9Gh66V7Y0aCbEIbGf9BB0brx0S1gO5tZxdgIPNY=; b=UBe5OR23NP63v3lQ9aDrSkQ0Dy1/kjLxQNVJkMxZXt6D9kkM5olsHkdvBupxNCnK7CAemxkg2zP+kyag4+jkKdkuYReZIkbtCmTe3c48D0OPswI1bHt1h503Br3aNizvj8lXAkx2v2jibiAlBV9SPHGpl8nT27bgJjlUj/yLq6U= Received: from MN2PR18MB2848.namprd18.prod.outlook.com (20.179.21.149) by MN2PR18MB2637.namprd18.prod.outlook.com (20.179.80.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2115.13; Thu, 25 Jul 2019 15:51:57 +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:51:57 +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] examples/rxtx_callbacks: fix HW timestamp enable Thread-Index: AQHVQwDjmhj5fSrF40Cc6qCNGgyhrg== Date: Thu, 25 Jul 2019 15:51:57 +0000 Message-ID: <1564069902-3500-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: PN1PR0101CA0036.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:c::22) 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: 8155f350-22a0-4e00-7907-08d711180628 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:MN2PR18MB2637; x-ms-traffictypediagnostic: MN2PR18MB2637: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2657; x-forefront-prvs: 0109D382B0 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(376002)(366004)(346002)(39860400002)(136003)(199004)(189003)(5660300002)(71200400001)(71190400001)(6506007)(386003)(2906002)(186003)(55236004)(86362001)(14454004)(36756003)(6116002)(3846002)(52116002)(102836004)(99286004)(316002)(26005)(476003)(256004)(7736002)(53936002)(54906003)(110136005)(8936002)(66476007)(66556008)(4326008)(486006)(66446008)(6512007)(66946007)(64756008)(478600001)(25786009)(6436002)(6486002)(2616005)(50226002)(68736007)(81166006)(66066001)(305945005)(81156014)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2637; 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: EwWyscczeUUHHrBv5413sB9zV7vWvUlsF/WXTok/FRkyDD3YbrIt2rK4Lr1N6OaYwgvDvgxkwPyBf9DdOUkV0FXW28wxgEzQRi3kSouENYRG5UtDPan/TTYfi5ThnkLkdzG0rjQtgFOFZHCh6SnEikTsvaRwr7NGPZlnhSaciOoHLkQt0HOtIOQDntzVmQdOuArr8SAN1K2/fwaPhv8S+pZOFwKcRU4STBv1dn98unbHuT65key/LgYxtdPC39i9x24z4S6KEkCYt8T5Crc75z8LoBZdFwCZi6ZvyHZ63MP5bgQbBCTZuaB09xFPL6pI55yE+82j5syifiiMUmEm37FJMHGGUH8eQ9gtjxp7C8yFax1pERdU8xjJHaefNsaudLZZ3QQ/cIQBscZ5K4+CPCBNZjPLDVJHOdDHGjHptms= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 8155f350-22a0-4e00-7907-08d711180628 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jul 2019 15:51:57.8266 (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: MN2PR18MB2637 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] 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" Offloafing Rx timestamp is a device capability than queue capability. Hence the logic to enable HW timestamp via DEV_RX_OFFLOAD_TIMESTAMP flag should be before device configuration. Fixes: cd1dadeb9b2a ("examples/rxtx_callbacks: support HW timestamp") Cc: barbette@kth.se Signed-off-by: Harman Kalra --- 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