From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6BD1FA00C2; Thu, 20 Oct 2022 10:25:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D13B42C7C; Thu, 20 Oct 2022 10:25:06 +0200 (CEST) Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) by mails.dpdk.org (Postfix) with ESMTP id 262C7427F5; Thu, 20 Oct 2022 10:25:05 +0200 (CEST) Received: by mail-qk1-f175.google.com with SMTP id o2so12324298qkk.10; Thu, 20 Oct 2022 01:25:05 -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=vsfiTe4h5VktoZOsatrSDGdCxffDsw+dzgWpDs17D8w=; b=XJVDr+zAVLgkfxyNqytpeyM6mhR/oeQoZNFDgOIaQYoRl7c3rFeMd/okAgZFjlj4+f 4UCmscBveK7oegaqdz8kq9RsdnPqAaAfiZUyqV5+ACiccr2nBIy6T/DGZjvVqFCBAWF3 df7MHfeAnx052AsTEEqL8NpqRFjN13YRWRfj6N28W0GVwaMOh522fg9aMmfQzuZjsp+1 wiBSMqCfHfYcgll3Xf4YwNSDaoOLcTVvRF7qrnu5JCZqX6oM1ex4q6ddud/+jaZzwx9Y J2ZEHi6L03wiGsq71KWYw4ImSRf//bLnZHqi3Tlnojk6IjHBng3nId0d6virGm2ktK6F 7EDA== 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=vsfiTe4h5VktoZOsatrSDGdCxffDsw+dzgWpDs17D8w=; b=EQCYpc6wCG1rKagXWQcRRVP9yEIIwJ6jq2fmZe9DNkvDmae8Sz0ayqi9/05ai3Rxyo kyodlJDXxx5H3qpYNRa+Dkc9tDkyKPSCwhHDM3Wbo5G3noI6xwPBZNpOoRN88wMA5A7J SgWh//OVbc02ikwz+9kUAi1eWz6g0tlgIwyKe7hF1DEoiTF2BthtrOCirVJ8Zjrrfjth /VBofj2xYIRH/08rYmTWIaySxFAyBJYjwTR1cAYdx+dnXUihKKbgzK/gEhZ1KsSIGfK4 wTxcumEPhN8xC4EinwR4QYkrmwApdkpYlsnXhwAYvkR0QI+RLapP4KWBAcOvYH48y/zC rmmQ== X-Gm-Message-State: ACrzQf00mpsPflhvbbXhSHdr4iLhoKtIxAxUtLDGxylyGz406OGUTP4t yU9XCQywbWQWQZfKSUSTRCB9NnWIiMxf86y/ej6sSmO9PNE= X-Google-Smtp-Source: AMsMyM5ZH74V3SE9sy4FsbkF6HujTkV/2c2r7hE5MP8Sk9UF+81ikQYOa0N7bJ6exm8/8GPhfBFQzv2XKV8dpUiMCpM= X-Received: by 2002:a05:620a:135b:b0:6ed:3816:f872 with SMTP id c27-20020a05620a135b00b006ed3816f872mr8290467qkl.305.1666254304372; Thu, 20 Oct 2022 01:25:04 -0700 (PDT) MIME-Version: 1.0 References: <20221019194734.4009186-1-abdullah.sevincer@intel.com> <20221020000733.4026522-1-abdullah.sevincer@intel.com> In-Reply-To: <20221020000733.4026522-1-abdullah.sevincer@intel.com> From: Jerin Jacob Date: Thu, 20 Oct 2022 13:54:38 +0530 Message-ID: Subject: Re: [PATCH v2] 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 5:38 AM 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 Please rebase to dpdk-next-eventdev [for-main]dell[dpdk-next-eventdev] $ git pw series apply 25323 Failed to apply patch: Applying: event/dlb2: fix port COS range allocation Using index info to reconstruct a base tree... M drivers/event/dlb2/dlb2.c M drivers/event/dlb2/dlb2_priv.h Falling back to patching base and 3-way merge... Auto-merging drivers/event/dlb2/dlb2_priv.h Auto-merging drivers/event/dlb2/dlb2.c CONFLICT (content): Merge conflict in drivers/event/dlb2/dlb2.c error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 event/dlb2: fix port COS range allocation When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". [for-main]dell[dpdk-next-eventdev] $ git diff diff --cc drivers/event/dlb2/dlb2.c index 02f0e57208,62e2bbeb3d..0000000000 --- a/drivers/event/dlb2/dlb2.c +++ b/drivers/event/dlb2/dlb2.c @@@ -182,8 -182,10 +182,14 @@@ dlb2_init_port_cos(struct dlb2_eventde for (q = 0; q < DLB2_MAX_NUM_PORTS_ALL; q++) { dlb2->ev_ports[q].cos_id = port_cos[q]; ++<<<<<<< HEAD + 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) { ++>>>>>>> event/dlb2: fix port COS range allocation dlb2->cos_ports[port_cos[q]]++; + dlb2->max_cos_port = q; } } } > --- > drivers/event/dlb2/dlb2.c | 14 +++++++++----- > drivers/event/dlb2/dlb2_priv.h | 2 ++ > 2 files changed, 11 insertions(+), 5 deletions(-) > > diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c > index 7fd89e940b..62e2bbeb3d 100644 > --- a/drivers/event/dlb2/dlb2.c > +++ b/drivers/event/dlb2/dlb2.c > @@ -180,11 +180,14 @@ dlb2_init_port_cos(struct dlb2_eventdev *dlb2, int *port_cos) > { > int q; > > - for (q = 0; q < DLB2_MAX_NUM_PORTS_ALL; q++) > - if (port_cos[q] != DLB2_COS_DEFAULT) { > - dlb2->ev_ports[q].cos_id = port_cos[q]; > + 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 && > + dlb2->cos_ports[port_cos[q]] < DLB2_MAX_NUM_LDB_PORTS_PER_COS) { > dlb2->cos_ports[port_cos[q]]++; > + dlb2->max_cos_port = q; > } > + } > } > > static void > @@ -840,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 9ef5bcb901..03ef15ac51 100644 > --- a/drivers/event/dlb2/dlb2_priv.h > +++ b/drivers/event/dlb2/dlb2_priv.h > @@ -93,6 +93,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 > @@ -636,6 +637,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 >