summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
diff options
context:
space:
mode:
authorTariq Toukan2017-01-18 13:28:53 +0100
committerSaeed Mahameed2017-06-22 13:30:13 +0200
commit78aedd327982ddd3cbb6ffc58f6fe0179cb6238b (patch)
tree88568429baf9707a7c503814c2f0ecd5580cefcf /drivers/net/ethernet/mellanox/mlx5/core/en_main.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff)
downloadkernel-qcow2-linux-78aedd327982ddd3cbb6ffc58f6fe0179cb6238b.tar.gz
kernel-qcow2-linux-78aedd327982ddd3cbb6ffc58f6fe0179cb6238b.tar.xz
kernel-qcow2-linux-78aedd327982ddd3cbb6ffc58f6fe0179cb6238b.zip
net/mlx5e: Build SKB with exact frag_size
Build the SKB over the receive packet instead of the whole page. Getting the SKB's linear data and shared_info closer improves locality. In addition, this opens up the possibility to make use of other parts of the page in the downstream page-reuse patch. Fixes: 1bfecfca565c ("net/mlx5e: Build RX SKB on demand") Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en_main.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_main.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 167bca50320a..c991c1e9ea1f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -639,11 +639,7 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c,
byte_count = rq->buff.wqe_sz;
/* calc the required page order */
- frag_sz = rq->rx_headroom +
- byte_count /* packet data */ +
- SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
- frag_sz = SKB_DATA_ALIGN(frag_sz);
-
+ frag_sz = MLX5_SKB_FRAG_SZ(rq->rx_headroom + byte_count);
npages = DIV_ROUND_UP(frag_sz, PAGE_SIZE);
rq->buff.page_order = order_base_2(npages);