From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1B49C43381 for ; Thu, 21 Feb 2019 12:40:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 636362086A for ; Thu, 21 Feb 2019 12:40:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="hJzAodgl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726199AbfBUMkB (ORCPT ); Thu, 21 Feb 2019 07:40:01 -0500 Received: from mail-eopbgr140083.outbound.protection.outlook.com ([40.107.14.83]:41701 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725385AbfBUMkA (ORCPT ); Thu, 21 Feb 2019 07:40:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IS2MkN75inXjWHXiJb+Vy160w05iaB3VO4obIiwSErk=; b=hJzAodglkP3/3SSd8gMGBkEUe5AvQEI4w0hZ3Iaw6TLYF9JSD48+9dQnjKdq05j5dUz5ufY+w4bPeRqpZoAPASQCa2r6h5fYHnQoDYUcxQi/C3471/VuCnflCmjt2qO3c8+mN5IPq8gQcf1B+Ghjoc7GPauvty5zxmzoEOXWAB0= Received: from AM6PR05MB5879.eurprd05.prod.outlook.com (20.179.0.76) by AM6PR05MB5490.eurprd05.prod.outlook.com (20.177.117.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.15; Thu, 21 Feb 2019 12:39:56 +0000 Received: from AM6PR05MB5879.eurprd05.prod.outlook.com ([fe80::98c7:b5be:ac6b:144]) by AM6PR05MB5879.eurprd05.prod.outlook.com ([fe80::98c7:b5be:ac6b:144%5]) with mapi id 15.20.1643.014; Thu, 21 Feb 2019 12:39:56 +0000 From: Maxim Mikityanskiy To: "David S. Miller" , Saeed Mahameed , Willem de Bruijn , Jason Wang , Eric Dumazet CC: "netdev@vger.kernel.org" , Eran Ben Elisha , Tariq Toukan , Maxim Mikityanskiy Subject: [PATCH net-next v2 0/7] AF_PACKET transport_offset fix Thread-Topic: [PATCH net-next v2 0/7] AF_PACKET transport_offset fix Thread-Index: AQHUyeKMAuARvCaFYUOs7RZ1VGetFg== Date: Thu, 21 Feb 2019 12:39:55 +0000 Message-ID: <20190221123908.7196-1-maximmi@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LNXP265CA0070.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5d::34) To AM6PR05MB5879.eurprd05.prod.outlook.com (2603:10a6:20b:a2::12) authentication-results: spf=none (sender IP is ) smtp.mailfrom=maximmi@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.19.1 x-originating-ip: [141.226.120.58] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 779e7f02-2c10-433d-b77e-08d697f9aed0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM6PR05MB5490; x-ms-traffictypediagnostic: AM6PR05MB5490: x-ms-exchange-purlcount: 1 x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1;AM6PR05MB5490;23:59T5C5BiqmIPKKXYYO7/3I0yHTgzDrmUso6IpYq?= =?iso-8859-1?Q?BqO84WjzZ2p+bK3/bUJ/HswJR03UbNM8Iy7hYAJ2D3oQJmFjrH8g5sHFyb?= =?iso-8859-1?Q?H3Ef5etmVY0G3kccaXAg00YlvnKbONfK7xrUM2kB1shsZzLiXNwPINhxGD?= =?iso-8859-1?Q?oaK467Uo5HFcWm44KqmC/bXo9sRrtfjju5O3TO5IdhTFoeApRD2gqOzh1x?= =?iso-8859-1?Q?b7gZjDwvcx3rjCfBRCwMK58y7o8QQw3gAi5v1MxRd+Sz9oh/0zIENCLuLc?= =?iso-8859-1?Q?6KLTv4N5j1kkk576owC991pVDu8MVsMOf6GuMDEGqeQalihrv1wrD3jmPi?= =?iso-8859-1?Q?cr8OTwm3qe+22Y9yHdDbXzu8+Ofw/MvdzzyHDUvhJkKk245lcJOjbtRoF3?= =?iso-8859-1?Q?ycsd++70SL8xd/3eIoQ/1BXsmEzwzcQnapv7KiusOd4dghkTp1t28URjiQ?= =?iso-8859-1?Q?mKL1fARjXn/uC+SsI9UfRWGPKtDXLME/L04SL1wM+WZ7Q/ubchZoKoKu7U?= =?iso-8859-1?Q?UiLagKyoGnfMS9dQvg6IBmactbghAF+At3FIfhjMJR9KKfXW25SMbwchCx?= =?iso-8859-1?Q?Ad/uiFz+XhLqIAGJsGND4r41U44ziaDVUd5+O1Xi0nw9llNIus0neNCABF?= =?iso-8859-1?Q?ERb7gXXOYqj8zJUSlrHYOHRQ6cXf5TJOVRtsZb0G7fyKg75RyFwaYaCg2b?= =?iso-8859-1?Q?05QhaAW81UB4ffo/xljSxshdT9qUIhxH3kjbEKCjNjh/praQpJrO3O0cAT?= =?iso-8859-1?Q?MoAEaZLY4xQiuu9qa60Ex2VbMJJGSSJae+dQB7+i6bPMZhNnISCEnEXXKv?= =?iso-8859-1?Q?+JvBff4FRrsvX4VPV1e4hg9SVq9h3YPCIVZXy+MwhJMMUdh4qwM8NkBwam?= =?iso-8859-1?Q?ZspoeEYyhpr10OveZnXbzn8OdIVvNTB//6f18jZ0HBF+bjP9d+JAPL9ZOm?= =?iso-8859-1?Q?Hf32Ket3lEsxJ2rcB8EzM9KDpxN9Kf8wHi9MnhfYtHTkL3pCY0H4VOzFxk?= =?iso-8859-1?Q?J1ACW9nZZ93ZrqSSCOrc2pq8xZRH+quzPPcdS4SMTwzkNxGe15vy8Vd7fB?= =?iso-8859-1?Q?E4bS6rBgCbNfCd+n0RRUPThrslUalDE/oCplweXJCP2RYKxlc408oFGDAX?= =?iso-8859-1?Q?k38XmSbsrlPyJxq+JOErhpg9sX8ewwWQRbvzsAuXV7OuDrIQIQ4ehZZ8xX?= =?iso-8859-1?Q?XIay3TenC0K2OkBNtNyG5dtwcCnNtHiVAE/knZ2sSkRID0o7h/6uQs56UE?= =?iso-8859-1?Q?QMyTG8fmIYuC+RzOl?= x-microsoft-antispam-prvs: x-forefront-prvs: 09555FB1AD x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(366004)(39860400002)(376002)(136003)(346002)(199004)(189003)(107886003)(66066001)(966005)(36756003)(68736007)(105586002)(53936002)(4326008)(106356001)(2906002)(25786009)(476003)(6506007)(486006)(102836004)(1076003)(386003)(2616005)(7736002)(97736004)(305945005)(26005)(186003)(86362001)(110136005)(5660300002)(256004)(6116002)(316002)(54906003)(99286004)(8676002)(81156014)(81166006)(6512007)(3846002)(6306002)(6436002)(6486002)(478600001)(14454004)(71200400001)(71190400001)(8936002)(50226002)(52116002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR05MB5490;H:AM6PR05MB5879.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: +XOtd8MVX7jZwuX0kqFS558PsnNq9z3ZnE9r5kRyd4Pn8LpviZ1w2JKa6z9YOxpTeUgKXvWCcCtklPqvSjkAzuKO135+XGX8uUCgRriZzHv+6ccWV9d7yUu9pCdkqdEfPvawYnnzqMeBI7+tMVMOUKAxydykRuoooYs58sq2dxqnNgEXD46HwyZwZk2uTvM3uPuJDmdZ9CkxE0GfT4w65IvuLjsvyXmSGm8g4KZMqjTC+tXl3WGOPF4fO86dhbHtbs4x6gMXEviyd0/Ja2UPOpYiyvLtNCGk1dSvkxmBvEJu4jl3k6BuEOJFdvjQVo9CUFpuvKgyVYT6L2JqGyC8x7Ii6rQmXO4iC5p6AHTLxWViTmlRHZGVRBJuJAW/uCXXxfyrw9/PQOx0sRCcmZhGB+/yenjCTI3DIWEKmp4Oex4= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 779e7f02-2c10-433d-b77e-08d697f9aed0 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2019 12:39:54.6392 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5490 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch series contains the implementation of the RFC that was posted on this mailing list previously: https://www.spinics.net/lists/netdev/msg541709.html It fixes having incorrect skb->transport_header values in cases when dissect fails. Having correct values set by the kernel fixes mlx5 operation and allows to remove some unnecessary code flows in mlx5. v2 changes: - Rebase against the fresh net-next. - Don't return bool from skb_probe_transport_header (and don't rename the function). - WARN_ON_ONCE and error path in case of GSO without the L4 header. Maxim Mikityanskiy (7): net: Don't set transport offset to invalid value net: Introduce parse_protocol header_ops callback net/ethernet: Add parse_protocol header_ops support net/packet: Ask driver for protocol if not provided by user net/packet: Remove redundant skb->protocol set net/mlx5e: Remove the wrong assumption about transport offset net/mlx5e: Trust kernel regarding transport offset .../net/ethernet/mellanox/mlx5/core/en_tx.c | 15 ++--------- drivers/net/tap.c | 4 +-- drivers/net/tun.c | 4 +-- drivers/net/xen-netback/netback.c | 15 ++++++++--- include/linux/etherdevice.h | 1 + include/linux/netdevice.h | 10 +++++++ include/linux/skbuff.h | 5 +--- include/linux/virtio_net.h | 2 +- net/ethernet/eth.c | 13 ++++++++++ net/packet/af_packet.c | 26 +++++++++---------- 10 files changed, 56 insertions(+), 39 deletions(-) --=20 2.19.1