From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A8A7CA0A0C; Thu, 15 Jul 2021 15:53:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 308044123B; Thu, 15 Jul 2021 15:53:48 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id E36024122D for ; Thu, 15 Jul 2021 15:53:46 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16FDp9Lu020151 for ; Thu, 15 Jul 2021 06:53:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=vN5eOSLKTnSY9/Wse5TNlAXA7eTXcPuxqeByOFE0C6o=; b=bSY8PGaqznddysI4VrMROX+VJA+qZgevjWkrkxyXhkAqTKw3TJBaBP899xgNBCTljbyH Te6djCUV90NVk1x+vh6DzW/CZYfpEBRc3XI/YY2SAjtRcL1F2Uk2+DCv002m8wVChcsx 9ndyVilfUH8zH2OjnBZUSMKrQuhY5fivV+HehBnW/PtRxKGT1BwYMl/kTS7zxBwJZTnw yfY6taCJASHKzJTOOp8pkxIZQU54TvgHV4RinPTGiQ/ucjLip+s5V2FUfJtZvyeHraFs T6VbhnSjmFvMDnZsLLfVntbqEnhVSAtVAqxMVVwVGV+AqPFQibSclXxJhzlrAD3BWAuE 0g== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 39tggc1774-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 15 Jul 2021 06:53:46 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 15 Jul 2021 06:53:44 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 15 Jul 2021 06:53:44 -0700 Received: from localhost.localdomain (unknown [10.28.34.39]) by maili.marvell.com (Postfix) with ESMTP id 7EC743F7081; Thu, 15 Jul 2021 06:53:43 -0700 (PDT) From: Tomasz Duszynski To: , Jakub Palider , Tomasz Duszynski CC: Date: Thu, 15 Jul 2021 08:53:29 -0500 Message-ID: <20210715135330.2541009-4-tduszynski@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210715135330.2541009-1-tduszynski@marvell.com> References: <20210715135330.2541009-1-tduszynski@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: qB9oT26Qn8f-KZ9TdHlqr0fJ6JrRlkTE X-Proofpoint-ORIG-GUID: qB9oT26Qn8f-KZ9TdHlqr0fJ6JrRlkTE X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-15_07:2021-07-14, 2021-07-15 signatures=0 Subject: [dpdk-dev] [PATCH 3/4] raw/cnxk_bphy: support reading FEC 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" Allow one to retrieve supported FEC setting for specific LMAC. Signed-off-by: Tomasz Duszynski --- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 9 +++++++++ drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c | 23 ++++++++++++++++++++++ drivers/raw/cnxk_bphy/rte_pmd_bphy.h | 1 + 3 files changed, 33 insertions(+) diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c index 3da2244146..693a9cd2d5 100644 --- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c +++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c @@ -62,6 +62,7 @@ cnxk_bphy_cgx_process_buf(struct cnxk_bphy_cgx *cgx, unsigned int queue, struct cnxk_bphy_cgx_msg_link_info *link_info; struct roc_bphy_cgx_link_info rlink_info; struct roc_bphy_cgx_link_mode rlink_mode; + enum roc_bphy_cgx_eth_link_fec *fec; unsigned int lmac = qp->lmac; void *rsp = NULL; int ret; @@ -122,6 +123,14 @@ cnxk_bphy_cgx_process_buf(struct cnxk_bphy_cgx *cgx, unsigned int queue, case CNXK_BPHY_CGX_MSG_TYPE_STOP_RXTX: ret = roc_bphy_cgx_stop_rxtx(cgx->rcgx, lmac); break; + case CNXK_BPHY_CGX_MSG_TYPE_GET_SUPPORTED_FEC: + fec = rte_zmalloc(NULL, sizeof(*fec), 0); + if (!fec) + return -ENOMEM; + + ret = roc_bphy_cgx_fec_supported_get(cgx->rcgx, lmac, fec); + rsp = fec; + break; default: return -EINVAL; } diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c index cb4dd4b221..cd3e6b2e97 100644 --- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c +++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c @@ -87,6 +87,22 @@ cnxk_bphy_cgx_link_cond(uint16_t dev_id, unsigned int queue, int cond) return -ETIMEDOUT; } +static int +cnxk_bphy_cgx_get_supported_fec(uint16_t dev_id, unsigned int queue, + enum cnxk_bphy_cgx_eth_link_fec *fec) +{ + struct cnxk_bphy_cgx_msg msg = { + .type = CNXK_BPHY_CGX_MSG_TYPE_GET_SUPPORTED_FEC, + }; + int ret; + + ret = cnxk_bphy_cgx_enq_msg(dev_id, queue, &msg); + if (ret) + return ret; + + return cnxk_bphy_cgx_deq_msg(dev_id, queue, (void **)&fec); +} + int cnxk_bphy_cgx_dev_selftest(uint16_t dev_id) { @@ -103,6 +119,7 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id) for (i = 0; i < queues; i++) { struct cnxk_bphy_cgx_msg_set_link_state link_state; + enum cnxk_bphy_cgx_eth_link_fec fec; struct cnxk_bphy_cgx_msg msg; unsigned int descs; @@ -198,6 +215,12 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id) break; } ret = 0; + + ret = cnxk_bphy_cgx_get_supported_fec(dev_id, i, &fec); + if (ret) { + RTE_LOG(ERR, PMD, "Failed to get supported FEC\n"); + break; + } } rte_rawdev_stop(dev_id); diff --git a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h index f3387f38e3..0737964149 100644 --- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h +++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h @@ -17,6 +17,7 @@ enum cnxk_bphy_cgx_msg_type { CNXK_BPHY_CGX_MSG_TYPE_SET_LINK_STATE, CNXK_BPHY_CGX_MSG_TYPE_START_RXTX, CNXK_BPHY_CGX_MSG_TYPE_STOP_RXTX, + CNXK_BPHY_CGX_MSG_TYPE_GET_SUPPORTED_FEC, }; enum cnxk_bphy_cgx_eth_link_speed { -- 2.25.1