[1/8] net/nfp: reuse the ring buffer struct
Checks
Commit Message
Reuse the ring buffer struct, make the code more readable.
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
drivers/net/nfp/flower/nfp_flower.c | 2 +-
drivers/net/nfp/flower/nfp_flower_ctrl.c | 2 +-
drivers/net/nfp/nfp_rxtx.c | 4 ++--
drivers/net/nfp/nfp_rxtx.h | 14 ++++++--------
4 files changed, 10 insertions(+), 12 deletions(-)
@@ -320,7 +320,7 @@ nfp_flower_pf_recv_pkts(void *rx_queue,
struct nfp_net_hw *hw;
struct rte_mbuf *new_mb;
struct nfp_net_rxq *rxq;
- struct nfp_net_rx_buff *rxb;
+ struct nfp_net_dp_buf *rxb;
struct nfp_net_rx_desc *rxds;
struct nfp_flower_representor *repr;
@@ -30,7 +30,7 @@ nfp_flower_ctrl_vnic_recv(void *rx_queue,
struct nfp_net_hw *hw;
struct nfp_net_rxq *rxq;
struct rte_mbuf *new_mb;
- struct nfp_net_rx_buff *rxb;
+ struct nfp_net_dp_buf *rxb;
struct nfp_net_rx_desc *rxds;
rxq = rx_queue;
@@ -28,7 +28,7 @@
static int
nfp_net_rx_fill_freelist(struct nfp_net_rxq *rxq)
{
- struct nfp_net_rx_buff *rxe = rxq->rxbufs;
+ struct nfp_net_dp_buf *rxe = rxq->rxbufs;
uint64_t dma_addr;
unsigned int i;
@@ -371,7 +371,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
{
struct nfp_net_rxq *rxq;
struct nfp_net_rx_desc *rxds;
- struct nfp_net_rx_buff *rxb;
+ struct nfp_net_dp_buf *rxb;
struct nfp_net_hw *hw;
struct rte_mbuf *mb;
struct rte_mbuf *new_mb;
@@ -98,6 +98,10 @@ struct nfp_meta_parsed {
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
+struct nfp_net_dp_buf {
+ struct rte_mbuf *mbuf;
+};
+
struct nfp_net_txq {
struct nfp_net_hw *hw; /* Backpointer to nfp_net structure */
@@ -128,9 +132,7 @@ struct nfp_net_txq {
* For each descriptor keep a reference to the mbuf and
* DMA address used until completion is signalled.
*/
- struct {
- struct rte_mbuf *mbuf;
- } *txbufs;
+ struct nfp_net_dp_buf *txbufs;
/*
* Information about the host side queue location. @txds is
@@ -210,10 +212,6 @@ struct nfp_net_rx_desc {
};
};
-struct nfp_net_rx_buff {
- struct rte_mbuf *mbuf;
-};
-
struct nfp_net_rxq {
struct nfp_net_hw *hw; /* Backpointer to nfp_net structure */
@@ -238,7 +236,7 @@ struct nfp_net_rxq {
* For each buffer placed on the freelist, record the
* associated SKB
*/
- struct nfp_net_rx_buff *rxbufs;
+ struct nfp_net_dp_buf *rxbufs;
/*
* Information about the host side queue location. @rxds is