From patchwork Wed Feb 24 12:43:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 386856 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp343296jap; Wed, 24 Feb 2021 04:46:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzw4wlMXE5DqbRiT/xLcshyUt2DYkb+8czEHg8xYYrZHfY0MH/RZtT9hvu4XQKUo1GBhxRQ X-Received: by 2002:a17:906:5681:: with SMTP id am1mr7213827ejc.173.1614170768060; Wed, 24 Feb 2021 04:46:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614170768; cv=none; d=google.com; s=arc-20160816; b=TEzHgc2JIIRm+fqczq1oISaUkdogkiZ7HjHk7aYdOaD3uFE+enskKR+Vo8K+7lTPfE gHQqR1fzKeq1whkPQNauC8+wKAl8S+rRosCJ8L2XJxph1RkXW7JDmhR5G9KY5RscdgLw 6Cl3jp/deVdJQrE3ubY/GAZsGZBTRY1dc6s1yRq6m+JyBUbDSOwoA1+mOTVwVR/SOFsq iBFlRchhXS3wt2BHK1xOAUG32vx5cj+X8ArtZoqjZyAbar80eRVO8M6hZvSTDg4Ohz/N mFKNYDGOQMZfKav7IrULTgIr6rCBRax3r2b4nqse22VngCvCCQph0D75upSGWp6CqqWF UuTg== 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=gAR0276OIzRxfUJjN+rWVvazkR3cNsDPn/Icz5//J4Q=; b=cciTkdU638imVXrZ4rBpwy+JlyE3IboM9QOUaAoXymgHrZyG29gqHx+fdnsEt02m1o LgmgJJpe8BX64VguSQBAZOU4iAAEcuhy30dq0/RAaSw1BQiYUp3KjMvythwKmGE3+KHo 14C7nOb6h5IML4dXa7KMga5H/k5WRsyZt5xlkAyyBLiBxrPiQ2z1e+eJ6VSlLOwmAbPf 6VpwYVjpXHtXHCG2rdVUh00hOCLqzcCsrd/zS0xrvh9HKbCZ2T5eJGs2vhlR1CU/vEoX bt1lh5XhA+SRLVTLz1h6f7Aytx73zcZ+TcgKQxXjf44q2XBX3lSEB4fMLtZUvqLFTQGR bdJQ== 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 z16si205829ejm.714.2021.02.24.04.46.07; Wed, 24 Feb 2021 04:46:08 -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 5C2FF1608C3; Wed, 24 Feb 2021 13:43:47 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id AB8B8160863 for ; Wed, 24 Feb 2021 13:43:30 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 793E71A039D; Wed, 24 Feb 2021 13:43:30 +0100 (CET) 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 654A71A03A1; Wed, 24 Feb 2021 13:43:28 +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 219BD4032B; Wed, 24 Feb 2021 13:43:25 +0100 (CET) From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Nipun Gupta Date: Wed, 24 Feb 2021 18:13:06 +0530 Message-Id: <20210224124311.29799-19-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210224124311.29799-1-hemant.agrawal@nxp.com> References: <20210211141620.12482-1-hemant.agrawal@nxp.com> <20210224124311.29799-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v3 18/23] 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 Acked-by: Hemant Agrawal --- 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) { ;