[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180131135356.19134-16-bjorn.topel@gmail.com>
Date: Wed, 31 Jan 2018 14:53:47 +0100
From: Björn Töpel <bjorn.topel@...il.com>
To: bjorn.topel@...il.com, magnus.karlsson@...el.com,
alexander.h.duyck@...el.com, alexander.duyck@...il.com,
john.fastabend@...il.com, ast@...com, brouer@...hat.com,
willemdebruijn.kernel@...il.com, daniel@...earbox.net,
netdev@...r.kernel.org
Cc: Björn Töpel <bjorn.topel@...el.com>,
michael.lundkvist@...csson.com, jesse.brandeburg@...el.com,
anjali.singhai@...el.com, jeffrey.b.shaw@...el.com,
ferruh.yigit@...el.com, qi.z.zhang@...el.com
Subject: [RFC PATCH 15/24] i40e: start using recycling buff_pool
From: Björn Töpel <bjorn.topel@...el.com>
Here, we start using the newly added buff_pool implementation.
Signed-off-by: Björn Töpel <bjorn.topel@...el.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 14 +++++++++++++-
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 7e82b7c6c0b7..79e48840a6bd 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -3211,6 +3211,8 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
u16 pf_q = vsi->base_queue + ring->queue_index;
struct i40e_hw *hw = &vsi->back->hw;
struct i40e_hmc_obj_rxq rx_ctx;
+ bool reserve_headroom;
+ unsigned int mtu = 0;
i40e_status err = 0;
bitmap_zero(ring->state, __I40E_RING_STATE_NBITS);
@@ -3218,7 +3220,17 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
/* clear the context structure first */
memset(&rx_ctx, 0, sizeof(rx_ctx));
- ring->bpool = i40e_buff_pool_create(ring->dev);
+ reserve_headroom = !vsi->netdev;
+
+ if (vsi->netdev) {
+ mtu = vsi->netdev->mtu;
+ reserve_headroom = !(vsi->back->flags & I40E_FLAG_LEGACY_RX);
+ } else {
+ reserve_headroom = false;
+ }
+ ring->bpool = i40e_buff_pool_recycle_create(mtu, reserve_headroom,
+ ring->dev,
+ ring->count);
ring->rx_buf_hr = (u16)bpool_buff_headroom(ring->bpool);
ring->rx_buf_len = (u16)bpool_buff_size(ring->bpool);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index aa29013acf0c..757cda5ac889 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1255,7 +1255,7 @@ void i40e_free_rx_resources(struct i40e_ring *rx_ring)
kfree(rx_ring->rx_bi);
rx_ring->rx_bi = NULL;
- i40e_buff_pool_destroy(rx_ring->bpool);
+ i40e_buff_pool_recycle_destroy(rx_ring->bpool);
rx_ring->bpool = NULL;
if (rx_ring->desc) {
--
2.14.1
Powered by blists - more mailing lists