From patchwork Thu Aug 29 10:27:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172553 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2028327ily; Thu, 29 Aug 2019 03:42:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXQgPHwMtqqvJ9XnZN3MNNf/gbbZFqhdKFHdm5LDRRRZVXHEcqQRUOu/tUogxIaViemNbJ X-Received: by 2002:a05:6402:1344:: with SMTP id y4mr8789502edw.124.1567075323123; Thu, 29 Aug 2019 03:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075323; cv=none; d=google.com; s=arc-20160816; b=vNGGdWBXN9laSONHxIneYbLG5Y0WrBpFbQaeUvC6+JmDEVK6Zk/DcA8vsLw1cugVZP OZHDPWfrrhDB0k4UsJR5IEGMCZYeFXfXuusMjUNcuWR+VncPTmQVcFihQ4njGdvFJvBr qebjjvxv75VLadW1fg4IwLUFRST3PAArVRyQfqmavZNrlk1JxaNZHf40kzc/OUTFVzlQ U1yjPFPKRwcNB2yL8DFx0AuuRg0tFW4kdyKxLpeMrc7jx9Qcshe1LXcqoGP3YRuDwjNg APWIbI2pzv5qebW3Mfb44GDbVQIAZY2lGxgbnMPX9pwMNlWoxvFWrY378znySTH28tAQ YfFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=i5N3T66YhwE++Olp3QJktTEwyhXAsX/WKplpbgCNjXs=; b=KjDBcVTCGP1r2GscKfvDG6vzWhlo0GykKe31FEvj7PQNLFQERw1SLy0Ps/XQTOOVix wmVv7czrU8OPwQHTOjuzFHcR71vs9Jic9L4KGp+ImWjAasHiUuJPxdsXl/U+lKtopOcZ /ByDbB+nOmM888+Wi/Tb8blVw6GtLMu5j5Re/CZvmRg4p7/zL9TNYe80F2UCpjm6hXo4 vRh3tEL2WNLcck898QGl7lCxh082z2vWSHecHq+VUhTahGlxTStBM2GYOM0kzJ0kLW75 Ypf9btNAVEdOkdkPH9gl7vPcYKopU5SdOVTye5+enwgtM38rXI6nJU+DYGx7dcKNBWZR qqpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id x21si867254ejb.386.2019.08.29.03.42.02; Thu, 29 Aug 2019 03:42:03 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ED15E1D453; Thu, 29 Aug 2019 12:41:51 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 6A79D1D42B; Thu, 29 Aug 2019 12:41:46 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id D61DA1A00B9; Thu, 29 Aug 2019 12:41:45 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 685E91A0010; Thu, 29 Aug 2019 12:41:43 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 70C94402DE; Thu, 29 Aug 2019 18:41:39 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, stable@dpdk.org, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:08 +0530 Message-Id: <20190829102737.13267-2-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 01/30] bus/dpaa: fix DPAA SEC blacklist case 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" From: Hemant Agrawal The black list of dpaa_sec devices fails. EAL: failed to parse device "dpaa:dpaa_sec-1" This patch address following issues: - bus usages dpaa-sec while the driver usage dpaa_sec - bus usages numbers from 0 to MAX_SEC - while driver probe usages sec number form max-fman_device +1 Fixes: 6e0752205bb2 ("bus/dpaa: support device blacklisting") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal Reviewed-by: Sachin Saxena --- doc/guides/cryptodevs/dpaa_sec.rst | 6 +++--- drivers/bus/dpaa/dpaa_bus.c | 6 +++--- drivers/crypto/dpaa_sec/dpaa_sec.c | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/doc/guides/cryptodevs/dpaa_sec.rst b/doc/guides/cryptodevs/dpaa_sec.rst index 0a2600634..3a3e30aaf 100644 --- a/doc/guides/cryptodevs/dpaa_sec.rst +++ b/doc/guides/cryptodevs/dpaa_sec.rst @@ -85,11 +85,11 @@ For blacklisting a DPAA device, following commands can be used. .. code-block:: console - -b "dpaa_bus:dpaa-secX" -- ... - e.g. "dpaa_bus:dpaa-sec0" + -b "dpaa:dpaa_sec-X" -- ... + e.g. "dpaa:dpaa_sec-1" or to disable all 4 SEC devices - -b "dpaa_sec:dpaa-sec0" -b "dpaa_sec:dpaa-sec1" -b "dpaa_sec:dpaa-sec2" -b "dpaa_sec:dpaa-sec3" + -b "dpaa:dpaa_sec-1" -b "dpaa:dpaa_sec-2" -b "dpaa:dpaa_sec-3" -b "dpaa:dpaa_sec-4" Limitations ----------- diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 07cc5c667..f7d1a5b63 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -218,7 +218,7 @@ dpaa_create_device_list(void) * allocated for dev->name/ */ memset(dev->name, 0, RTE_ETH_NAME_MAX_LEN); - sprintf(dev->name, "dpaa-sec%d", i); + sprintf(dev->name, "dpaa_sec-%d", i+1); DPAA_BUS_LOG(INFO, "%s cryptodev added", dev->name); dev->device.name = dev->name; dev->device.devargs = dpaa_devargs_lookup(dev); @@ -397,7 +397,7 @@ rte_dpaa_bus_parse(const char *name, void *out_name) * without separator. Both need to be handled. * It is also possible that "name=fm1-mac3" is passed along. */ - DPAA_BUS_DEBUG("Parse device name (%s)\n", name); + DPAA_BUS_DEBUG("Parse device name (%s)", name); /* Check for dpaa_bus:fm1-mac3 style */ dup_name = strdup(name); @@ -428,7 +428,7 @@ rte_dpaa_bus_parse(const char *name, void *out_name) for (i = 0; i < RTE_LIBRTE_DPAA_MAX_CRYPTODEV; i++) { char sec_name[16]; - snprintf(sec_name, 16, "dpaa-sec%d", i); + snprintf(sec_name, 16, "dpaa_sec-%d", i+1); if (strcmp(sec_name, sep) == 0) { if (out_name) strcpy(out_name, sep); diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 122c80a07..1754862be 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -2678,8 +2678,7 @@ cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused, int retval; - snprintf(cryptodev_name, sizeof(cryptodev_name), "dpaa_sec-%d", - dpaa_dev->id.dev_id); + snprintf(cryptodev_name, sizeof(cryptodev_name), "%s", dpaa_dev->name); cryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, rte_socket_id()); if (cryptodev == NULL) From patchwork Thu Aug 29 10:27:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172552 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2028186ily; Thu, 29 Aug 2019 03:41:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcuFVfBXBrcKW1Z2aTsqDoxyfpL4Ke5Le7RmeN88UtwCaNsL70SiGdDs0ycQM+SawWQttg X-Received: by 2002:a17:906:80da:: with SMTP id a26mr7511504ejx.222.1567075314672; Thu, 29 Aug 2019 03:41:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075314; cv=none; d=google.com; s=arc-20160816; b=kzmNBgEL2jw0Z5Bv/p6VSuX8QrWru6GINWDRbI5VYGwUy+2NxMoxNEkBqrNxPxvNsB /ZAU6xD3fEO6/jZcDc5rcf+AfrNtUHnUhYj/H0B4VOjHjx4RnAWyiVA0WuSf7iJH6UwE 5gGYGRuIBO23f9hVhljzGj39XZA2RxvNVFQnVB5v2MwmASQ0LtdjwYqpbBrBHdXyN9r6 LoDrKoWyuBYxF8utYC/ggAWR8kRHMvunyETleYTr+pfN64xX2MKLNsECKywXoL7QmdEd XN4AVN/LxG5urvfVmXRAVlRyasHhdcdyq1gEO4PoC84yFGcWz2wQfwHKgNKFv1amExGi 0qQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=QHb3EC6meRr3vE1PotUlGzqxaBR93YfK8/9Etjh/Ir8=; b=cOvpQf645fnnPtElHIYEpN0GtmVGD6sahbijbwUuiEArY69k0al5mVZmPs18iKG9ta kEJ813jFdr82QvNyIq62Fjz5w/Q+trXftFstJWeBbBpxxyU1UARc+MXAVtRcjVLWfaid pJK00rLNMEzHDbjuygOa+QolX+IHNGfp99NqYceQI7pDx5VHWZTOVv5uMWmYjd0ld8GT krlbzygWm5gxrXYSPqByjwb6VItoPw0daRgXc4eZpJH7+cAxL9borWYyBy8pPM0bDuwX 8ZEVxp2JEOxGHZVUDRn32DNeH1B0yCc+eFqGWWif8r8EJvT80ahLBLoE4SK3x9lw2KkF 2opQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id j14si1031692eda.147.2019.08.29.03.41.54; Thu, 29 Aug 2019 03:41:54 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E9CA71D440; Thu, 29 Aug 2019 12:41:48 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 310191D42A for ; Thu, 29 Aug 2019 12:41:46 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A68601A00E8; Thu, 29 Aug 2019 12:41:45 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A38601A00B9; Thu, 29 Aug 2019 12:41:43 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 3458E402E7; Thu, 29 Aug 2019 18:41:40 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:09 +0530 Message-Id: <20190829102737.13267-3-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 02/30] net/dpaa: improve the Rx offload debug message 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" From: Hemant Agrawal This patch also align few RX offload support to right category. Signed-off-by: Hemant Agrawal Reviewed-by: Sachin Saxena --- drivers/net/dpaa/dpaa_ethdev.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 7154fb9b4..7f5a8ac3b 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -59,7 +59,9 @@ static uint64_t dev_rx_offloads_nodis = DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM; /* Supported Tx offloads */ -static uint64_t dev_tx_offloads_sup; +static uint64_t dev_tx_offloads_sup = + DEV_TX_OFFLOAD_MT_LOCKFREE | + DEV_TX_OFFLOAD_MBUF_FAST_FREE; /* Tx offloads which cannot be disabled */ static uint64_t dev_tx_offloads_nodis = @@ -68,9 +70,7 @@ static uint64_t dev_tx_offloads_nodis = DEV_TX_OFFLOAD_TCP_CKSUM | DEV_TX_OFFLOAD_SCTP_CKSUM | DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | - DEV_TX_OFFLOAD_MULTI_SEGS | - DEV_TX_OFFLOAD_MT_LOCKFREE | - DEV_TX_OFFLOAD_MBUF_FAST_FREE; + DEV_TX_OFFLOAD_MULTI_SEGS; /* Keep track of whether QMAN and BMAN have been globally initialized */ static int is_global_init; @@ -196,20 +196,20 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); - /* Rx offloads validation */ + /* Rx offloads which are enabled by default */ if (dev_rx_offloads_nodis & ~rx_offloads) { - DPAA_PMD_WARN( - "Rx offloads non configurable - requested 0x%" PRIx64 - " ignored 0x%" PRIx64, - rx_offloads, dev_rx_offloads_nodis); + DPAA_PMD_INFO( + "Some of rx offloads enabled by default - requested 0x%" PRIx64 + " fixed are 0x%" PRIx64, + rx_offloads, dev_rx_offloads_nodis); } - /* Tx offloads validation */ + /* Tx offloads which are enabled by default */ if (dev_tx_offloads_nodis & ~tx_offloads) { - DPAA_PMD_WARN( - "Tx offloads non configurable - requested 0x%" PRIx64 - " ignored 0x%" PRIx64, - tx_offloads, dev_tx_offloads_nodis); + DPAA_PMD_INFO( + "Some of tx offloads enabled by default - requested 0x%" PRIx64 + " fixed are 0x%" PRIx64, + tx_offloads, dev_tx_offloads_nodis); } if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { From patchwork Thu Aug 29 10:27:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172554 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2028498ily; Thu, 29 Aug 2019 03:42:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyG1iCk9L8NW48ZE4DI/0GEI6P1kMtV3ySsx9WjscvYotsSOj+C+6mcx0058brh76qi+JPr X-Received: by 2002:a17:906:5214:: with SMTP id g20mr7258443ejm.220.1567075332739; Thu, 29 Aug 2019 03:42:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075332; cv=none; d=google.com; s=arc-20160816; b=fSdkgTU3MqW3dJ55yTfF1n4R1eEAJiZDshd+8PvPVdAGKpJHbWyNywuBO49n4LvL1h Llycco/WgjC1iZyLO1KS4vqx61w63GfFltx2J1ussFznMIoVxs5+PgIulYuZ0COha1Ig j4t9yJNREGp/cBeBd5SZ7ct6k+k4NrB8CRR+OSCpDeXG+7oVq9+iDgw+qW7P8mwmxxVk gI6dtNdb+vBgZlwzKFQmj+7p9JuAbVuZxOmIs/0hRWqxwfXClij4LOJgi6VctCuruVFO VKttT7hBXyT5Wfno8ZGUjSqfkOjIhwFnKIGwuvLHR9hR/hUVZDWrqdpf4UAqwLbyjdLZ bD1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=l0UKPCTMnGCbO+BhomoJqgqwQq4WXLWjd4U+1AElciI=; b=Amt8zdFv1HWFRkNfU5km09VWnkt25YEIKzPLKchXf9dPLr282qpHOceUK+smXXBU/U 2i/LfXwta46m0/cxJ6BDKUYRI5VHgjGiYmIdDEZURxFbAChHS2iEDE1l/l8HVXI9NRZ0 V1JIl/nF8hm52arBVS2QO0XdwMiPXkzKjuq/M1dAlkUeKKHyyhhayCIOR0GK1+C871C4 +7zt2/5FwBHb04T5prY6gM6vbM2i7PGNhBXUyPsCkChH+kKO2IImiCSbSoOKeKObJ/MO DLMLdNKQSSDnsK+gHMCCoBLbR9Snci/UiEkxLB+eEcUwmwldQ5dlsp3Mz8AYkDaowWpq VrSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id e35si898356eda.401.2019.08.29.03.42.12; Thu, 29 Aug 2019 03:42:12 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 290161DF98; Thu, 29 Aug 2019 12:41:55 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id D08A21D440 for ; Thu, 29 Aug 2019 12:41:46 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 92B32200332; Thu, 29 Aug 2019 12:41:46 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 514F8200322; Thu, 29 Aug 2019 12:41:44 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id D9C57402F0; Thu, 29 Aug 2019 18:41:40 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Nipun Gupta Date: Thu, 29 Aug 2019 15:57:10 +0530 Message-Id: <20190829102737.13267-4-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 03/30] bus/dpaa: remove un-necessary thread affinity 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" From: Nipun Gupta Thread affinity is already taken care by DPDK. Remove them from bus. Signed-off-by: Nipun Gupta --- drivers/bus/dpaa/base/qbman/qman_driver.c | 56 ++--------------------- drivers/bus/dpaa/dpaa_bus.c | 13 ------ 2 files changed, 3 insertions(+), 66 deletions(-) -- 2.17.1 Acked-by: Hemant Agrawal diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index ba153396d..5c773669a 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) * * Copyright 2008-2016 Freescale Semiconductor Inc. - * Copyright 2017 NXP + * Copyright 2017,2019 NXP * */ @@ -32,31 +32,9 @@ static __thread struct dpaa_ioctl_portal_map map = { static int fsl_qman_portal_init(uint32_t index, int is_shared) { - cpu_set_t cpuset; struct qman_portal *portal; - int loop, ret; struct dpaa_ioctl_irq_map irq_map; - - /* Verify the thread's cpu-affinity */ - ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), - &cpuset); - if (ret) { - error(0, ret, "pthread_getaffinity_np()"); - return ret; - } - qpcfg.cpu = -1; - for (loop = 0; loop < CPU_SETSIZE; loop++) - if (CPU_ISSET(loop, &cpuset)) { - if (qpcfg.cpu != -1) { - pr_err("Thread is not affine to 1 cpu\n"); - return -EINVAL; - } - qpcfg.cpu = loop; - } - if (qpcfg.cpu == -1) { - pr_err("Bug in getaffinity handling!\n"); - return -EINVAL; - } + int ret; /* Allocate and map a qman portal */ map.index = index; @@ -145,14 +123,11 @@ void qman_thread_irq(void) struct qman_portal *fsl_qman_portal_create(void) { - cpu_set_t cpuset; struct qman_portal *res; - struct qm_portal_config *q_pcfg; - int loop, ret; struct dpaa_ioctl_irq_map irq_map; struct dpaa_ioctl_portal_map q_map = {0}; - int q_fd; + int q_fd, ret; q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0); if (!q_pcfg) { @@ -160,31 +135,6 @@ struct qman_portal *fsl_qman_portal_create(void) return NULL; } - /* Verify the thread's cpu-affinity */ - ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), - &cpuset); - if (ret) { - error(0, ret, "pthread_getaffinity_np()"); - kfree(q_pcfg); - return NULL; - } - - q_pcfg->cpu = -1; - for (loop = 0; loop < CPU_SETSIZE; loop++) - if (CPU_ISSET(loop, &cpuset)) { - if (q_pcfg->cpu != -1) { - pr_err("Thread is not affine to 1 cpu\n"); - kfree(q_pcfg); - return NULL; - } - q_pcfg->cpu = loop; - } - if (q_pcfg->cpu == -1) { - pr_err("Bug in getaffinity handling!\n"); - kfree(q_pcfg); - return NULL; - } - /* Allocate and map a qman portal */ q_map.type = dpaa_portal_qman; q_map.index = QBMAN_ANY_PORTAL_IDX; diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index f7d1a5b63..b0e68c4a4 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -250,11 +250,9 @@ dpaa_clean_device_list(void) int rte_dpaa_portal_init(void *arg) { - pthread_t id; unsigned int cpu, lcore = rte_lcore_id(); int ret; struct dpaa_portal *dpaa_io_portal; - rte_cpuset_t cpuset; BUS_INIT_FUNC_TRACE(); @@ -266,17 +264,6 @@ int rte_dpaa_portal_init(void *arg) cpu = rte_lcore_to_cpu_id(lcore); - /* Set CPU affinity for this thread.*/ - id = pthread_self(); - cpuset = rte_lcore_cpuset(lcore); - ret = pthread_setaffinity_np(id, sizeof(cpu_set_t), - &cpuset); - if (ret) { - DPAA_BUS_LOG(ERR, "pthread_setaffinity_np failed on core :%u" - " (lcore=%u) with ret: %d", cpu, lcore, ret); - return ret; - } - /* Initialise bman thread portals */ ret = bman_thread_init(); if (ret) { From patchwork Thu Aug 29 10:27:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172555 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2028745ily; Thu, 29 Aug 2019 03:42:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvadAXuiH4c8ify5FJqfkama24uvymd2CvO7FXqXSKXLG/JCA4qzmkHryiAVIp2G0PeTS0 X-Received: by 2002:a17:906:70c8:: with SMTP id g8mr7293306ejk.241.1567075344933; Thu, 29 Aug 2019 03:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075344; cv=none; d=google.com; s=arc-20160816; b=GrLCoSMGo85dnvrRAUKs5N3HpAeesaGpZC9QLo4IejMJdHG+0tNNcGgxLvL460n0uA uOp33Dz1TCXPiOvVzxB4k7o0sLUSW99DdPJTQuKQMbl0nXKa87Kwt/3xZBbINqc+gCeM 6Ocyc77MIQfbi4fhBxyEDGJE1UlwQZ8ozBbMGQ1+IFjSvW045sl4gJf6SqTmGKZhyXzW 4Vk03096cA1tHoeUTHhdLXTr8GGQdHAX9bdY43PMmNirkiuF8Sn+z45jranekqKe8FJp 9fCXTc2PunHyh3NGEsWvFnHu5gQBbgcz2ruJmb6eXiJR1HCnegStasi1V2pZ1eQ1WJGM cW1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=KjOiZO/lW5qWOFhfj4+hYL7TaIwlN/JajoEdobd+KEk=; b=zNiUmqB3DVTFwM/rjoFIwyXcPviyVkvAognOcq3lLq9h3yGHjk3JoCdFB+Ba/xlyuW R2UIwcZpROZqCJceBfg4d1n60MXmv0x6yUZOQWoIPpKIPJhDqFs4oYzA76/QLmikJWd0 kdov0TtSFacxVv5K+Qj3P72B07P0uR0Ng6MN2gOOSoqwsQHf5iYt9a6FX5MP1ktOA2UM AM5jYJCGdY93sALUWc8UVy24ozc42iFpow9T8hsGwWlVv8ZOdo6xW7rhXsqgUsNUYrSY dvdLTrYxJLa6Rj2lo1lS/gvUGDCz4x2kX3fVxatnPp7R1fMs/2p8jTULKnbl0rj6TzYu JFnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id z20si489616edd.219.2019.08.29.03.42.24; Thu, 29 Aug 2019 03:42:24 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E4B371D450; Thu, 29 Aug 2019 12:41:59 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 03AC91D446 for ; Thu, 29 Aug 2019 12:41:49 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D5B4820014F; Thu, 29 Aug 2019 12:41:48 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 9C74E200336; Thu, 29 Aug 2019 12:41:46 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 88BD04030E; Thu, 29 Aug 2019 18:41:41 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Nipun Gupta Date: Thu, 29 Aug 2019 15:57:11 +0530 Message-Id: <20190829102737.13267-5-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 04/30] bus/dpaa: decouple fq portal alloc and init 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" From: Nipun Gupta The decoupling of FQ portal allocation is required as a pre-requisite to support Rx interrupts as we need to have event FD's at portal allocation i.e. before the initialization of the Frame Queues. This change will help us get the event fd once the portals have been allocated for static FQ's. Signed-off-by: Nipun Gupta --- drivers/bus/dpaa/base/qbman/qman.c | 35 ++++++++--------- drivers/bus/dpaa/base/qbman/qman_driver.c | 46 ++++++++++++++++------- drivers/bus/dpaa/base/qbman/qman_priv.h | 13 +++++-- drivers/bus/dpaa/dpaa_bus.c | 13 +++---- drivers/bus/dpaa/include/fsl_qman.h | 3 +- drivers/bus/dpaa/include/fsl_usd.h | 6 ++- drivers/bus/dpaa/rte_bus_dpaa_version.map | 7 ++++ drivers/net/dpaa/dpaa_ethdev.c | 10 +++++ drivers/net/dpaa/dpaa_rxtx.c | 3 +- 9 files changed, 90 insertions(+), 46 deletions(-) -- 2.17.1 Acked-by: Hemant Agrawal diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index c6f7d7bb3..79017f7f2 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -498,11 +498,10 @@ static inline void qm_mr_pvb_update(struct qm_portal *portal) dcbit_ro(res); } -static inline -struct qman_portal *qman_create_portal( - struct qman_portal *portal, - const struct qm_portal_config *c, - const struct qman_cgrs *cgrs) +struct qman_portal * +qman_init_portal(struct qman_portal *portal, + const struct qm_portal_config *c, + const struct qman_cgrs *cgrs) { struct qm_portal *p; char buf[16]; @@ -511,6 +510,9 @@ struct qman_portal *qman_create_portal( p = &portal->p; + if (!c) + c = portal->config; + if (dpaa_svr_family == SVR_LS1043A_FAMILY) portal->use_eqcr_ci_stashing = 3; else @@ -632,21 +634,23 @@ struct qman_portal *qman_create_portal( static struct qman_portal global_portals[MAX_GLOBAL_PORTALS]; static rte_atomic16_t global_portals_used[MAX_GLOBAL_PORTALS]; -static struct qman_portal * -qman_alloc_global_portal(void) +struct qman_portal * +qman_alloc_global_portal(struct qm_portal_config *q_pcfg) { unsigned int i; for (i = 0; i < MAX_GLOBAL_PORTALS; i++) { - if (rte_atomic16_test_and_set(&global_portals_used[i])) + if (rte_atomic16_test_and_set(&global_portals_used[i])) { + global_portals[i].config = q_pcfg; return &global_portals[i]; + } } pr_err("No portal available (%x)\n", MAX_GLOBAL_PORTALS); return NULL; } -static int +int qman_free_global_portal(struct qman_portal *portal) { unsigned int i; @@ -661,22 +665,15 @@ qman_free_global_portal(struct qman_portal *portal) } struct qman_portal *qman_create_affine_portal(const struct qm_portal_config *c, - const struct qman_cgrs *cgrs, - int alloc) + const struct qman_cgrs *cgrs) { struct qman_portal *res; - struct qman_portal *portal; - - if (alloc) - portal = qman_alloc_global_portal(); - else - portal = get_affine_portal(); + struct qman_portal *portal = get_affine_portal(); /* A criteria for calling this function (from qman_driver.c) is that * we're already affine to the cpu and won't schedule onto another cpu. */ - - res = qman_create_portal(portal, c, cgrs); + res = qman_init_portal(portal, c, cgrs); if (res) { spin_lock(&affine_mask_lock); CPU_SET(c->cpu, &affine_mask); diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index 5c773669a..06ed814e1 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -62,7 +62,7 @@ static int fsl_qman_portal_init(uint32_t index, int is_shared) qpcfg.node = NULL; qpcfg.irq = qmfd; - portal = qman_create_affine_portal(&qpcfg, NULL, 0); + portal = qman_create_affine_portal(&qpcfg, NULL); if (!portal) { pr_err("Qman portal initialisation failed (%d)\n", qpcfg.cpu); @@ -121,13 +121,13 @@ void qman_thread_irq(void) out_be32(qpcfg.addr_virt[DPAA_PORTAL_CI] + 0x36C0, 0); } -struct qman_portal *fsl_qman_portal_create(void) +struct qman_portal *fsl_qman_fq_portal_create(void) { - struct qman_portal *res; + struct qman_portal *portal = NULL; struct qm_portal_config *q_pcfg; struct dpaa_ioctl_irq_map irq_map; struct dpaa_ioctl_portal_map q_map = {0}; - int q_fd, ret; + int q_fd = 0, ret; q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0); if (!q_pcfg) { @@ -155,38 +155,58 @@ struct qman_portal *fsl_qman_portal_create(void) q_fd = open(QMAN_PORTAL_IRQ_PATH, O_RDONLY); if (q_fd == -1) { pr_err("QMan irq init failed\n"); - goto err1; + goto err; } q_pcfg->irq = q_fd; - res = qman_create_affine_portal(q_pcfg, NULL, true); - if (!res) { + portal = qman_alloc_global_portal(q_pcfg); + if (!portal) { pr_err("Qman portal initialisation failed (%d)\n", q_pcfg->cpu); - goto err2; + goto err; } irq_map.type = dpaa_portal_qman; irq_map.portal_cinh = q_map.addr.cinh; process_portal_irq_map(q_fd, &irq_map); - return res; -err2: - close(q_fd); -err1: + return portal; +err: + if (portal) + qman_free_global_portal(portal); + if (q_fd) + close(q_fd); process_portal_unmap(&q_map.addr); kfree(q_pcfg); return NULL; } -int fsl_qman_portal_destroy(struct qman_portal *qp) +int fsl_qman_fq_portal_init(struct qman_portal *qp) +{ + struct qman_portal *res; + + res = qman_init_portal(qp, NULL, NULL); + if (!res) { + pr_err("Qman portal initialisation failed\n"); + return -1; + } + + return 0; +} + +int fsl_qman_fq_portal_destroy(struct qman_portal *qp) { const struct qm_portal_config *cfg; struct dpaa_portal_map addr; int ret; cfg = qman_destroy_affine_portal(qp); + + ret = qman_free_global_portal(qp); + if (ret) + pr_err("qman_free_global_portal() (%d)\n", ret); + kfree(qp); process_portal_irq_unmap(cfg->irq); diff --git a/drivers/bus/dpaa/base/qbman/qman_priv.h b/drivers/bus/dpaa/base/qbman/qman_priv.h index 02f6301f0..97d5521a8 100644 --- a/drivers/bus/dpaa/base/qbman/qman_priv.h +++ b/drivers/bus/dpaa/base/qbman/qman_priv.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) * * Copyright 2008-2016 Freescale Semiconductor Inc. - * Copyright 2017 NXP + * Copyright 2017,2019 NXP * */ @@ -145,11 +145,18 @@ int qm_get_wpm(int *wpm); struct qman_portal *qman_create_affine_portal( const struct qm_portal_config *config, - const struct qman_cgrs *cgrs, - int alloc); + const struct qman_cgrs *cgrs); const struct qm_portal_config * qman_destroy_affine_portal(struct qman_portal *q); +struct qman_portal * +qman_init_portal(struct qman_portal *portal, + const struct qm_portal_config *c, + const struct qman_cgrs *cgrs); + +struct qman_portal *qman_alloc_global_portal(struct qm_portal_config *q_pcfg); +int qman_free_global_portal(struct qman_portal *portal); + struct qm_portal_config *qm_get_unused_portal(void); struct qm_portal_config *qm_get_unused_portal_idx(uint32_t idx); diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index b0e68c4a4..1d8a294b1 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -321,7 +321,6 @@ rte_dpaa_portal_fq_init(void *arg, struct qman_fq *fq) { /* Affine above created portal with channel*/ u32 sdqcr; - struct qman_portal *qp; int ret; if (unlikely(!RTE_PER_LCORE(dpaa_io))) { @@ -333,21 +332,21 @@ rte_dpaa_portal_fq_init(void *arg, struct qman_fq *fq) } /* Initialise qman specific portals */ - qp = fsl_qman_portal_create(); - if (!qp) { - DPAA_BUS_LOG(ERR, "Unable to alloc fq portal"); + ret = fsl_qman_fq_portal_init(fq->qp); + if (ret) { + DPAA_BUS_LOG(ERR, "Unable to init fq portal"); return -1; } - fq->qp = qp; + sdqcr = QM_SDQCR_CHANNELS_POOL_CONV(fq->ch_id); - qman_static_dequeue_add(sdqcr, qp); + qman_static_dequeue_add(sdqcr, fq->qp); return 0; } int rte_dpaa_portal_fq_close(struct qman_fq *fq) { - return fsl_qman_portal_destroy(fq->qp); + return fsl_qman_fq_portal_destroy(fq->qp); } void diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index e5cccbbea..5f13a5544 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1217,7 +1217,8 @@ struct qman_fq { u32 fqid_le; u16 ch_id; u8 cgr_groupid; - u8 is_static; + u8 is_static:4; + u8 qp_initialized:4; /* DPDK Interface */ void *dpaa_intf; diff --git a/drivers/bus/dpaa/include/fsl_usd.h b/drivers/bus/dpaa/include/fsl_usd.h index ec1ab7cee..ea7be38af 100644 --- a/drivers/bus/dpaa/include/fsl_usd.h +++ b/drivers/bus/dpaa/include/fsl_usd.h @@ -2,6 +2,7 @@ * * Copyright 2010-2011 Freescale Semiconductor, Inc. * All rights reserved. + * Copyright 2019 NXP * */ @@ -74,8 +75,9 @@ int qman_global_init(void); int bman_global_init(void); /* Direct portal create and destroy */ -struct qman_portal *fsl_qman_portal_create(void); -int fsl_qman_portal_destroy(struct qman_portal *qp); +struct qman_portal *fsl_qman_fq_portal_create(void); +int fsl_qman_fq_portal_destroy(struct qman_portal *qp); +int fsl_qman_fq_portal_init(struct qman_portal *qp); #ifdef __cplusplus } diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index c88deaf7f..f779469f9 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -123,3 +123,10 @@ DPDK_19.05 { local: *; } DPDK_18.11; + +DPDK_19.11 { + global: + fsl_qman_fq_portal_create; + + local: *; +} DPDK_19.05; diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 7f5a8ac3b..4e2c9471e 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -629,6 +629,8 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, dev->data->dev_conf.rxmode.max_rx_pkt_len); /* checking if push mode only, no error check for now */ if (dpaa_push_mode_max_queue > dpaa_push_queue_idx) { + struct qman_portal *qp; + dpaa_push_queue_idx++; opts.we_mask = QM_INITFQ_WE_FQCTRL | QM_INITFQ_WE_CONTEXTA; opts.fqd.fq_ctrl = QM_FQCTRL_AVOIDBLOCK | @@ -672,6 +674,14 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, } rxq->is_static = true; + + /* Allocate qman specific portals */ + qp = fsl_qman_fq_portal_create(); + if (!qp) { + DPAA_PMD_ERR("Unable to alloc fq portal"); + return -1; + } + rxq->qp = qp; } rxq->bp_array = rte_dpaa_bpid_info; dev->data->rx_queues[queue_idx] = rxq; diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 30b183607..220c3477d 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -517,12 +517,13 @@ dpaa_eth_queue_portal_rx(struct qman_fq *fq, { int ret; - if (unlikely(fq->qp == NULL)) { + if (unlikely(!fq->qp_initialized)) { ret = rte_dpaa_portal_fq_init((void *)0, fq); if (ret) { DPAA_PMD_ERR("Failure in affining portal %d", ret); return 0; } + fq->qp_initialized = 1; } return qman_portal_poll_rx(nb_bufs, (void **)bufs, fq->qp); From patchwork Thu Aug 29 10:27:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172556 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2028907ily; Thu, 29 Aug 2019 03:42:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIcrxa+JPsefU15zcylo2a9Crfg5J8xDcpG9LZj+lqhxvAl5v3c1FJn1EY9cbX8PiaxCyd X-Received: by 2002:a50:9127:: with SMTP id e36mr8856518eda.219.1567075354629; Thu, 29 Aug 2019 03:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075354; cv=none; d=google.com; s=arc-20160816; b=NJSA2nbhXQxbEmvsWdBPOszNmCNb4dpbvwyO8L3qvqRJVqlkMywmWI6b2XbTAxEMK+ XtxDCq91uyYBPGMZuXqxNdpsIY+vj7jCKCEQUs2JNxnL+G+W+cKE7K8dcqIgeha7R/WD z8TXm2Nofsw9WOhaDqnwPxOy4u9CkOH5W7SuBwrzQjvloj1HXBF0XaJ8h/zgxfdCfifS deW+1uSX8p3DOEq0drvcBbvtZoGJi3oCf+ISRUeTTaRtT/KnWSj99PeEk3+n7H0YavcE t/D0nGVR7kmg9QEXHHBSIR/5dEiwhVIaVFhrFujL7pVb6PJLwSn4GNNX/r2zu108F/Lo sqVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=YGOEtEg0vvPkN8F5KCCW9mzfFqF0wwZFF9JwSyaQK2A=; b=SMnCh/dmjnC0AyVvoCPD3OqELyF1mBrs+9wPOIevcJfvFvOaKvlzqIpKs0ion3nwAR 0T52FY6gcZ4bUrsc2MXWWdNGOya7vCiBUuk9kY/cv+NmJao9Wfox2Reuval68w25zm5E g15jM4JKmfcVZBx5jw7J5HhO4S4DE4f8tLE95w4ah6fRc0ugZ+V9bl7lA4s/YyvkjjGv +hhUUkSkXUoKGNUfKGQckDnbU/D+8nRIQn+/40mGqj66l+mAqdcEsg+K/MVg/u7XmqcR bQNbNr44BdWFzqccbpVHcM5aKKFidFhZpZhFO8mq7N9b6yb3/uWWS1VfpGxWnCvPxc1I a4aQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id b45si1059270edc.103.2019.08.29.03.42.34; Thu, 29 Aug 2019 03:42:34 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 356C81DFEC; Thu, 29 Aug 2019 12:42:03 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 09BBB1D448 for ; Thu, 29 Aug 2019 12:41:49 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id DA7701A02EB; Thu, 29 Aug 2019 12:41:48 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 9C93A1A0155; Thu, 29 Aug 2019 12:41:46 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 387D64031E; Thu, 29 Aug 2019 18:41:42 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Nipun Gupta Date: Thu, 29 Aug 2019 15:57:12 +0530 Message-Id: <20190829102737.13267-6-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 05/30] net/dpaa: support Rx interrupt handler 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" From: Nipun Gupta This patch adds interrupt handler support for the ethernet devices which are configured with a dedicated portal for packet Rx (i.e. for FQ's in push mode). Signed-off-by: Nipun Gupta --- drivers/bus/dpaa/base/qbman/qman_driver.c | 3 ++- drivers/bus/dpaa/include/fsl_qman.h | 18 +++++++++++++- drivers/bus/dpaa/include/fsl_usd.h | 2 +- drivers/bus/dpaa/rte_dpaa_bus.h | 1 + drivers/net/dpaa/dpaa_ethdev.c | 29 +++++++++++++++++++++-- 5 files changed, 48 insertions(+), 5 deletions(-) -- 2.17.1 Acked-by: Hemant Agrawal diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index 06ed814e1..acd003143 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -121,7 +121,7 @@ void qman_thread_irq(void) out_be32(qpcfg.addr_virt[DPAA_PORTAL_CI] + 0x36C0, 0); } -struct qman_portal *fsl_qman_fq_portal_create(void) +struct qman_portal *fsl_qman_fq_portal_create(int *fd) { struct qman_portal *portal = NULL; struct qm_portal_config *q_pcfg; @@ -171,6 +171,7 @@ struct qman_portal *fsl_qman_fq_portal_create(void) irq_map.portal_cinh = q_map.addr.cinh; process_portal_irq_map(q_fd, &irq_map); + *fd = q_fd; return portal; err: if (portal) diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index 5f13a5544..064b65aed 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1215,6 +1215,9 @@ struct qman_fq { struct qman_fq_cb cb; u32 fqid_le; + u32 fqid; + + int q_fd; u16 ch_id; u8 cgr_groupid; u8 is_static:4; @@ -1231,7 +1234,6 @@ struct qman_fq { volatile unsigned long flags; enum qman_fq_state state; - u32 fqid; spinlock_t fqlock; struct rb_node node; @@ -1333,6 +1335,13 @@ u32 qman_portal_dequeue(struct rte_event ev[], unsigned int poll_limit, */ int qman_irqsource_add(u32 bits); +/** + * qman_fq_portal_irqsource_add - samilar to qman_irqsource_add, but it + * takes portal (fq specific) as input rather than using the thread affined + * portal. + */ +int qman_fq_portal_irqsource_add(struct qman_portal *p, u32 bits); + /** * qman_irqsource_remove - remove processing sources from being interrupt-driven * @bits: bitmask of QM_PIRQ_**I processing sources @@ -1343,6 +1352,13 @@ int qman_irqsource_add(u32 bits); */ int qman_irqsource_remove(u32 bits); +/** + * qman_fq_portal_irqsource_remove - similar to qman_irqsource_remove, but it + * takes portal (fq specific) as input rather than using the thread affined + * portal. + */ +int qman_fq_portal_irqsource_remove(struct qman_portal *p, u32 bits); + /** * qman_affine_channel - return the channel ID of an portal * @cpu: the cpu whose affine portal is the subject of the query diff --git a/drivers/bus/dpaa/include/fsl_usd.h b/drivers/bus/dpaa/include/fsl_usd.h index ea7be38af..a407e2b22 100644 --- a/drivers/bus/dpaa/include/fsl_usd.h +++ b/drivers/bus/dpaa/include/fsl_usd.h @@ -75,7 +75,7 @@ int qman_global_init(void); int bman_global_init(void); /* Direct portal create and destroy */ -struct qman_portal *fsl_qman_fq_portal_create(void); +struct qman_portal *fsl_qman_fq_portal_create(int *fd); int fsl_qman_fq_portal_destroy(struct qman_portal *qp); int fsl_qman_fq_portal_init(struct qman_portal *qp); diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h index 554a56f2e..9601aebdd 100644 --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/rte_dpaa_bus.h @@ -75,6 +75,7 @@ struct rte_dpaa_device { }; struct rte_dpaa_driver *driver; struct dpaa_device_id id; + struct rte_intr_handle intr_handle; enum rte_dpaa_type device_type; /**< Ethernet or crypto type device */ char name[RTE_ETH_NAME_MAX_LEN]; }; diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 4e2c9471e..1934f85ae 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -628,8 +628,10 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, fman_if_get_sg_enable(dpaa_intf->fif), dev->data->dev_conf.rxmode.max_rx_pkt_len); /* checking if push mode only, no error check for now */ - if (dpaa_push_mode_max_queue > dpaa_push_queue_idx) { + if (!rxq->is_static && + dpaa_push_mode_max_queue > dpaa_push_queue_idx) { struct qman_portal *qp; + int q_fd; dpaa_push_queue_idx++; opts.we_mask = QM_INITFQ_WE_FQCTRL | QM_INITFQ_WE_CONTEXTA; @@ -676,12 +678,35 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, rxq->is_static = true; /* Allocate qman specific portals */ - qp = fsl_qman_fq_portal_create(); + qp = fsl_qman_fq_portal_create(&q_fd); if (!qp) { DPAA_PMD_ERR("Unable to alloc fq portal"); return -1; } rxq->qp = qp; + + /* Set up the device interrupt handler */ + if (!dev->intr_handle) { + struct rte_dpaa_device *dpaa_dev; + struct rte_device *rdev = dev->device; + + dpaa_dev = container_of(rdev, struct rte_dpaa_device, + device); + dev->intr_handle = &dpaa_dev->intr_handle; + dev->intr_handle->intr_vec = rte_zmalloc(NULL, + dpaa_push_mode_max_queue, 0); + if (!dev->intr_handle->intr_vec) { + DPAA_PMD_ERR("intr_vec alloc failed"); + return -ENOMEM; + } + dev->intr_handle->nb_efd = dpaa_push_mode_max_queue; + dev->intr_handle->max_intr = dpaa_push_mode_max_queue; + } + + dev->intr_handle->type = RTE_INTR_HANDLE_EXT; + dev->intr_handle->intr_vec[queue_idx] = queue_idx + 1; + dev->intr_handle->efds[queue_idx] = q_fd; + rxq->q_fd = q_fd; } rxq->bp_array = rte_dpaa_bpid_info; dev->data->rx_queues[queue_idx] = rxq; From patchwork Thu Aug 29 10:27:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172557 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2029084ily; Thu, 29 Aug 2019 03:42:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUkqO7voyPQI7XBW6GfnRAYjQLH0Z/B33DXE3WcmW2J7uhhPbi6sdV8af91YeOfUmzR6M7 X-Received: by 2002:a50:f04e:: with SMTP id u14mr2851799edl.247.1567075364687; Thu, 29 Aug 2019 03:42:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075364; cv=none; d=google.com; s=arc-20160816; b=hQf5YKLIc30HV/4OLpQrcBpPOLXG79tIe4L7X9PyUEFo1s218oyXPy6uQ5frkT3/Kb LVP5wtlxt6bGmSmJ7FYpdaMi9PoXaZxMUXNL1RSxR87ipAIvu3vYVIrLu8aL44XrFzY/ y0in2W1fWQjaBJ0bRwZpnPu46IN0qnSKyIhAUjqWIxvHP1wZBfjXIHwP1GBAvzYiT/mL EN+8LPHsJPqsY/JvyGr4cdHx1qU8qwi9dFHxn7NlNhnGsZvmkmLk4S1ysNLvP86RxoP2 dvj/eoI8XCaXuzippYKEfDYmK3voNNMsozcJ0hb7BbnrM6YJSkwzHXORJx3q8jTuVx3w Dp/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=Z+nZGZiQGKDaKOoHsSmuMGcsmH7xRqqMclJffc7Ng1M=; b=Q7wFLubNQUyF0Gpg/JnygJhAa9L5AGRKsZbDJXSygBMqUkh0fk9gVHt+LZHavuEY+R T4ZoD1elmhsGkeNaUOKdU1oR7Lurr7cahJbkvSlLjhXV8tEVvX4V+27dQZHXsKBXVf9U 8KiMETVDkiw3b2UEghfkyeCjrbJeLYwMZqb0k33mGY1qWSPKD9rVx2rZLgb1ZyCJ2t5o LS8cmIaM9AyyxmTRMR8hRsUbNhFI+e8fn7MoKs+hncvzhMREt2Aqmy/Iq1oEpSEwo3P0 zCmlZF+7alttMlmAVyWwF/IKZr1h8KLaGKsCHfdR06YkK2nzIOy0TQRsA9csvNxqfdlk Y1uA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id w8si890960ejb.308.2019.08.29.03.42.44; Thu, 29 Aug 2019 03:42:44 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC6151E4D3; Thu, 29 Aug 2019 12:42:05 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id D93191D446 for ; Thu, 29 Aug 2019 12:41:49 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B9B7A20032C; Thu, 29 Aug 2019 12:41:49 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 818B220032A; Thu, 29 Aug 2019 12:41:47 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id DB1BF4031F; Thu, 29 Aug 2019 18:41:42 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Nipun Gupta Date: Thu, 29 Aug 2019 15:57:13 +0530 Message-Id: <20190829102737.13267-7-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 06/30] net/dpaa: support for Rx interrupt enable and disable 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" From: Nipun Gupta This patch adds support for dpaa eth driver interrupt enable and disable callback functions. Signed-off-by: Nipun Gupta --- drivers/bus/dpaa/base/qbman/qman.c | 45 +++++++++++++++++++++++ drivers/bus/dpaa/base/qbman/qman_driver.c | 5 +++ drivers/bus/dpaa/base/qbman/qman_priv.h | 2 + drivers/bus/dpaa/include/fsl_usd.h | 1 + drivers/bus/dpaa/rte_bus_dpaa_version.map | 3 ++ drivers/net/dpaa/dpaa_ethdev.c | 39 +++++++++++++++++++- 6 files changed, 94 insertions(+), 1 deletion(-) -- 2.17.1 Acked-by: Hemant Agrawal diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 79017f7f2..96208bc40 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -664,6 +664,12 @@ qman_free_global_portal(struct qman_portal *portal) return -1; } +void +qman_portal_uninhibit_isr(struct qman_portal *portal) +{ + qm_isr_uninhibit(&portal->p); +} + struct qman_portal *qman_create_affine_portal(const struct qm_portal_config *c, const struct qman_cgrs *cgrs) { @@ -1053,6 +1059,20 @@ int qman_irqsource_add(u32 bits) dpaa_set_bits(bits, &p->irq_sources); qm_isr_enable_write(&p->p, p->irq_sources); + return 0; +} + +int qman_fq_portal_irqsource_add(struct qman_portal *p, u32 bits) +{ + bits = bits & QM_PIRQ_VISIBLE; + + /* Clear any previously remaining interrupt conditions in + * QCSP_ISR. This prevents raising a false interrupt when + * interrupt conditions are enabled in QCSP_IER. + */ + qm_isr_status_clear(&p->p, bits); + dpaa_set_bits(bits, &p->irq_sources); + qm_isr_enable_write(&p->p, p->irq_sources); return 0; } @@ -1083,6 +1103,31 @@ int qman_irqsource_remove(u32 bits) return 0; } +int qman_fq_portal_irqsource_remove(struct qman_portal *p, u32 bits) +{ + u32 ier; + + /* Our interrupt handler only processes+clears status register bits that + * are in p->irq_sources. As we're trimming that mask, if one of them + * were to assert in the status register just before we remove it from + * the enable register, there would be an interrupt-storm when we + * release the IRQ lock. So we wait for the enable register update to + * take effect in h/w (by reading it back) and then clear all other bits + * in the status register. Ie. we clear them from ISR once it's certain + * IER won't allow them to reassert. + */ + + bits &= QM_PIRQ_VISIBLE; + dpaa_clear_bits(bits, &p->irq_sources); + qm_isr_enable_write(&p->p, p->irq_sources); + ier = qm_isr_enable_read(&p->p); + /* Using "~ier" (rather than "bits" or "~p->irq_sources") creates a + * data-dependency, ie. to protect against re-ordering. + */ + qm_isr_status_clear(&p->p, ~ier); + return 0; +} + u16 qman_affine_channel(int cpu) { if (cpu < 0) { diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index acd003143..69244ef70 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -121,6 +121,11 @@ void qman_thread_irq(void) out_be32(qpcfg.addr_virt[DPAA_PORTAL_CI] + 0x36C0, 0); } +void qman_fq_portal_thread_irq(struct qman_portal *qp) +{ + qman_portal_uninhibit_isr(qp); +} + struct qman_portal *fsl_qman_fq_portal_create(int *fd) { struct qman_portal *portal = NULL; diff --git a/drivers/bus/dpaa/base/qbman/qman_priv.h b/drivers/bus/dpaa/base/qbman/qman_priv.h index 97d5521a8..8254729e6 100644 --- a/drivers/bus/dpaa/base/qbman/qman_priv.h +++ b/drivers/bus/dpaa/base/qbman/qman_priv.h @@ -157,6 +157,8 @@ qman_init_portal(struct qman_portal *portal, struct qman_portal *qman_alloc_global_portal(struct qm_portal_config *q_pcfg); int qman_free_global_portal(struct qman_portal *portal); +void qman_portal_uninhibit_isr(struct qman_portal *portal); + struct qm_portal_config *qm_get_unused_portal(void); struct qm_portal_config *qm_get_unused_portal_idx(uint32_t idx); diff --git a/drivers/bus/dpaa/include/fsl_usd.h b/drivers/bus/dpaa/include/fsl_usd.h index a407e2b22..3c26d6ccb 100644 --- a/drivers/bus/dpaa/include/fsl_usd.h +++ b/drivers/bus/dpaa/include/fsl_usd.h @@ -67,6 +67,7 @@ int bman_thread_fd(void); */ void qman_thread_irq(void); void bman_thread_irq(void); +void qman_fq_portal_thread_irq(struct qman_portal *qp); void qman_clear_irq(void); diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index f779469f9..962b952d3 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -127,6 +127,9 @@ DPDK_19.05 { DPDK_19.11 { global: fsl_qman_fq_portal_create; + qman_fq_portal_irqsource_add; + qman_fq_portal_irqsource_remove; + qman_fq_portal_thread_irq; local: *; } DPDK_19.05; diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 1934f85ae..42ab3d05f 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright 2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2017 NXP + * Copyright 2017-2019 NXP * */ /* System headers */ @@ -1013,6 +1013,40 @@ dpaa_dev_set_mac_addr(struct rte_eth_dev *dev, return ret; } +static int dpaa_dev_queue_intr_enable(struct rte_eth_dev *dev, + uint16_t queue_id) +{ + struct dpaa_if *dpaa_intf = dev->data->dev_private; + struct qman_fq *rxq = &dpaa_intf->rx_queues[queue_id]; + + if (!rxq->is_static) + return -EINVAL; + + return qman_fq_portal_irqsource_add(rxq->qp, QM_PIRQ_DQRI); +} + +static int dpaa_dev_queue_intr_disable(struct rte_eth_dev *dev, + uint16_t queue_id) +{ + struct dpaa_if *dpaa_intf = dev->data->dev_private; + struct qman_fq *rxq = &dpaa_intf->rx_queues[queue_id]; + uint32_t temp; + ssize_t temp1; + + if (!rxq->is_static) + return -EINVAL; + + qman_fq_portal_irqsource_remove(rxq->qp, ~0); + + temp1 = read(rxq->q_fd, &temp, sizeof(temp)); + if (temp1 != sizeof(temp)) + DPAA_EVENTDEV_ERR("irq read error"); + + qman_fq_portal_thread_irq(rxq->qp); + + return 0; +} + static struct eth_dev_ops dpaa_devops = { .dev_configure = dpaa_eth_dev_configure, .dev_start = dpaa_eth_dev_start, @@ -1050,6 +1084,9 @@ static struct eth_dev_ops dpaa_devops = { .mac_addr_set = dpaa_dev_set_mac_addr, .fw_version_get = dpaa_fw_version_get, + + .rx_queue_intr_enable = dpaa_dev_queue_intr_enable, + .rx_queue_intr_disable = dpaa_dev_queue_intr_disable, }; static bool From patchwork Thu Aug 29 10:27:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172558 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2029235ily; Thu, 29 Aug 2019 03:42:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWPm/Q7ma3iz+NmCZr2OHUmGA8ibEztWMcUm+GfnykvvadmyWUq+hpLjDYDhxXLUliIMhv X-Received: by 2002:a17:906:fca8:: with SMTP id qw8mr7585042ejb.273.1567075372404; Thu, 29 Aug 2019 03:42:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075372; cv=none; d=google.com; s=arc-20160816; b=EHBDVeFTEoX2zi6b/2PeEHkyciorgpTYxfC8fmUaySgSocCZ3Ft250xrZWfWjHoB8y 9ouBSNsDhlvFXGNmKdBrmMLI1yJKJN+q0KBgcSrwLVwiB2458EE7Z8HcW2go17rForlk 6bYU5q9JrINdQIYmv8/oAAwZdtBQ/YebhCH/o+s1EamPlvzoJnyu789uziHSLy+0w/8K /6qKuzYHdnXe+F1rJroChQ+sye2bT12Svz5kZJ6eVncdBUZsKrMYW4hFjTYMBl09Wy7d Q//Vxah85Bq3h9kk0cK9cn9mdAmG4VgngsoiNVlHx1TiBtQOnHUuQe142MUp/cZV+TuX mSOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=smYfWK6Why1FUt6Xx/c+6KOBsTUKi7w7ZSw3AFPfCZM=; b=a6fuDLV98AIrtdMECNvSEcQ5xWDQr1PTiX+dDTKs5J6Zs96quucq9W5V6c6G1PIUDW ZMlR1vHCFuc3XkmKA0ANR/mYJqm3G6HacoMjQxvtxCoLsB7NzfCyxcNR4SRYJUObZZ9f qMnsPkWFsWN2nDeExk/rRDng2pzFui807cpXgJQi6vQywH3yZFN/bYf95OFkxJcXtaZ9 fzX1WRzTdI+0ajFxU5BDrKQeU/N+daIM3hAWQE62TGkOz4ZtDkNdrC3WD9jeEOWt+OKc 8u1Nlfdi50bDenriwY8lq0wV6DRRJEo4kuigaWSoi7c6LUGNPYQ671yUiDzJ3r4zLQV5 i6zg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id e38si1031498edb.389.2019.08.29.03.42.52; Thu, 29 Aug 2019 03:42:52 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F22271E4E2; Thu, 29 Aug 2019 12:42:07 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 4ED4B1D446 for ; Thu, 29 Aug 2019 12:41:50 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 30FB11A015C; Thu, 29 Aug 2019 12:41:50 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id EBE651A0010; Thu, 29 Aug 2019 12:41:47 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 8A90640320; Thu, 29 Aug 2019 18:41:43 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Nipun Gupta Date: Thu, 29 Aug 2019 15:57:14 +0530 Message-Id: <20190829102737.13267-8-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 07/30] net/dpaa: add SG support in Tx for non DPAA buffer 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" From: Nipun Gupta This patch adds support for Scatter Gather in the transmit side, for the cases where the buffer are received which are not from DPAA buffer pool. Signed-off-by: Nipun Gupta --- drivers/net/dpaa/dpaa_rxtx.c | 189 +++++++++++++++++++---------------- 1 file changed, 101 insertions(+), 88 deletions(-) -- 2.17.1 Acked-by: Hemant Agrawal diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 220c3477d..2de1a1a7e 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -642,53 +642,6 @@ uint16_t dpaa_eth_queue_rx(void *q, return num_rx; } -static void *dpaa_get_pktbuf(struct dpaa_bp_info *bp_info) -{ - int ret; - size_t buf = 0; - struct bm_buffer bufs; - - ret = bman_acquire(bp_info->bp, &bufs, 1, 0); - if (ret <= 0) { - DPAA_PMD_WARN("Failed to allocate buffers %d", ret); - return (void *)buf; - } - - DPAA_DP_LOG(DEBUG, "got buffer 0x%" PRIx64 " from pool %d", - (uint64_t)bufs.addr, bufs.bpid); - - buf = (size_t)DPAA_MEMPOOL_PTOV(bp_info, bufs.addr) - - bp_info->meta_data_size; - if (!buf) - goto out; - -out: - return (void *)buf; -} - -static struct rte_mbuf *dpaa_get_dmable_mbuf(struct rte_mbuf *mbuf, - struct dpaa_if *dpaa_intf) -{ - struct rte_mbuf *dpaa_mbuf; - - /* allocate pktbuffer on bpid for dpaa port */ - dpaa_mbuf = dpaa_get_pktbuf(dpaa_intf->bp_info); - if (!dpaa_mbuf) - return NULL; - - memcpy((uint8_t *)(dpaa_mbuf->buf_addr) + RTE_PKTMBUF_HEADROOM, (void *) - ((uint8_t *)(mbuf->buf_addr) + mbuf->data_off), mbuf->pkt_len); - - /* Copy only the required fields */ - dpaa_mbuf->data_off = RTE_PKTMBUF_HEADROOM; - dpaa_mbuf->pkt_len = mbuf->pkt_len; - dpaa_mbuf->ol_flags = mbuf->ol_flags; - dpaa_mbuf->packet_type = mbuf->packet_type; - dpaa_mbuf->tx_offload = mbuf->tx_offload; - rte_pktmbuf_free(mbuf); - return dpaa_mbuf; -} - int dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, struct qm_fd *fd, @@ -862,26 +815,84 @@ tx_on_dpaa_pool(struct rte_mbuf *mbuf, } /* Handle all mbufs on an external pool (non-dpaa) */ -static inline uint16_t -tx_on_external_pool(struct qman_fq *txq, struct rte_mbuf *mbuf, - struct qm_fd *fd_arr) +static inline struct rte_mbuf * +reallocate_mbuf(struct qman_fq *txq, struct rte_mbuf *mbuf) { struct dpaa_if *dpaa_intf = txq->dpaa_intf; - struct rte_mbuf *dmable_mbuf; + struct dpaa_bp_info *bp_info = dpaa_intf->bp_info; + struct rte_mbuf *new_mbufs[DPAA_SGT_MAX_ENTRIES + 1] = {0}; + struct rte_mbuf *temp_mbuf; + int num_new_segs, mbuf_greater, ret, extra_seg = 0, i = 0; + uint64_t mbufs_size, bytes_to_copy, offset1 = 0, offset2 = 0; + char *data; + + DPAA_DP_LOG(DEBUG, "Reallocating transmit buffer"); + + mbufs_size = bp_info->size - + bp_info->meta_data_size - RTE_PKTMBUF_HEADROOM; + extra_seg = !!(mbuf->pkt_len % mbufs_size); + num_new_segs = (mbuf->pkt_len / mbufs_size) + extra_seg; + + ret = rte_pktmbuf_alloc_bulk(bp_info->mp, new_mbufs, num_new_segs); + if (ret != 0) { + DPAA_DP_LOG(DEBUG, "Allocation for new buffers failed"); + return NULL; + } - DPAA_DP_LOG(DEBUG, "Non-BMAN offloaded buffer." - "Allocating an offloaded buffer"); - dmable_mbuf = dpaa_get_dmable_mbuf(mbuf, dpaa_intf); - if (!dmable_mbuf) { - DPAA_DP_LOG(DEBUG, "no dpaa buffers."); - return 1; + temp_mbuf = mbuf; + + while (temp_mbuf) { + /* If mbuf data is less than new mbuf remaining memory */ + if ((temp_mbuf->data_len - offset1) < (mbufs_size - offset2)) { + bytes_to_copy = temp_mbuf->data_len - offset1; + mbuf_greater = -1; + /* If mbuf data is greater than new mbuf remaining memory */ + } else if ((temp_mbuf->data_len - offset1) > + (mbufs_size - offset2)) { + bytes_to_copy = mbufs_size - offset2; + mbuf_greater = 1; + /* if mbuf data is equal to new mbuf remaining memory */ + } else { + bytes_to_copy = temp_mbuf->data_len - offset1; + mbuf_greater = 0; + } + + /* Copy the data */ + data = rte_pktmbuf_append(new_mbufs[0], bytes_to_copy); + + rte_memcpy((uint8_t *)data, rte_pktmbuf_mtod_offset(mbuf, + void *, offset1), bytes_to_copy); + + /* Set new offsets and the temp buffers */ + if (mbuf_greater == -1) { + offset1 = 0; + offset2 += bytes_to_copy; + temp_mbuf = temp_mbuf->next; + } else if (mbuf_greater == 1) { + offset2 = 0; + offset1 += bytes_to_copy; + new_mbufs[i]->next = new_mbufs[i + 1]; + new_mbufs[0]->nb_segs++; + i++; + } else { + offset1 = 0; + offset2 = 0; + temp_mbuf = temp_mbuf->next; + new_mbufs[i]->next = new_mbufs[i + 1]; + if (new_mbufs[i + 1]) + new_mbufs[0]->nb_segs++; + i++; + } } - DPAA_MBUF_TO_CONTIG_FD(dmable_mbuf, fd_arr, dpaa_intf->bp_info->bpid); - if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) - dpaa_unsegmented_checksum(mbuf, fd_arr); + /* Copy other required fields */ + new_mbufs[0]->ol_flags = mbuf->ol_flags; + new_mbufs[0]->packet_type = mbuf->packet_type; + new_mbufs[0]->tx_offload = mbuf->tx_offload; - return 0; + rte_pktmbuf_free(mbuf); + + return new_mbufs[0]; } uint16_t @@ -893,7 +904,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) struct qm_fd fd_arr[DPAA_TX_BURST_SIZE]; uint32_t frames_to_send, loop, sent = 0; uint16_t state; - int ret; + int ret, realloc_mbuf = 0; uint32_t seqn, index, flags[DPAA_TX_BURST_SIZE] = {0}; if (unlikely(!RTE_PER_LCORE(dpaa_io))) { @@ -911,6 +922,13 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) DPAA_TX_BURST_SIZE : nb_bufs; for (loop = 0; loop < frames_to_send; loop++) { mbuf = *(bufs++); + /* In case the data offset is not multiple of 16, + * FMAN can stall because of an errata. So reallocate + * the buffer in such case. + */ + if (dpaa_svr_family == SVR_LS1043A_FAMILY && + (mbuf->data_off & 0xFF) != 0x0) + realloc_mbuf = 1; seqn = mbuf->seqn; if (seqn != DPAA_INVALID_MBUF_SEQN) { index = seqn - 1; @@ -930,6 +948,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) if (likely(mp->ops_index == bp_info->dpaa_ops_index && mbuf->nb_segs == 1 && + realloc_mbuf == 0 && rte_mbuf_refcnt_read(mbuf) == 1)) { DPAA_MBUF_TO_CONTIG_FD(mbuf, &fd_arr[loop], bp_info->bpid); @@ -945,32 +964,12 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) } bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp); - if (likely(mp->ops_index == bp_info->dpaa_ops_index)) { - state = tx_on_dpaa_pool(mbuf, bp_info, - &fd_arr[loop]); - if (unlikely(state)) { - /* Set frames_to_send & nb_bufs so - * that packets are transmitted till - * previous frame. - */ - frames_to_send = loop; - nb_bufs = loop; - goto send_pkts; - } - } else { - /* TODO not supporting sg for external bufs*/ - if (unlikely(mbuf->nb_segs > 1)) { - /* Set frames_to_send & nb_bufs so - * that packets are transmitted till - * previous frame. - */ - frames_to_send = loop; - nb_bufs = loop; - goto send_pkts; - } - state = tx_on_external_pool(q, mbuf, - &fd_arr[loop]); - if (unlikely(state)) { + if (unlikely(mp->ops_index != bp_info->dpaa_ops_index || + realloc_mbuf == 1)) { + struct rte_mbuf *temp_mbuf; + + temp_mbuf = reallocate_mbuf(q, mbuf); + if (!temp_mbuf) { /* Set frames_to_send & nb_bufs so * that packets are transmitted till * previous frame. @@ -979,6 +978,20 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) nb_bufs = loop; goto send_pkts; } + mbuf = temp_mbuf; + realloc_mbuf = 0; + } + + state = tx_on_dpaa_pool(mbuf, bp_info, + &fd_arr[loop]); + if (unlikely(state)) { + /* Set frames_to_send & nb_bufs so + * that packets are transmitted till + * previous frame. + */ + frames_to_send = loop; + nb_bufs = loop; + goto send_pkts; } } From patchwork Thu Aug 29 10:27:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172559 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2029374ily; Thu, 29 Aug 2019 03:43:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHTaJ2Fle/3hVkQUA9cHoaQW1GjPXpw1/tYtRMxFnKui/ApI2CDNQvHYlpKkpjPwlLDmDk X-Received: by 2002:aa7:c655:: with SMTP id z21mr8936209edr.87.1567075381158; Thu, 29 Aug 2019 03:43:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075381; cv=none; d=google.com; s=arc-20160816; b=jLgy0i8lwWCI/e46tTtHk+/UM2DA1SZgNbMcdSq9mGMtrC7mU6pyG2+q6CqVMceRtg D/+AQoQQA4UrMnqkDrslAZRPh8vawOjyH0Y5eRfn051XnHueYgl53bWPOulckR9iFBdo ui4Vb5ErcWgHU0VcYC1l5RTWC3+cwn7Mmu1s8lUROsDNY4iTWaZJvKmrdYgWhdanU7qS YRqErLXiBK4SwPoT8fRyKciEIjhbp+Ad/048mXo19eKjo4MQNvOPkNjNxpskxxrFOhQA 5tzNi8T0D6ITNLpJ9TEc1K298KEzQ7c/IYupT8v8Xmzn5YEt/z/JjRFyC6aAjKBjJ7zm Mi2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=IiU8lk+L/ZWSNAWWNky00BH3PX5aYDAXeFUgpjJ2+kM=; b=L7nC9usoBIG+bgIT7uPEzkDcwkF9t6rdjWnyJxmQvqH6TBNegPpwrSseN2C4bVqncy VpEu2/YeGiMyz5uYLf4C9Xl+3to5l4INOz23nZx0bB9NeKqT/Otkrnp3esPZ7SLo/DVp SSgx4+VaLN7BXwUXVDO3B1qcs3eC72YYoyJEDEqhs2QJwFKZxVBa2IsStAsFuLLSOZ9q 2q7xWv0i6DgcVS9aOAm8WtwpMHfBH26REoeMowOC41p+fqCbmEHM2H9H4vw6I0654HVc sFADqnWpfPN5RHttFIjIC0kj1keM69MN1BgGCkd+pC4q4icrAVfZ8uI8MQ8gzKjKw8Ac x+qA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id gq12si884488ejb.170.2019.08.29.03.43.00; Thu, 29 Aug 2019 03:43:01 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A41AB1E4DE; Thu, 29 Aug 2019 12:42:10 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 5D8441D448 for ; Thu, 29 Aug 2019 12:41:50 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 40C4C1A031F; Thu, 29 Aug 2019 12:41:50 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3DE491A00B9; Thu, 29 Aug 2019 12:41:48 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 392BE402D7; Thu, 29 Aug 2019 18:41:44 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:15 +0530 Message-Id: <20190829102737.13267-9-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 08/30] net/dpaa: reduce debug messages 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" From: Hemant Agrawal Signed-off-by: Hemant Agrawal Reviewed-by: Sachin Saxena --- drivers/net/dpaa/dpaa_ethdev.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 42ab3d05f..dc2e584b1 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -335,7 +335,7 @@ static void dpaa_eth_dev_info(struct rte_eth_dev *dev, { struct dpaa_if *dpaa_intf = dev->data->dev_private; - PMD_INIT_FUNC_TRACE(); + DPAA_PMD_DEBUG(": %s", dpaa_intf->name); dev_info->max_rx_queues = dpaa_intf->nb_rx_queues; dev_info->max_tx_queues = dpaa_intf->nb_tx_queues; @@ -1172,8 +1172,6 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, } }; - PMD_INIT_FUNC_TRACE(); - if (fqid) { ret = qman_reserve_fqid(fqid); if (ret) { @@ -1225,8 +1223,6 @@ static int dpaa_tx_queue_init(struct qman_fq *fq, struct qm_mcc_initfq opts = {0}; int ret; - PMD_INIT_FUNC_TRACE(); - ret = qman_create_fq(0, QMAN_FQ_FLAG_DYNAMIC_FQID | QMAN_FQ_FLAG_TO_DCPORTAL, fq); if (ret) { From patchwork Thu Aug 29 10:27:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172560 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2029484ily; Thu, 29 Aug 2019 03:43:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFQ635XbvQd3RgiqERmEUEDdCmB+LZsUy4qwWCAcYDoLwTvbOJhqeatTt2aBi3eebYpDFB X-Received: by 2002:a50:ee88:: with SMTP id f8mr9065980edr.290.1567075388753; Thu, 29 Aug 2019 03:43:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075388; cv=none; d=google.com; s=arc-20160816; b=yvQUqJXCGVzdi5YzF7hhSYidiwZjKA0j02An+gG8k8ewJ2PfVyZBB5xW1ZESIRxYPp nrpawvYhbXO02fJQvSzIO+X7z0IhdaNQtyIBytmDZcQ+/U+C/Qn7u2OKbGZPgj+J9Z4o A+WiJBnjtXaIouQo1Og2ZTOAvHVDmO4SE1LG0txzsoKdiIoidT1v46lpF1A1VfMPtJ0O SAxeNnBu2W+aUNrx71AMJbk/z+rKZro+JTy8kMEkE3kvKsIbuKM+8nAnJecWf4XhFJgU DBmhp1iBhBpALp4w1ANhiW4usuX+vIMzPxUhwrWSVkU0pZ92GxmttjINzwlg+MC489sF dozg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=kh2On7sBlljzffwt6fmdEYXA5VAJ3OXfxDrgTvsGa8s=; b=gykne682oxboQfY3SoCFIU1L7lU9lmE/+w+devxo92OsL4egnwIKvxlOeFUpq9wW// QVYzr0CBlMaiMl4IuVsyl6CULGa0U4JzM/jxbyOnRoY0HYweG8hx9aQW1BfFdcV4kVVs DTBF4yi672PJZIYH+eJHwEnXUmEaYkJyW4VLlBz5MHB8fxPFXKfdTdhk+bwbxAcHbKmK We0oJGBajp9TiW/Mx6Q3cSvcBbJaFA6mEFwYL0xCdnbVcUavY5bheHY+cC4CAd1+v2nR QwLAx6fLUqmFFINFMZN0bz9EjzYrXWiBzZwbNfetQ4m2nMpnIyZTbAYFJFA7OK/s1jXW uXsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id t14si889503ejd.101.2019.08.29.03.43.08; Thu, 29 Aug 2019 03:43:08 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1184F1E532; Thu, 29 Aug 2019 12:42:13 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id CA31D1D453 for ; Thu, 29 Aug 2019 12:41:50 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id ACE5D1A00E8; Thu, 29 Aug 2019 12:41:50 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A87471A030F; Thu, 29 Aug 2019 12:41:48 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id E5C6C40323; Thu, 29 Aug 2019 18:41:44 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:16 +0530 Message-Id: <20190829102737.13267-10-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 09/30] net/dpaa2: improve the Rx offload debug message 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" From: Hemant Agrawal Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index dd6a78f9f..bbebb66fe 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -395,20 +395,20 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); - /* Rx offloads validation */ + /* Rx offloads which are enabled by default */ if (dev_rx_offloads_nodis & ~rx_offloads) { - DPAA2_PMD_WARN( - "Rx offloads non configurable - requested 0x%" PRIx64 - " ignored 0x%" PRIx64, - rx_offloads, dev_rx_offloads_nodis); + DPAA2_PMD_INFO( + "Some of rx offloads enabled by default - requested 0x%" PRIx64 + " fixed are 0x%" PRIx64, + rx_offloads, dev_rx_offloads_nodis); } - /* Tx offloads validation */ + /* Tx offloads which are enabled by default */ if (dev_tx_offloads_nodis & ~tx_offloads) { - DPAA2_PMD_WARN( - "Tx offloads non configurable - requested 0x%" PRIx64 - " ignored 0x%" PRIx64, - tx_offloads, dev_tx_offloads_nodis); + DPAA2_PMD_INFO( + "Some of tx offloads enabled by default - requested 0x%" PRIx64 + " fixed are 0x%" PRIx64, + tx_offloads, dev_tx_offloads_nodis); } if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { From patchwork Thu Aug 29 10:27:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172561 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2029582ily; Thu, 29 Aug 2019 03:43:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzc30z3YA+Syb2dGwVLRld0lOLacW3xzLVTHWIw5UJQ3NKt+aZPXPmGSutOksn+vYVYIlEp X-Received: by 2002:a50:aee9:: with SMTP id f38mr8995857edd.22.1567075395683; Thu, 29 Aug 2019 03:43:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075395; cv=none; d=google.com; s=arc-20160816; b=mcXkLJRYnP3HwCDu7kU8fDa0Br+kh6htz/EwTtnlzhS3zIZOvKlk3fRBQXxb8TNvBO I57rFoPyJvLBTUdXMXIxvo/HGOxsTp+pYLZH2NDdK+W2OyR4WFnB11CcUu7qDlXMhMrE FTzOchWYO+8POIO7ZSWUKcHtG28D+6iPtKh54O4mLOa3sBo3xnitgpDab1iIykb5reT9 BaO5rIAjpmowPi1ARf2zEmgvQxcrNyOupGFVz/QRyx9FxUnsZufFOxMjXO0vJ/qnOY6r ExjjJq1HQUPU3yP6AvLk+zONkblsU9i7pFl9ekTO2TDUa38jfj3cUMtxK82ldXhfFeOw ix6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=WqzB9MoyGTXXdlHu1nCSF/Nvw5mHjrAjfnUNfJ1C8pI=; b=GlfuFt/VZBuPZa2mMmBUInYCfyHsPbZXfljuwHwky04gu1UWk4YV+WvktrwHIcNwxw Ay4XmTtJQx05whpy1y9MAzbP65E+1YNNuNMAo26y3AdaHegIP2IsPu9JFxn+Tn2Q5zwh SHNtbFcClk30CV3Kh2WaNFhX/OX0jXt3sfbU09UJtjzEffSw4/OqijmRM6lBdQRVArIk +B8181kjTjsbrMeEFTa8QF4zbj0SmWT6+AsrlgSCovrBGI45H1irhX0HvkuDl1lNqJ0k rOdWuiEAqhw+l21szJT8Lsxt81hAX3CaqqK0H8F35TGzbO2OIAU6VmKVJgR9dnSL0NDw tSmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id d33si1013540eda.62.2019.08.29.03.43.15; Thu, 29 Aug 2019 03:43:15 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9382E1E538; Thu, 29 Aug 2019 12:42:15 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id B7CD51D450 for ; Thu, 29 Aug 2019 12:41:50 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 988201A00B9; Thu, 29 Aug 2019 12:41:50 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 95E491A00E8; Thu, 29 Aug 2019 12:41:48 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 95004402EB; Thu, 29 Aug 2019 18:41:45 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:17 +0530 Message-Id: <20190829102737.13267-11-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 10/30] common/dpaax: reduce debug mesages 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" From: Hemant Agrawal Signed-off-by: Hemant Agrawal Reviewed-by: Sachin Saxena --- drivers/common/dpaax/dpaax_iova_table.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c index ae0af0919..43c9c72e6 100644 --- a/drivers/common/dpaax/dpaax_iova_table.c +++ b/drivers/common/dpaax/dpaax_iova_table.c @@ -140,7 +140,8 @@ read_memory_node(unsigned int *count) DPAAX_DEBUG("Device-tree memory node data:"); do { - DPAAX_DEBUG("\n %08" PRIx64 " %08zu", nodes[j].addr, nodes[j].len); + DPAAX_DEBUG(" %08" PRIx64 " %08zu", + nodes[j].addr, nodes[j].len); } while (--j); cleanup: @@ -241,7 +242,7 @@ dpaax_iova_table_populate(void) /* Release memory associated with nodes array - not required now */ free(nodes); - DPAAX_DEBUG("Adding mem-event handler\n"); + DPAAX_DEBUG("Adding mem-event handler"); ret = dpaax_handle_memevents(); if (ret) { DPAAX_ERR("Unable to add mem-event handler"); @@ -306,10 +307,11 @@ dpaax_iova_table_update(phys_addr_t paddr, void *vaddr, size_t length) * case. */ entry[i].pages[e_offset] = align_vaddr; +#ifdef RTE_COMMON_DPAAX_DEBUG DPAAX_DEBUG("Added: vaddr=%zu for Phy:%"PRIu64" at %zu" " remaining len %zu", align_vaddr, align_paddr, e_offset, req_length); - +#endif /* Incoming request can be larger than the * DPAAX_MEM_SPLIT size - in which case, multiple * entries in entry->pages[] are filled up. @@ -336,10 +338,11 @@ dpaax_iova_table_update(phys_addr_t paddr, void *vaddr, size_t length) vaddr, paddr); return -1; } - +#ifdef RTE_COMMON_DPAAX_DEBUG DPAAX_DEBUG("Add: Found slot at (%"PRIu64")[(%zu)] for vaddr:(%p)," " phy(%"PRIu64"), len(%zu)", entry[i].start, e_offset, vaddr, paddr, length); +#endif return 0; } @@ -404,13 +407,13 @@ dpaax_memevent_cb(enum rte_mem_event type, const void *addr, size_t len, phys_addr = rte_mem_virt2phy(ms->addr); virt_addr = ms->addr; map_len = ms->len; - +#ifdef RTE_COMMON_DPAAX_DEBUG DPAAX_DEBUG("Request for %s, va=%p, virt_addr=%p," "iova=%"PRIu64", map_len=%zu", type == RTE_MEM_EVENT_ALLOC ? "alloc" : "dealloc", va, virt_addr, phys_addr, map_len); - +#endif if (type == RTE_MEM_EVENT_ALLOC) ret = dpaax_iova_table_update(phys_addr, virt_addr, map_len); From patchwork Thu Aug 29 10:27:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172562 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2029779ily; Thu, 29 Aug 2019 03:43:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrXdP2qbEWcAkewnbR01HoEymfim02EhY8NkKjquRQMGQ2CShlcsGkH8tZ+UwnQrg2nhCD X-Received: by 2002:a50:fb90:: with SMTP id e16mr8799430edq.16.1567075406449; Thu, 29 Aug 2019 03:43:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075406; cv=none; d=google.com; s=arc-20160816; b=qOdnW1pmoQm7EKEmmF9cKfpymu3uYshbp28VC6ej4i4l6xlwZuuePeC0mtmaxT7cEB +65ncWTqGpgPvHeXgOfvM8eCUrD2knxi99HYZAXpkATSQFLGenbaqOCZ2bZh4zTme7df P0m8ifjk70dG7emI8STw9rBJ/tVxxprRmEuuq6TSMFggpEW/VEQuRcIAdBqeG8gaQcIZ Vg0CNle29h8M5+7hL6I/uPQ6gvf8K525Zv99StwMdPjl2N/TJp80mHvMK+eP/aRMrQjp vZVVfzSiq3Jvx9LNdafIfbktR1zLkpVgiI9+Uw0yoFy19B0D2pZmQXKa+yIAXiaItqfx N9+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=y5ZuhV8wtmrGASDSrDF/US3Yp+7uGiPFJQgBDsCz56Y=; b=ZH0guvbJmdt4+lRpfBvZPKeowQbSy2IBOEK5flp/AUWmhV5WiRIo4UrluVPOXAOlqJ NJGTq8MSPfDNNLx3qvYwpxP7G+FQbQ+shVdnQ46ppyAERMhS75Lgn2xc124BRDZtSbPZ pSiTURn0nLcMEOTgZEBsVraYISaXSXubHZSD4sdv/7PWiR+tyDbu9vr8olIslTdnnp/r dxRROfaTApVMAqcjp3niyyepPrbAcm8CBRZqIMMkpWrdDQyFZTN6fvuD57h+mVjjoVVJ E/FoAcmC/yCNC4hqVAqo22AEfexGx0C4v0iiVvRaZNyV1qaRchjCnJJ83qTAsHv7D19n +wSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id y12si989218edd.87.2019.08.29.03.43.26; Thu, 29 Aug 2019 03:43:26 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1EABD1E53E; Thu, 29 Aug 2019 12:42:18 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 6EF401D446 for ; Thu, 29 Aug 2019 12:41:51 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 505AE20033A; Thu, 29 Aug 2019 12:41:51 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 4E298200322; Thu, 29 Aug 2019 12:41:49 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 4364C402DE; Thu, 29 Aug 2019 18:41:46 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:18 +0530 Message-Id: <20190829102737.13267-12-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 11/30] mempool/dpaa: reduce debug messages 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" From: Hemant Agrawal Signed-off-by: Hemant Agrawal Reviewed-by: Sachin Saxena --- drivers/mempool/dpaa/dpaa_mempool.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c index c371d3a6b..a25697f05 100644 --- a/drivers/mempool/dpaa/dpaa_mempool.c +++ b/drivers/mempool/dpaa/dpaa_mempool.c @@ -298,8 +298,6 @@ dpaa_populate(struct rte_mempool *mp, unsigned int max_objs, struct dpaa_bp_info *bp_info; unsigned int total_elt_sz; - MEMPOOL_INIT_FUNC_TRACE(); - if (!mp || !mp->pool_data) { DPAA_MEMPOOL_ERR("Invalid mempool provided\n"); return 0; @@ -311,7 +309,7 @@ dpaa_populate(struct rte_mempool *mp, unsigned int max_objs, bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp); total_elt_sz = mp->header_size + mp->elt_size + mp->trailer_size; - DPAA_MEMPOOL_DEBUG("Req size %" PRIx64 " vs Available %u\n", + DPAA_MEMPOOL_DPDEBUG("Req size %" PRIx64 " vs Available %u\n", (uint64_t)len, total_elt_sz * mp->size); /* Detect pool area has sufficient space for elements in this memzone */ From patchwork Thu Aug 29 10:27:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172563 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2029935ily; Thu, 29 Aug 2019 03:43:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVhrgTOLsvCLDCILz4AFq5flnmkofWY5j9s/Rroyut0yzhyxTQOc1gybfR54R4gJrfDmtB X-Received: by 2002:a50:d748:: with SMTP id i8mr8812928edj.4.1567075416202; Thu, 29 Aug 2019 03:43:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075416; cv=none; d=google.com; s=arc-20160816; b=U7Kl2IYupdqvJKIkgZ5VjZAtc0h00cG3cG9DKufQGu8tFY92/3GFE9TKjisHP0nnFr r1lnKoia7i7yz0v1aRO4OR93P4vtjRUEnYuCsVmuYt3Yy+RjSyiKLgJXLq3pzGeVzeJo ciQEfwL3POSrhZ7QeoBToVzXWbmyMoafv6RyS8FvC01u9+E/kTtGW4eDbmmJENSt60sN iknQu7Umv/6gtAX4rGl68z5xCnDxhympdsThZJl4hnJyDB9Ko7wwDhSFrTbKIALLOHGf X+TxFS4xctlsV0VLlMSoo+zB36CSfIAs6Nun+5WhCOHonbOnflmbfBjUuUtYDsXcNniW GrFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=nnNDeQmjTqf2d21sEMKM97QRX9F2bHbqe1Y785j0Rx8=; b=GUEm0K9MCWnwt8wgqSNvoRKeR+7wALiNp1zk4FpOw6+ZoCaw2BiG0mrgb3ZvMH5Vyd EduBH1Fsmtf1Bp5CP7QedeomMaAhG1+OuVvrHwT47deKYPwhO2bEoDVro0FB1USSISoA ZjbOeWHhwFsHk8nrf5+TrNJwe/tIiM2/ANQqSwp4O6GKJ39Yjf1H4IRbsJDuzH5D4dti V4A4S3tEU6w19sbs7IfOgLWL9sBZ3keUq7Rc8FxHxdI5MzRTe6sq6o+nbEtWDkMXk0gT UIyGlq+E9XEzaJFrbghYJpgI14NurHqCgWatn0MzZ6dryegO46mYWGUTGMNbX1HvOOm5 36lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id no6si892956ejb.173.2019.08.29.03.43.36; Thu, 29 Aug 2019 03:43:36 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3D2F51E544; Thu, 29 Aug 2019 12:42:20 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 871E91D42B for ; Thu, 29 Aug 2019 12:41:52 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 696BB200336; Thu, 29 Aug 2019 12:41:52 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 666A220032A; Thu, 29 Aug 2019 12:41:50 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id EEA71402E7; Thu, 29 Aug 2019 18:41:46 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:19 +0530 Message-Id: <20190829102737.13267-13-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 12/30] net/dpaa2: realign Rx offload support types 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" From: Hemant Agrawal Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index bbebb66fe..130fb5297 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -32,11 +32,11 @@ /* Supported Rx offloads */ static uint64_t dev_rx_offloads_sup = - DEV_RX_OFFLOAD_VLAN_STRIP | - DEV_RX_OFFLOAD_IPV4_CKSUM | - DEV_RX_OFFLOAD_UDP_CKSUM | - DEV_RX_OFFLOAD_TCP_CKSUM | + DEV_RX_OFFLOAD_CHECKSUM | + DEV_RX_OFFLOAD_SCTP_CKSUM | DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | + DEV_RX_OFFLOAD_OUTER_UDP_CKSUM | + DEV_RX_OFFLOAD_VLAN_STRIP | DEV_RX_OFFLOAD_VLAN_FILTER | DEV_RX_OFFLOAD_JUMBO_FRAME; @@ -51,13 +51,13 @@ static uint64_t dev_tx_offloads_sup = DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM | DEV_TX_OFFLOAD_SCTP_CKSUM | - DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM; + DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | + DEV_TX_OFFLOAD_MT_LOCKFREE | + DEV_TX_OFFLOAD_MBUF_FAST_FREE; /* Tx offloads which cannot be disabled */ static uint64_t dev_tx_offloads_nodis = - DEV_TX_OFFLOAD_MULTI_SEGS | - DEV_TX_OFFLOAD_MT_LOCKFREE | - DEV_TX_OFFLOAD_MBUF_FAST_FREE; + DEV_TX_OFFLOAD_MULTI_SEGS; /* enable timestamp in mbuf */ enum pmd_dpaa2_ts dpaa2_enable_ts; @@ -439,7 +439,8 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) rx_l3_csum_offload = true; if ((rx_offloads & DEV_RX_OFFLOAD_UDP_CKSUM) || - (rx_offloads & DEV_RX_OFFLOAD_TCP_CKSUM)) + (rx_offloads & DEV_RX_OFFLOAD_TCP_CKSUM) || + (rx_offloads & DEV_RX_OFFLOAD_SCTP_CKSUM)) rx_l4_csum_offload = true; ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, From patchwork Thu Aug 29 10:27:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172564 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2030144ily; Thu, 29 Aug 2019 03:43:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFxlhSIaLMgt41EAwTLVEgGU/ejbogF/s9u2t0UQw7SaLJ2LuVsFI3COya4tnj+/wYqC7W X-Received: by 2002:a50:fc8c:: with SMTP id f12mr9007438edq.191.1567075426853; Thu, 29 Aug 2019 03:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075426; cv=none; d=google.com; s=arc-20160816; b=k5iUvLYnPXKcdL/OA57Orybag5+Bqnb35qfltY0IXyv+07laaom886PKcQOaT6Jv+2 fKOONfsgiAXahdTJoQGT8WkDNZm4HE/OO6jITlHlRIfXJOA71c7oJFYfxKVU9Zvzf2+W ZoCnGvMyuZ73ohUhOhx5e95bSpspws+MdtI4N+MW3wx41VuujBvdg01C/XxC046dlj9I DDO9fyLx+P0kyFRXEedQXoH7BTtypTU46LhWvz0j2XLW3hYpaGUkzohWYXLOJ69PqUa1 Xapm7GLhQm+thE24J6qCqA9zEcug1eDaT4B5P7VONBDDAOY7URUu7lLrl1uSCdLMY/Qe nzbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=deAB1sqgLpGqQwqIqCeFAPOHuHlA0SR3n+/RUDaVrq0=; b=QhHXfjYA6COnnitRgD+yEuN8LC40NPkU3e279tUVPCj6Z5mFVnUd8YjU29DzZ9pyhA LZHW+MRWVrjlTFjnxP6djHdH5heEuu+CDvobiw4V1ng1H39DGdgiUvJmsKR3F+E0qI93 6fnZ4MLwczISpHLHGBVaEZmSknq+3VpRONvEKLOeyGDkYcZMhxRu3YDxTqk7DHgqGETV dQjAgeeuLKhi6Vy3f291XxM6e2p7lPiMuZZsUiZ90ghiJoxA/CEVse1pEeh3QLvErqni 7Gja690ag95s7d+bGj6e24pb6RiUNZWwpYMTyED+f0DV1WroqpcG11oynZZTbyyfMvZr g/ww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id p9si903608ejf.115.2019.08.29.03.43.46; Thu, 29 Aug 2019 03:43:46 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 025121E550; Thu, 29 Aug 2019 12:42:23 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 3DAB51D42B for ; Thu, 29 Aug 2019 12:41:53 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 1FBAF200769; Thu, 29 Aug 2019 12:41:53 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 1DE0A200332; Thu, 29 Aug 2019 12:41:51 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 9D8FB402F0; Thu, 29 Aug 2019 18:41:47 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:20 +0530 Message-Id: <20190829102737.13267-14-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 13/30] net/dpaa2: enable Rx offload for timestamp 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" From: Hemant Agrawal Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 130fb5297..4689cf9a4 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -38,7 +38,8 @@ static uint64_t dev_rx_offloads_sup = DEV_RX_OFFLOAD_OUTER_UDP_CKSUM | DEV_RX_OFFLOAD_VLAN_STRIP | DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_JUMBO_FRAME; + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_TIMESTAMP; /* Rx offloads which cannot be disabled */ static uint64_t dev_rx_offloads_nodis = @@ -457,6 +458,9 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) return ret; } + if (rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP) + dpaa2_enable_ts = true; + if (tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) tx_l3_csum_offload = true; From patchwork Thu Aug 29 10:27:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172565 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2030261ily; Thu, 29 Aug 2019 03:43:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwk/sUaUtq6fPYoMVoZ7NHO3nm65SZbv3Jx0OqWdZnUXAesasmL9PFsQvMJWVB5qHafuAU X-Received: by 2002:a17:906:3c7:: with SMTP id c7mr7554095eja.187.1567075434533; Thu, 29 Aug 2019 03:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075434; cv=none; d=google.com; s=arc-20160816; b=rzYCDh6AAp4bRK8IvR7ahFo+DnA5j4AiTWMjdhltGwYc8DxIXWmY9r0LalkZezguVH dkf/R5VMtpx3swmDxL4p9KmU/rTmuNJgcy2tU/luKtFdUFTForiOz0OpHSRaizPnWmjv thhyEDz5IyZyciAPUv5dFLSh88TztWTkm6ULOFp2+iZrZLPDagSz/4oiq83aJcJBAhkG mHXEhXQrjiKHGaKQR6bRUAldsGB34HdPct777qooB/GorwTI/e5DS6D230K8SdkmNF7b 8x5EyS3NbckUMf6WyIMpDYhyIoulczmFwY0m+YLCtu3nPLoYuwJKy94WDIOT460Azw3b t3dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=TAZRpzk4jQHTY0QB46wEpO9jrlg2t5y0IEqNHpxArms=; b=njEnZjYPGhwg8GAqVGshAILhMsEQpQyp1RfT9a7HywM3AKNMlDTSCXsXG05FcrpVSp Xb3Vp8Wr5Qe1ai/ro7ariB8D15IM6fYh4wsil2M3Yvix+lo+qQsk6ii7lRamP9nepTkL 0QzIW+WnQ5ytbHD4ibuVQZqGNmoHLmfFFFB9gtvabK+htAuyPpZHJ2ovS2D0DLOeU6Bt zg2gq4wk3M4eVBsBfC3VyXISq2lOF7r5FZ8flhWc6nEURsRvQyW2FJ5ow0fCfIYlTbj7 rt+JgMrgbjCHIIp4eYT+o9VF1mjSdvphZ8Z4FhE7A1Mi8YJkOMqTxbijYwT2jxPkrnO4 +mvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id y13si891234eje.259.2019.08.29.03.43.54; Thu, 29 Aug 2019 03:43:54 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC1C21E558; Thu, 29 Aug 2019 12:42:24 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 8D1451D446 for ; Thu, 29 Aug 2019 12:41:53 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6FD35200332; Thu, 29 Aug 2019 12:41:53 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6D3E0200321; Thu, 29 Aug 2019 12:41:51 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 54E8440324; Thu, 29 Aug 2019 18:41:48 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:21 +0530 Message-Id: <20190829102737.13267-15-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 14/30] net/dpaa2: support L2 payload based RSS distribution 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" From: Hemant Agrawal Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.h | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 33b1506aa..69ab577f5 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -54,6 +54,7 @@ #define DPAA2_RX_TAILDROP_OFF 0x04 #define DPAA2_RSS_OFFLOAD_ALL ( \ + ETH_RSS_L2_PAYLOAD | \ ETH_RSS_IP | \ ETH_RSS_UDP | \ ETH_RSS_TCP | \ From patchwork Thu Aug 29 10:27:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172566 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2030415ily; Thu, 29 Aug 2019 03:44:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5JeacRPRbfAahRe5nmwfSwEIYBFlcObWEmcdPea0EMVskLIes91rQ96XvBJ2pzRtbG1+U X-Received: by 2002:a17:906:3b09:: with SMTP id g9mr7622042ejf.297.1567075444264; Thu, 29 Aug 2019 03:44:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075444; cv=none; d=google.com; s=arc-20160816; b=nkx3ZgVFobepHTbyN0oIt9ifLMFkxrbsBl9WDtzZO17zRqtGbEEB/9YqZtGqdR84P8 bVt6vfg88XpXoyvT4HROSOqwo3EHSBR3HQxZVzFXBqAhhutdzOQmF/cIBUtSfe2EfnRs sj6NqB3vdiq8QKZE2fkiGA/XtzN+2eHf6jXv/gBDVLBh9TkZCyhwI8tNV7KI2f075wTA cqbaWwbZlrpKLTKbLDzbHlA0ZWoiichSxBTawiK+6LvzoXJiYZjwQDF8wALd7jaSP2hn 5GfxODmRlx126mM1AR9ltPBBbf8W284dCkvgxe0Av2ot+N9IdNUX/l1WiRbwAXX7GDhJ oa7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=RkoLDjJOofgRmWsRa0i+cLAAwGQEi9hYB/KsgboT6gI=; b=s4yOWRTd3xHeUzYhPgzrwRjbIjRyBNw/EvcUV3Pe9eITLl2MPjSlR6H+MPaJkIVZeq GKxbUe+KcTterOcArmSE5Kw7Z9sUTUBVQEEO9wuXhJfM7jTpweYLYn3rS90IJ/kFEW0Z vI/RfsLyBK3t5XAK3a9DiQVrqEUFeDWejBYtjvaOtop+WrhaJ1mayceThWFdg1EoK+FF WKyR2E3LIq1crxsFlhbn19+egfSiDAa74z/lJjQgmCTHb+yalKge8Gm2R3aI5AhJ12GV Bv6shSt0Jp4ChmeHn5N9O+mra1rVRYFz1QWhDa7VZYvBcwUO7MqFQHQRvXf18WLlCd3/ 7shw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id k9si992103edd.138.2019.08.29.03.44.04; Thu, 29 Aug 2019 03:44:04 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 91EE61E568; Thu, 29 Aug 2019 12:42:28 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 6461F1D42B for ; Thu, 29 Aug 2019 12:41:54 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 45A321A015C; Thu, 29 Aug 2019 12:41:54 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0E0AD1A030F; Thu, 29 Aug 2019 12:41:52 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 0BF284030E; Thu, 29 Aug 2019 18:41:48 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Nipun Gupta Date: Thu, 29 Aug 2019 15:57:22 +0530 Message-Id: <20190829102737.13267-16-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 15/30] net/dpaa2: add optional non-prefetch Rx mode 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" From: Nipun Gupta When we need particular number of packets from the rx routine, which would change in every call, we cannot prefetch the packets and provide previous results to the user. User can select the mode by using devargs for non pretech mode. Signed-off-by: Nipun Gupta --- doc/guides/nics/dpaa2.rst | 4 ++ drivers/net/dpaa2/dpaa2_ethdev.c | 11 +++- drivers/net/dpaa2/dpaa2_ethdev.h | 2 + drivers/net/dpaa2/dpaa2_rxtx.c | 105 +++++++++++++++++++++++++++++++ 4 files changed, 121 insertions(+), 1 deletion(-) -- 2.17.1 Acked-by: Hemant Agrawal diff --git a/doc/guides/nics/dpaa2.rst b/doc/guides/nics/dpaa2.rst index a698e5ab6..99e4c8d72 100644 --- a/doc/guides/nics/dpaa2.rst +++ b/doc/guides/nics/dpaa2.rst @@ -504,6 +504,10 @@ for details. driver level. Any packet received will be reflected back by the driver on same port. e.g. ``fslmc:dpni.1,drv_loopback=1`` +* Use dev arg option ``drv_no_prefetch=1`` to disable prefetching + of the packet pull command which is issued in the previous cycle. + e.g. ``fslmc:dpni.1,drv_no_prefetch=1`` + Enabling logs ------------- diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 4689cf9a4..f25cdfb3d 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -29,6 +29,7 @@ #include #define DRIVER_LOOPBACK_MODE "drv_loopback" +#define DRIVER_NO_PREFETCH_MODE "drv_no_prefetch" /* Supported Rx offloads */ static uint64_t dev_rx_offloads_sup = @@ -750,6 +751,7 @@ dpaa2_supported_ptypes_get(struct rte_eth_dev *dev) }; if (dev->rx_pkt_burst == dpaa2_dev_prefetch_rx || + dev->rx_pkt_burst == dpaa2_dev_rx || dev->rx_pkt_burst == dpaa2_dev_loopback_rx) return ptypes; return NULL; @@ -2118,6 +2120,9 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) eth_dev->dev_ops = &dpaa2_ethdev_ops; if (dpaa2_get_devargs(dev->devargs, DRIVER_LOOPBACK_MODE)) eth_dev->rx_pkt_burst = dpaa2_dev_loopback_rx; + else if (dpaa2_get_devargs(dev->devargs, + DRIVER_NO_PREFETCH_MODE)) + eth_dev->rx_pkt_burst = dpaa2_dev_rx; else eth_dev->rx_pkt_burst = dpaa2_dev_prefetch_rx; eth_dev->tx_pkt_burst = dpaa2_dev_tx; @@ -2236,6 +2241,9 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) if (dpaa2_get_devargs(dev->devargs, DRIVER_LOOPBACK_MODE)) { eth_dev->rx_pkt_burst = dpaa2_dev_loopback_rx; DPAA2_PMD_INFO("Loopback mode"); + } else if (dpaa2_get_devargs(dev->devargs, DRIVER_NO_PREFETCH_MODE)) { + eth_dev->rx_pkt_burst = dpaa2_dev_rx; + DPAA2_PMD_INFO("No Prefetch mode"); } else { eth_dev->rx_pkt_burst = dpaa2_dev_prefetch_rx; } @@ -2395,7 +2403,8 @@ static struct rte_dpaa2_driver rte_dpaa2_pmd = { RTE_PMD_REGISTER_DPAA2(net_dpaa2, rte_dpaa2_pmd); RTE_PMD_REGISTER_PARAM_STRING(net_dpaa2, - DRIVER_LOOPBACK_MODE "="); + DRIVER_LOOPBACK_MODE "= " + DRIVER_NO_PREFETCH_MODE "="); RTE_INIT(dpaa2_pmd_init_log) { dpaa2_logtype_pmd = rte_log_register("pmd.net.dpaa2"); diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 69ab577f5..a991ccc1d 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -149,6 +149,8 @@ int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev, int dpaa2_eth_eventq_detach(const struct rte_eth_dev *dev, int eth_rx_queue_id); +uint16_t dpaa2_dev_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts); + uint16_t dpaa2_dev_loopback_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts); diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 6ca5071e0..19838180f 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -727,6 +727,111 @@ dpaa2_dev_process_ordered_event(struct qbman_swp *swp, qbman_swp_dqrr_consume(swp, dq); } +uint16_t +dpaa2_dev_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) +{ + /* Function receive frames for a given device and VQ */ + struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)queue; + struct qbman_result *dq_storage; + uint32_t fqid = dpaa2_q->fqid; + int ret, num_rx = 0, next_pull = nb_pkts, num_pulled; + uint8_t pending, status; + struct qbman_swp *swp; + const struct qbman_fd *fd, *next_fd; + struct qbman_pull_desc pulldesc; + struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data; + + if (unlikely(!DPAA2_PER_LCORE_DPIO)) { + ret = dpaa2_affine_qbman_swp(); + if (ret) { + DPAA2_PMD_ERR("Failure in affining portal\n"); + return 0; + } + } + swp = DPAA2_PER_LCORE_PORTAL; + + do { + dq_storage = dpaa2_q->q_storage->dq_storage[0]; + qbman_pull_desc_clear(&pulldesc); + qbman_pull_desc_set_fq(&pulldesc, fqid); + qbman_pull_desc_set_storage(&pulldesc, dq_storage, + (size_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1); + + if (next_pull > dpaa2_dqrr_size) { + qbman_pull_desc_set_numframes(&pulldesc, + dpaa2_dqrr_size); + next_pull -= dpaa2_dqrr_size; + } else { + qbman_pull_desc_set_numframes(&pulldesc, next_pull); + next_pull = 0; + } + + while (1) { + if (qbman_swp_pull(swp, &pulldesc)) { + DPAA2_PMD_DP_DEBUG( + "VDQ command is not issued.QBMAN is busy\n"); + /* Portal was busy, try again */ + continue; + } + break; + } + + rte_prefetch0((void *)((size_t)(dq_storage + 1))); + /* Check if the previous issued command is completed. */ + while (!qbman_check_command_complete(dq_storage)) + ; + + num_pulled = 0; + pending = 1; + do { + /* Loop until the dq_storage is updated with + * new token by QBMAN + */ + while (!qbman_check_new_result(dq_storage)) + ; + rte_prefetch0((void *)((size_t)(dq_storage + 2))); + /* Check whether Last Pull command is Expired and + * setting Condition for Loop termination + */ + if (qbman_result_DQ_is_pull_complete(dq_storage)) { + pending = 0; + /* Check for valid frame. */ + status = qbman_result_DQ_flags(dq_storage); + if (unlikely((status & + QBMAN_DQ_STAT_VALIDFRAME) == 0)) + continue; + } + fd = qbman_result_DQ_fd(dq_storage); + + next_fd = qbman_result_DQ_fd(dq_storage + 1); + /* Prefetch Annotation address for the parse results */ + rte_prefetch0( + (void *)(size_t)(DPAA2_GET_FD_ADDR(next_fd) + + DPAA2_FD_PTA_SIZE + 16)); + + if (unlikely(DPAA2_FD_GET_FORMAT(fd) == qbman_fd_sg)) + bufs[num_rx] = eth_sg_fd_to_mbuf(fd); + else + bufs[num_rx] = eth_fd_to_mbuf(fd); + bufs[num_rx]->port = eth_data->port_id; + + if (eth_data->dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_VLAN_STRIP) { + rte_vlan_strip(bufs[num_rx]); + } + + dq_storage++; + num_rx++; + num_pulled++; + } while (pending); + /* Last VDQ provided all packets and more packets are requested */ + } while (next_pull && num_pulled == dpaa2_dqrr_size); + + dpaa2_q->rx_pkts += num_rx; + + return num_rx; +} + /* * Callback to handle sending packets through WRIOP based interface */ From patchwork Thu Aug 29 10:27:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172567 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2030553ily; Thu, 29 Aug 2019 03:44:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqztJXT4DgyRGXhNwdZjDDyC2tmySf2+5DC+f5wgrX2c36+KfknHkYtLtbpYy7CFx0qu7yzN X-Received: by 2002:aa7:d3d9:: with SMTP id o25mr8684107edr.141.1567075452676; Thu, 29 Aug 2019 03:44:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075452; cv=none; d=google.com; s=arc-20160816; b=W8FQs7IqY1Lcor36XBQZjCesq1VyTPGpEgebC6QBvvjtAxmjeNXl7PQNFjF2Z+gbMm tZ7jLJwNqZgbvHK3m8FAE9UGCABepQgEoySf/xUg8xtV1S1ucX1cGOiYmDCk4xOq9RaK lsRWcGtJjiWvMfgPwAfKgdbfPhRe/MyCwOQPeyYmTlJBWmMWTcoxXmELiL/Z6lPDj491 ip5xxJRcwNAN4zdCMseG/MFxLwaZsSfpkl4ZEOILOHjPZlc4ui7iYZzEHzI40CnVkV0F f3nq4l4YRqViS47gfH7Gnu34KNh449dpJjxwdY4LnWcohCtyNdRVgDIp5sRg1mScHyj7 eC2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=Z9Kik0L90dx1S29MbOFwfgr8OPeYkWmZyTJkiqJg9ic=; b=PKo14z08Wtci/lS95N7VhgX/kBJiqFp5C4BzOJHYZNEZlHJLw3mHAYtntDWKgXWN0U Z0ny0kG+eu+ONRTiAlrpXQt6w4KwtbS/dBr7UU2yFxh3bkpevk63pAjj30u4e+vZYPqg v9B0T2BO8hM4bllll2EOYuW6DdgfQsTP3ko/GMqo0j5bjUHLoDSnY7klPbV4tMTpHMTw SNrDthiPtAlJc8a90tPSzZzotgH9TqqlrlEs9o6MbNAlKwVRVEqiwLpHHkkbQAXkNUv4 PM1o3ZLFRZsahyOsIu9CvevwE8gw94T1DWXUQlBIhTQvh6+PqoULQd5DgOhyN41cquOR q4Rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id z37si986514edz.99.2019.08.29.03.44.12; Thu, 29 Aug 2019 03:44:12 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7FE911E569; Thu, 29 Aug 2019 12:42:32 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 1334F1D42B for ; Thu, 29 Aug 2019 12:41:55 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id EA4ED200321; Thu, 29 Aug 2019 12:41:54 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B1243200764; Thu, 29 Aug 2019 12:41:52 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id AF479402BE; Thu, 29 Aug 2019 18:41:49 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:23 +0530 Message-Id: <20190829102737.13267-17-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 16/30] net/dpaa2: add taildrop support on frame count basis 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" From: Hemant Agrawal The existing taildrop was based on queue data size. This patch replaces it with frame count bases using CGR methods of DPAA2 device. The number of CGRs are limited. So, - use per queue CGR based tail drop for as many as CGR available. - Remaining queues shall use the legacy byte based tail drop Number of CGRs can be controlled by dpl file during dpni_create. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 5 +- drivers/net/dpaa2/dpaa2_ethdev.c | 113 +++++++++++++++++++++--- drivers/net/dpaa2/dpaa2_ethdev.h | 6 +- 3 files changed, 107 insertions(+), 17 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 4bb6b26c7..7f7e2fd78 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -145,10 +145,10 @@ struct dpaa2_queue { struct rte_eth_dev_data *eth_data; struct rte_cryptodev_data *crypto_data; }; - int32_t eventfd; /*!< Event Fd of this queue */ uint32_t fqid; /*!< Unique ID of this queue */ - uint8_t tc_index; /*!< traffic class identifier */ uint16_t flow_id; /*!< To be used by DPAA2 frmework */ + uint8_t tc_index; /*!< traffic class identifier */ + uint8_t cgid; /*! < Congestion Group id for this queue */ uint64_t rx_pkts; uint64_t tx_pkts; uint64_t err_pkts; @@ -157,6 +157,7 @@ struct dpaa2_queue { struct qbman_result *cscn; }; struct rte_event ev; + int32_t eventfd; /*!< Event Fd of this queue */ dpaa2_queue_cb_dqrr_t *cb; dpaa2_queue_cb_eqresp_free_t *cb_eqresp_free; struct dpaa2_bp_info *bp_array; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index f25cdfb3d..877acff94 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -514,7 +514,7 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) static int dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, - uint16_t nb_rx_desc __rte_unused, + uint16_t nb_rx_desc, unsigned int socket_id __rte_unused, const struct rte_eth_rxconf *rx_conf __rte_unused, struct rte_mempool *mb_pool) @@ -526,7 +526,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, uint8_t options = 0; uint8_t flow_id; uint32_t bpid; - int ret; + int i, ret; PMD_INIT_FUNC_TRACE(); @@ -545,12 +545,28 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, dpaa2_q->bp_array = rte_dpaa2_bpid_info; /*Get the flow id from given VQ id*/ - flow_id = rx_queue_id % priv->nb_rx_queues; + flow_id = dpaa2_q->flow_id; memset(&cfg, 0, sizeof(struct dpni_queue)); options = options | DPNI_QUEUE_OPT_USER_CTX; cfg.user_context = (size_t)(dpaa2_q); + /* check if a private cgr available. */ + for (i = 0; i < priv->max_cgs; i++) { + if (!priv->cgid_in_use[i]) { + priv->cgid_in_use[i] = 1; + break; + } + } + + if (i < priv->max_cgs) { + options |= DPNI_QUEUE_OPT_SET_CGID; + cfg.cgid = i; + dpaa2_q->cgid = cfg.cgid; + } else { + dpaa2_q->cgid = 0xff; + } + /*if ls2088 or rev2 device, enable the stashing */ if ((dpaa2_svr_family & 0xffff0000) != SVR_LS2080A) { @@ -579,15 +595,56 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, struct dpni_taildrop taildrop; taildrop.enable = 1; - /*enabling per rx queue congestion control */ - taildrop.threshold = CONG_THRESHOLD_RX_Q; - taildrop.units = DPNI_CONGESTION_UNIT_BYTES; - taildrop.oal = CONG_RX_OAL; - DPAA2_PMD_DEBUG("Enabling Early Drop on queue = %d", - rx_queue_id); - ret = dpni_set_taildrop(dpni, CMD_PRI_LOW, priv->token, + + /* Private CGR will use tail drop length as nb_rx_desc. + * for rest cases we can use standard byte based tail drop. + * There is no HW restriction, but number of CGRs are limited, + * hence this restriction is placed. + */ + if (dpaa2_q->cgid != 0xff) { + /*enabling per rx queue congestion control */ + taildrop.threshold = nb_rx_desc; + taildrop.units = DPNI_CONGESTION_UNIT_FRAMES; + taildrop.oal = 0; + DPAA2_PMD_DEBUG("Enabling CG Tail Drop on queue = %d", + rx_queue_id); + ret = dpni_set_taildrop(dpni, CMD_PRI_LOW, priv->token, + DPNI_CP_CONGESTION_GROUP, + DPNI_QUEUE_RX, + dpaa2_q->tc_index, + flow_id, &taildrop); + } else { + /*enabling per rx queue congestion control */ + taildrop.threshold = CONG_THRESHOLD_RX_BYTES_Q; + taildrop.units = DPNI_CONGESTION_UNIT_BYTES; + taildrop.oal = CONG_RX_OAL; + DPAA2_PMD_DEBUG("Enabling Byte based Drop on queue= %d", + rx_queue_id); + ret = dpni_set_taildrop(dpni, CMD_PRI_LOW, priv->token, + DPNI_CP_QUEUE, DPNI_QUEUE_RX, + dpaa2_q->tc_index, flow_id, + &taildrop); + } + if (ret) { + DPAA2_PMD_ERR("Error in setting taildrop. err=(%d)", + ret); + return -1; + } + } else { /* Disable tail Drop */ + struct dpni_taildrop taildrop = {0}; + DPAA2_PMD_INFO("Tail drop is disabled on queue"); + + taildrop.enable = 0; + if (dpaa2_q->cgid != 0xff) { + ret = dpni_set_taildrop(dpni, CMD_PRI_LOW, priv->token, + DPNI_CP_CONGESTION_GROUP, DPNI_QUEUE_RX, + dpaa2_q->tc_index, + flow_id, &taildrop); + } else { + ret = dpni_set_taildrop(dpni, CMD_PRI_LOW, priv->token, DPNI_CP_QUEUE, DPNI_QUEUE_RX, dpaa2_q->tc_index, flow_id, &taildrop); + } if (ret) { DPAA2_PMD_ERR("Error in setting taildrop. err=(%d)", ret); @@ -655,7 +712,7 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev, dpaa2_q->tc_index = tc_id; if (!(priv->flags & DPAA2_TX_CGR_OFF)) { - struct dpni_congestion_notification_cfg cong_notif_cfg; + struct dpni_congestion_notification_cfg cong_notif_cfg = {0}; cong_notif_cfg.units = DPNI_CONGESTION_UNIT_FRAMES; cong_notif_cfg.threshold_entry = CONG_ENTER_TX_THRESHOLD; @@ -693,7 +750,29 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev, static void dpaa2_dev_rx_queue_release(void *q __rte_unused) { + struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)q; + struct dpaa2_dev_priv *priv = dpaa2_q->eth_data->dev_private; + struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; + uint8_t options = 0; + int ret; + struct dpni_queue cfg; + + memset(&cfg, 0, sizeof(struct dpni_queue)); PMD_INIT_FUNC_TRACE(); + if (dpaa2_q->cgid != 0xff) { + options = DPNI_QUEUE_OPT_CLEAR_CGID; + cfg.cgid = dpaa2_q->cgid; + + ret = dpni_set_queue(dpni, CMD_PRI_LOW, priv->token, + DPNI_QUEUE_RX, + dpaa2_q->tc_index, dpaa2_q->flow_id, + options, &cfg); + if (ret) + DPAA2_PMD_ERR("Unable to clear CGR from q=%u err=%d", + dpaa2_q->fqid, ret); + priv->cgid_in_use[dpaa2_q->cgid] = 0; + dpaa2_q->cgid = 0xff; + } } static void @@ -2166,6 +2245,14 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) } priv->num_rx_tc = attr.num_rx_tcs; + /* only if the custom CG is enabled */ + if (attr.options & DPNI_OPT_CUSTOM_CG) + priv->max_cgs = attr.num_cgs; + else + priv->max_cgs = 0; + + for (i = 0; i < priv->max_cgs; i++) + priv->cgid_in_use[i] = 0; for (i = 0; i < attr.num_rx_tcs; i++) priv->nb_rx_queues += attr.num_queues; @@ -2173,9 +2260,9 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) /* Using number of TX queues as number of TX TCs */ priv->nb_tx_queues = attr.num_tx_tcs; - DPAA2_PMD_DEBUG("RX-TC= %d, nb_rx_queues= %d, nb_tx_queues=%d", + DPAA2_PMD_DEBUG("RX-TC= %d, rx_queues= %d, tx_queues=%d, max_cgs=%d", priv->num_rx_tc, priv->nb_rx_queues, - priv->nb_tx_queues); + priv->nb_tx_queues, priv->max_cgs); priv->hw = dpni_dev; priv->hw_id = hw_id; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index a991ccc1d..2f14a3525 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -37,9 +37,9 @@ #define CONG_RETRY_COUNT 18000 /* RX queue tail drop threshold - * currently considering 32 KB packets + * currently considering 64 KB packets */ -#define CONG_THRESHOLD_RX_Q (64 * 1024) +#define CONG_THRESHOLD_RX_BYTES_Q (64 * 1024) #define CONG_RX_OAL 128 /* Size of the input SMMU mapped memory required by MC */ @@ -115,6 +115,8 @@ struct dpaa2_dev_priv { uint8_t flags; /*dpaa2 config flags */ uint8_t en_ordered; uint8_t en_loose_ordered; + uint8_t max_cgs; + uint8_t cgid_in_use[MAX_RX_QUEUES]; struct pattern_s { uint8_t item_count; From patchwork Thu Aug 29 10:27:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172568 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2030736ily; Thu, 29 Aug 2019 03:44:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqynqGxrNdS8bjUQHqXOuIHAFHMtd/wWnOgu0vlZFT7MOdUc0JBKjvowBkT5iXPhq/91mVtO X-Received: by 2002:a50:dec8:: with SMTP id d8mr8930488edl.76.1567075464367; Thu, 29 Aug 2019 03:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075464; cv=none; d=google.com; s=arc-20160816; b=NC2V2KfL9c00njHvuLGIoBoSMAEL+GvRrm5LQCKvmxJ011oneP6sm36blXAMCaYcRb TmF9YrhgSm/lEfzj1dLfETC5igoHeBNjcS7Gk06RVg3GBaCjqE/E5Y6PWWLZNYOX4Cvp lTLaSdgD+9CmHzJQP6dnGEk+7fG0AmSIj7S1x2Lb83veIUcNo3u2WTuurnKU8pYyMF0A eAzxvyYGA+O6OnSCO6G0BAxGz+B5tIOxalWtML4aymbppgywFnID3GmbKaPPqBX7y1/C CirXqWeP/27g8qlHoq3xeSvIaoFifRuIRt84/V5MisylTq0eNFJp5C9rW3X9njJSiXYW NHwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=NLdNNFAxoyBk08YD8rJ72+TnjizyK4o3CvC5jD+yGe0=; b=jIe2V+Nwxa816EfdG/IJGenLCjUARD/8qIbT6TwVn0kcylzis5Yh+N/WkM8Dj4YNuH kLZ++qlUkqUX0EG1O6KijK2zQaKT7Lo2f2GTUrrEO9Vuld57e2Eg0vpyhaky0d9V1GjY WdpnpBRJN7LYv96V7D7OZuqLiyy/X5CSCdjyJvR29lEdxOy9mhFrx0+F4t5wvPMMrmxo F1roLAjwAhBARERmuTkKNd2402V8FxdzfLkW1mN1rmEgykXXoNNBmVRXvuSVU01bYogC TWUXp6OkFvio518qcd3CKjL+laTG6ux6iYXXSG3V+sBG8VDWOhQsejGFs2pEfOjenNof 6lmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id h1si1003791ede.423.2019.08.29.03.44.24; Thu, 29 Aug 2019 03:44:24 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F1B061E877; Thu, 29 Aug 2019 12:42:36 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 80DED1DFE2 for ; Thu, 29 Aug 2019 12:41:55 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 61C6B20032C; Thu, 29 Aug 2019 12:41:55 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 5F3D720032A; Thu, 29 Aug 2019 12:41:53 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 5DD6E402D7; Thu, 29 Aug 2019 18:41:50 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:24 +0530 Message-Id: <20190829102737.13267-18-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 17/30] net/dpaa2: add cgr counters in xtra stats 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" From: Hemant Agrawal Add congestion frame drop and byte drop count in xtra stats. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 877acff94..721e125b4 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -84,6 +84,8 @@ static const struct rte_dpaa2_xstats_name_off dpaa2_xstats_strings[] = { {"ingress_nobuffer_discards", 2, 2}, {"egress_discarded_frames", 2, 3}, {"egress_confirmed_frames", 2, 4}, + {"cgr_reject_frames", 4, 0}, + {"cgr_reject_bytes", 4, 1}, }; static const enum rte_filter_op dpaa2_supported_filter_ops[] = { @@ -1371,7 +1373,7 @@ dpaa2_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; int32_t retcode; - union dpni_statistics value[3] = {}; + union dpni_statistics value[5] = {}; unsigned int i = 0, num = RTE_DIM(dpaa2_xstats_strings); if (n < num) @@ -1398,6 +1400,18 @@ dpaa2_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, if (retcode) goto err; + for (i = 0; i < priv->max_cgs; i++) { + if (!priv->cgid_in_use[i]) { + /* Get Counters from page_4*/ + retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, + priv->token, + 4, 0, &value[4]); + if (retcode) + goto err; + break; + } + } + for (i = 0; i < num; i++) { xstats[i].id = i; xstats[i].value = value[dpaa2_xstats_strings[i].page_id]. @@ -1439,7 +1453,7 @@ dpaa2_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; int32_t retcode; - union dpni_statistics value[3] = {}; + union dpni_statistics value[5] = {}; if (n < stat_cnt) return stat_cnt; @@ -1465,6 +1479,12 @@ dpaa2_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, if (retcode) return 0; + /* Get Counters from page_4*/ + retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token, + 4, 0, &value[4]); + if (retcode) + return 0; + for (i = 0; i < stat_cnt; i++) { values[i] = value[dpaa2_xstats_strings[i].page_id]. raw.counter[dpaa2_xstats_strings[i].stats_id]; From patchwork Thu Aug 29 10:27:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172569 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2030851ily; Thu, 29 Aug 2019 03:44:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwa6r6kYG94RmK/LmQOHL+LF4xTPX37v80RmrKZTyODvjDS/zwh6pXkbGzF/T3MLOukomw2 X-Received: by 2002:aa7:c81a:: with SMTP id a26mr9013038edt.26.1567075472496; Thu, 29 Aug 2019 03:44:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075472; cv=none; d=google.com; s=arc-20160816; b=p6z3+BH3GRW0nLPbonEE9kjvvfyk8+XxSRd8+vtpW0azyGYyyXOd/QJw0ulKM2YuC4 rvnoUNssC3TFQ9QfAbWuSUZjJwa0oz5ZGzyYz9rOQtq3b3T+u8toPhWzToNyeNMJdbdi LaQ059t223GPpuuwUOodb/Ly4zqQOdfzuxnGqedqBLDmTgSyO/PXNb7dUmrXJ+XvwtI9 ZU36oEaX7KCnXihKLiOKfJ+5wzRaF85fCF+NuIeGH/42FTqvYy3xgXLdyyR9iBjPFHRs gqM5/rUZlxijQJaY5UkEeobw4pnGlkJ03XDmtK4LDeK1kFwwJgaLU7b+ULyXbDd+wO5B If3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=84SAiJhnNdr3o6czGEjumFOwRgx55KPoIM8ulxkxzz8=; b=HgUL8m3T/4R5EMzdbpxg04Swq9ohKsGHTMu0Md7ku6WzMgO0HAl0rXf5OC0q7YkHAX Zw06qWXKup7atGG2Yo01h+SUkv1FoPcY9iKXTl9ccw4I119Etw1MiG/k2VQB7NDTYf8N WDG85Opg2uLZt9BY12p0ITzFG29oOtKHHgtbdP+0se+yrUczHNGRXQCh7RLHyLV0KXkt GYUc0LoSzPepQzd4ZuGt01o8crKmQcUwN5XJ/yOAeaMXucJOSarR3I/qDcfNYVqg8WU3 EH6AhewC3dOh0hvxPNbPvOyDbxK60sdxGzLi3Ohwa4ixZ1mPPmbBGrqkhUWj/NUmuvyu 6tBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id f17si1004874eda.242.2019.08.29.03.44.32; Thu, 29 Aug 2019 03:44:32 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 25E461E876; Thu, 29 Aug 2019 12:42:41 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 305671DF96 for ; Thu, 29 Aug 2019 12:41:56 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 101B01A0010; Thu, 29 Aug 2019 12:41:56 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0D7021A00B9; Thu, 29 Aug 2019 12:41:54 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 0BFC5402EB; Thu, 29 Aug 2019 18:41:50 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:25 +0530 Message-Id: <20190829102737.13267-19-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 18/30] net/dpaa2: add support for config max Rx length in HW 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" From: Hemant Agrawal The MC expects the length to be configured without CRC Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 721e125b4..a1ef5be6a 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -418,12 +418,17 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { if (eth_conf->rxmode.max_rx_pkt_len <= DPAA2_MAX_RX_PKT_LEN) { ret = dpni_set_max_frame_length(dpni, CMD_PRI_LOW, - priv->token, eth_conf->rxmode.max_rx_pkt_len); + priv->token, eth_conf->rxmode.max_rx_pkt_len + - RTE_ETHER_CRC_LEN); if (ret) { DPAA2_PMD_ERR( "Unable to set mtu. check config"); return ret; } + dev->data->mtu = + dev->data->dev_conf.rxmode.max_rx_pkt_len - + RTE_ETHER_HDR_LEN - RTE_ETHER_CRC_LEN - + VLAN_TAG_SIZE; } else { return -1; } @@ -1201,7 +1206,7 @@ dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) * Maximum Ethernet header length */ ret = dpni_set_max_frame_length(dpni, CMD_PRI_LOW, priv->token, - frame_size); + frame_size - RTE_ETHER_CRC_LEN); if (ret) { DPAA2_PMD_ERR("Setting the max frame length failed"); return -1; @@ -2376,6 +2381,14 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) } } + ret = dpni_set_max_frame_length(dpni_dev, CMD_PRI_LOW, priv->token, + RTE_ETHER_MAX_LEN - RTE_ETHER_CRC_LEN + + VLAN_TAG_SIZE); + if (ret) { + DPAA2_PMD_ERR("Unable to set mtu. check config"); + goto init_err; + } + RTE_LOG(INFO, PMD, "%s: netdev created\n", eth_dev->data->name); return 0; init_err: From patchwork Thu Aug 29 10:27:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172570 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2031080ily; Thu, 29 Aug 2019 03:44:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwl6CvoU82cj1NXE5NfrHKYNcvCln3288Sn6RIeZv06OfHinalQk5T6LpH3lfEOkp+r3v6q X-Received: by 2002:a50:8752:: with SMTP id 18mr8902115edv.96.1567075488659; Thu, 29 Aug 2019 03:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075488; cv=none; d=google.com; s=arc-20160816; b=vD+aqwSsM9VzCGnY4l+WNWtkPnXe7opR1wrFXFCgf7X5kvyS4qpQOuxvMLROiiz8io oWlZuiqgt5uj6EFPHYAuz9tg1ZFhAgD2IliDYagHXS7DiZCYf3qIGMBX5UNQXx3Kterj 2AJc76DUGKQSjnXaMxIYgW9Ji4A1js1QmXfjN83v8kRlDcQ5Rd8hDF6vCurrCUKZEJgl 9gfPsFMlxbYosJzJaSmfdjQLCxU+8Mnt/6p2JlCYznCaeH2+o5YiuiNaXRoYAAbCOdyV 2CFpKDzWtrnuRFxFTcP5r7cvmChSJZ5ty8dMIAyd26Ux37/N7/n7+HPGg5rQH7SQE9Gh hfUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=yY+PbLstWWZwm2r8YxIPG6f1qjLNYEwSoK8cs88ccsk=; b=lohC7b5BMo+llFztdMKralGCVcEXFgk41H0tQ8HQIKZW7DBKlpLXKNlcTXspchxNsy Ml4AwI4rhqb6PmSVY0tb9bARka+zUnKApXy8/hb0zAvAjSECGwrJRlKW8Kvy5H4rGIfa qTq+0SvQ+cwqnd1L5CX/y+rMKYnf8K8l2HjgBr9s7O0p4ATmEIvWT1e3ukg7wF9kP+Hb q8dXmyEke2ujilwODCQYMjNeUVcr8SoKhkggyrR8eyglA0KrQpyjP/Ejly71oZ+XcUM9 XnhMJsjiUxAIzIvY8UFexrHvwoGS1Jty9KIvX5ohVr09haoeD4Zv1M9KX7BibJ12/VZd E0iA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id me5si972648ejb.56.2019.08.29.03.44.48; Thu, 29 Aug 2019 03:44:48 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 77C5D1E889; Thu, 29 Aug 2019 12:42:49 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id B16531DF96 for ; Thu, 29 Aug 2019 12:41:57 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 95F94200322; Thu, 29 Aug 2019 12:41:57 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 5EC7E20033A; Thu, 29 Aug 2019 12:41:55 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 5DA814031E; Thu, 29 Aug 2019 18:41:52 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:27 +0530 Message-Id: <20190829102737.13267-21-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 20/30] net/dpaa2: support dpdmux classification on eth type 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" From: Hemant Agrawal Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_mux.c | 84 +++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 29 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_mux.c b/drivers/net/dpaa2/dpaa2_mux.c index e487c6b54..1910cc418 100644 --- a/drivers/net/dpaa2/dpaa2_mux.c +++ b/drivers/net/dpaa2/dpaa2_mux.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2019 NXP */ #include @@ -60,19 +60,13 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, { struct dpaa2_dpdmux_dev *dpdmux_dev; struct dpkg_profile_cfg kg_cfg; - const struct rte_flow_item_ipv4 *spec; const struct rte_flow_action_vf *vf_conf; struct dpdmux_cls_action dpdmux_action; struct rte_flow *flow = NULL; void *key_iova, *mask_iova, *key_cfg_iova = NULL; + uint8_t key_size = 0; int ret; - if (pattern[0]->type != RTE_FLOW_ITEM_TYPE_IPV4) { - DPAA2_PMD_ERR("Not supported pattern type: %d", - pattern[0]->type); - return NULL; - } - /* Find the DPDMUX from dpdmux_id in our list */ dpdmux_dev = get_dpdmux_from_id(dpdmux_id); if (!dpdmux_dev) { @@ -86,16 +80,63 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, DPAA2_PMD_ERR("Unable to allocate flow-dist parameters"); return NULL; } + flow = rte_zmalloc(NULL, sizeof(struct rte_flow) + + (2 * DIST_PARAM_IOVA_SIZE), RTE_CACHE_LINE_SIZE); + if (!flow) { + DPAA2_PMD_ERR( + "Memory allocation failure for rule configration\n"); + goto creation_error; + } + key_iova = (void *)((size_t)flow + sizeof(struct rte_flow)); + mask_iova = (void *)((size_t)key_iova + DIST_PARAM_IOVA_SIZE); /* Currently taking only IP protocol as an extract type. * This can be exended to other fields using pattern->type. */ memset(&kg_cfg, 0, sizeof(struct dpkg_profile_cfg)); - kg_cfg.extracts[0].extract.from_hdr.prot = NET_PROT_IP; - kg_cfg.extracts[0].extract.from_hdr.field = NH_FLD_IP_PROTO; - kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_HDR; - kg_cfg.extracts[0].extract.from_hdr.type = DPKG_FULL_FIELD; - kg_cfg.num_extracts = 1; + + switch (pattern[0]->type) { + case RTE_FLOW_ITEM_TYPE_IPV4: + { + const struct rte_flow_item_ipv4 *spec; + kg_cfg.extracts[0].extract.from_hdr.prot = NET_PROT_IP; + kg_cfg.extracts[0].extract.from_hdr.field = NH_FLD_IP_PROTO; + kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_HDR; + kg_cfg.extracts[0].extract.from_hdr.type = DPKG_FULL_FIELD; + kg_cfg.num_extracts = 1; + + spec = (const struct rte_flow_item_ipv4 *)pattern[0]->spec; + memcpy(key_iova, (const void *)(&spec->hdr.next_proto_id), + sizeof(uint8_t)); + memcpy(mask_iova, pattern[0]->mask, sizeof(uint8_t)); + key_size = sizeof(uint8_t); + } + break; + + case RTE_FLOW_ITEM_TYPE_ETH: + { + const struct rte_flow_item_eth *spec; + uint16_t eth_type; + kg_cfg.extracts[0].extract.from_hdr.prot = NET_PROT_ETH; + kg_cfg.extracts[0].extract.from_hdr.field = NH_FLD_ETH_TYPE; + kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_HDR; + kg_cfg.extracts[0].extract.from_hdr.type = DPKG_FULL_FIELD; + kg_cfg.num_extracts = 1; + + spec = (const struct rte_flow_item_eth *)pattern[0]->spec; + eth_type = rte_constant_bswap16(spec->type); + memcpy((void *)key_iova, (const void *)ð_type, + sizeof(rte_be16_t)); + memcpy(mask_iova, pattern[0]->mask, sizeof(uint16_t)); + key_size = sizeof(uint16_t); + } + break; + + default: + DPAA2_PMD_ERR("Not supported pattern type: %d", + pattern[0]->type); + goto creation_error; + } ret = dpkg_prepare_key_cfg(&kg_cfg, key_cfg_iova); if (ret) { @@ -114,24 +155,9 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, /* As now our key extract parameters are set, let us configure * the rule. */ - flow = rte_zmalloc(NULL, sizeof(struct rte_flow) + - (2 * DIST_PARAM_IOVA_SIZE), RTE_CACHE_LINE_SIZE); - if (!flow) { - DPAA2_PMD_ERR( - "Memory allocation failure for rule configration\n"); - goto creation_error; - } - key_iova = (void *)((size_t)flow + sizeof(struct rte_flow)); - mask_iova = (void *)((size_t)key_iova + DIST_PARAM_IOVA_SIZE); - - spec = (const struct rte_flow_item_ipv4 *)pattern[0]->spec; - memcpy(key_iova, (const void *)&spec->hdr.next_proto_id, - sizeof(uint8_t)); - memcpy(mask_iova, pattern[0]->mask, sizeof(uint8_t)); - flow->rule.key_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(key_iova)); flow->rule.mask_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(mask_iova)); - flow->rule.key_size = sizeof(uint8_t); + flow->rule.key_size = key_size; vf_conf = (const struct rte_flow_action_vf *)(actions[0]->conf); if (vf_conf->id == 0 || vf_conf->id > dpdmux_dev->num_ifs) { From patchwork Thu Aug 29 10:27:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172571 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2032171ily; Thu, 29 Aug 2019 03:45:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRmWwtCAczPXEXgJ7/+GB9wg9/YUzIMuqcZokCuQ9sGBERXH27Hbi/HVxJJvZMMff3erA6 X-Received: by 2002:a50:ab5d:: with SMTP id t29mr9086454edc.32.1567075554778; Thu, 29 Aug 2019 03:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567075554; cv=none; d=google.com; s=arc-20160816; b=xvfEvWdmTjxccgVUsuvLn4C/iT6+/TzlgfslgdZYto6mUFEfqcjkkbuHN8UkKaIArp kHxf8hNqjnDp4VFqNKa2KXFqrGwv+4CVv5mHnIHKMyXRC6tS7q/DnnjwgJj9M0SZWc3K wpfRSoRTNtGKXnUdKlxvfmVYVrlN/sZDEPYGQKfO/xuhiHYmCxpZzXpa8DymEzHgvbSR 2Oy82spzMB/8F5m0C6t9Sc+DlpeZPRXJJVy6E6VXMzmYDHwD9VzCaRtveIh6cX/4R1HP PbM8omVS72bRGRlu8Xq7SCNUcrvkE5l0OhijfGwy5GzT36M6t53Twa2POJPjXF8c4LiJ 5Xcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=IVGEE/uHG0aBqpwR/fdFEGNJGzPcQOSUx1yVRHtdRT0=; b=GmqE5zU/PKpWC/z3sN/eo8NWbepHxxe7kCr70xcae0xFML0ZcrsAHjhQr1gmpl0rZp HQSwuQZTiJnkfiRCzs6ICCWkMj6yDJTPi+fXWk5nTkj0p0x1xmS40vZlX9TrWoGXq1hH 0hejkohVxq06tno6GXYH5kk0AjMDkfpf0g0zt2QGuwlR+EHgsaMgcVxD4BYSo9w1E8vZ 64Z0Pe+IcnBaVQyzFzjhBao64yNj/2zLnGI6IhpvloWBAO6cn6uz/SRrQwJIQ4BLRlRq 0hbJtIDS/UVdeppcnnA3P+yULI5DunhQQbxV3q087Iw/WdxHxFbz0beZ5PaB53KCbLRG r29w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id w27si1015490edd.84.2019.08.29.03.45.54; Thu, 29 Aug 2019 03:45:54 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D4CBC1E8E3; Thu, 29 Aug 2019 12:43:19 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 835751DF95 for ; Thu, 29 Aug 2019 12:42:02 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 671F5200772; Thu, 29 Aug 2019 12:42:02 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 2EB37200322; Thu, 29 Aug 2019 12:42:00 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 2CB114031F; Thu, 29 Aug 2019 18:41:57 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:34 +0530 Message-Id: <20190829102737.13267-28-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 27/30] bus/fslmc: support multi vfio group 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" From: Hemant Agrawal DPAA2 support VFIO device passthrough in VM. However in this case, each device is associated with different vfio group. This code required different container id for each group. On using the same container fd the second time, ioctl calls are returning error. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/fslmc_bus.c | 7 +- drivers/bus/fslmc/fslmc_vfio.c | 160 ++++++++++++++++++++++++++------- drivers/bus/fslmc/fslmc_vfio.h | 3 + 3 files changed, 133 insertions(+), 37 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index 9226d5b62..eff15f25d 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * - * Copyright 2016,2018 NXP + * Copyright 2016,2018-2019 NXP * */ @@ -325,8 +325,7 @@ rte_fslmc_scan(void) goto scan_fail; /* Scan devices on the group */ - snprintf(fslmc_dirpath, sizeof(fslmc_dirpath), "%s/%d/devices", - VFIO_IOMMU_GROUP_PATH, groupid); + sprintf(fslmc_dirpath, "%s/%s", SYSFS_FSL_MC_DEVICES, fslmc_container); dir = opendir(fslmc_dirpath); if (!dir) { DPAA2_BUS_ERR("Unable to open VFIO group directory"); @@ -334,7 +333,7 @@ rte_fslmc_scan(void) } while ((entry = readdir(dir)) != NULL) { - if (entry->d_name[0] == '.' || entry->d_type != DT_LNK) + if (entry->d_name[0] == '.' || entry->d_type != DT_DIR) continue; ret = scan_one_fslmc_device(entry->d_name); diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 60c51d80e..970969d2b 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -40,16 +40,13 @@ #include "portal/dpaa2_hw_pvt.h" #include "portal/dpaa2_hw_dpio.h" -/** Pathname of FSL-MC devices directory. */ -#define SYSFS_FSL_MC_DEVICES "/sys/bus/fsl-mc/devices" - #define FSLMC_CONTAINER_MAX_LEN 8 /**< Of the format dprc.XX */ /* Number of VFIO containers & groups with in */ static struct fslmc_vfio_group vfio_group; static struct fslmc_vfio_container vfio_container; static int container_device_fd; -static char *fslmc_container; +char *fslmc_container; static int fslmc_iommu_type; static uint32_t *msi_intr_vaddr; void *(*rte_mcp_ptr_list); @@ -435,28 +432,136 @@ int rte_fslmc_vfio_dmamap(void) return 0; } -static int64_t vfio_map_mcp_obj(struct fslmc_vfio_group *group, char *mcp_obj) +static int +fslmc_vfio_setup_device(const char *sysfs_base, const char *dev_addr, + int *vfio_dev_fd, struct vfio_device_info *device_info) +{ + struct vfio_group_status group_status = { + .argsz = sizeof(group_status) + }; + int vfio_group_fd, vfio_container_fd, iommu_group_no, ret; + + /* get group number */ + ret = rte_vfio_get_group_num(sysfs_base, dev_addr, &iommu_group_no); + if (ret < 0) + return -1; + + /* get the actual group fd */ + vfio_group_fd = rte_vfio_get_group_fd(iommu_group_no); + if (vfio_group_fd < 0) + return -1; + + /* if group_fd == 0, that means the device isn't managed by VFIO */ + if (vfio_group_fd == 0) { + RTE_LOG(WARNING, EAL, " %s not managed by VFIO driver, skipping\n", + dev_addr); + return 1; + } + + /* Opens main vfio file descriptor which represents the "container" */ + vfio_container_fd = rte_vfio_get_container_fd(); + if (vfio_container_fd < 0) { + DPAA2_BUS_ERR("Failed to open VFIO container"); + return -errno; + } + + /* check if the group is viable */ + ret = ioctl(vfio_group_fd, VFIO_GROUP_GET_STATUS, &group_status); + if (ret) { + DPAA2_BUS_ERR(" %s cannot get group status, " + "error %i (%s)\n", dev_addr, + errno, strerror(errno)); + close(vfio_group_fd); + rte_vfio_clear_group(vfio_group_fd); + return -1; + } else if (!(group_status.flags & VFIO_GROUP_FLAGS_VIABLE)) { + DPAA2_BUS_ERR(" %s VFIO group is not viable!\n", dev_addr); + close(vfio_group_fd); + rte_vfio_clear_group(vfio_group_fd); + return -1; + } + /* At this point, we know that this group is viable (meaning, + * all devices are either bound to VFIO or not bound to anything) + */ + + /* check if group does not have a container yet */ + if (!(group_status.flags & VFIO_GROUP_FLAGS_CONTAINER_SET)) { + + /* add group to a container */ + ret = ioctl(vfio_group_fd, VFIO_GROUP_SET_CONTAINER, + &vfio_container_fd); + if (ret) { + DPAA2_BUS_ERR(" %s cannot add VFIO group to container, " + "error %i (%s)\n", dev_addr, + errno, strerror(errno)); + close(vfio_group_fd); + close(vfio_container_fd); + rte_vfio_clear_group(vfio_group_fd); + return -1; + } + + /* + * set an IOMMU type for container + * + */ + if (ioctl(vfio_container_fd, VFIO_CHECK_EXTENSION, + fslmc_iommu_type)) { + ret = ioctl(vfio_container_fd, VFIO_SET_IOMMU, + fslmc_iommu_type); + if (ret) { + DPAA2_BUS_ERR("Failed to setup VFIO iommu"); + close(vfio_group_fd); + close(vfio_container_fd); + return -errno; + } + } else { + DPAA2_BUS_ERR("No supported IOMMU available"); + close(vfio_group_fd); + close(vfio_container_fd); + return -EINVAL; + } + } + + /* get a file descriptor for the device */ + *vfio_dev_fd = ioctl(vfio_group_fd, VFIO_GROUP_GET_DEVICE_FD, dev_addr); + if (*vfio_dev_fd < 0) { + /* if we cannot get a device fd, this implies a problem with + * the VFIO group or the container not having IOMMU configured. + */ + + DPAA2_BUS_WARN("Getting a vfio_dev_fd for %s failed", dev_addr); + close(vfio_group_fd); + close(vfio_container_fd); + rte_vfio_clear_group(vfio_group_fd); + return -1; + } + + /* test and setup the device */ + ret = ioctl(*vfio_dev_fd, VFIO_DEVICE_GET_INFO, device_info); + if (ret) { + DPAA2_BUS_ERR(" %s cannot get device info, error %i (%s)", + dev_addr, errno, strerror(errno)); + close(*vfio_dev_fd); + close(vfio_group_fd); + close(vfio_container_fd); + rte_vfio_clear_group(vfio_group_fd); + return -1; + } + + return 0; +} + +static intptr_t vfio_map_mcp_obj(const char *mcp_obj) { intptr_t v_addr = (intptr_t)MAP_FAILED; int32_t ret, mc_fd; + struct vfio_group_status status = { .argsz = sizeof(status) }; struct vfio_device_info d_info = { .argsz = sizeof(d_info) }; struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) }; - /* getting the mcp object's fd*/ - mc_fd = ioctl(group->fd, VFIO_GROUP_GET_DEVICE_FD, mcp_obj); - if (mc_fd < 0) { - DPAA2_BUS_ERR("Error in VFIO get dev %s fd from group %d", - mcp_obj, group->fd); - return v_addr; - } - - /* getting device info*/ - ret = ioctl(mc_fd, VFIO_DEVICE_GET_INFO, &d_info); - if (ret < 0) { - DPAA2_BUS_ERR("Error in VFIO getting DEVICE_INFO"); - goto MC_FAILURE; - } + fslmc_vfio_setup_device(SYSFS_FSL_MC_DEVICES, mcp_obj, + &mc_fd, &d_info); /* getting device region info*/ ret = ioctl(mc_fd, VFIO_DEVICE_GET_REGION_INFO, ®_info); @@ -589,19 +694,8 @@ fslmc_process_iodevices(struct rte_dpaa2_device *dev) struct vfio_device_info device_info = { .argsz = sizeof(device_info) }; struct rte_dpaa2_object *object = NULL; - dev_fd = ioctl(vfio_group.fd, VFIO_GROUP_GET_DEVICE_FD, - dev->device.name); - if (dev_fd <= 0) { - DPAA2_BUS_ERR("Unable to obtain device FD for device:%s", - dev->device.name); - return -1; - } - - if (ioctl(dev_fd, VFIO_DEVICE_GET_INFO, &device_info)) { - DPAA2_BUS_ERR("Unable to obtain information for device:%s", - dev->device.name); - return -1; - } + fslmc_vfio_setup_device(SYSFS_FSL_MC_DEVICES, dev->device.name, + &dev_fd, &device_info); switch (dev->dev_type) { case DPAA2_ETH: @@ -654,7 +748,7 @@ fslmc_process_mcp(struct rte_dpaa2_device *dev) goto cleanup; } - v_addr = vfio_map_mcp_obj(&vfio_group, dev_name); + v_addr = vfio_map_mcp_obj(dev->device.name); if (v_addr == (intptr_t)MAP_FAILED) { DPAA2_BUS_ERR("Error mapping region (errno = %d)", errno); ret = -1; diff --git a/drivers/bus/fslmc/fslmc_vfio.h b/drivers/bus/fslmc/fslmc_vfio.h index e877255ea..c98812129 100644 --- a/drivers/bus/fslmc/fslmc_vfio.h +++ b/drivers/bus/fslmc/fslmc_vfio.h @@ -10,6 +10,8 @@ #include +/* Pathname of FSL-MC devices directory. */ +#define SYSFS_FSL_MC_DEVICES "/sys/bus/fsl-mc/devices" #define DPAA2_MC_DPNI_DEVID 7 #define DPAA2_MC_DPSECI_DEVID 3 #define DPAA2_MC_DPCON_DEVID 5 @@ -38,6 +40,7 @@ typedef struct fslmc_vfio_container { struct fslmc_vfio_group *group; } fslmc_vfio_container; +extern char *fslmc_container; int rte_dpaa2_intr_enable(struct rte_intr_handle *intr_handle, int index); int rte_dpaa2_intr_disable(struct rte_intr_handle *intr_handle, int index);