From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680089.outbound.protection.outlook.com [40.107.68.89]) by dpdk.org (Postfix) with ESMTP id 16DEF4CB5; Wed, 14 Nov 2018 10:22:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Os1VCo7ohUrAfKnvmVL3osP60x/iZEg8XGmSvQ2hfLg=; b=XM2nPR+AHa3NKcJLvvAo+wALZ1W9sfmXV1sxPSrG8QxnBmI2/XR2Sfb0qXUns4ZNSEHBgWvgU4Sfk3dMQIlabu2ZA85/a8CPYMrM2Qqj6GJ3B7EP/jbYWkqjOaeFdpcCkU0DcadNjZN2eZO4ontqorGd+pI0igr1XZZG07yhhZU= Received: from SN6PR07MB4911.namprd07.prod.outlook.com (52.135.77.157) by SN6PR07MB5117.namprd07.prod.outlook.com (52.135.101.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Wed, 14 Nov 2018 09:22:04 +0000 Received: from SN6PR07MB4911.namprd07.prod.outlook.com ([fe80::cd76:e8cc:c0:ebf4]) by SN6PR07MB4911.namprd07.prod.outlook.com ([fe80::cd76:e8cc:c0:ebf4%3]) with mapi id 15.20.1294.045; Wed, 14 Nov 2018 09:22:04 +0000 From: Anoob Joseph To: Ferruh Yigit , "Jacob, Jerin" CC: "Joseph, Anoob" , "Athreya, Narayana Prasad" , "Bhagavatula, Pavan" , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/octeontx: fix failures when available ports > queues Thread-Index: AQHUe/uBggOzRVWYzUaHl+8mxb8Qdg== Date: Wed, 14 Nov 2018 09:22:03 +0000 Message-ID: <1542187282-30800-1-git-send-email-anoob.joseph@caviumnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [115.113.156.2] x-clientproxiedby: BM1PR01CA0137.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::31) To SN6PR07MB4911.namprd07.prod.outlook.com (2603:10b6:805:3c::29) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5117; 6:kyhV1VeNlX1WaNWmqPSzaX1EEQyGGCpdai7grOowvJ3HvuDlXVFwj/8Pn7QwKfT63y1MKUxpM+8qP6+DqDERBVFyifKdHChAH1mvRKH8D0TkPXH+XZ2QnCLa948boohpw9SYrkFbSMeZFAK+THtIw4SoCJnoebBjxKXT2IfrnfXf/wLZGLj2XofvZKDx7zJSbfiBABrNAZxEPGYS13QZWwuURPQfL4Yn0WgzxzdNqmwTU5tn8/vQD1jlyYwiGlkiqpjx+pwW5rLrRLcgU3XLbOCzVwSF9ObbPod+XB1Z6Y8r+UbNak9/b2UmIwJP3h9bZJmR5sm3Az4OBpWwlto9C5tRpBGykEoTtzzLKATH82jd9fmBsJouy6aYbY95m00w5UxqktE52hqmd98EH9lr4OiqY5OoM6D821CqbWvd7iUml2VMfT4Zgok3Qj8l+3Z89Nif5Uuvq+MK3eOiblK0bQ==; 5:1bXyJ5GUHepyTa0+efsFYTgpvQNgQVRYHBENlD0ORSlmj3pS9lR9IEAozSbFibaWtL2ZSmzml4RcDtVddfzGqXIDyAy/rW+BhjyDcmGmVZEJijYp2/w8f1F+XGP6X86rs/m7IZOMLb7aynuC8tDOI3SorYvxMFf8LrhUDVeOnfo=; 7:LZbQqCL+FE5iFpRsOjtY5UwEoSlQUtRkg/5evkdCt3MwyLMXIYBy1m2QHtDorSrhQ9tKZCZwO/uACD5eHyAsZ83B8yrXa0F7TQ48ZgM+EaHzNDbDBDt0vcxLkbAoapNUxuM01KcWpmXjrpzl48jp7Q== x-ms-office365-filtering-correlation-id: e3bbf003-7803-4ca2-e079-08d64a12a398 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5117; x-ms-traffictypediagnostic: SN6PR07MB5117: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231410)(944501410)(52105112)(93006095)(148016)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5117; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5117; x-forefront-prvs: 085634EFF4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(376002)(366004)(346002)(39860400002)(189003)(199004)(110136005)(26005)(71190400001)(71200400001)(4326008)(2906002)(8676002)(106356001)(478600001)(2900100001)(186003)(316002)(6436002)(81166006)(81156014)(386003)(14454004)(6486002)(6116002)(6512007)(6506007)(55236004)(102836004)(3846002)(53936002)(54906003)(52116002)(72206003)(97736004)(5660300001)(99286004)(68736007)(36756003)(105586002)(256004)(8936002)(1857600001)(486006)(66066001)(476003)(2616005)(7736002)(42882007)(305945005)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5117; H:SN6PR07MB4911.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 12cvmU3bI1GWcYEFLTmvLGCKWgJYLRXE8YtBNzxFUwmH0cfrFrXuIcsrsCvmVCDk8XF3+c4fy2ohgDd53N9lTW3zrUEo9e9XpUVQQj68gR1KMv35qtuwEbuMMnxNK+gHQjgWhxbG5wlz889QaAaRsxY6PPky8kdVRi4WQyyqmx+o8BkXLq7mESkCxdra7drqnKMT0LSmjTqDlmYgmL5fKQk4/ei6vctbBxM/J3VqiFuzTakoh4BEV8eRHPJlYHk43EJX3MkJQGXTUs1vKLldN1VOZC0K0abchY5VjgdlSLdHy6FUBcOWmDQqiyDOFWxLesjMimAdol+HR+jtn671K2Jj6mfgDariZEkZiG04vFs= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3bbf003-7803-4ca2-e079-08d64a12a398 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Nov 2018 09:22:03.9859 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5117 X-Mailman-Approved-At: Fri, 16 Nov 2018 11:06:35 +0100 Subject: [dpdk-stable] [PATCH] net/octeontx: fix failures when available ports > queues X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 09:22:06 -0000 When eth_octeontx is initialized before event_octeontx, eth_octeontx would initiate setting up of the event device with the max ports and queues available. If number of ports is more than the number of queues, some ports would be left unused when the ports and queues are mapped 1:1. But even in that case the ports need to be setup, or otherwise it would lead to a segmentation fault when event device is started. Fixes: f7be70e5130e ("net/octeontx: add net device probe and remove") Signed-off-by: Anoob Joseph Signed-off-by: Pavan Nikhilesh --- drivers/net/octeontx/octeontx_ethdev.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/= octeontx_ethdev.c index 0681486..9c421d5 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -1237,15 +1237,8 @@ octeontx_probe(struct rte_vdev_device *dev) res =3D -EINVAL; goto parse_error; } - if (pnum > qnum) { - /* - * We don't poll on event ports - * that do not have any queues assigned. - */ - pnum =3D qnum; - PMD_INIT_LOG(INFO, - "reducing number of active event ports to %d", pnum); - } + + /* Enable all queues available */ for (i =3D 0; i < qnum; i++) { res =3D rte_event_queue_setup(evdev, i, NULL); if (res < 0) { @@ -1255,6 +1248,7 @@ octeontx_probe(struct rte_vdev_device *dev) } } =20 + /* Enable all ports available */ for (i =3D 0; i < pnum; i++) { res =3D rte_event_port_setup(evdev, i, NULL); if (res < 0) { @@ -1263,6 +1257,14 @@ octeontx_probe(struct rte_vdev_device *dev) i, res); goto parse_error; } + } + + /* + * Do 1:1 links for ports & queues. All queues would be mapped to + * one port. If there are more ports than queues, then some ports + * won't be linked to any queue. + */ + for (i =3D 0; i < qnum; i++) { /* Link one queue to one event port */ qlist =3D i; res =3D rte_event_port_link(evdev, i, &qlist, NULL, 1); --=20 2.7.4