From patchwork Thu Feb 11 14:16:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 381002 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp2122204jah; Thu, 11 Feb 2021 06:29:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrTChBokZ2OMjjLF0SwgBPJfleDiRpElvs2uRd9rHBmKrK7HG1IiQFwHrPoPowfd4UB11e X-Received: by 2002:a17:906:168e:: with SMTP id s14mr8903715ejd.515.1613053749102; Thu, 11 Feb 2021 06:29:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613053749; cv=none; d=google.com; s=arc-20160816; b=yhJDEyRjrruBF5Y+wq8SilL7dX1ZFhQbYTGR3pibF/hzkV529anGpVNEFRsQECK7yz e7f7Rp2UpbVpGJPo5cLB4zrNvBzpNZfDqPViTA2feg1LdY3NbLBhXmgsKZoiq/aneyWV /QLLaf+SFFpqrHipfV/NE9nU3ReWVOROb40BXpzX5juxCoD76JuUY6ksS42YqMxqV0ZE etw0LSgk3xSLo9z1Xo2n0me01rv9P3zJZ2aWjTpb14X9f/ouQAPgwXFLC5VjILoyq/+e TFAdEYIEbzCO0yHT3sYf17WDnYjhZMFwKCHuaFEHy1wPafC2cgghrMvyDbi08Owvi7db Gflw== 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=Hn0XZ7G3GvotXViccZHZPeCHb0I8nP+jBPq15QeTkjA=; b=XRjodFMWQHHIj/cyLp8P0rwC+UX59kaVce43/hZGpgdH9emmHGBC+t4D0dzqem9Eo6 tAS3jBphFOeeje9H8itdeZycELccaAdCcU6O7izgpriPu95FwYOQpllXVdyHKSToaUhB N+HYYc0PQXWeywtunn1oV3jNPfR9YiXv/pZdv2LhHWDyJNs0MItGnJPg83780lejmijf Ldo8Xi49EtZAi1zYM3e266Q6pZQWSoXxk74rGY5iqYpj//gPkYdmLiCeG/zsUfhDmWzn hMPy0QUaTslefn+jnSQ1sFOtuMXiijf8601OUkdAIs3WmuGhqJVKsybIn6iVwaioxTF5 VWVg== 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 f8si3775007ejf.3.2021.02.11.06.29.08; Thu, 11 Feb 2021 06:29:09 -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 AB1D81CC57A; Thu, 11 Feb 2021 15:28:10 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id E155A1CC504 for ; Thu, 11 Feb 2021 15:28:02 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id BD8A31A05C7; Thu, 11 Feb 2021 15:28:02 +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 7DFC61A05F5; Thu, 11 Feb 2021 15:28:01 +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 D1887402B7; Thu, 11 Feb 2021 15:27:59 +0100 (CET) From: Hemant Agrawal To: dev@dpdk.org, ferruh.yigit@intel.com Date: Thu, 11 Feb 2021 19:46:09 +0530 Message-Id: <20210211141620.12482-10-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 09/20] net/dpaa2: add support to configure dpdmux max Rx frame len 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" This patch introduce a new pmd api, which can help the applications to configure the max framelen for a given dpdmux interface Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_mux.c | 28 +++++++++++++++++++++++++++- drivers/net/dpaa2/rte_pmd_dpaa2.h | 18 +++++++++++++++++- drivers/net/dpaa2/version.map | 1 + 3 files changed, 45 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_mux.c b/drivers/net/dpaa2/dpaa2_mux.c index f8366e839e..b397d333d6 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-2020 NXP + * Copyright 2018-2021 NXP */ #include @@ -205,6 +205,32 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, return NULL; } +int +rte_pmd_dpaa2_mux_rx_frame_len(uint32_t dpdmux_id, uint16_t max_rx_frame_len) +{ + struct dpaa2_dpdmux_dev *dpdmux_dev; + int ret; + + /* Find the DPDMUX from dpdmux_id in our list */ + dpdmux_dev = get_dpdmux_from_id(dpdmux_id); + if (!dpdmux_dev) { + DPAA2_PMD_ERR("Invalid dpdmux_id: %d", dpdmux_id); + return -1; + } + + ret = dpdmux_set_max_frame_length(&dpdmux_dev->dpdmux, + CMD_PRI_LOW, dpdmux_dev->token, max_rx_frame_len); + if (ret) { + DPAA2_PMD_ERR("DPDMUX:Unable to set mtu. check config %d", ret); + return ret; + } + + DPAA2_PMD_INFO("dpdmux mtu set as %u", + DPAA2_MAX_RX_PKT_LEN - RTE_ETHER_CRC_LEN); + + return ret; +} + static int dpaa2_create_dpdmux_device(int vdev_fd __rte_unused, struct vfio_device_info *obj_info __rte_unused, diff --git a/drivers/net/dpaa2/rte_pmd_dpaa2.h b/drivers/net/dpaa2/rte_pmd_dpaa2.h index ec8df75af9..7204a8f951 100644 --- a/drivers/net/dpaa2/rte_pmd_dpaa2.h +++ b/drivers/net/dpaa2/rte_pmd_dpaa2.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018-2020 NXP + * Copyright 2018-2021 NXP */ #ifndef _RTE_PMD_DPAA2_H @@ -40,6 +40,22 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, struct rte_flow_item *pattern[], struct rte_flow_action *actions[]); +/** + * @warning + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice + * + * demultiplex interface max rx frame length configure + * + * @param dpdmux_id + * ID of the DPDMUX MC object. + * @param max_rx_frame_len + * maximum receive frame length (will be checked to be minimux of all dpnis) + * + */ +__rte_experimental +int +rte_pmd_dpaa2_mux_rx_frame_len(uint32_t dpdmux_id, uint16_t max_rx_frame_len); + /** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice diff --git a/drivers/net/dpaa2/version.map b/drivers/net/dpaa2/version.map index 72d1b2b1c8..3c087c2423 100644 --- a/drivers/net/dpaa2/version.map +++ b/drivers/net/dpaa2/version.map @@ -2,6 +2,7 @@ EXPERIMENTAL { global: rte_pmd_dpaa2_mux_flow_create; + rte_pmd_dpaa2_mux_rx_frame_len; rte_pmd_dpaa2_set_custom_hash; };