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 D1D96A054C for ; Fri, 14 Feb 2020 18:04:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CAF84F72; Fri, 14 Feb 2020 18:04:24 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id C243E1F28 for ; Fri, 14 Feb 2020 18:04:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581699863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oh9VgubVx+Nve9QjahEUUee2oNxJOFt1+v3LKSOjHPg=; b=VaHIn4p5gFTPRUZ79jq2VglCgr655W7YRsn26nA2q5wVSH/VIuwGwHqNUqLQ4ZZOITRIzM lCRIsz+0+J0V/Re9YZzH00ByTNGY/855WhNFnDnLukbyL5MjRIOSMFRF+7sV8r/pOERuPZ /BrVWlb26eHr2jJpXn1bd0usSXt65lg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-KtXXjTFmMjSeHJj8t3fHeQ-1; Fri, 14 Feb 2020 12:04:20 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1346818B9FB5; Fri, 14 Feb 2020 17:04:19 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 927AB8AC4D; Fri, 14 Feb 2020 17:04:16 +0000 (UTC) From: Kevin Traynor To: Viacheslav Ovsiienko Cc: Ferruh Yigit , dpdk stable Date: Fri, 14 Feb 2020 17:03:00 +0000 Message-Id: <20200214170337.25093-6-ktraynor@redhat.com> In-Reply-To: <20200214170337.25093-1-ktraynor@redhat.com> References: <20200214170337.25093-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: KtXXjTFmMjSeHJj8t3fHeQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'ethdev: fix switching domain allocation' has been queued to LTS release 18.11.7 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/20/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/2376793d11fc74b4f0= 52c1fa592591186149f1e0 Thanks. Kevin. --- >From 2376793d11fc74b4f052c1fa592591186149f1e0 Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Thu, 16 Jan 2020 16:19:54 +0000 Subject: [PATCH] ethdev: fix switching domain allocation [ upstream commit 7e9165b1beb77554916686cb4ff4d16c4e995b74 ] The maximum amount of unique swutching domain is supposed to be equal RTE_MAX_ETHPORTS. Current implementation allows to allocate only RTE_MAX_ETHPORTS-1 domains. The definition of RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID is changed from 0 to UINT16_MAX, the rte_eth_dev_info_get is updated to initialize dev_ibfo structure accordingly. Fixes: ce9250406323 ("ethdev: add switch domain allocator") Signed-off-by: Viacheslav Ovsiienko Reviewed-by: Ferruh Yigit --- lib/librte_ethdev/rte_ethdev.c | 4 ++-- lib/librte_ethdev/rte_ethdev.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.= c index 51954456c2..13866150ef 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2525,4 +2525,5 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth= _dev_info *dev_info) =09 */ =09memset(dev_info, 0, sizeof(struct rte_eth_dev_info)); +=09dev_info->switch_info.domain_id =3D RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALI= D; =20 =09RTE_ETH_VALID_PORTID_OR_RET(port_id); @@ -4360,6 +4361,5 @@ rte_eth_switch_domain_alloc(uint16_t *domain_id) =09*domain_id =3D RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID; =20 -=09for (i =3D RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID + 1; -=09=09i < RTE_MAX_ETHPORTS; i++) { +=09for (i =3D 0; i < RTE_MAX_ETHPORTS; i++) { =09=09if (rte_eth_switch_domains[i].state =3D=3D =09=09=09RTE_ETH_SWITCH_DOMAIN_UNUSED) { diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.= h index a9472af62a..7b4221d7b4 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -1055,5 +1055,5 @@ struct rte_eth_dev_portconf { * domain definitions. */ -#define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID=09(0) +#define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID=09(UINT16_MAX) =20 /** --=20 2.21.1 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092020-02-14 17:02:37.389188970 +0000 +++ 0006-ethdev-fix-switching-domain-allocation.patch=092020-02-14 17:02:36= .931408356 +0000 @@ -1 +1 @@ -From 7e9165b1beb77554916686cb4ff4d16c4e995b74 Mon Sep 17 00:00:00 2001 +From 2376793d11fc74b4f052c1fa592591186149f1e0 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7e9165b1beb77554916686cb4ff4d16c4e995b74 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index aec2d0f704..42ce177fe1 100644 +index 51954456c2..13866150ef 100644 @@ -28 +29 @@ -@@ -2969,4 +2969,5 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_et= h_dev_info *dev_info) +@@ -2525,4 +2525,5 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_et= h_dev_info *dev_info) @@ -33,2 +34,2 @@ - =09RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); -@@ -5065,6 +5066,5 @@ rte_eth_switch_domain_alloc(uint16_t *domain_id) + =09RTE_ETH_VALID_PORTID_OR_RET(port_id); +@@ -4360,6 +4361,5 @@ rte_eth_switch_domain_alloc(uint16_t *domain_id) @@ -43 +44 @@ -index 18a9defc24..d1a593ad11 100644 +index a9472af62a..7b4221d7b4 100644 @@ -46 +47 @@ -@@ -1197,5 +1197,5 @@ struct rte_eth_dev_portconf { +@@ -1055,5 +1055,5 @@ struct rte_eth_dev_portconf {