net/sfc: add device configuration checks
Manual link speed/duplex configuration is not supported yet. Loopback is not supported yet. Flow Director is not supported. Link status change notification using interrupt is not supported yet. Receive data notification using interrupts is not supported yet. Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
This commit is contained in:
parent
aaa3f5f0f7
commit
c7cb2d7a5f
@ -37,6 +37,20 @@ More information can be found at `Solarflare Communications website
|
||||
<http://solarflare.com>`_.
|
||||
|
||||
|
||||
Non-supported Features
|
||||
----------------------
|
||||
|
||||
The features not yet supported include:
|
||||
|
||||
- Link status change interrupt
|
||||
|
||||
- Receive queue interupts
|
||||
|
||||
- Priority-based flow control
|
||||
|
||||
- Loopback
|
||||
|
||||
|
||||
Supported NICs
|
||||
--------------
|
||||
|
||||
|
@ -82,9 +82,55 @@ sfc_dma_free(const struct sfc_adapter *sa, efsys_mem_t *esmp)
|
||||
memset(esmp, 0, sizeof(*esmp));
|
||||
}
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
||||
if (conf->link_speeds != ETH_LINK_SPEED_AUTONEG) {
|
||||
sfc_err(sa, "Manual link speed/duplex choice not supported");
|
||||
rc = EINVAL;
|
||||
}
|
||||
|
||||
if (conf->lpbk_mode != 0) {
|
||||
sfc_err(sa, "Loopback not supported");
|
||||
rc = EINVAL;
|
||||
}
|
||||
|
||||
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) {
|
||||
sfc_err(sa, "Link status change interrupt not supported");
|
||||
rc = EINVAL;
|
||||
}
|
||||
|
||||
if (conf->intr_conf.rxq != 0) {
|
||||
sfc_err(sa, "Receive queue interrupt not supported");
|
||||
rc = EINVAL;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
sfc_configure(struct sfc_adapter *sa)
|
||||
{
|
||||
int rc;
|
||||
|
||||
sfc_log_init(sa, "entry");
|
||||
|
||||
SFC_ASSERT(sfc_adapter_is_locked(sa));
|
||||
@ -92,9 +138,18 @@ sfc_configure(struct sfc_adapter *sa)
|
||||
SFC_ASSERT(sa->state == SFC_ADAPTER_INITIALIZED);
|
||||
sa->state = SFC_ADAPTER_CONFIGURING;
|
||||
|
||||
rc = sfc_check_conf(sa);
|
||||
if (rc != 0)
|
||||
goto fail_check_conf;
|
||||
|
||||
sa->state = SFC_ADAPTER_CONFIGURED;
|
||||
sfc_log_init(sa, "done");
|
||||
return 0;
|
||||
|
||||
fail_check_conf:
|
||||
sa->state = SFC_ADAPTER_INITIALIZED;
|
||||
sfc_log_init(sa, "failed %d", rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user