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: