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 C231FA0A0C; Thu, 15 Jul 2021 15:54:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7630141253; Thu, 15 Jul 2021 15:53:52 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id BC2754122E for ; Thu, 15 Jul 2021 15:53:48 +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 16FDpPq3020204 for ; Thu, 15 Jul 2021 06:53:47 -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=eFcu1UaQGwtqf6dBtHDiIaxSXg/6ugc1EbQTBtEwMwQ=; b=XNQSghQyzbKTHwcFqN+V/AcpDpI8DfI4nYAGVfTvJg9ReA9j1JgXUmIeIJttwx6VsE+m XpXiipt+aH/AvPOsabzcqOfN9a1ydIvmn3LnS6fzIARWo+p/Y6rG1grovERZ0fxUuozg ZNZhYNWx8tL/s+rPICrBXH/TqRNTSUTrNlaXEScAhg3BYbF0ZiNoea7lZdC2ySyLEhhd su0njuUViZA4bSHoPFuHrj3hQU/h88bDFrwFdr9jySHnqBq9/QDwjL3P3nF2p86JwvOr FN1oA/ekXBKDfdqpijNZix51Hm2WWlKnDpiN69o6203lkeYc3ayf8OGQ2XMu1zEUeJMO VA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 39tggc1776-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 15 Jul 2021 06:53:47 -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:46 -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:46 -0700 Received: from localhost.localdomain (unknown [10.28.34.39]) by maili.marvell.com (Postfix) with ESMTP id 4DAB93F7082; Thu, 15 Jul 2021 06:53:45 -0700 (PDT) From: Tomasz Duszynski To: , Jakub Palider , Tomasz Duszynski CC: Date: Thu, 15 Jul 2021 08:53:30 -0500 Message-ID: <20210715135330.2541009-5-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: bEjZNEj05Ez0Z31W0pnIlsjZ4EYFGwiX X-Proofpoint-ORIG-GUID: bEjZNEj05Ez0Z31W0pnIlsjZ4EYFGwiX 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 4/4] raw/cnxk_bphy: support setting 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" Add support for setting FEC for a given LMAC. Signed-off-by: Tomasz Duszynski --- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 4 ++++ drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c | 19 +++++++++++++++++++ drivers/raw/cnxk_bphy/rte_pmd_bphy.h | 1 + 3 files changed, 24 insertions(+) diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c index 693a9cd2d5..ade45ab741 100644 --- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c +++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c @@ -131,6 +131,10 @@ cnxk_bphy_cgx_process_buf(struct cnxk_bphy_cgx *cgx, unsigned int queue, ret = roc_bphy_cgx_fec_supported_get(cgx->rcgx, lmac, fec); rsp = fec; break; + case CNXK_BPHY_CGX_MSG_TYPE_SET_FEC: + fec = msg->data; + ret = roc_bphy_cgx_fec_set(cgx->rcgx, lmac, *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 cd3e6b2e97..d96e98661f 100644 --- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c +++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c @@ -221,6 +221,25 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id) RTE_LOG(ERR, PMD, "Failed to get supported FEC\n"); break; } + + /* set supported fec */ + msg.type = CNXK_BPHY_CGX_MSG_TYPE_SET_FEC; + msg.data = &fec; + ret = cnxk_bphy_cgx_enq_msg(dev_id, i, &msg); + if (ret) { + RTE_LOG(ERR, PMD, "Failed to set FEC to %d\n", fec); + break; + } + + /* disable fec */ + fec = CNXK_BPHY_CGX_ETH_LINK_FEC_NONE; + msg.type = CNXK_BPHY_CGX_MSG_TYPE_SET_FEC; + msg.data = &fec; + ret = cnxk_bphy_cgx_enq_msg(dev_id, i, &msg); + if (ret) { + RTE_LOG(ERR, PMD, "Failed to disable 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 0737964149..d459c3a862 100644 --- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h +++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h @@ -18,6 +18,7 @@ enum cnxk_bphy_cgx_msg_type { CNXK_BPHY_CGX_MSG_TYPE_START_RXTX, CNXK_BPHY_CGX_MSG_TYPE_STOP_RXTX, CNXK_BPHY_CGX_MSG_TYPE_GET_SUPPORTED_FEC, + CNXK_BPHY_CGX_MSG_TYPE_SET_FEC, }; enum cnxk_bphy_cgx_eth_link_speed { -- 2.25.1