From: Tomasz Duszynski <tduszynski@marvell.com>
To: <dev@dpdk.org>, Jakub Palider <jpalider@marvell.com>,
Tomasz Duszynski <tduszynski@marvell.com>
Cc: <jerinj@marvell.com>
Subject: [dpdk-dev] [PATCH 4/4] raw/cnxk_bphy: support setting FEC
Date: Thu, 15 Jul 2021 08:53:30 -0500 [thread overview]
Message-ID: <20210715135330.2541009-5-tduszynski@marvell.com> (raw)
In-Reply-To: <20210715135330.2541009-1-tduszynski@marvell.com>
Add support for setting FEC for a given LMAC.
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
---
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
next prev parent reply other threads:[~2021-07-15 13:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-15 13:53 [dpdk-dev] [PATCH 0/4] raw/cnxk_bphy: add FEC support Tomasz Duszynski
2021-07-15 13:53 ` [dpdk-dev] [PATCH 1/4] common/cnxk: support reading BPHY CGX/RPM FEC Tomasz Duszynski
2021-07-15 13:53 ` [dpdk-dev] [PATCH 2/4] common/cnxk: support setting " Tomasz Duszynski
2021-07-15 13:53 ` [dpdk-dev] [PATCH 3/4] raw/cnxk_bphy: support reading FEC Tomasz Duszynski
2021-07-15 13:53 ` Tomasz Duszynski [this message]
2021-07-23 8:07 ` [dpdk-dev] [PATCH 0/4] raw/cnxk_bphy: add FEC support Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210715135330.2541009-5-tduszynski@marvell.com \
--to=tduszynski@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=jpalider@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).