Reviewed-by: Andy Moreton <amoreton at solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
 doc/guides/nics/sfc_efx.rst  | 12 +++++++++
 drivers/net/sfc/efx/sfc_rx.c | 61 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)

diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst
index 46c892b..87b217f8 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/efx/sfc_rx.c b/drivers/net/sfc/efx/sfc_rx.c
index 961e6b6..bc43e4e 100644
--- a/drivers/net/sfc/efx/sfc_rx.c
+++ b/drivers/net/sfc/efx/sfc_rx.c
@@ -48,6 +48,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.
  *
@@ -59,9 +114,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;
@@ -85,6 +145,7 @@ sfc_rx_init(struct sfc_adapter *sa)

 fail_rxqs_alloc:
        sa->rxq_count = 0;
+fail_check_mode:
        sfc_log_init(sa, "failed %d", rc);
        return rc;
 }
-- 
2.5.5

Reply via email to