{net, IB}/mlx5: Refactor internal SRQ API
[linux-2.6-block.git] / include / linux / mlx5 / driver.h
index 369c837d40f566827cac1fd9c0427386bcd66761..ba933335772cfa19a13fececa254c98ec8173323 100644 (file)
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/radix-tree.h>
+#include <linux/workqueue.h>
+#include <linux/interrupt.h>
 
 #include <linux/mlx5/device.h>
 #include <linux/mlx5/doorbell.h>
+#include <linux/mlx5/srq.h>
+
+enum {
+       MLX5_RQ_BITMASK_VSD = 1 << 1,
+};
 
 enum {
        MLX5_BOARD_ID_LEN = 64,
@@ -112,9 +119,12 @@ enum {
        MLX5_REG_PMPE            = 0x5010,
        MLX5_REG_PELC            = 0x500e,
        MLX5_REG_PVLC            = 0x500f,
-       MLX5_REG_PMLP            = 0, /* TBD */
+       MLX5_REG_PCMR            = 0x5041,
+       MLX5_REG_PMLP            = 0x5002,
        MLX5_REG_NODE_DESC       = 0x6001,
        MLX5_REG_HOST_ENDIANNESS = 0x7004,
+       MLX5_REG_MCIA            = 0x9014,
+       MLX5_REG_MLCR            = 0x902b,
 };
 
 enum {
@@ -304,6 +314,14 @@ struct mlx5_buf {
        u8                      page_shift;
 };
 
+struct mlx5_eq_tasklet {
+       struct list_head list;
+       struct list_head process_list;
+       struct tasklet_struct task;
+       /* lock on completion tasklet list */
+       spinlock_t lock;
+};
+
 struct mlx5_eq {
        struct mlx5_core_dev   *dev;
        __be32 __iomem         *doorbell;
@@ -317,6 +335,7 @@ struct mlx5_eq {
        struct list_head        list;
        int                     index;
        struct mlx5_rsc_debug   *dbg;
+       struct mlx5_eq_tasklet  tasklet_ctx;
 };
 
 struct mlx5_core_psv {
@@ -450,6 +469,17 @@ struct mlx5_irq_info {
        char name[MLX5_MAX_IRQ_NAME];
 };
 
+struct mlx5_fc_stats {
+       struct list_head list;
+       struct list_head addlist;
+       /* protect addlist add/splice operations */
+       spinlock_t addlist_lock;
+
+       struct workqueue_struct *wq;
+       struct delayed_work work;
+       unsigned long next_query;
+};
+
 struct mlx5_eswitch;
 
 struct mlx5_priv {
@@ -511,6 +541,10 @@ struct mlx5_priv {
        unsigned long           pci_dev_data;
        struct mlx5_flow_root_namespace *root_ns;
        struct mlx5_flow_root_namespace *fdb_root_ns;
+       struct mlx5_flow_root_namespace *esw_egress_root_ns;
+       struct mlx5_flow_root_namespace *esw_ingress_root_ns;
+
+       struct mlx5_fc_stats            fc_stats;
 };
 
 enum mlx5_device_state {
@@ -553,6 +587,9 @@ struct mlx5_core_dev {
        struct mlx5_profile     *profile;
        atomic_t                num_qps;
        u32                     issi;
+#ifdef CONFIG_RFS_ACCEL
+       struct cpu_rmap         *rmap;
+#endif
 };
 
 struct mlx5_db {
@@ -736,11 +773,10 @@ struct mlx5_cmd_mailbox *mlx5_alloc_cmd_mailbox_chain(struct mlx5_core_dev *dev,
 void mlx5_free_cmd_mailbox_chain(struct mlx5_core_dev *dev,
                                 struct mlx5_cmd_mailbox *head);
 int mlx5_core_create_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq,
-                        struct mlx5_create_srq_mbox_in *in, int inlen,
-                        int is_xrc);
+                        struct mlx5_srq_attr *in);
 int mlx5_core_destroy_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq);
 int mlx5_core_query_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq,
-                       struct mlx5_query_srq_mbox_out *out);
+                       struct mlx5_srq_attr *out);
 int mlx5_core_arm_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq,
                      u16 lwm, int is_srq);
 void mlx5_init_mkey_table(struct mlx5_core_dev *dev);