net/bnxt: refactor async event handling
[dpdk.git] / drivers / net / mlx4 / mlx4_flow.c
index 793f0b0..71ea91b 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <rte_byteorder.h>
 #include <rte_errno.h>
-#include <rte_ethdev_driver.h>
+#include <ethdev_driver.h>
 #include <rte_ether.h>
 #include <rte_flow.h>
 #include <rte_flow_driver.h>
@@ -791,7 +791,8 @@ fill:
                        rss = action->conf;
                        /* Default RSS configuration if none is provided. */
                        if (rss->key_len) {
-                               rss_key = rss->key;
+                               rss_key = rss->key ?
+                                         rss->key : mlx4_rss_hash_key_default;
                                rss_key_len = rss->key_len;
                        } else {
                                rss_key = mlx4_rss_hash_key_default;
@@ -980,12 +981,13 @@ mlx4_drop_get(struct mlx4_priv *priv)
        priv->drop = drop;
        return drop;
 error:
-       if (drop->qp)
-               claim_zero(mlx4_glue->destroy_qp(drop->qp));
-       if (drop->cq)
-               claim_zero(mlx4_glue->destroy_cq(drop->cq));
-       if (drop)
+       if (drop) {
+               if (drop->qp)
+                       claim_zero(mlx4_glue->destroy_qp(drop->qp));
+               if (drop->cq)
+                       claim_zero(mlx4_glue->destroy_cq(drop->cq));
                rte_free(drop);
+       }
        rte_errno = ENOMEM;
        return NULL;
 }
@@ -1589,37 +1591,19 @@ static const struct rte_flow_ops mlx4_flow_ops = {
 };
 
 /**
- * Manage filter operations.
+ * Get rte_flow callbacks.
  *
  * @param dev
  *   Pointer to Ethernet device structure.
- * @param filter_type
- *   Filter type.
- * @param filter_op
- *   Operation to perform.
- * @param arg
+ * @param ops
  *   Pointer to operation-specific structure.
  *
- * @return
- *   0 on success, negative errno value otherwise and rte_errno is set.
+ * @return 0
  */
 int
-mlx4_filter_ctrl(struct rte_eth_dev *dev,
-                enum rte_filter_type filter_type,
-                enum rte_filter_op filter_op,
-                void *arg)
+mlx4_flow_ops_get(struct rte_eth_dev *dev __rte_unused,
+                 const struct rte_flow_ops **ops)
 {
-       switch (filter_type) {
-       case RTE_ETH_FILTER_GENERIC:
-               if (filter_op != RTE_ETH_FILTER_GET)
-                       break;
-               *(const void **)arg = &mlx4_flow_ops;
-               return 0;
-       default:
-               ERROR("%p: filter type (%d) not supported",
-                     (void *)dev, filter_type);
-               break;
-       }
-       rte_errno = ENOTSUP;
-       return -rte_errno;
+       *ops = &mlx4_flow_ops;
+       return 0;
 }