From patchwork Thu Feb 11 14:16:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 381011 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp2123499jah; Thu, 11 Feb 2021 06:30:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZyggoQN0IPVEHA1OtjBsloyYTyPJL11dmbZF7BS8lBrO9yhNNRtnVQhkZqMDQPKUy2S46 X-Received: by 2002:a17:906:9b4f:: with SMTP id ep15mr8637611ejc.423.1613053825707; Thu, 11 Feb 2021 06:30:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613053825; cv=none; d=google.com; s=arc-20160816; b=RpJA1H+7PZVIzPM/h9bEGpGoAy0GP/PYTpONCvrTFEM1/F2EEopUBsDFDlNJcFBWXx qqj3im4hsbE+ynJ2CTHBhlEF/Vw7yc7nJWTPmsk3v0/PPbX3nSr/thOkvy7DYSRp7FDD Rf6oxMMm9sXbqj0d4kn/S2N3N9lphZWiBOqBCfAbX3n/aeByGpTshhIff7VQ+umVWbG0 +5KyBv/4Lxrbq57YcwxoVrZqw14nIGIiaWawDX4IfD4360X1QX52vdw/lZq2L5MvO25d dzBJp0V7Mv2Mq4a9lX/rQEjOQkeXLaNfEYTW9fH5m05Ye4cPicd1Wy9kzD9m+5nHjDM9 6Ywg== 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:to:from; bh=629E1wPgIZh1VWizxgbJjCBxCQidQlKcwTW7fZxjoxo=; b=pEP4GrIf2mZEbngqtyDNyZvmPrC/5t/5jNGqkhLI0vwWxrDcoeWglWKIM1pst0pxKa gugpyAyjy5qm97v0qRDBcKZ+WuKjIrNteJ46pudxCkOHHtpwzYv4dN1s+oYnpenLZzAf Fl87yyUETvTU74Iwqit4F5rfxhEZUeJnsVZZfK/bB4F4xuzVJ+BDqQ8gIo49Ka0JygRK gQdwO+wDuhPD6seScwZwnifHZXnc5yXcgF42USBWTeI9TSlxZ56lZmece9x9Sw9/9e57 z2E5fdf7VRxIn5ApuO1pJch3U0H5kcAGL3wyuurHT5fKRPW5aVt2valqCUEGvWhPCnzw 0HLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.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 mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id a67si4175848edf.42.2021.02.11.06.30.25; Thu, 11 Feb 2021 06:30:25 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D17931CC5B3; Thu, 11 Feb 2021 15:28:22 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 1C31A1CC56B for ; Thu, 11 Feb 2021 15:28:07 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 01DC72008D8; Thu, 11 Feb 2021 15:28:07 +0100 (CET) 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 B6D41200610; Thu, 11 Feb 2021 15:28:05 +0100 (CET) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 16630402B7; Thu, 11 Feb 2021 15:28:04 +0100 (CET) From: Hemant Agrawal To: dev@dpdk.org, ferruh.yigit@intel.com Date: Thu, 11 Feb 2021 19:46:17 +0530 Message-Id: <20210211141620.12482-18-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210211141620.12482-1-hemant.agrawal@nxp.com> References: <20210120142723.14090-1-hemant.agrawal@nxp.com> <20210211141620.12482-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 17/20] net/dpaa: prevent multiple mp config on an device X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Nipun Gupta The current driver only support single buffer pool on a given pmd instance. return error, if trying to configure more. Signed-off-by: Nipun Gupta --- drivers/mempool/dpaa/dpaa_mempool.c | 1 + drivers/net/dpaa/dpaa_ethdev.c | 6 ++++++ 2 files changed, 7 insertions(+) -- 2.17.1 diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c index e6b06f0575..1ee7ffb647 100644 --- a/drivers/mempool/dpaa/dpaa_mempool.c +++ b/drivers/mempool/dpaa/dpaa_mempool.c @@ -134,6 +134,7 @@ dpaa_mbuf_free_pool(struct rte_mempool *mp) DPAA_MEMPOOL_INFO("BMAN pool freed for bpid =%d", bp_info->bpid); rte_free(mp->pool_data); + bp_info->bp = NULL; mp->pool_data = NULL; } } diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 0996edf9a9..a3a3e7cb24 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -969,6 +969,12 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, } } + if (dpaa_intf->bp_info && dpaa_intf->bp_info->bp && + dpaa_intf->bp_info->mp != mp) { + DPAA_PMD_WARN("Multiple pools on same interface not supported"); + return -EINVAL; + } + /* Max packet can fit in single buffer */ if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= buffsz) { ;