net/sfc: make Rx scatter a datapath-dependent feature
authorAndrew Rybchenko <arybchenko@solarflare.com>
Mon, 20 Mar 2017 10:15:11 +0000 (10:15 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 4 Apr 2017 16:59:42 +0000 (18:59 +0200)
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
drivers/net/sfc/sfc_dp_rx.h
drivers/net/sfc/sfc_rx.c

index 7e56d14..b3c6a6c 100644 (file)
@@ -139,6 +139,8 @@ typedef unsigned int (sfc_dp_rx_qdesc_npending_t)(struct sfc_dp_rxq *dp_rxq);
 struct sfc_dp_rx {
        struct sfc_dp                           dp;
 
+       unsigned int                            features;
+#define SFC_DP_RX_FEAT_SCATTER                 0x1
        sfc_dp_rx_qcreate_t                     *qcreate;
        sfc_dp_rx_qdestroy_t                    *qdestroy;
        sfc_dp_rx_qstart_t                      *qstart;
index 7845bd8..56e48ab 100644 (file)
@@ -487,6 +487,7 @@ struct sfc_dp_rx sfc_efx_rx = {
                .type           = SFC_DP_RX,
                .hw_fw_caps     = 0,
        },
+       .features               = SFC_DP_RX_FEAT_SCATTER,
        .qcreate                = sfc_efx_rx_qcreate,
        .qdestroy               = sfc_efx_rx_qdestroy,
        .qstart                 = sfc_efx_rx_qstart,
@@ -1181,6 +1182,13 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
                rxmode->hw_strip_crc = 1;
        }
 
+       if (rxmode->enable_scatter &&
+           (~sa->dp_rx->features & SFC_DP_RX_FEAT_SCATTER)) {
+               sfc_err(sa, "Rx scatter not supported by %s datapath",
+                       sa->dp_rx->dp.name);
+               rc = EINVAL;
+       }
+
        if (rxmode->enable_lro) {
                sfc_err(sa, "LRO not supported");
                rc = EINVAL;