net/sfc: implement representor Rx
[dpdk.git] / drivers / net / sfc / sfc_repr.c
index fc3229a..64753f2 100644 (file)
@@ -160,6 +160,16 @@ sfc_repr_tx_queue_stop(void *queue)
        rte_ring_reset(txq->ring);
 }
 
+static uint16_t
+sfc_repr_rx_burst(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
+{
+       struct sfc_repr_rxq *rxq = rx_queue;
+       void **objs = (void *)&rx_pkts[0];
+
+       /* mbufs port is already filled correctly by representors proxy */
+       return rte_ring_sc_dequeue_burst(rxq->ring, objs, nb_pkts, NULL);
+}
+
 static uint16_t
 sfc_repr_tx_burst(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 {
@@ -803,6 +813,7 @@ sfc_repr_dev_close(struct rte_eth_dev *dev)
 
        (void)sfc_repr_proxy_del_port(srs->pf_port_id, srs->repr_id);
 
+       dev->rx_pkt_burst = NULL;
        dev->tx_pkt_burst = NULL;
        dev->dev_ops = NULL;
 
@@ -924,6 +935,7 @@ sfc_repr_eth_dev_init(struct rte_eth_dev *dev, void *init_params)
                goto fail_mac_addrs;
        }
 
+       dev->rx_pkt_burst = sfc_repr_rx_burst;
        dev->tx_pkt_burst = sfc_repr_tx_burst;
        dev->dev_ops = &sfc_repr_dev_ops;