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 F3DB8A051C for ; Tue, 11 Feb 2020 12:29:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E70FF1BE90; Tue, 11 Feb 2020 12:29:28 +0100 (CET) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by dpdk.org (Postfix) with ESMTP id 3C6461BE90 for ; Tue, 11 Feb 2020 12:29:27 +0100 (CET) Received: by mail-wm1-f54.google.com with SMTP id b17so3094077wmb.0 for ; Tue, 11 Feb 2020 03:29:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FJYIFa00K6nycRthHguxa0HYF0OAbbJjeV8CZmXORY8=; b=RLJoZO9eGIcb4+UJbAmXG4LBml/rNFVWQ0s+ET49QnHpz/o3DzSCFiHQQEQKB1Np5M FHY1B2z/I3on7EEaTP7t/LYt8oThlm4/JPB1CUD0WE6dFS7lPZVQwIQhH6zJRJAeXsVh Wk5DAhQMqb01H05zlsW/q/qOxQmTJSuSnz1KjFD7OZhUrVVG/K+7kUvXCX/Q81gr37xd TYSBJo//ipn6fpvpSNRWENFUsBkuoA+H4DniU+SwRXOWat9a2T5IobpsKNpT8qe09X05 g4KQpxmB6dgx5/iypsQi0BuSrlJp6QdapN9qeU1G5fQbT8xydr2H2ryKV2rqBd3L+e4R muSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FJYIFa00K6nycRthHguxa0HYF0OAbbJjeV8CZmXORY8=; b=TKSfNL/HxZWTlQHSd9f/lJeGN6nA27F732DOsoYS1Mc7Ant1CCUVTAsqmXSC1bh/vv tgCQUPm/+LbtcoWqe/AYiQCMWsNl5+vC9bnLnIh0SusjujxyIkjKdwshrlVfSF0G9OFw ofsZLa094jvn6UzIzZH0TyJDKkPBEeAbqBug0re+OBUWKOy1dGewKymilmPRjQsdWjgf q2ZMlNTeyY7ut81uBd6WgRv/V9ZHOOVt8WeqGsJE6g0P44jFqQSR7vNY6dnHrgfWkvcR kt84ArpkzYTCnNsQue5xkoN8+Br/X7qALMFcrwvkscQoijvAqMguchTWKLA8d+Xd6LNx /NRg== X-Gm-Message-State: APjAAAVitafV4fSTkTkwWFhnhqzI5ru0HQpWUh+sgT+VCsD+sCV821so 7FG1rJAmN4AGed8hIMrIVFc= X-Google-Smtp-Source: APXvYqyENOaPm5Uv0YbuVF3PPm3MssiFbl5Ru1arraPLm3+XlUodLyM693vMQvn79WrIpjFRrwKMQA== X-Received: by 2002:a1c:b789:: with SMTP id h131mr5162815wmf.148.1581420565906; Tue, 11 Feb 2020 03:29:25 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id i16sm3573762wmb.36.2020.02.11.03.29.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:29:25 -0800 (PST) From: luca.boccassi@gmail.com To: Viacheslav Ovsiienko Cc: Ferruh Yigit , dpdk stable Date: Tue, 11 Feb 2020 11:20:45 +0000 Message-Id: <20200211112216.3929-99-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200211112216.3929-1-luca.boccassi@gmail.com> References: <20200211112216.3929-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'ethdev: fix switching domain allocation' has been queued to stable release 19.11.1 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 stable release 19.11.1 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/13/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 rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From a24a24e86348360770e8637da79c482e7ec007b7 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 aec2d0f704..42ce177fe1 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2968,6 +2968,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) * return status and does not know if get is successful or not. */ memset(dev_info, 0, sizeof(struct rte_eth_dev_info)); + dev_info->switch_info.domain_id = RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5064,8 +5065,7 @@ rte_eth_switch_domain_alloc(uint16_t *domain_id) *domain_id = RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID; - for (i = RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID + 1; - i < RTE_MAX_ETHPORTS; i++) { + for (i = 0; i < RTE_MAX_ETHPORTS; i++) { if (rte_eth_switch_domains[i].state == RTE_ETH_SWITCH_DOMAIN_UNUSED) { rte_eth_switch_domains[i].state = diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 18a9defc24..d1a593ad11 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -1196,7 +1196,7 @@ struct rte_eth_dev_portconf { * Default values for switch domain id when ethdev does not support switch * domain definitions. */ -#define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID (0) +#define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID (UINT16_MAX) /** * Ethernet device associated switch information -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:42.301683295 +0000 +++ 0099-ethdev-fix-switching-domain-allocation.patch 2020-02-11 11:17:38.548004114 +0000 @@ -1,8 +1,10 @@ -From 7e9165b1beb77554916686cb4ff4d16c4e995b74 Mon Sep 17 00:00:00 2001 +From a24a24e86348360770e8637da79c482e7ec007b7 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. @@ -12,7 +14,6 @@ updated to initialize dev_ibfo structure accordingly. Fixes: ce9250406323 ("ethdev: add switch domain allocator") -Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko Reviewed-by: Ferruh Yigit