src/dpdk/drivers/net/sfc/sfc.c
static int
sfc_check_conf(struct sfc_adapter *sa)
{
	const struct rte_eth_conf *conf = &sa->eth_dev->data->dev_conf;
	int rc = 0;

	sa->port.phy_adv_cap =
		sfc_phy_cap_from_link_speeds(conf->link_speeds) &
		sa->port.phy_adv_cap_mask;
	if ((sa->port.phy_adv_cap & ~(1 << EFX_PHY_CAP_AN)) == 0) {
		sfc_err(sa, "No link speeds from mask %#x are supported",
			conf->link_speeds);
		rc = EINVAL;
	}

#if !EFSYS_OPT_LOOPBACK
	if (conf->lpbk_mode != 0) {
		sfc_err(sa, "Loopback not supported");
		rc = EINVAL;
	}
#endif

	if (conf->dcb_capability_en != 0) {
		sfc_err(sa, "Priority-based flow control not supported");
		rc = EINVAL;
	}

	if (conf->fdir_conf.mode != RTE_FDIR_MODE_NONE) {
		sfc_err(sa, "Flow Director not supported");
		rc = EINVAL;
	}

	if ((conf->intr_conf.lsc != 0) &&
	    (sa->intr.type != EFX_INTR_LINE) &&
	    (sa->intr.type != EFX_INTR_MESSAGE)) {
		sfc_err(sa, "Link status change interrupt not supported");
		rc = EINVAL;
	}

	if (conf->intr_conf.rxq != 0 &&
	    (sa->priv.dp_rx->features & SFC_DP_RX_FEAT_INTR) == 0) {
		sfc_err(sa, "Receive queue interrupt not supported");
		rc = EINVAL;
	}

	return rc;
}
/*
 * Check requested device level configuration.
 * Receive and transmit configuration is checked in corresponding
 * modules.
 */
Check requested device level configuration.
Receive and transmit configuration is checked in corresponding
modules.
Check requested device level configuration . Receive and transmit configuration is checked in corresponding modules .
static int
sfc_check_conf(struct sfc_adapter *sa)
{
	const struct rte_eth_conf *conf = &sa->eth_dev->data->dev_conf;
	int rc = 0;
	sa->port.phy_adv_cap =
		sfc_phy_cap_from_link_speeds(conf->link_speeds) &
		sa->port.phy_adv_cap_mask;
	if ((sa->port.phy_adv_cap & ~(1 << EFX_PHY_CAP_AN)) == 0) {
		sfc_err(sa, "No link speeds from mask %#x are supported",
			conf->link_speeds);
		rc = EINVAL;
	}
#if !EFSYS_OPT_LOOPBACK
	if (conf->lpbk_mode != 0) {
		sfc_err(sa, "Loopback not supported");
		rc = EINVAL;
	}
#endif
	if (conf->dcb_capability_en != 0) {
		sfc_err(sa, "Priority-based flow control not supported");
		rc = EINVAL;
	}
	if (conf->fdir_conf.mode != RTE_FDIR_MODE_NONE) {
		sfc_err(sa, "Flow Director not supported");
		rc = EINVAL;
	}
	if ((conf->intr_conf.lsc != 0) &&
	    (sa->intr.type != EFX_INTR_LINE) &&
	    (sa->intr.type != EFX_INTR_MESSAGE)) {
		sfc_err(sa, "Link status change interrupt not supported");
		rc = EINVAL;
	}
	if (conf->intr_conf.rxq != 0 &&
	    (sa->priv.dp_rx->features & SFC_DP_RX_FEAT_INTR) == 0) {
		sfc_err(sa, "Receive queue interrupt not supported");
		rc = EINVAL;
	}
	return rc;
}
static int sfc_check_conf ( struct sfc_adapter * sa ) { const struct rte_eth_conf * conf = & sa -> eth_dev -> data -> dev_conf ; int rc = 0 ; sa -> port . phy_adv_cap = sfc_phy_cap_from_link_speeds ( conf -> link_speeds ) & sa -> port . phy_adv_cap_mask ; if ( ( sa -> port . phy_adv_cap & ~ ( 1 << EFX_PHY_CAP_AN ) ) == 0 ) { sfc_err ( sa , " " , conf -> link_speeds ) ; rc = EINVAL ; } #if ! EFSYS_OPT_LOOPBACK if ( conf -> lpbk_mode != 0 ) { sfc_err ( sa , " " ) ; rc = EINVAL ; } #endif if ( conf -> dcb_capability_en != 0 ) { sfc_err ( sa , " " ) ; rc = EINVAL ; } if ( conf -> fdir_conf . mode != RTE_FDIR_MODE_NONE ) { sfc_err ( sa , " " ) ; rc = EINVAL ; } if ( ( conf -> intr_conf . lsc != 0 ) && ( sa -> intr . type != EFX_INTR_LINE ) && ( sa -> intr . type != EFX_INTR_MESSAGE ) ) { sfc_err ( sa , " " ) ; rc = EINVAL ; } if ( conf -> intr_conf . rxq != 0 && ( sa -> priv . dp_rx -> features & SFC_DP_RX_FEAT_INTR ) == 0 ) { sfc_err ( sa , " " ) ; rc = EINVAL ; } return rc ; }
Check requested device level configuration.
Check requested device level configuration .