[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190627220836.2572684-2-jonathan.lemon@gmail.com>
Date: Thu, 27 Jun 2019 15:08:31 -0700
From: Jonathan Lemon <jonathan.lemon@...il.com>
To: <netdev@...r.kernel.org>, <bjorn.topel@...el.com>,
<magnus.karlsson@...el.com>, <saeedm@...lanox.com>,
<maximmi@...lanox.com>, <brouer@...hat.com>
CC: <kernel-team@...com>
Subject: [PATCH 1/6 bpf-next] Have xsk_umem_peek_addr_rq() return chunk-aligned handles.
xkq_peek_addr() returns chunk-aligned handles, so have the rq behave
the same way. Clean up callsites.
Signed-off-by: Jonathan Lemon <jonathan.lemon@...il.com>
---
drivers/net/ethernet/intel/i40e/i40e_xsk.c | 2 --
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 2 --
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c | 2 +-
include/net/xdp_sock.h | 2 +-
4 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
index 32bad014d76c..3b84fca1c11d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
@@ -289,8 +289,6 @@ static bool i40e_alloc_buffer_slow_zc(struct i40e_ring *rx_ring,
return false;
}
- handle &= rx_ring->xsk_umem->chunk_mask;
-
hr = umem->headroom + XDP_PACKET_HEADROOM;
bi->dma = xdp_umem_get_dma(umem, handle);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
index 6b609553329f..a9cab3271ac9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
@@ -293,8 +293,6 @@ static bool ixgbe_alloc_buffer_slow_zc(struct ixgbe_ring *rx_ring,
return false;
}
- handle &= rx_ring->xsk_umem->chunk_mask;
-
hr = umem->headroom + XDP_PACKET_HEADROOM;
bi->dma = xdp_umem_get_dma(umem, handle);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c
index 6a55573ec8f2..85440b1c1c3f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c
@@ -44,7 +44,7 @@ int mlx5e_xsk_page_alloc_umem(struct mlx5e_rq *rq,
static inline void mlx5e_xsk_recycle_frame(struct mlx5e_rq *rq, u64 handle)
{
- xsk_umem_fq_reuse(rq->umem, handle & rq->umem->chunk_mask);
+ xsk_umem_fq_reuse(rq->umem, handle);
}
/* XSKRQ uses pages from UMEM, they must not be released. They are returned to
diff --git a/include/net/xdp_sock.h b/include/net/xdp_sock.h
index 057b159ff8b9..39516d960636 100644
--- a/include/net/xdp_sock.h
+++ b/include/net/xdp_sock.h
@@ -117,7 +117,7 @@ static inline u64 *xsk_umem_peek_addr_rq(struct xdp_umem *umem, u64 *addr)
if (!rq->length)
return xsk_umem_peek_addr(umem, addr);
- *addr = rq->handles[rq->length - 1];
+ *addr = rq->handles[rq->length - 1] & umem->chunk_mask;
return addr;
}
--
2.17.1
Powered by blists - more mailing lists