From patchwork Thu Nov 5 21:22:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy McDaniel X-Patchwork-Id: 83766 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8923FA0521; Thu, 5 Nov 2020 22:21:21 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 708E82BE1; Thu, 5 Nov 2020 22:21:20 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 8D55B29C6; Thu, 5 Nov 2020 22:21:17 +0100 (CET) IronPort-SDR: T9FPtAdcFrjWMVIz2MP0xt1prpRqxIYfEUR6koZwLDuarW4hdRIhYhJQHpMjmIootwxsCNARrx e76/daFEuZAw== X-IronPort-AV: E=McAfee;i="6000,8403,9796"; a="169574385" X-IronPort-AV: E=Sophos;i="5.77,454,1596524400"; d="scan'208";a="169574385" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2020 13:21:15 -0800 IronPort-SDR: /ch5N1YJ6424lZ3jf2IbxDlMWx1jXIAufsbi3cgAKL34ekozb4CxaDdkL5zi3Qz8aFulEyjNha xVP6Ddr7QIdQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,454,1596524400"; d="scan'208";a="354448987" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by fmsmga004.fm.intel.com with ESMTP; 05 Nov 2020 13:21:15 -0800 From: Timothy McDaniel To: Gage Eads Cc: dev@dpdk.org, erik.g.carrillo@intel.com, harry.van.haaren@intel.com, jerinj@marvell.com, john.mcnamara@dpdk.org, stable@dpdk.org Date: Thu, 5 Nov 2020 15:22:53 -0600 Message-Id: <1604611374-2072-3-git-send-email-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1604611374-2072-1-git-send-email-timothy.mcdaniel@intel.com> References: <1604611374-2072-1-git-send-email-timothy.mcdaniel@intel.com> Subject: [dpdk-dev] [PATCH 1/4] event/dlb: fix memory overrun Coverity warning X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix memory corruption bug caused by passing address of a 16b value, instead of address of a 32b value. Fixes: 1998008 ("event/dlb: add eventdev probe") Coverity issue: 363715 Cc: stable@dpdk.org Signed-off-by: Timothy McDaniel --- drivers/event/dlb/pf/dlb_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/event/dlb/pf/dlb_main.c b/drivers/event/dlb/pf/dlb_main.c index 87ab8dd..17e671e 100644 --- a/drivers/event/dlb/pf/dlb_main.c +++ b/drivers/event/dlb/pf/dlb_main.c @@ -250,13 +250,13 @@ dlb_pf_reset(struct dlb_dev *dlb_dev) { int msix_cap_offset, err_cap_offset, acs_cap_offset, wait_count; uint16_t dev_ctl_word, dev_ctl2_word, lnk_word, lnk_word2; - uint16_t rt_ctl_word, pri_reqs_dword, pri_ctrl_word; + uint16_t rt_ctl_word, pri_ctrl_word; struct rte_pci_device *pdev = dlb_dev->pdev; uint16_t devsta_busy_word, devctl_word; int pcie_cap_offset, pri_cap_offset; uint16_t slt_word, slt_word2, cmd; int ret = 0, i = 0; - uint32_t dword[16]; + uint32_t dword[16], pri_reqs_dword; off_t off; /* Save PCI config state */ From patchwork Thu Nov 5 21:22:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy McDaniel X-Patchwork-Id: 83769 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 96523A0521; Thu, 5 Nov 2020 22:22:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3DB0C3772; Thu, 5 Nov 2020 22:21:25 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id EDA132BFE; Thu, 5 Nov 2020 22:21:20 +0100 (CET) IronPort-SDR: ZSEaQbSqT8/+usv9eNEAE5UsxH7q4tBpNGm2hvxCOb+SMKQBnVMoKSSDl/y/JAFX76bLwsAOpQ q7X74QrCCWSQ== X-IronPort-AV: E=McAfee;i="6000,8403,9796"; a="169574386" X-IronPort-AV: E=Sophos;i="5.77,454,1596524400"; d="scan'208";a="169574386" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2020 13:21:16 -0800 IronPort-SDR: ZLPDV3q94tEf6+zqAfFZ2C2U86ccaVaFzfFYq8h6vFt5yCcdhhRgErCE1KA+yp2cE2hqFtc9MK ZzJ+AUx9Hbkw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,454,1596524400"; d="scan'208";a="354448992" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by fmsmga004.fm.intel.com with ESMTP; 05 Nov 2020 13:21:15 -0800 From: Timothy McDaniel To: Gage Eads Cc: dev@dpdk.org, erik.g.carrillo@intel.com, harry.van.haaren@intel.com, jerinj@marvell.com, john.mcnamara@dpdk.org, stable@dpdk.org Date: Thu, 5 Nov 2020 15:22:54 -0600 Message-Id: <1604611374-2072-4-git-send-email-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1604611374-2072-1-git-send-email-timothy.mcdaniel@intel.com> References: <1604611374-2072-1-git-send-email-timothy.mcdaniel@intel.com> Subject: [dpdk-dev] [PATCH 2/4] event/dlb: fix no-effect Coverity warning X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Remove nonproductive assignment of qmport->cq_depth. Fixes: ee57517 ("event/dlb: add port setup") Coverity issue: 363717 Cc: stable@dpdk.org Signed-off-by: Timothy McDaniel --- drivers/event/dlb/dlb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/event/dlb/dlb.c b/drivers/event/dlb/dlb.c index 2bb270d..0c95c47 100644 --- a/drivers/event/dlb/dlb.c +++ b/drivers/event/dlb/dlb.c @@ -1000,7 +1000,6 @@ dlb_hw_create_ldb_port(struct dlb_eventdev *dlb, /* The credit window is one high water mark of QEs */ qm_port->dir_pushcount_at_credit_expiry = 0; qm_port->cached_dir_credits = cfg.dir_credit_high_watermark; - qm_port->cq_depth = cfg.cq_depth; /* CQs with depth < 8 use an 8-entry queue, but withhold credits so * the effective depth is smaller. */ From patchwork Thu Nov 5 21:22:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy McDaniel X-Patchwork-Id: 83768 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8C483A0521; Thu, 5 Nov 2020 22:21:59 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 99D782E1E; Thu, 5 Nov 2020 22:21:23 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 3F5F72C01; Thu, 5 Nov 2020 22:21:20 +0100 (CET) IronPort-SDR: 6kClAkveDIgQrYzuLc9INykmERYNqXtfjJt7DPyeW+rby7EfbDIWCu8kqg3JVoh2BNPC1D9uB+ rqXoJXTdgksQ== X-IronPort-AV: E=McAfee;i="6000,8403,9796"; a="169574384" X-IronPort-AV: E=Sophos;i="5.77,454,1596524400"; d="scan'208";a="169574384" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2020 13:21:14 -0800 IronPort-SDR: mvl+hb+21kS47phXMRymrLNyL0XLToUk+sp3aAMe9cXNHsFmwoI4/1ef2tKN8rDf7s0TsS6eKE HlWx4Jf6a/4w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,454,1596524400"; d="scan'208";a="354448982" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by fmsmga004.fm.intel.com with ESMTP; 05 Nov 2020 13:21:14 -0800 From: Timothy McDaniel To: Gage Eads Cc: dev@dpdk.org, erik.g.carrillo@intel.com, harry.van.haaren@intel.com, jerinj@marvell.com, john.mcnamara@dpdk.org, stable@dpdk.org Date: Thu, 5 Nov 2020 15:22:52 -0600 Message-Id: <1604611374-2072-2-git-send-email-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1604611374-2072-1-git-send-email-timothy.mcdaniel@intel.com> References: <1604611374-2072-1-git-send-email-timothy.mcdaniel@intel.com> Subject: [dpdk-dev] [PATCH 3/4] event/dlb2: fix dereference NULL pointer Coverity warning X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add NULL check before using t->mbuf_pool. Fixes: 6f1b828 ("event/dlb2: add self-tests") Coverity issue: 363719 Cc: stable@dpdk.org Signed-off-by: Timothy McDaniel --- drivers/event/dlb2/dlb2_selftest.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/event/dlb2/dlb2_selftest.c b/drivers/event/dlb2/dlb2_selftest.c index e300067..f433654 100644 --- a/drivers/event/dlb2/dlb2_selftest.c +++ b/drivers/event/dlb2/dlb2_selftest.c @@ -212,7 +212,12 @@ test_stop_flush(struct test *t) /* test to check we can properly flush events */ goto err; } - count = rte_mempool_avail_count(t->mbuf_pool); + if (t->mbuf_pool) + count = rte_mempool_avail_count(t->mbuf_pool); + else { + printf("%d: mbuf_pool is NULL\n", __LINE__); + goto err; + } if (rte_event_port_attr_get(evdev, 0, From patchwork Thu Nov 5 21:22:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy McDaniel X-Patchwork-Id: 83767 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6D56FA0521; Thu, 5 Nov 2020 22:21:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC09B2C2E; Thu, 5 Nov 2020 22:21:21 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 7CFB529C6; Thu, 5 Nov 2020 22:21:19 +0100 (CET) IronPort-SDR: Br5smugTWMFE0xXNDL/iR4CBCoFQkeVJh8ppCCR/FGi9AhAIp0keS2YE9rrRb1n+VSl3NofDfe 4C6iKQ11ityQ== X-IronPort-AV: E=McAfee;i="6000,8403,9796"; a="169574383" X-IronPort-AV: E=Sophos;i="5.77,454,1596524400"; d="scan'208";a="169574383" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2020 13:21:14 -0800 IronPort-SDR: N+p8ArtD/y7vAFqLsfoRzW6b3H61Mb0vnq7OZPNyHjbqjv54GmJ6rmDiv0S8W4yV3ozmCas7NR Zf93wKYPBv+Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,454,1596524400"; d="scan'208";a="354448977" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by fmsmga004.fm.intel.com with ESMTP; 05 Nov 2020 13:21:13 -0800 From: Timothy McDaniel To: Cc: dev@dpdk.org, erik.g.carrillo@intel.com, gage.eads@intel.com, harry.van.haaren@intel.com, jerinj@marvell.com, john.mcnamara@dpdk.org, stable@dpdk.org Date: Thu, 5 Nov 2020 15:22:51 -0600 Message-Id: <1604611374-2072-1-git-send-email-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 1.7.10 Subject: [dpdk-dev] [PATCH 4/4] event/dlb2: add missing sections to documentation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add queue depth threshold and class of service sections to DLB2 rst file. Fixes:5433956 ("event/dlb2: add eventdev probe") Cc: stable@dpdk.org Signed-off-by: Timothy McDaniel --- doc/guides/eventdevs/dlb2.rst | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/doc/guides/eventdevs/dlb2.rst b/doc/guides/eventdevs/dlb2.rst index b9f57fd..159f36c 100644 --- a/doc/guides/eventdevs/dlb2.rst +++ b/doc/guides/eventdevs/dlb2.rst @@ -363,3 +363,50 @@ increase a vdev's per-queue atomic-inflight allocation to (for example) 64: --vdev=dlb1_event,atm_inflights=64 +QID Depth Threshold +~~~~~~~~~~~~~~~~~~~ + +DLB2 supports setting and tracking queue depth thresholds. Hardware uses +the thresholds to track how full a queue is compared to its threshold. +Four buckets are used + +- Less than or equal to 50% of queue depth threshold +- Greater than 50%, but less than or equal to 75% of depth threshold +- Greater than 75%, but less than or equal to 100% of depth threshold +- Greater than 100% of depth thresholds + +Per queue threshold metrics are tracked in the DLB2 xstats, and are also +returned in the impl_opaque field of each received event. + +The per qid threshold can be specified as part of the device args, and +can be applied to all queue, a range of queues, or a single queue, as +shown below. + + .. code-block:: console + + --vdev=dlb2_event,qid_depth_thresh=all: + --vdev=dlb2_event,qid_depth_thresh=qidA-qidB: + --vdev=dlb2_event,qid_depth_thresh=qid: + +Class of service +~~~~~~~~~~~~~~~~ + +DLB2 supports provisioning the DLB2 bandwidth into 4 classes of service. + +- Class 4 corresponds to 40% of the DLB2 hardware bandwidth +- Class 3 corresponds to 30% of the DLB2 hardware bandwidth +- Class 2 corresponds to 20% of the DLB2 hardware bandwidth +- Class 1 corresponds to 10% of the DLB2 hardware bandwidth +- Class 0 corresponds to don't care + +The classes are applied globally to the set of ports contained in this +scheduling domain, which is more appropriate for the bifurcated +PMD than for the PF PMD, since the PF PMD supports just 1 scheduling +domain. + +Class of service can be specified in the devargs, as follows + + .. code-block:: console + + --vdev=dlb2_event,cos=<0..4> +