raw/cnxk_bphy: support setting FEC
Add support for setting FEC for a given LMAC. Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
This commit is contained in:
parent
3b28b36545
commit
1409edec9e
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user