X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fionic%2Fionic_lif.h;h=96522c544a7ea21e097f9a12dabed611b8538e4c;hb=01a6c311df2fa78928d46eb9bf4f2658a3cc08ee;hp=6e3233d1d62de31bb7f5c293ed4c36937be16a61;hpb=c67719e133f767451b16d6c13bd857bc09d0a2a9;p=dpdk.git diff --git a/drivers/net/ionic/ionic_lif.h b/drivers/net/ionic/ionic_lif.h index 6e3233d1d6..96522c544a 100644 --- a/drivers/net/ionic/ionic_lif.h +++ b/drivers/net/ionic/ionic_lif.h @@ -13,6 +13,26 @@ #include "ionic_osdep.h" #include "ionic_dev.h" +#define IONIC_ADMINQ_LENGTH 16 /* must be a power of two */ + +#define IONIC_QCQ_F_INITED BIT(0) +#define IONIC_QCQ_F_SG BIT(1) +#define IONIC_QCQ_F_INTR BIT(2) + +/* Queue / Completion Queue */ +struct ionic_qcq { + struct ionic_queue q; /**< Queue */ + struct ionic_cq cq; /**< Completion Queue */ + struct ionic_lif *lif; /**< LIF */ + struct rte_mempool *mb_pool; /**< mbuf pool to populate the RX ring */ + const struct rte_memzone *base_z; + void *base; + rte_iova_t base_pa; + uint32_t total_size; + uint32_t flags; + struct ionic_intr_info intr; +}; + #define IONIC_LIF_F_INITED BIT(0) #define IONIC_LIF_NAME_MAX_SZ (32) @@ -25,6 +45,9 @@ struct ionic_lif { uint32_t hw_index; uint32_t state; uint32_t kern_pid; + rte_spinlock_t adminq_lock; + rte_spinlock_t adminq_service_lock; + struct ionic_qcq *adminqcq; struct ionic_doorbell __iomem *kern_dbpage; char name[IONIC_LIF_NAME_MAX_SZ]; uint32_t info_sz; @@ -47,4 +70,17 @@ int ionic_lif_start(struct ionic_lif *lif); int ionic_lif_configure(struct ionic_lif *lif); void ionic_lif_reset(struct ionic_lif *lif); +int ionic_intr_alloc(struct ionic_lif *lif, struct ionic_intr_info *intr); +void ionic_intr_free(struct ionic_lif *lif, struct ionic_intr_info *intr); + +bool ionic_adminq_service(struct ionic_cq *cq, uint32_t cq_desc_index, + void *cb_arg); +int ionic_qcq_service(struct ionic_qcq *qcq, int budget, ionic_cq_cb cb, + void *cb_arg); + +void ionic_qcq_free(struct ionic_qcq *qcq); + +int ionic_qcq_enable(struct ionic_qcq *qcq); +int ionic_qcq_disable(struct ionic_qcq *qcq); + #endif /* _IONIC_LIF_H_ */