From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69942C433FE for ; Fri, 21 Oct 2022 08:07:05 +0000 (UTC) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B9C142C3C; Fri, 21 Oct 2022 10:05:25 +0200 (CEST) Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) by mails.dpdk.org (Postfix) with ESMTP id 756E242C1D; Fri, 21 Oct 2022 10:05:23 +0200 (CEST) Received: by mail-qk1-f179.google.com with SMTP id b25so1553815qkk.7; Fri, 21 Oct 2022 01:05:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oExa9DhumQbRl0DYHeWFEh5WLKjthC2pQdbco1A4tN4=; b=KW0FIW8nfvs2rItzchbUsiKtsdnfGenJOor8wbqDdgCBh2STlbtEfTuFyb5dQ8zh+W QF4UqxQel8sf9jkLk0o4jFlv8YhLoMWMkrD4EYVehvS3EyAocTWdTSkcXCQk9JTfeFfu TFf/S9xzRIC6zTc+BixClNTXCWbmfSlbJlDGH50R0SDMPYQmKvCu6IfA9RakgRrAMDhq wmW8mCpWpHA3TYpmeYN0kudBBcWUrq2gKe0dBaiAk+7yxgMeOpEMeGZqdeRqjzhfvHmT +Y1B9Iw52oKb3hQDg59+ukegq46tbA2Qkdqjfuud4kUI9BSPTsENleUGon0MefJVGG2t 5+vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oExa9DhumQbRl0DYHeWFEh5WLKjthC2pQdbco1A4tN4=; b=Neq6QdSmaNLHG+SCOfDOETQpyQcHqIBncy5BYsw2Jd8eOrA/xC9Zem/zNEpL3a5d2d DOUifcJFlpEQDvAgz2b024Q2mo5+PTh+6osgF7lBPAUJVhE6DyJpP5ZpqRzpwJuTD7yh rTOXtajs1u4f+6ig024l/CZNjLSOHZ3gYPHCmx+777j5RO0CmSxYR+6e14tS5wmf+WET mgjGBP/v87ze1JkG24BGIJqNIUkXBODwe6ziP3c5/3qMwiCthNXpFXc4XCa7VPr3QtU7 WgR0uwyLCMNasiFg3eUAdLb2QSnmyFqvduxQQgUBC7Oq7h9JYh1Lxl3hQQHK0mLIsxEA Rgew== X-Gm-Message-State: ACrzQf0cbJKl9xQFpTISXTBqzDX86TDD5OkNjJe4ruedV7fteoLknA/+ 7DByhTU7wFosOVY6OWGxmQJWEBd4lh7cQq+jW4I= X-Google-Smtp-Source: AMsMyM64SLEBEdCUfe05MjyVMV66ZS87OTLtWUOOLtH0kVMq6iyIhy8Whrc0sqahAmMKNDcbwfNeHLMh0CQyfr9lGQo= X-Received: by 2002:a05:620a:1986:b0:6ec:fc63:1dce with SMTP id bm6-20020a05620a198600b006ecfc631dcemr13289090qkb.90.1666339522823; Fri, 21 Oct 2022 01:05:22 -0700 (PDT) MIME-Version: 1.0 References: <20221020173145.4098491-1-abdullah.sevincer@intel.com> In-Reply-To: <20221020173145.4098491-1-abdullah.sevincer@intel.com> From: Jerin Jacob Date: Fri, 21 Oct 2022 13:34:57 +0530 Message-ID: Subject: Re: [PATCH v3] event/dlb2: fix port COS range allocation To: Abdullah Sevincer Cc: dev@dpdk.org, jerinj@marvell.com, shivani.doneria@intel.com, tirthendu.sarkar@intel.com, stable@dpdk.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Oct 20, 2022 at 11:01 PM Abdullah Sevincer wrote: > > This commit fixes allocation of port COS > when application requested port COS exceeds > (e.g. beyond 0-15) the number of LDB ports for > the domain. > > We limit application specified ports from a > COS to the max ports allocated for the COS > so that the rest of the of the ports can be > allocated from default(best) COS. > > Fixes: bec8901bfe9f ("event/dlb2: support ldb port specific COS") > Cc: stable@dpdk.org > > Signed-off-by: Abdullah Sevincer Updated the git commit as follows and applied to dpdk-next-net-eventdev/for-main. Thanks event/dlb2: fix port COS range allocation Fix the allocation of port COS when the application requested port COS exceeds (e.g. beyond 0-15) the number of LDB ports for the domain. Driver limits application specified ports from a COS to the max ports allocated for the COS so that the rest of the ports can be allocated from default(best) COS. Fixes: bec8901bfe9f ("event/dlb2: support ldb port specific COS") Cc: stable@dpdk.org Signed-off-by: Abdullah Sevincer --- > drivers/event/dlb2/dlb2.c | 9 ++++++--- > drivers/event/dlb2/dlb2_priv.h | 2 ++ > 2 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c > index 02f0e57208..60c5cd4804 100644 > --- a/drivers/event/dlb2/dlb2.c > +++ b/drivers/event/dlb2/dlb2.c > @@ -182,8 +182,10 @@ dlb2_init_port_cos(struct dlb2_eventdev *dlb2, int *port_cos) > > for (q = 0; q < DLB2_MAX_NUM_PORTS_ALL; q++) { > dlb2->ev_ports[q].cos_id = port_cos[q]; > - if (port_cos[q] != DLB2_COS_DEFAULT) { > + if (port_cos[q] != DLB2_COS_DEFAULT && > + dlb2->cos_ports[port_cos[q]] < DLB2_MAX_NUM_LDB_PORTS_PER_COS) { > dlb2->cos_ports[port_cos[q]]++; > + dlb2->max_cos_port = q; > } > } > } > @@ -841,8 +843,9 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2, > cos_ports = dlb2->cos_ports[0] + dlb2->cos_ports[1] + > dlb2->cos_ports[2] + dlb2->cos_ports[3]; > > - if (cos_ports > resources_asked->num_ldb_ports) { > - DLB2_LOG_ERR("dlb2: num_ldb_ports < nonzero cos_ports\n"); > + if (cos_ports > resources_asked->num_ldb_ports || > + (cos_ports && dlb2->max_cos_port >= resources_asked->num_ldb_ports)) { > + DLB2_LOG_ERR("dlb2: num_ldb_ports < cos_ports\n"); > ret = EINVAL; > goto error_exit; > } > diff --git a/drivers/event/dlb2/dlb2_priv.h b/drivers/event/dlb2/dlb2_priv.h > index ac20c5a179..f4b9e7f9ff 100644 > --- a/drivers/event/dlb2/dlb2_priv.h > +++ b/drivers/event/dlb2/dlb2_priv.h > @@ -92,6 +92,7 @@ > #define DLB2_NUM_SN_GROUPS 2 > #define DLB2_MAX_LDB_SN_ALLOC 1024 > #define DLB2_MAX_QUEUE_DEPTH_THRESHOLD 8191 > +#define DLB2_MAX_NUM_LDB_PORTS_PER_COS (DLB2_MAX_NUM_LDB_PORTS/DLB2_COS_NUM_VALS) > > /* 2048 total hist list entries and 64 total ldb ports, which > * makes for 2048/64 == 32 hist list entries per port. However, CQ > @@ -635,6 +636,7 @@ struct dlb2_eventdev { > }; > uint32_t cos_ports[DLB2_COS_NUM_VALS]; /* total ldb ports in each class */ > uint32_t cos_bw[DLB2_COS_NUM_VALS]; /* bandwidth per cos domain */ > + uint8_t max_cos_port; /* Max LDB port from any cos */ > }; > > /* used for collecting and passing around the dev args */ > -- > 2.25.1 >