ethdev: add new offload flag to keep CRC
[dpdk.git] / drivers / net / cxgbe / cxgbe_ethdev.c
index 3245091..a1dcf58 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "cxgbe.h"
 #include "cxgbe_pfvf.h"
+#include "cxgbe_flow.h"
 
 /*
  * Macros needed to support the PCI Device ID Table ...
@@ -353,7 +354,11 @@ int cxgbe_dev_configure(struct rte_eth_dev *eth_dev)
 
        CXGBE_FUNC_TRACE();
        configured_offloads = eth_dev->data->dev_conf.rxmode.offloads;
-       if (!(configured_offloads & DEV_RX_OFFLOAD_CRC_STRIP)) {
+
+       /* KEEP_CRC offload flag is not supported by PMD
+        * can remove the below block when DEV_RX_OFFLOAD_CRC_STRIP removed
+        */
+       if (rte_eth_dev_must_keep_crc(configured_offloads)) {
                dev_info(adapter, "can't disable hw crc strip\n");
                eth_dev->data->dev_conf.rxmode.offloads |=
                        DEV_RX_OFFLOAD_CRC_STRIP;
@@ -364,6 +369,9 @@ int cxgbe_dev_configure(struct rte_eth_dev *eth_dev)
                if (err)
                        return err;
                adapter->flags |= FW_QUEUE_BOUND;
+               err = setup_sge_ctrl_txq(adapter);
+               if (err)
+                       return err;
        }
 
        err = cfg_queue_count(eth_dev);
@@ -1036,6 +1044,7 @@ static const struct eth_dev_ops cxgbe_eth_dev_ops = {
        .rx_queue_start         = cxgbe_dev_rx_queue_start,
        .rx_queue_stop          = cxgbe_dev_rx_queue_stop,
        .rx_queue_release       = cxgbe_dev_rx_queue_release,
+       .filter_ctrl            = cxgbe_dev_filter_ctrl,
        .stats_get              = cxgbe_dev_stats_get,
        .stats_reset            = cxgbe_dev_stats_reset,
        .flow_ctrl_get          = cxgbe_flow_ctrl_get,