mlx5: support MTU configuration
[dpdk.git] / drivers / net / mlx5 / mlx5_rxtx.h
index 1459317..b6f2128 100644 (file)
 #include "mlx5.h"
 #include "mlx5_defs.h"
 
+/* RX element (scattered packets). */
+struct rxq_elt_sp {
+       struct ibv_recv_wr wr; /* Work Request. */
+       struct ibv_sge sges[MLX5_PMD_SGE_WR_N]; /* Scatter/Gather Elements. */
+       struct rte_mbuf *bufs[MLX5_PMD_SGE_WR_N]; /* SGEs buffers. */
+};
+
 /* RX element. */
 struct rxq_elt {
        struct ibv_recv_wr wr; /* Work Request. */
@@ -78,12 +85,16 @@ struct rxq {
        struct ibv_qp *qp; /* Queue Pair. */
        struct ibv_exp_qp_burst_family *if_qp; /* QP burst interface. */
        struct ibv_exp_cq_family *if_cq; /* CQ interface. */
+       /* MAC flow steering rules. */
+       struct ibv_flow *mac_flow[MLX5_MAX_MAC_ADDRESSES];
        unsigned int port_id; /* Port ID for incoming packets. */
        unsigned int elts_n; /* (*elts)[] length. */
        unsigned int elts_head; /* Current index in (*elts)[]. */
        union {
+               struct rxq_elt_sp (*sp)[]; /* Scattered RX elements. */
                struct rxq_elt (*no_sp)[]; /* RX elements. */
        } elts;
+       unsigned int sp:1; /* Use scattered RX elements. */
        uint32_t mb_len; /* Length of a mp-issued mbuf. */
        unsigned int socket; /* CPU socket ID for allocations. */
        struct ibv_exp_res_domain *rd; /* Resource Domain. */
@@ -133,6 +144,7 @@ struct txq {
 /* mlx5_rxq.c */
 
 void rxq_cleanup(struct rxq *);
+int rxq_rehash(struct rte_eth_dev *, struct rxq *);
 int rxq_setup(struct rte_eth_dev *, struct rxq *, uint16_t, unsigned int,
              const struct rte_eth_rxconf *, struct rte_mempool *);
 int mlx5_rx_queue_setup(struct rte_eth_dev *, uint16_t, uint16_t, unsigned int,
@@ -149,6 +161,7 @@ void mlx5_tx_queue_release(void *);
 /* mlx5_rxtx.c */
 
 uint16_t mlx5_tx_burst(void *, struct rte_mbuf **, uint16_t);
+uint16_t mlx5_rx_burst_sp(void *, struct rte_mbuf **, uint16_t);
 uint16_t mlx5_rx_burst(void *, struct rte_mbuf **, uint16_t);
 uint16_t removed_tx_burst(void *, struct rte_mbuf **, uint16_t);
 uint16_t removed_rx_burst(void *, struct rte_mbuf **, uint16_t);