]> git.droids-corp.org - dpdk.git/commitdiff
raw/cnxk_bphy: support setting FEC
authorTomasz Duszynski <tduszynski@marvell.com>
Thu, 15 Jul 2021 13:53:30 +0000 (08:53 -0500)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 22 Jul 2021 22:54:01 +0000 (00:54 +0200)
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
drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c
drivers/raw/cnxk_bphy/rte_pmd_bphy.h

index 693a9cd2d516949582386ce5167a5e2859b34886..ade45ab741968f0112f11f4e94c7a3a098553925 100644 (file)
@@ -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;
        }
index cd3e6b2e97ab53b9d52ee7034129f4bdb0e505c1..d96e98661f2ff87d38f318ca52ac419b37275135 100644 (file)
@@ -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);
index 0737964149306187c4ae71498caeeec60f61c350..d459c3a8625555448dbce8a6934d5bca4be0b2c3 100644 (file)
@@ -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 {