From: Andrew Rybchenko Date: Tue, 29 Nov 2016 16:19:16 +0000 (+0000) Subject: net/sfc: check configured Rx mode X-Git-Tag: spdx-start~5055 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=976f2e5a0cebc1c60d9ff5b5608e9ad8e547510c;p=dpdk.git net/sfc: check configured Rx mode Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton Reviewed-by: Ferruh Yigit --- diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst index 46c892bab5..87b217f847 100644 --- a/doc/guides/nics/sfc_efx.rst +++ b/doc/guides/nics/sfc_efx.rst @@ -60,6 +60,18 @@ The features not yet supported include: - Loopback +- Configurable RX CRC stripping (always stripped) + +- Header split on receive + +- VLAN filtering + +- VLAN stripping + +- Scattered receive + +- LRO + Supported NICs -------------- diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index e2c7d00bc2..88e33198f8 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -47,6 +47,61 @@ sfc_rx_qinit_info(struct sfc_adapter *sa, unsigned int sw_index) return 0; } +static int +sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode) +{ + int rc = 0; + + switch (rxmode->mq_mode) { + case ETH_MQ_RX_NONE: + /* No special checks are required */ + break; + default: + sfc_err(sa, "Rx multi-queue mode %u not supported", + rxmode->mq_mode); + rc = EINVAL; + } + + if (rxmode->header_split) { + sfc_err(sa, "Header split on Rx not supported"); + rc = EINVAL; + } + + if (rxmode->hw_vlan_filter) { + sfc_err(sa, "HW VLAN filtering not supported"); + rc = EINVAL; + } + + if (rxmode->hw_vlan_strip) { + sfc_err(sa, "HW VLAN stripping not supported"); + rc = EINVAL; + } + + if (rxmode->hw_vlan_extend) { + sfc_err(sa, + "Q-in-Q HW VLAN stripping not supported"); + rc = EINVAL; + } + + if (!rxmode->hw_strip_crc) { + sfc_warn(sa, + "FCS stripping control not supported - always stripped"); + rxmode->hw_strip_crc = 1; + } + + if (rxmode->enable_scatter) { + sfc_err(sa, "Scatter on Rx not supported"); + rc = EINVAL; + } + + if (rxmode->enable_lro) { + sfc_err(sa, "LRO not supported"); + rc = EINVAL; + } + + return rc; +} + /** * Initialize Rx subsystem. * @@ -58,9 +113,14 @@ sfc_rx_qinit_info(struct sfc_adapter *sa, unsigned int sw_index) int sfc_rx_init(struct sfc_adapter *sa) { + struct rte_eth_conf *dev_conf = &sa->eth_dev->data->dev_conf; unsigned int sw_index; int rc; + rc = sfc_rx_check_mode(sa, &dev_conf->rxmode); + if (rc != 0) + goto fail_check_mode; + sa->rxq_count = sa->eth_dev->data->nb_rx_queues; rc = ENOMEM; @@ -84,6 +144,7 @@ fail_rx_qinit_info: fail_rxqs_alloc: sa->rxq_count = 0; +fail_check_mode: sfc_log_init(sa, "failed %d", rc); return rc; }