From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Mikityanskiy Subject: [PATCH 6/7] net/mlx5e: Remove the wrong assumption about transport offset Date: Mon, 14 Jan 2019 13:19:05 +0000 Message-ID: <20190114131841.1932-7-maximmi@mellanox.com> References: <20190114131841.1932-1-maximmi@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "netdev@vger.kernel.org" , Eran Ben Elisha , Tariq Toukan , Maxim Mikityanskiy To: "David S. Miller" , Saeed Mahameed , Willem de Bruijn , Jason Wang , Eric Dumazet Return-path: Received: from mail-eopbgr40064.outbound.protection.outlook.com ([40.107.4.64]:35733 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726538AbfANNTN (ORCPT ); Mon, 14 Jan 2019 08:19:13 -0500 In-Reply-To: <20190114131841.1932-1-maximmi@mellanox.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: skb_transport_offset() =3D=3D 0 is not a special value. The only special value is when skb->transport_header is ~0U, and it's checked by skb_transport_header_was_set(). Signed-off-by: Maxim Mikityanskiy --- drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/= ethernet/mellanox/mlx5/core/en_tx.c index 598ad7e4d5c9..563fdb1dd15e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c @@ -172,15 +172,8 @@ static inline u16 mlx5e_calc_min_inline(enum mlx5_inli= ne_modes mode, hlen +=3D VLAN_HLEN; break; case MLX5_INLINE_MODE_IP: - /* When transport header is set to zero, it means no transport - * header. When transport header is set to 0xff's, it means - * transport header wasn't set. - */ - if (skb_transport_offset(skb)) { - hlen =3D mlx5e_skb_l3_header_offset(skb); - break; - } - /* fall through */ + hlen =3D mlx5e_skb_l3_header_offset(skb); + break; case MLX5_INLINE_MODE_L2: default: hlen =3D mlx5e_skb_l2_header_offset(skb); --=20 2.19.1