diff options
author | Boris Pismenny | 2018-06-30 21:14:27 +0200 |
---|---|---|
committer | Saeed Mahameed | 2018-07-24 00:01:11 +0200 |
commit | 3f44899ef2ce0c9da49feb0d6f08098a08cb96ae (patch) | |
tree | 03c85492a9c0491c2560340ad81972e62eb45ad2 /drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h | |
parent | net/mlx5e: Support offloading double vlan push/pop tc actions (diff) | |
download | kernel-qcow2-linux-3f44899ef2ce0c9da49feb0d6f08098a08cb96ae.tar.gz kernel-qcow2-linux-3f44899ef2ce0c9da49feb0d6f08098a08cb96ae.tar.xz kernel-qcow2-linux-3f44899ef2ce0c9da49feb0d6f08098a08cb96ae.zip |
net/mlx5e: Use PARTIAL_GSO for UDP segmentation
This patch removes the splitting of UDP_GSO_L4 packets in the driver,
and exposes UDP_GSO_L4 as a PARTIAL_GSO feature. Thus, the network stack
is not responsible for splitting the packet into two.
Signed-off-by: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h index 39a5d13ba459..1dd225380a66 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h @@ -38,14 +38,22 @@ #include <linux/netdevice.h> #include "en_accel/ipsec_rxtx.h" #include "en_accel/tls_rxtx.h" -#include "en_accel/rxtx.h" #include "en.h" -static inline struct sk_buff *mlx5e_accel_handle_tx(struct sk_buff *skb, - struct mlx5e_txqsq *sq, - struct net_device *dev, - struct mlx5e_tx_wqe **wqe, - u16 *pi) +static inline void +mlx5e_udp_gso_handle_tx_skb(struct sk_buff *skb) +{ + int payload_len = skb_shinfo(skb)->gso_size + sizeof(struct udphdr); + + udp_hdr(skb)->len = htons(payload_len); +} + +static inline struct sk_buff * +mlx5e_accel_handle_tx(struct sk_buff *skb, + struct mlx5e_txqsq *sq, + struct net_device *dev, + struct mlx5e_tx_wqe **wqe, + u16 *pi) { #ifdef CONFIG_MLX5_EN_TLS if (test_bit(MLX5E_SQ_STATE_TLS, &sq->state)) { @@ -63,11 +71,8 @@ static inline struct sk_buff *mlx5e_accel_handle_tx(struct sk_buff *skb, } #endif - if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) { - skb = mlx5e_udp_gso_handle_tx_skb(dev, sq, skb, wqe, pi); - if (unlikely(!skb)) - return NULL; - } + if (skb_is_gso(skb) && skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) + mlx5e_udp_gso_handle_tx_skb(skb); return skb; } |