From patchwork Tue Jul 7 09:22:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 234963 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp736859ilg; Tue, 7 Jul 2020 02:28:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXWZ2l3egtHjOqieHHcBRnkJD3WDHq6nEff0Y3WpuqriWef1fWh1O7bV6EZhLXWegEMsmn X-Received: by 2002:a17:906:d116:: with SMTP id b22mr22834058ejz.250.1594114131395; Tue, 07 Jul 2020 02:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594114131; cv=none; d=google.com; s=arc-20160816; b=YRq/xwMwZ78FdUBI+6/DozMe0Z5CxQLCQZEEiWr2gwHBjZGmTceTveXzG5+UJuI9ry GZTVCKK1ytHWR6yjuH0ZAM8tMKUeFU8uFfkv/8j7W/HEvlm1nl87fave9EvA50Le6/3Y /pT6AE2zvhGKAN8LPOwuho529/bt1psdcE/OdM4nheu7DpLBXZHxdP4Ov8q9kuSYhEhp usUpEMb8LYbRC3jqz107VnrvZnOsPl7pmlthsm8e0UQvFb+yQEx1IObxVNIXUednWI5N FPZqDpacldks14bQlDJxwYe5xZMZGPxbmq84ayTWUwjz9XEiBgmIN4Ol4K8FjKKsyqgl RfuA== 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=Zga92JVegTJoA4OtrM4iEJQ5kg7LFdxNUfsnQqRTXRI=; b=JagvG1kjaq8ej3pxgI9mhk3TBUqWnKYc4lfkhoUscfCP2POcPnObqf+tEvFzImgxtK FugTTm1CveKp2f+//GwNvZMupqqwwKeq5MlziLFRuxSAlbmrSyjKvJGq344pl3/+sR57 nwxV0OFbbU2ASL57fDNT3X9yNXGNsVrrFZhCeaF1+QQvzBDKFr0wNTyxtOEXR6RpslmF xxXGGLDFymSg4ZGnjOrfiSn+TVycEZiF+NFnC7UH4P6a8WmNTwnJ411/elvZiIipUJ51 LJbphiu1bBOM1WfGbfxjw9/zh8WQb+pVSJLdHeMgPsV2FE+kjG3Ffmg/gDOEYBVinaGB crxg== 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 u6si14656154ejt.460.2020.07.07.02.28.51; Tue, 07 Jul 2020 02:28:51 -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 69FD21DD4D; Tue, 7 Jul 2020 11:27:15 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id A0E8A1DBBD for ; Tue, 7 Jul 2020 11:27:05 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 85B662008CE; Tue, 7 Jul 2020 11:27:05 +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 448122008E9; Tue, 7 Jul 2020 11:27:03 +0200 (CEST) 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 8B1F7402A8; Tue, 7 Jul 2020 17:27:00 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Sachin Saxena , Gagandeep Singh Date: Tue, 7 Jul 2020 14:52:25 +0530 Message-Id: <20200707092244.12791-11-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200707092244.12791-1-hemant.agrawal@nxp.com> References: <20200527132326.1382-1-hemant.agrawal@nxp.com> <20200707092244.12791-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 10/29] net/dpaa: add 2.5G support 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: Sachin Saxena Handle 2.5Gbps ethernet ports as well. Signed-off-by: Sachin Saxena Signed-off-by: Gagandeep Singh --- doc/guides/nics/features/dpaa.ini | 2 +- drivers/bus/dpaa/base/fman/fman.c | 6 ++++-- drivers/bus/dpaa/base/fman/netcfg_layer.c | 3 ++- drivers/bus/dpaa/include/fman.h | 1 + drivers/net/dpaa/dpaa_ethdev.c | 9 ++++++++- 5 files changed, 16 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/doc/guides/nics/features/dpaa.ini b/doc/guides/nics/features/dpaa.ini index 24cfd8566..b00f46a97 100644 --- a/doc/guides/nics/features/dpaa.ini +++ b/doc/guides/nics/features/dpaa.ini @@ -4,7 +4,7 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] -Speed capabilities = P +Speed capabilities = Y Link status = Y Jumbo frame = Y MTU update = Y diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c index 6d77a7e39..ae26041ca 100644 --- a/drivers/bus/dpaa/base/fman/fman.c +++ b/drivers/bus/dpaa/base/fman/fman.c @@ -263,7 +263,7 @@ fman_if_init(const struct device_node *dpa_node) fman_dealloc_bufs_mask_hi = 0; fman_dealloc_bufs_mask_lo = 0; } - /* Is the MAC node 1G, 10G? */ + /* Is the MAC node 1G, 2.5G, 10G? */ __if->__if.is_memac = 0; if (of_device_is_compatible(mac_node, "fsl,fman-1g-mac")) @@ -279,7 +279,9 @@ fman_if_init(const struct device_node *dpa_node) /* Right now forcing memac to 1g in case of error*/ __if->__if.mac_type = fman_mac_1g; } else { - if (strstr(char_prop, "sgmii")) + if (strstr(char_prop, "sgmii-2500")) + __if->__if.mac_type = fman_mac_2_5g; + else if (strstr(char_prop, "sgmii")) __if->__if.mac_type = fman_mac_1g; else if (strstr(char_prop, "rgmii")) { __if->__if.mac_type = fman_mac_1g; diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/base/fman/netcfg_layer.c index 36eca88cd..b7009f229 100644 --- a/drivers/bus/dpaa/base/fman/netcfg_layer.c +++ b/drivers/bus/dpaa/base/fman/netcfg_layer.c @@ -44,7 +44,8 @@ dump_netcfg(struct netcfg_info *cfg_ptr) printf("\n+ Fman %d, MAC %d (%s);\n", __if->fman_idx, __if->mac_idx, - (__if->mac_type == fman_mac_1g) ? "1G" : "10G"); + (__if->mac_type == fman_mac_1g) ? "1G" : + (__if->mac_type == fman_mac_2_5g) ? "2.5G" : "10G"); printf("\tmac_addr: %02x:%02x:%02x:%02x:%02x:%02x\n", (&__if->mac_addr)->addr_bytes[0], diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h index c02d32d22..b6293b61c 100644 --- a/drivers/bus/dpaa/include/fman.h +++ b/drivers/bus/dpaa/include/fman.h @@ -72,6 +72,7 @@ enum fman_mac_type { fman_offline = 0, fman_mac_1g, fman_mac_10g, + fman_mac_2_5g, }; struct mac_addr { diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index fd2c0c681..c0ded9086 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -356,8 +356,13 @@ static int dpaa_eth_dev_info(struct rte_eth_dev *dev, if (dpaa_intf->fif->mac_type == fman_mac_1g) { dev_info->speed_capa = ETH_LINK_SPEED_1G; + } else if (dpaa_intf->fif->mac_type == fman_mac_2_5g) { + dev_info->speed_capa = ETH_LINK_SPEED_1G + | ETH_LINK_SPEED_2_5G; } else if (dpaa_intf->fif->mac_type == fman_mac_10g) { - dev_info->speed_capa = (ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G); + dev_info->speed_capa = ETH_LINK_SPEED_1G + | ETH_LINK_SPEED_2_5G + | ETH_LINK_SPEED_10G; } else { DPAA_PMD_ERR("invalid link_speed: %s, %d", dpaa_intf->name, dpaa_intf->fif->mac_type); @@ -388,6 +393,8 @@ static int dpaa_eth_link_update(struct rte_eth_dev *dev, if (dpaa_intf->fif->mac_type == fman_mac_1g) link->link_speed = ETH_SPEED_NUM_1G; + else if (dpaa_intf->fif->mac_type == fman_mac_2_5g) + link->link_speed = ETH_SPEED_NUM_2_5G; else if (dpaa_intf->fif->mac_type == fman_mac_10g) link->link_speed = ETH_SPEED_NUM_10G; else