void bnxt_flow_cnt_alarm_cb(void *arg);
int bnxt_flow_stats_req(struct bnxt *bp);
int bnxt_flow_stats_cnt(struct bnxt *bp);
+uint32_t bnxt_get_speed_capabilities(struct bnxt *bp);
#endif
* Device configuration and status function
*/
-static uint32_t bnxt_get_speed_capabilities(struct bnxt *bp)
+uint32_t bnxt_get_speed_capabilities(struct bnxt *bp)
{
uint32_t link_speed = bp->link_info->support_speeds;
uint32_t speed_capa = 0;
ETH_LINK_SPEED_40G | ETH_LINK_SPEED_50G | \
ETH_LINK_SPEED_100G | ETH_LINK_SPEED_200G)
-static int bnxt_valid_link_speed(uint32_t link_speed, uint16_t port_id)
+static int bnxt_validate_link_speed(struct bnxt *bp)
{
+ uint32_t link_speed = bp->eth_dev->data->dev_conf.link_speeds;
+ uint16_t port_id = bp->eth_dev->data->port_id;
+ uint32_t link_speed_capa;
uint32_t one_speed;
if (link_speed == ETH_LINK_SPEED_AUTONEG)
return 0;
+ link_speed_capa = bnxt_get_speed_capabilities(bp);
+
if (link_speed & ETH_LINK_SPEED_FIXED) {
one_speed = link_speed & ~ETH_LINK_SPEED_FIXED;
link_speed, port_id);
return -EINVAL;
}
- if ((one_speed & BNXT_SUPPORTED_SPEEDS) != one_speed) {
+ if ((one_speed & link_speed_capa) != one_speed) {
PMD_DRV_LOG(ERR,
"Unsupported advertised speed (%u) for port %u\n",
link_speed, port_id);
return -EINVAL;
}
} else {
- if (!(link_speed & BNXT_SUPPORTED_SPEEDS)) {
+ if (!(link_speed & link_speed_capa)) {
PMD_DRV_LOG(ERR,
"Unsupported advertised speeds (%u) for port %u\n",
link_speed, port_id);
if (!BNXT_SINGLE_PF(bp) || BNXT_VF(bp))
return 0;
- rc = bnxt_valid_link_speed(dev_conf->link_speeds,
- bp->eth_dev->data->port_id);
+ rc = bnxt_validate_link_speed(bp);
if (rc)
goto error;