summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
diff options
context:
space:
mode:
authorMaxim Mikityanskiy2019-06-26 16:35:35 +0200
committerDaniel Borkmann2019-06-27 22:53:28 +0200
commita011b49f4ed7813777a15da12a426ab939c58f14 (patch)
tree1d8529bdc872a9bae18caa591604f7c11b82752b /drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
parentnet/mlx5e: XDP_TX from UMEM support (diff)
downloadkernel-qcow2-linux-a011b49f4ed7813777a15da12a426ab939c58f14.tar.gz
kernel-qcow2-linux-a011b49f4ed7813777a15da12a426ab939c58f14.tar.xz
kernel-qcow2-linux-a011b49f4ed7813777a15da12a426ab939c58f14.zip
net/mlx5e: Consider XSK in XDP MTU limit calculation
Use the existing mlx5e_get_linear_rq_headroom function to calculate the headroom for mlx5e_xdp_max_mtu. This function takes the XSK headroom into consideration, which will be used in the following patches. Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com> Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Acked-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
index 1364bdff702c..ee99efde9143 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
@@ -32,10 +32,11 @@
#include <linux/bpf_trace.h>
#include "en/xdp.h"
+#include "en/params.h"
-int mlx5e_xdp_max_mtu(struct mlx5e_params *params)
+int mlx5e_xdp_max_mtu(struct mlx5e_params *params, struct mlx5e_xsk_param *xsk)
{
- int hr = NET_IP_ALIGN + XDP_PACKET_HEADROOM;
+ int hr = mlx5e_get_linear_rq_headroom(params, xsk);
/* Let S := SKB_DATA_ALIGN(sizeof(struct skb_shared_info)).
* The condition checked in mlx5e_rx_is_linear_skb is: