From patchwork Sat May 30 04:26:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 218151 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, 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 9B23EC433DF for ; Sat, 30 May 2020 04:26:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 786BD20715 for ; Sat, 30 May 2020 04:26:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="NhZRRRab" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725924AbgE3E0z (ORCPT ); Sat, 30 May 2020 00:26:55 -0400 Received: from mail-eopbgr130058.outbound.protection.outlook.com ([40.107.13.58]:61765 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725823AbgE3E0y (ORCPT ); Sat, 30 May 2020 00:26:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QbHU0qNqE5JdIh/mcvrReMr+8IXAY/p7AioArXzCoWs0bz4rIGxYy7d2EQe2pQJ2f0txTypABiOcXaZKyppzBp7LUQLCEqfcYYSihVKIoicMOWXRiqpqdGv4N10PTIdINid2wTd7m4eD7wR9qWnkCcuFHpo42YYlXpramGrr0JlP6Sn0fkjYryOuEqNDcyFy7yrrzxsD/rS8V0diDi5yEq9CMtjyC10g5SNLPDeeWTeI+RNedJc4Kp42QBiBY6fxyKq4xX7ADbr4Q44l7+8XfbG76OTJE6Ymggt7F46sctNpXOLvsXeyEzkVEou9jENQCHpXj5Ac4xYO3X6/r0XnqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hvdwobTABJU6EMF+nXn05OmjHQ3yMSzQII8TtC5yZ8w=; b=d0ECFqtV6pK/QqS1uuKeedfouNxHIA7VoUZz/TnKnLguEDCY0NZhV6PTrdNsnuvh88gEuRhxyR0fA9m9WklUZgXIbiUyIeTiEyA+67+JjzIWG8LCPyEuKzBJi7Kd72IVkhSfFCXucDI6aAHF/QUBZSWnUUP5AgWhjoBljZTJFSzgUNzJ7Dr6Ydq5s02LN4cssPcfhObYJj5GNMjUxFnAlMgAYi/1gEs8joBFe457qqJa6CSGJm6XZZhJ390D5GTEB3pr6ITXF/j/PIp39kg3nhf8kdTxI/+Glggm5ePTzvpkA1Ag/gmanslx1ZNXC5/xksJIRKtCHb7wvZKgbnJCeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=hvdwobTABJU6EMF+nXn05OmjHQ3yMSzQII8TtC5yZ8w=; b=NhZRRRaby1gFErQ6+ark1XNxm55SeNH7X7Hn6vcJrodyPyRwSmpmpZjCBpyn2UfJ3lxn8TzJ+T3l8oAuXK7VyMh5AEwXlkd3+9/zHYL/xwh257pdu96WUYJz6rbiiQpKC3PRgWqOZXsh/lJbJ0sRouU0KlSMJxyXjdcPkEQb8gA= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB3408.eurprd05.prod.outlook.com (2603:10a6:802:1e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.18; Sat, 30 May 2020 04:26:49 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c%2]) with mapi id 15.20.3045.018; Sat, 30 May 2020 04:26:49 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Jesper Dangaard Brouer , David Ahern , David Ahern , Saeed Mahameed Subject: [net-next 01/15] mlx5: fix xdp data_meta setup in mlx5e_fill_xdp_buff Date: Fri, 29 May 2020 21:26:12 -0700 Message-Id: <20200530042626.15837-2-saeedm@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200530042626.15837-1-saeedm@mellanox.com> References: <20200530042626.15837-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.7 via Frontend Transport; Sat, 30 May 2020 04:26:47 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7d86b16b-c5f7-4c10-57dd-08d80451aba8 X-MS-TrafficTypeDiagnostic: VI1PR05MB3408: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 041963B986 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3GD6PqQL5rVB3e4Hz4rj5rEPe6+dzHql8B+wQXJIE9qqca2Z+TIuGumByvy/9lIOAj7VyMImGCQCTRT/lIE4y94qq5bZRllnf6XAgOIWp6MQyXDFzYRKe5r89SSBlQnN3tvKyxpjJOcArpebxE3y/3Yov0GG84N3Her18fKttcm7i+6TMvop5lb6XWz+zACkdsOLnwowJ5voFR39fj38qn4MZaGGtsCo0+4st4CFzpVnCBxL3Snm/iAi8mUwyzQ7J+YzuNp0gNuMe40SlaVFfTEZOg1eRspVwAFpQCSlj3tk2obM6lSWRKSeFOX1mGloPvSpXyOqWL8QpOmpNDwWhyHuDySUgnIITVe9VxBu6vj+8yLUFCb5UwQBBOEuNkdd X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5102.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(366004)(52116002)(5660300002)(6666004)(107886003)(186003)(66476007)(26005)(16526019)(66946007)(478600001)(1076003)(8676002)(4326008)(6486002)(66556008)(2906002)(956004)(86362001)(6512007)(83380400001)(316002)(6506007)(36756003)(2616005)(8936002)(54906003)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: SLxP7OC6nWmiyaova1WJ4/2rakQoWwebUCXZ4M2TGZfPMnOGiQ8V8yZ9zFtubM4DSyHY9mMmkPUMXBWKUmX/O+l7jIqrpYJ89OVVP/vXXT5NgJRkBqGiBcuMVZxV73kvOVgN6BChGS6VEJWYdYAN8wzSzafXEaW5/t2TV4fOeP1tiePgjq0Z+OIxT3zj6wzGDQXlRP1OtZjeqTqIC38UZ1MHVeN1bNB6PVN05Ts0eLdOHJwvUcurOOX3NACNMZ1bgoXJQBi/uRMRVdlkQLjshoyGuNk1g47IbuwpoBSl9TP2hncph5h3demrhwkW3NUD1EG+DggbYILwwfxr0MipSnh3JPfOVPd7/mGEXZrpPAt9nTkwZlO0vMJOmV7AWHoF/NWS0t3bgUeGsNe9sSHhLsyXFZL4Tqcy/4cpoUAssipZl+ydHsJLmCsR9bqoBIiYY1NfJUPTkIVn09V9yi/6eo+vY3oSIUbonXkVWhfGzkE= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d86b16b-c5f7-4c10-57dd-08d80451aba8 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2020 04:26:49.5531 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jVsYBwTjunblNrIFKaSjMX4GXxrnO3T9EzYCd+xeCbQfZKCnQC3ItLEF1wapbRIoDrJUVt1fgK1dYQpemY5v4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3408 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jesper Dangaard Brouer The helper function xdp_set_data_meta_invalid() must be called after setting xdp->data as it depends on it. The bug was introduced in the cited patch below, and cause the kernel to crash when using BPF helper bpf_xdp_adjust_head() on mlx5 driver. Fixes: 39d6443c8daf ("mlx5, xsk: Migrate to new MEM_TYPE_XSK_BUFF_POOL") Reported-by: David Ahern Signed-off-by: Jesper Dangaard Brouer Tested-by: David Ahern Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 6b3c82da199ce..dbb1c63239672 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -1056,8 +1056,8 @@ static void mlx5e_fill_xdp_buff(struct mlx5e_rq *rq, void *va, u16 headroom, u32 len, struct xdp_buff *xdp) { xdp->data_hard_start = va; - xdp_set_data_meta_invalid(xdp); xdp->data = va + headroom; + xdp_set_data_meta_invalid(xdp); xdp->data_end = xdp->data + len; xdp->rxq = &rq->xdp_rxq; xdp->frame_sz = rq->buff.frame0_sz; From patchwork Sat May 30 04:26:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 218150 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, 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 75636C433E1 for ; Sat, 30 May 2020 04:26:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51169206EB for ; Sat, 30 May 2020 04:26:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="KWZvFSdY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725992AbgE3E06 (ORCPT ); Sat, 30 May 2020 00:26:58 -0400 Received: from mail-eopbgr130058.outbound.protection.outlook.com ([40.107.13.58]:61765 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725889AbgE3E05 (ORCPT ); Sat, 30 May 2020 00:26:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E8Ny1lZqzzLIueggc+JthJCxfaMMk04qcG2idkUtEM6aCEi8bnL7kGsSMETlnvynXlZyv/J8v3IDkEzxgARSY7P8xWP40b56wGjNJ3PbCHoh4SXQ4/PdTAqi+DG5qD8aPH1t6qhwAGZ72l4PUTWgTfrkSitVo7iVDB0/M+IL/OjoAAHETAHWNN9lfbjHUohHNmWS3Uo/wncDH6Nb8wkqkvOJ7rjh8tLp6bqH9e8XHPB53GdvhpFRODdDqsq75EaYZBR9DQY4O9bgtsJBCL6vK+40kfHV8aqmc83nGjTq/TsxmzusSV/JZL8hTZiKv1FsIsKWnjJTLLIic471Y8ielg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8ymRM/Ii5nLKWGxLqUlFdR+kFBEB47GBtoZb8RenGUg=; b=POSgz7Pi/egH7mrXyijFTX88Ij1LwrFHqtVLyWV1jcqC5ASpyg63tHsirH5Gut5UVWb53n2WzDcDeQ9oHnHhA7iyNJ23PqllHB6179PM33lp0MkotgXvE0KBOZdw8O/eM6bBKPFKf38YU2EkXgUtky2PXeFOHppNZnR3cxSrxpcWbtPT5+D3rnwmqLVnOaLaBesLst1ClI8lRT3YTjwWRXRgG17ZMpR7NTP1oL5MO5rrvXIMH8dhQ0xi7lfF+XA/0ZME/0qpy8Sb5ZSgWMKYdprd1Z6MxVXKpXeHHCq8q0xX5FM3LUaW9vtYIkAnnjgiZbpdK2eWmNvblRI2DkJvBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=8ymRM/Ii5nLKWGxLqUlFdR+kFBEB47GBtoZb8RenGUg=; b=KWZvFSdY22xtCDeB0OyvEButETnXxMJGC+tpta+ISi7eZWxzzwVN5mpjbJoXHqUU/Rzb55Q+7r7JtN/LG6zD403kXenwSoekE3gmjuQw5kV1BayyTQev4OudZxtZ+4Yja8bFf8c/Zd5QihaPLCdiyFR38iFkKC9pRoP+MkXAF/Q= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB3408.eurprd05.prod.outlook.com (2603:10a6:802:1e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.18; Sat, 30 May 2020 04:26:51 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c%2]) with mapi id 15.20.3045.018; Sat, 30 May 2020 04:26:51 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Saeed Mahameed , Marcelo Ricardo Leitner Subject: [net-next 02/15] net/mlx5: Kconfig: Fix spelling typo Date: Fri, 29 May 2020 21:26:13 -0700 Message-Id: <20200530042626.15837-3-saeedm@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200530042626.15837-1-saeedm@mellanox.com> References: <20200530042626.15837-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.7 via Frontend Transport; Sat, 30 May 2020 04:26:49 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 133c891f-af26-4bdf-6062-08d80451acde X-MS-TrafficTypeDiagnostic: VI1PR05MB3408: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-Forefront-PRVS: 041963B986 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +4QijyOvHE6qaNJFWiQfcksyAnDelaHUsmzYRk7TVHNWI87v38lGk80GMTdgRy70tEO+cGQwOShn3H0NRtPVLasaMCnIL2NCSIVUvHXGTpFSfpdokOR7ehS1GkgYLMt9+W1GVibDCVCKLzThzcJmFXp7lgjvl8noaVbSnHcL+Aq0x/zImxkN8iGOBTuMKB79dKO6pO/EZLyd63xI27UYsBoD1GG5UAFB2VlL9GnV+g3zM2IZCUP4ec05zjJihdArFc4Aj+MGhxiZKQQoQ0Q8IVik/GyHKnWFerrgyBPnCTkyJ/CuM+xOpG1W1Wxw73K9mHNmLQ2oUNefsiE5CuVBLadeoNTH86v57YFo1MrYem8N8GRGotgS6H8FpVVG7gD4 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5102.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(366004)(52116002)(5660300002)(6666004)(186003)(66476007)(26005)(16526019)(66946007)(478600001)(1076003)(8676002)(4326008)(6486002)(66556008)(2906002)(956004)(86362001)(6512007)(83380400001)(316002)(6506007)(36756003)(2616005)(8936002)(54906003)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: t0sJs+LfvLqTmBlc3sn/FsaSFAswrjbQbIy/NbgGnhsUSrGAYrt+AN7luF9iK3KHgwwVMZKa5rJPfL6beQyMmvRa5bJYEH/OcAazedx+pA+3KL4gDHSq5p1TjFRI8ExTTdIdFDoO8QyUpv0nrz6Eu3Rnx3S3jl/1rZsy0LodLRbT8nH4/aE7gX6LhhOmWSB7n9r8BzHaqrVNkgtDxDB38K0/DF2rQ1uyju0xj3eInDXo0HDZ2owtCkELijI79zIZNdBGvuWz1MT0c8LfloWm2tYnWuN9xpLSUw12C/KzopVUtxIfvxpSGyjfmvh0A4jWbdkoXnsQucxkQaTTbCTksCuD5iujnM46MrhUDaTRU1NjpH1l/uY604W6+uNvfSa/c0zCLoyJRUxI2VA8Pq9+KLRZA2puTpCgTIrqzfUamilxh0GJHYTPtrH1HttTSMuwd40xEDxPOsGNGUgdnoDGMGXe0H6dykhQspELf5MEuNE= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 133c891f-af26-4bdf-6062-08d80451acde X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2020 04:26:51.5729 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ydQ4//mlNCLUFyubu24tPshJVnuhB5fZM9QyPuq7MmqfSG4hbVin/4+QFv8lyByPyvK6nx7aYy6AoPEp6BrYZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3408 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org "mdoe"->"mode" Fixes: d956873f908c ("net/mlx5e: Introduce kconfig var for TC support") Signed-off-by: Saeed Mahameed Reported-by: Marcelo Ricardo Leitner --- drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig index 4256d59eca2b3..b6ffd1622cfdd 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig +++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig @@ -84,7 +84,7 @@ config MLX5_CLS_ACT default y help mlx5 ConnectX offloads support for TC classifier action (NET_CLS_ACT), - works in both native NIC mdoe and Switchdev SRIOV mode. + works in both native NIC mode and Switchdev SRIOV mode. Actions get attached to a Hardware offloaded classifiers and are invoked after a successful classification. Actions are used to overwrite the classification result, instantly drop or redirect and/or From patchwork Sat May 30 04:26:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 218149 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 69B4AC433E3 for ; Sat, 30 May 2020 04:27:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3D78E20722 for ; Sat, 30 May 2020 04:27:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="eHiHa7Fi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727859AbgE3E1I (ORCPT ); Sat, 30 May 2020 00:27:08 -0400 Received: from mail-eopbgr130058.outbound.protection.outlook.com ([40.107.13.58]:61765 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726193AbgE3E1G (ORCPT ); Sat, 30 May 2020 00:27:06 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N2pLI3xbtjcYxjndQDVCKvpzgLGc602VJUdYtTacNNbM0D0dKs7B21va7TWxuY/k+8Wd8ebXEECY44z0vVlTYV/38Ev878/haLviFeU1lqg+MIrRIp4ZxHciSqRaYjo78jKixFvb7V0+7dkh71p06abt4EWTqa0xkEYN1fwSxekkGf/F8qUu0LTSkcF1CkmtXSlkq2m7yEt+qn9zW280vxJR4wTQJ3LDXLSytPYAPTNWvZDc9oNbCx3nXriVzONAekxMP/+nimTRW2DxPkcPjjzLGBsUBft+nFPTQP3XTWnX/yZ8x39tlsQwXHVnAmto7zwuJyyGCuv+ovOsmUQ2yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5nCzvAleViq4OoMfg11dzbMyV0VV941Pc7rK/1Y7guw=; b=jjHP0H7rqFfol+2cGJrqZai06qdZBut4w8bjni+p63MjRVzj3+hsgEf+Ozf1oGJygRZm6+co3dFvRjM+oNs0uNynMW3ByCxSZFlPjORK4z+K/fSOzcbVwNnasdqFkJ8fQ2Q3f+E6/Y9lfKHOkWGNENqOK8EMCgAWeGssCrCZ1pExH3DDm2gqG6MgH1oHzlOwT8Lsf/wWfeJmwJzasHeYejuPuobNs9Q3dTlEOWu28yHwJs4N0YcVM+fDt28jkbjcvAGwgL3J4ZvFIcSCw7SFQ5fZ4VgcbvFVJ7kNZZjghJiVusEXKoo/Yk17jK2XmJSESvEdoqdyNdO5Dgj7B5CC1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=5nCzvAleViq4OoMfg11dzbMyV0VV941Pc7rK/1Y7guw=; b=eHiHa7FiT02WJ99Kvr4YDdmCzlRfMn8j/seGrvFvjJi70vasSHW4VuhNxuBhvwT6uolSVhCkieB0q1RHaJO+EzARiFPw+qkDwWyi0hXHSkmbzWhDHBOb/UaCPL/KI9BVZVqQqyd3Mz4O8Y7+Ak/bpqo8HaFyeXo7/JPD6jL4YRg= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB3408.eurprd05.prod.outlook.com (2603:10a6:802:1e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.18; Sat, 30 May 2020 04:26:58 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c%2]) with mapi id 15.20.3045.018; Sat, 30 May 2020 04:26:58 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Eli Cohen , David Ahern , Saeed Mahameed Subject: [net-next 05/15] net: Make mpls_entry_encode() available for generic users Date: Fri, 29 May 2020 21:26:16 -0700 Message-Id: <20200530042626.15837-6-saeedm@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200530042626.15837-1-saeedm@mellanox.com> References: <20200530042626.15837-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.7 via Frontend Transport; Sat, 30 May 2020 04:26:56 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 14bd5d52-5ddd-4757-b4f2-08d80451b114 X-MS-TrafficTypeDiagnostic: VI1PR05MB3408: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-Forefront-PRVS: 041963B986 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8MiKIG2p8vMtqQgaaZ6fxbTFW+Y2W02d/dvtv8d5dglzb8EHi/ywZVs1hEatamEwtzj38UHLzpQxf1fOcgR1eiY8i4X1t7JbzkX5ByjPfTxpygbR/xxtd2I6gMomIyQFmOGmlfP3OilYOIRagpSv0ITnuxpucpU6Pf8VmQFhhpjzboRNN7tL5s5KKP3IIn0J6vZvGracwexh1QcVhdUdyFZt6r2u5O/n3ELjhPxsIbkonJ/zmmhIArjbE3mz1uDg9yT1gA+c92EoIbOrLaFJuMspjsnB1gd9OZYHfct1QAx1qEmXDNlraepJQ2V0OLe+8wLi9lHhf6/DOHsjnm99L7GFkq3x1UpQn5eg/J4E2Vn2olUjoVFpXG7DgiesBdIdOMq/OUMvHLmd7YnjI+ddAYu8HCGFeMeFyiHIz/efqukPcEO3SzMMGB60cApBO8ITRMlKR67iKXEeDTHRWk3+jGR7p3DXJzG0Mmw6WKpMN3I= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5102.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(366004)(52116002)(5660300002)(6666004)(107886003)(186003)(66476007)(26005)(16526019)(66946007)(478600001)(1076003)(8676002)(4326008)(6486002)(66556008)(2906002)(956004)(86362001)(6512007)(83380400001)(316002)(6506007)(36756003)(2616005)(8936002)(54906003)(26730200005)(41533002)(54420400002)(19860200003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: LBwEWhPwtHUl8DBhXn3oyxUfaQd6Pdb7jaqad90se4jxsgjjfFFQj4uRwx42o/Xyo50uJOzbibaNNQbQtqGZ2NBaaxpStvJuQH96IDIipCX9Fm9WK/qZsYGehfH1v38BXIZrpxzLmBdvYgbuJjFrhNPccxPEylth3LAd+N35kowGt2sX7cznWhVQ0xbJZDsOr09BQlyheLMPENUl4dWBJeswJ8aEWHbmFkJzGeNRh1mjp3KNf/D4ewi+4XU1plJbDBLCSi2p1qod4rS8fADoLfBTCtaYLv9NZmz4pas1KNhspD0oD7E+M451TXTfYG/Vekr2Fe9uOUtw134MDU7kiJx74qO9ROZNj0Q2B8nhw5mbNcptFsY79y5sOmtRSKGf2RS7sM8Y8VvgUX4lD7jnXanWpyS3ntWHQFQUotdVMxf8mYDth6A77jC4xCayLfz/YzmQ7wTwsmFyKxXfdhUgEo0OUxy0lDkDehcUWNk+c3w= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14bd5d52-5ddd-4757-b4f2-08d80451b114 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2020 04:26:58.4970 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Pqhz7ngqumtKZ21iC6ZI/Dwk0Mqkg2dS4Rd7e977Knj5D3jmZUOaTsUSGBIu5iqGLaqp+ZPqWtv7zfKjtQ8Bsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3408 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eli Cohen Move mpls_entry_encode() from net/mpls/internal.h to include/net/mpls.h and make it available for other users. Specifically, hardware driver that offload MPLS can benefit from that. Suggested-by: Jakub Kicinski Suggested-by: David Ahern Signed-off-by: Eli Cohen Signed-off-by: Saeed Mahameed --- include/net/mpls.h | 17 +++++++++++++++++ net/mpls/internal.h | 11 ----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/include/net/mpls.h b/include/net/mpls.h index ccaf238e8ea70..0bb7944e7b083 100644 --- a/include/net/mpls.h +++ b/include/net/mpls.h @@ -8,6 +8,7 @@ #include #include +#include #define MPLS_HLEN 4 @@ -25,4 +26,20 @@ static inline struct mpls_shim_hdr *mpls_hdr(const struct sk_buff *skb) { return (struct mpls_shim_hdr *)skb_network_header(skb); } + +static inline struct mpls_shim_hdr mpls_entry_encode(u32 label, + unsigned int ttl, + unsigned int tc, + bool bos) +{ + struct mpls_shim_hdr result; + + result.label_stack_entry = + cpu_to_be32((label << MPLS_LS_LABEL_SHIFT) | + (tc << MPLS_LS_TC_SHIFT) | + (bos ? (1 << MPLS_LS_S_SHIFT) : 0) | + (ttl << MPLS_LS_TTL_SHIFT)); + return result; +} + #endif diff --git a/net/mpls/internal.h b/net/mpls/internal.h index 0e9aa94adc07f..838cdfc10e47d 100644 --- a/net/mpls/internal.h +++ b/net/mpls/internal.h @@ -172,17 +172,6 @@ struct mpls_route { /* next hop label forwarding entry */ #define endfor_nexthops(rt) } -static inline struct mpls_shim_hdr mpls_entry_encode(u32 label, unsigned ttl, unsigned tc, bool bos) -{ - struct mpls_shim_hdr result; - result.label_stack_entry = - cpu_to_be32((label << MPLS_LS_LABEL_SHIFT) | - (tc << MPLS_LS_TC_SHIFT) | - (bos ? (1 << MPLS_LS_S_SHIFT) : 0) | - (ttl << MPLS_LS_TTL_SHIFT)); - return result; -} - static inline struct mpls_entry_decoded mpls_entry_decode(struct mpls_shim_hdr *hdr) { struct mpls_entry_decoded result; From patchwork Sat May 30 04:26:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 218148 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 8EDA3C433E1 for ; Sat, 30 May 2020 04:27:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6965B206EB for ; Sat, 30 May 2020 04:27:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="S7TdpNOh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728297AbgE3E1L (ORCPT ); Sat, 30 May 2020 00:27:11 -0400 Received: from mail-eopbgr130058.outbound.protection.outlook.com ([40.107.13.58]:61765 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725889AbgE3E1K (ORCPT ); Sat, 30 May 2020 00:27:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bW6hIM1ZBknYQbpQxBAHj2nvps/ZmJLoNrjEIowEaAjLHqKKfnpFqZxNZYAsHfKTPx7uN4O16Hn2NpvQ7lSP5KY8I7n/wT8d2/axIP5gdkftLD3meMhBaxB41R0EW87sPCsyHuf2CNCPX25QLXLU8+BP/J7sq+aBeiFFurAj8vwd1rVu+v1eb6xN/u4egz4mVLVJQJdjvpQThfl9Rb+NEv4aYFLZRMF+D8LYXwRZWq/eKXdQIZeMZ5vZqepDCsKamYRq8fELiPFjn+koWQfs8AnqnZ0TFCFp9dMfJRxdhRCSs08HAk3THnIHL2DCzEwXkthFAR+TYGqfZw+z3PcvXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mGgODeHiIU5ib3j5u5F5CN44CDWE56jA+yGyQirGf6I=; b=dtJHP2ec1wZWtdvsAMwwCS/nuVQmIpUp7kfPDwi8nU7wBJpEipTCpS49fbwRa/UUhdctw3Wqeu2BN3OiQuqx6ME/WKpb1+4BWnBU8dOA2p2AeNyxNPQxqWV26/1gIWVuI0o8h+kMKNDiaGs6BpIv9ARminU1L/UCRPYLW9iTQOhKQ9pQSJQ8HB6O93eYDBpB/V9Br176FGhoiBeBMHImUXCqpXLXLXOOBhEyNbdQ2GPvsbbN8iPU3Bf0hWLIP5USVI6eWqehmd2y0EWyN4P3WKmzA9VpbiZ3PuUb4eoWkjWarWzG7R8dK1IFyt0dVf85OLh2/Wy+uTiQmCekhR5Tag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=mGgODeHiIU5ib3j5u5F5CN44CDWE56jA+yGyQirGf6I=; b=S7TdpNOhsme2wMEbrrQoVHYo1rZQesxcmuwtRwJujLP6ml7GiFT57WoPbYE3ITSV6z28MdrigHtLBHLuy2PayXvnTLYpLYeWptR6syyoDj8yGbSdmIwhPTZbXc8S6CZpeoX2DFfc/YiBeY/obK6NkUujiVk+KA88dMdAwZhyYwg= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB3408.eurprd05.prod.outlook.com (2603:10a6:802:1e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.18; Sat, 30 May 2020 04:27:00 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c%2]) with mapi id 15.20.3045.018; Sat, 30 May 2020 04:27:00 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Eli Cohen , Saeed Mahameed Subject: [net-next 06/15] net/mlx5e: Use generic API to build MPLS label Date: Fri, 29 May 2020 21:26:17 -0700 Message-Id: <20200530042626.15837-7-saeedm@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200530042626.15837-1-saeedm@mellanox.com> References: <20200530042626.15837-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.7 via Frontend Transport; Sat, 30 May 2020 04:26:58 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 80860fee-31b4-4744-7c2c-08d80451b24d X-MS-TrafficTypeDiagnostic: VI1PR05MB3408: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:800; X-Forefront-PRVS: 041963B986 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H5kwdIVRTjE8Ye12wZDKFy1uGU1ThYr9+/5gK/Y2kgHcFirmrpi2MjQMN5hbL5hUqEz+WB4A/5LIOOMUpe646SV7MHx/f+2rFJrEJicWHAjmobZK6ebmOw9SerDXb0nCIDUocMOzi1MYziNyfErWyK8Ycu6xH27EPsCiWl+qgvWFDBqzH2Q1R2vrRhu8pahMzs5U/Q0zqJFgixH9IpOPstZBsS1tntheoNKjykzXehC+q6UggGgiTEvNmirupg4x2ynUCbHcJhg9YKmmj5jA++EQom2tsOCDnay6pXIfLthtBrAtFHXqIPgKxmI6lgAcS7kPb/LIbnSQu/E0qYV/Uqf4ngXbRD+8EIqYoJ10jypOAJwjBp7jz0iNN2wvWnYiuNa8mRYt20YRW5pH8P9RdA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5102.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(366004)(52116002)(5660300002)(6666004)(107886003)(186003)(66476007)(26005)(16526019)(66946007)(478600001)(1076003)(8676002)(4326008)(6486002)(66556008)(2906002)(956004)(86362001)(6512007)(83380400001)(316002)(6506007)(36756003)(2616005)(8936002)(54906003)(41533002)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: r2snFaequIV6R0NFqGAeEy5PwJuVhxEe79E7D6rbC4FXY7Y7U217u95lgLkvpilJgjKG1rFVQrVElZL3++iFCNQnYItKgAxD6PcOwLBBawe7IN6NXqRchwcwF5mZ166IqNAVWQ/aRP0aOU1fQfPftYlfbeTP5f9AlDlSAwYuFiLv4s4UgUA6hF/GqFTN0rMth5MmfH5pM5ZpspoUhRvXGa6NBsxyF6pVObv119RIHexoTFHkFVQ+K71uSaqLGLL2+lD8z5PjCdL0wLpCY3ZUCowvz8gZ8GWnGOFJeUZnClHsi1xGHfhdMjULdFedPdBNFujGYC9tnwmhOz5BRLreQ6fTRo9NfAgkIu+49hatJ8usDs9X89t6UAmfrqFf0lPmggQaR5RukC/OgrqfifE9shuixueZLlrwSFVIeOrXeEZSesZUDtu49G/ZYHgmGUzZGS9fwARAESlgb/7jrf6LPN5uCvqT85qINoXXoxYqJe8= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80860fee-31b4-4744-7c2c-08d80451b24d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2020 04:27:00.5448 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rWaB+CpEImLMC/LXRkhDgwK8dipoCGf1HWz3F9c4dKVWg0RgPNuk2dvvJNcbVupLeWOrhbgyT+kIviUWX5tmIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3408 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eli Cohen Make use of generic API mpls_entry_encode() to build mpls label and get rid of local function. Signed-off-by: Eli Cohen Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/en/tc_tun_mplsoudp.c | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_mplsoudp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_mplsoudp.c index b4a3c96d34fdb..1f95262442221 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_mplsoudp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_mplsoudp.c @@ -25,35 +25,21 @@ static int init_encap_attr(struct net_device *tunnel_dev, return 0; } -static inline __be32 mpls_label_id_field(__be32 label, u8 tos, u8 ttl) -{ - u32 res; - - /* mpls label is 32 bits long and construction as follows: - * 20 bits label - * 3 bits tos - * 1 bit bottom of stack. Since we support only one label, this bit is - * always set. - * 8 bits TTL - */ - res = be32_to_cpu(label) << 12 | 1 << 8 | (tos & 7) << 9 | ttl; - return cpu_to_be32(res); -} - static int generate_ip_tun_hdr(char buf[], __u8 *ip_proto, struct mlx5e_encap_entry *r) { const struct ip_tunnel_key *tun_key = &r->tun_info->key; - __be32 tun_id = tunnel_id_to_key32(tun_key->tun_id); struct udphdr *udp = (struct udphdr *)(buf); struct mpls_shim_hdr *mpls; + u32 tun_id; + tun_id = be32_to_cpu(tunnel_id_to_key32(tun_key->tun_id)); mpls = (struct mpls_shim_hdr *)(udp + 1); *ip_proto = IPPROTO_UDP; udp->dest = tun_key->tp_dst; - mpls->label_stack_entry = mpls_label_id_field(tun_id, tun_key->tos, tun_key->ttl); + *mpls = mpls_entry_encode(tun_id, tun_key->ttl, tun_key->tos, true); return 0; } From patchwork Sat May 30 04:26:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 218147 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 79037C433DF for ; Sat, 30 May 2020 04:27:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B29E206EB for ; Sat, 30 May 2020 04:27:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="GJRf0xde" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728733AbgE3E1S (ORCPT ); Sat, 30 May 2020 00:27:18 -0400 Received: from mail-eopbgr130058.outbound.protection.outlook.com ([40.107.13.58]:61765 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725889AbgE3E1Q (ORCPT ); Sat, 30 May 2020 00:27:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hJnd8gIGTirP2/mMNf4m1AwbbZ+eH0bVbXaY95GQmnSA/DLH2QQbMFLnKF+0gBsNtlfjwL+cBOQbaYKn26vg0pmqbysnW43QvVDjC/wRcoWMd/0hrkqDqU4IPNHaHzkfGstBVAa0M13ju9qvc+bn4gp/pvyqvma6QFzqrK4L6HwNE3XNrMVQrhdfEv1VwciDu2OYFkBObPAWn72IXX0wbQQOgTlgn8F72LXk0a03IJ9u9wT2msaRzSdf9wDh+PfxITCXNjmSbN4NMPX+kZvEAnhYwuxscMZxLdQaTZqtRkidKNMYLcyilPuqH064HkU0BKRrV926ohUjAiy89Lg9Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XRggQkwFSp80gouhgTnGMhw9i4LFy1lAHt4XLrhQo9o=; b=OG7aR1N7UM0UOuNpZhEYrxX86loxfss1d3DHqdSJbW3VSzix5XeW0x+DBrxf0VC0rm4UdR0a23/hia5Zcpm+RZmAy09L00O0a/7SVauS8yhc9NoFZ1a7o2xkQVAZKaCfA0S4jjX1wPvktFR+0D4nYJI/GfmIa8EReFxIRnDaCKcGHVLZwsx7tdw7cOvyJiQ/GgtAllzM5tAnrqPU0z88LR9OszAb3Hc1F3FBvOxPUZLL+uIWXHKZtJfFHs1DmaU+KOQQTxmaTcAP6ri6LJwbxQK3s48fPl4vWqGN4QvrNUfnMeE1fb3kiH8w+FEoF8/mzarXKJIfLTF2Kaayjv8ULw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=XRggQkwFSp80gouhgTnGMhw9i4LFy1lAHt4XLrhQo9o=; b=GJRf0xdeiHZh8K+ghE+WkBjvFmn1XJBwNt7JyfknP5YzI703wmHtSJ1dgVMyGwfDbUMT8F9y0hIJHvGFt+FMxISm5iaP6dsdc/Ed94EiMvXV5pg64TQr8KX/48sGAYD4JwsmQ4A2VbxBT00y5Nfzk+V+T0SLn5d6hhV+ax7tsEs= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB3408.eurprd05.prod.outlook.com (2603:10a6:802:1e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.18; Sat, 30 May 2020 04:27:05 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c%2]) with mapi id 15.20.3045.018; Sat, 30 May 2020 04:27:05 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Saeed Mahameed , Mark Bloch Subject: [net-next 08/15] net/mlx5: DR: Fix cast to restricted __be32 Date: Fri, 29 May 2020 21:26:19 -0700 Message-Id: <20200530042626.15837-9-saeedm@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200530042626.15837-1-saeedm@mellanox.com> References: <20200530042626.15837-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.7 via Frontend Transport; Sat, 30 May 2020 04:27:03 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ea497bd0-25d9-49d2-1587-08d80451b4dd X-MS-TrafficTypeDiagnostic: VI1PR05MB3408: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:569; X-Forefront-PRVS: 041963B986 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QwP8SMC/aUg0CNK4c7LYD5ZaTr9mXBRem5zXH27O3DQpXG5ANeKhhJG+yC+FHgBbTJd5FoPTDD33/gnCYezghswFC6zQWNnkpyhsd0wa35fllg9t65jdyxW0PmD9mS2cBvYTssBOMZeUtrwZF32ll2GennoFnL6NyZyfxsnXdgUUhbx9hS8MxwisqFykcTVdKouy8UwKuc7Z9yeULxF/Ezsrfiz+tTHY5sf3/EzLzwWbPb3oJvENvAAThwJgTwMZeTT6KnLC0N1Sf9YPcNs6lNZIFc665pdIIhfK2uiaqyljD4EIX+xLst/hV3s8mXGAncqYyJupjnL0HF3fKMCEOiiAWcw2LGMqpn3UCedHFI/Zg42bbmniSyauzGPxOU+6 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5102.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(366004)(52116002)(5660300002)(6666004)(107886003)(186003)(66476007)(26005)(16526019)(66946007)(478600001)(1076003)(4744005)(8676002)(4326008)(6486002)(66556008)(2906002)(956004)(86362001)(6512007)(83380400001)(316002)(6506007)(36756003)(2616005)(8936002)(54906003)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: IoKX3Zrv0WRfat/x6cn7AH9EYsbegebTMhNXxcTXeVvBRj9WZieJjrFdpKPqA43Cwvds9Dp0sFqX842KjpZD7iKY61hr92jTGkLfZtwJQKi2z5dEoKf/odQpLnBXQm/DPuwy3sG/1z9u830Vr1MgCOYZnpVhjhCzZg7N/9wzegfzpB261KNXt9gMfRQodjyMG8gYm3drMwgIILW1TFwW7GctSEmvZBLOG94zqXOB78NBQnADR7bhOI48h68wJNaOU9cqHOLSQSfOY0KXUh9wXL6uvDuSeleahOfDboz5+WKAAdilXqAu2RdIGqPbRV8RQjGXZllWVJGgGaz0udI3l3FmZJGA/SPHnCR4W7hOE3mRmqjUXRULLowhPSsKOc839Gb5j40CP344lbwix2ihxBBKD165MCAtiU2l8s5M07Ge9z4gi98pmT3mEqOWYzOdxmzvalukXdUncpCgGDrNQqyuR3V4/a6ApTwD+icP/w4= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea497bd0-25d9-49d2-1587-08d80451b4dd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2020 04:27:05.0082 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WQJeDdRoDbvH6LF69KhlPc7MlXxPUYT5Lt+1RVoHcpwJ1CF8eQeqPEmTnlbTcPS8FHnNAJbwkBCi4sfjvjuVzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3408 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org raw_ip actual type is __be32 and not u32. Fix that and get rid of the warning. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c:906:31: warning: cast to restricted __be32 Signed-off-by: Saeed Mahameed Reviewed-by: Mark Bloch --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c index 78c884911ceb3..4708950166930 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c @@ -869,7 +869,7 @@ static void dr_ste_copy_mask_misc(char *mask, struct mlx5dr_match_misc *spec) static void dr_ste_copy_mask_spec(char *mask, struct mlx5dr_match_spec *spec) { - u32 raw_ip[4]; + __be32 raw_ip[4]; spec->smac_47_16 = MLX5_GET(fte_match_set_lyr_2_4, mask, smac_47_16); From patchwork Sat May 30 04:26:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 218146 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 2EDC5C433E0 for ; Sat, 30 May 2020 04:27:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 01A14206EB for ; Sat, 30 May 2020 04:27:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="F/SvCtil" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728771AbgE3E11 (ORCPT ); Sat, 30 May 2020 00:27:27 -0400 Received: from mail-eopbgr130058.outbound.protection.outlook.com ([40.107.13.58]:61765 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725889AbgE3E1Y (ORCPT ); Sat, 30 May 2020 00:27:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jMtIS0qOH/eYPGsswMGMcAoqEvgymTsUvgBYJV3BQtxUdoDujzKZ5fTULCxDPD29Nw1pKXukt0PYDvPfeIC+ni/GPgq7d2mEY6hoLI3jIMPE+BzU7jEcDLdIYDz/iHpw6yooy68PaUQGMEWAncUFi9xarCn3Z9y97+0Ri/5jmyOKvCNZZiCnbGHhFlWf/pBJ2ElMmh9izQb+x9KP27cBhIaIJLkVjR4LquANAMbAOUvGqTyAMMqhYrbU+1TELF6LOwSu/6UCKlNGbhuU92ztVFH4YoPZBBeDNZEC3lkiDvSgjtY/5IEfyzzqkYf9Oji/6miUWd5igL/f94NMqakXtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tJm3QcmXy0S8Y5P3Y1yZjWwCZWNGDprpllFjxtOELW4=; b=hyS4fmmZPbHLeB81VCEUDxctxoQnxNnejZVkK569XSBoOynb1S6r6dEfIwumB51VBj20vpp+53jFc1QgISQj1esnSt0nljQAExwYTBchcZcqHrLwBsTogc/TjWQsjXX9fbZbAO5BV3z2IPSZjQsv5BaG6BSRx23oJfLcpLB2KRFTiv4dwnaV8dh4IMREFvJBdK31M6xCBw7zkMp+W39hkIv9WxZpy29cip0QlRPb5ePC6gnDmQTm0qyk3G9Mb+akgRUo0ZFUeNZpbcGs+X118/Cswa2Qc0u8NstIBSJgTPSzwfAd0UpRsOXsB7YLnPhp85GBUyVgRwJDurcwXMk4/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=tJm3QcmXy0S8Y5P3Y1yZjWwCZWNGDprpllFjxtOELW4=; b=F/SvCtilhvXwC5IeXODwSSHJD1j5bcfjwvtYs9V3pwtKJ4AxwEo51EoCGscZYWYak6qDpodldhcUkgNxX+T3VNK1d6K2stDU4qwCYkoJTfT04fidlNr5CVyoI1+grfZAs1i7/qE4wR2n8Uo1uLz2NTZvvjThwM0vFgaMxWJQdVM= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB3408.eurprd05.prod.outlook.com (2603:10a6:802:1e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.18; Sat, 30 May 2020 04:27:09 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c%2]) with mapi id 15.20.3045.018; Sat, 30 May 2020 04:27:09 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Saeed Mahameed Subject: [net-next 10/15] net/mlx5: cmd: Fix memset with byte count warning Date: Fri, 29 May 2020 21:26:21 -0700 Message-Id: <20200530042626.15837-11-saeedm@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200530042626.15837-1-saeedm@mellanox.com> References: <20200530042626.15837-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.7 via Frontend Transport; Sat, 30 May 2020 04:27:07 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b4c711c4-da66-499f-4b17-08d80451b76d X-MS-TrafficTypeDiagnostic: VI1PR05MB3408: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:480; X-Forefront-PRVS: 041963B986 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Bn6TOyQ1lO0hPiUkw9MavydAfPpGvre/I9cY4k2uMVZqViGX9pqN0cKBKf2RIF5ix+2XZrXXyZUqi/cuZFYN6S7UHUrEEWpPpoPBcaizWFacOkxFtr8JZqK9uNwOMaJXNxhMrQCfPkb8rJ+jHEZSXnrvQeKvubQQh0fNDrRmzdZ7fLzUe4oi0jzE9qY/hPv+07ahrxLpnXYhKFsjAYrCR8mCO50SfzzOhttC2RiVtZ3MByDKaAX7el+LZi52URhfJwHM2h+466cK9iLbBZ3yoXWQskp43XxspxMAmCGDLqp9xdEaF+9yWOK0d1jhGLXWzvsEpOq24TLwRgaoKxs8zx5C6mDecyFR3PcquBuRKma4wIseG16UZOwE6adz+Q6B X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5102.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(366004)(52116002)(5660300002)(6666004)(107886003)(186003)(66476007)(26005)(16526019)(66946007)(478600001)(1076003)(8676002)(4326008)(6486002)(66556008)(2906002)(956004)(86362001)(6512007)(83380400001)(316002)(6506007)(36756003)(2616005)(8936002)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: p4P3cVqa0oJFXfLz+q5doTUMV30jrZSkbz+r+ZTJQjw/w27uk4fU7OjJFc8cBv6lvCwriSPo6wrow01RnlMLKVEDDQ4737zSDN7enlengiy5xXNjlyR7L5sXuFWjY3YwDI35dMzZtNYn3TQEGk3a4dR8HdAAHXCUl3CDoImpfxu4z3Zejurf+PMgCbvfKoy1uDkfEce8GRTCZL1LPJrGBbT7jw7aTwDWJBkCUXu3HaQ0GlweiR0Te1ue6d/S19LarLire/uQ6yYUJC119XSe5F8sss8hWewsalj3Xxwc10JwfQXlRouFoFaLaQpi1z91eiDa0MGJBsk5qApgbsVfvTXLk9+9Ir+n0guNKtkxhCzsUJDXffWlZGl1ZEDv58IXJmcE5BYz53UuHUADWaJ9TRX9/+0PRHJY82+e6loqoRSqeJrkkRFBevTmpd7tq76UqH5zTDJU83gpPf4hQHBEGfpzr1bbzIwvkPVF+Q7pI/M= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4c711c4-da66-499f-4b17-08d80451b76d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2020 04:27:09.1539 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FjMq7iN+iH9bFeZE1IQ6qk9wrWNYzxMUnVKTBKD7i7BrISx8g/rtJ7WWGPFxYpDRCe84BuPgAkhUcCkZji3ZfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3408 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fix sparse warning: drivers/net/ethernet/mellanox/mlx5/core/cmd.c:1949:15: warning: memset with byte count of 271720 mlx5_cmd_stats array is too big to be held inline in mlx5_cmd. Allocate it separately. Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 20 +++++++++++++------ .../net/ethernet/mellanox/mlx5/core/debugfs.c | 2 +- include/linux/mlx5/driver.h | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index eca159e8e123b..1d91a0d0ab1d7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c @@ -1072,7 +1072,7 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in, ds = ent->ts2 - ent->ts1; op = MLX5_GET(mbox_in, in->first.data, opcode); - if (op < ARRAY_SIZE(cmd->stats)) { + if (op < MLX5_CMD_OP_MAX) { stats = &cmd->stats[op]; spin_lock_irq(&stats->lock); stats->sum += ds; @@ -1551,7 +1551,7 @@ static void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u64 vec, bool force if (ent->callback) { ds = ent->ts2 - ent->ts1; - if (ent->op < ARRAY_SIZE(cmd->stats)) { + if (ent->op < MLX5_CMD_OP_MAX) { stats = &cmd->stats[ent->op]; spin_lock_irqsave(&stats->lock, flags); stats->sum += ds; @@ -1960,10 +1960,16 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) return -EINVAL; } - cmd->pool = dma_pool_create("mlx5_cmd", dev->device, size, align, 0); - if (!cmd->pool) + cmd->stats = kvzalloc(MLX5_CMD_OP_MAX * sizeof(*cmd->stats), GFP_KERNEL); + if (!cmd->stats) return -ENOMEM; + cmd->pool = dma_pool_create("mlx5_cmd", dev->device, size, align, 0); + if (!cmd->pool) { + err = -ENOMEM; + goto dma_pool_err; + } + err = alloc_cmd_page(dev, cmd); if (err) goto err_free_pool; @@ -1999,7 +2005,7 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) spin_lock_init(&cmd->alloc_lock); spin_lock_init(&cmd->token_lock); - for (i = 0; i < ARRAY_SIZE(cmd->stats); i++) + for (i = 0; i < MLX5_CMD_OP_MAX; i++) spin_lock_init(&cmd->stats[i].lock); sema_init(&cmd->sem, cmd->max_reg_cmds); @@ -2046,7 +2052,8 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) err_free_pool: dma_pool_destroy(cmd->pool); - +dma_pool_err: + kvfree(cmd->stats); return err; } EXPORT_SYMBOL(mlx5_cmd_init); @@ -2060,6 +2067,7 @@ void mlx5_cmd_cleanup(struct mlx5_core_dev *dev) destroy_msg_cache(dev); free_cmd_page(dev, cmd); dma_pool_destroy(cmd->pool); + kvfree(cmd->stats); } EXPORT_SYMBOL(mlx5_cmd_cleanup); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c index d2d57213511be..07c8d9811bc81 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c @@ -171,7 +171,7 @@ void mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev) cmd = &dev->priv.cmdif_debugfs; *cmd = debugfs_create_dir("commands", dev->priv.dbg_root); - for (i = 0; i < ARRAY_SIZE(dev->cmd.stats); i++) { + for (i = 0; i < MLX5_CMD_OP_MAX; i++) { stats = &dev->cmd.stats[i]; namep = mlx5_command_str(i); if (strcmp(namep, "unknown command opcode")) { diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 6aa6bbd60559b..13c0e4556eda9 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -298,7 +298,7 @@ struct mlx5_cmd { struct mlx5_cmd_debug dbg; struct cmd_msg_cache cache[MLX5_NUM_COMMAND_CACHES]; int checksum_disabled; - struct mlx5_cmd_stats stats[MLX5_CMD_OP_MAX]; + struct mlx5_cmd_stats *stats; }; struct mlx5_port_caps { From patchwork Sat May 30 04:26:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 218145 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 5310BC433E0 for ; Sat, 30 May 2020 04:27:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2848F20715 for ; Sat, 30 May 2020 04:27:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="Iqnx1Sdm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728800AbgE3E1e (ORCPT ); Sat, 30 May 2020 00:27:34 -0400 Received: from mail-db8eur05on2070.outbound.protection.outlook.com ([40.107.20.70]:36101 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728772AbgE3E13 (ORCPT ); Sat, 30 May 2020 00:27:29 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a8Kxj7O0EnURNHT7mm+zDQEqu3HEIy+eklpGfatoh9s51bkqTeEjaByMfOYKnjbl25uefg8+ReNCwbQbc9DUI+tyO0a8ECvt8P+OQPEh67pF/brEn2tk5FZyrUpBgHSk+JOIzZdJBXHCO/qf5RuXkWzG1Geanohc9y5jFOKZGvhGOlBmZrZQouh6PkTn1vNQ3lAIwt4ajO747ggUhk5P2Jm3q7J/WGEMdRdRtFFmLj+7Oxb89m//L/QXD7fxYRwMxSPXdRaOWYee9zpxJ2WvzrY18nAcH8nVx4zcpuMf2G1KUT2GBcyi3BoJkM1cJ+i9yqiL444H6APsJ9U1UivN2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oGwErllm3G2QOT6zWeKgsMbnwUVVT8jWgN0TMqTW4LY=; b=IeP+3INB/qzUsAmehZJ4fZ6KZ8/2RuX8YYVzyklqbzE6ttbDKNzYF/JxbzOJMXcyyspZdlzQ6oSWV5utavWH+jvZ2azXE9xAooW6hLrtnJaSpSuBrLJxYdCIgYkK2sVM0UXb8uRDNwyUeX4OAVfgCFnyJgyijp76F5G7HnFxa5ZcJ2c5yqaDCIX7WzD9dYoYWkXghwPAGY13stDj7eqAuWCM7rP9ct7PxrXUXmx1bFbqxpKjrNzoz15xL+sIJ5+WSpOjpdkor+wKJOcCY4Qf+ODPuILFW9RcFE4NrIWtm5pYsGs0yjv+Ro1JORvfzYACmCtLCfEhrCdx9d0e0Ne1Ug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=oGwErllm3G2QOT6zWeKgsMbnwUVVT8jWgN0TMqTW4LY=; b=Iqnx1SdmHMpqIa5C2dnlmd9/JfLts3EhR6K+HeiTTWNyofE+eALMKetLmK58pkVpRpVlO/zQ2WcPKPQGUF9MzMRRmu0cI0zet6RM/LsLzPKnOUIwH43uLk+TvO03keBAotegfr9B4S/tBvBUCZ2wMwMkrkARnKEjjXzHhth70To= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB3408.eurprd05.prod.outlook.com (2603:10a6:802:1e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.18; Sat, 30 May 2020 04:27:13 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c%2]) with mapi id 15.20.3045.018; Sat, 30 May 2020 04:27:13 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Saeed Mahameed Subject: [net-next 12/15] net/mlx5: IPSec: Fix incorrect type for spi Date: Fri, 29 May 2020 21:26:23 -0700 Message-Id: <20200530042626.15837-13-saeedm@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200530042626.15837-1-saeedm@mellanox.com> References: <20200530042626.15837-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.7 via Frontend Transport; Sat, 30 May 2020 04:27:11 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fabc2a69-ad3a-4e42-884a-08d80451b9ce X-MS-TrafficTypeDiagnostic: VI1PR05MB3408: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:326; X-Forefront-PRVS: 041963B986 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6gXsmN09lY2f3jBddciJpCef4mHG9vr4ODFw3UGYwLYdJeumzmFW/Y9vkPuWOanDQz2srbuJrC7Xx+5aCGVBEiDMkRJuOVEVlGuTfe0L+j18rjPmj7XmHnftG8G9T8oMmzlDEogCz+kzTGjVqmacE4hSjNNy/+hQGSq1LlWiUPPAZuXS+ke8GL+RIFAEJl3ZSHTH4y30gxDAImZnKAbfnZwb5c+90gz28UOtzMuRS9W5PRUaT3AgwfcXWpfuqlujRFLXPDfBBmj2LtVBOh46oh9vvjWkqrFDnmE53276nloAGMYKiQiYjVKQ1VI2pfsAUfSx8LxGJCqF/HgW6MUZl/leHrVhaZ+xOBtODDV/SwfN67uI5cQtukOGHu3tfske X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5102.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(366004)(52116002)(5660300002)(6666004)(107886003)(186003)(66476007)(26005)(16526019)(66946007)(478600001)(1076003)(4744005)(8676002)(4326008)(6486002)(66556008)(2906002)(956004)(86362001)(6512007)(83380400001)(316002)(6506007)(36756003)(2616005)(8936002)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ssE8nByyTX1Ui+XIp1VbtYMVoS5wCHfh/xqnEyCJGeC3V00YR0giRu1/MKJQ2ebOPIK6c0k2HvJTGsFmlflSdhk4UL7aZInZR7uEAaH59zwHFPZ7UK8pbU6XOfVsVsuB76kyn51Ut94e8Y4fo5uLO9D7aTIHfDWO/Ww97z05g9VD8+kSLv+GHjQw2Rxl5i2eEIkfeFcnRU2uJucNLSr+d3ltIu2OSZ1eNwmfoKGXkBGwKcZ+7E0NvQuUW+F+F0RT6+sNx/R5T7UIRAU53IRa98COp5aFVWEQMcyIBxk8dv10yIrUUW5M7jNVsBPtfneBKDkxRccPwYTvy+Ewrx/tIwXKRVf6RRrw5Y9Bmku7Lu9EM6qzZuCFXLW5WMbtHVKi+9frBxxWRY9M787aG31Kh5Rp48Yhbmzuaf6S6vkEHEUmY/3pqIrIIWpqyzWrys2UYpPnX0bKjWQNrgsS20a5QjYSBE/I2SDwRsNufcoACeQ= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: fabc2a69-ad3a-4e42-884a-08d80451b9ce X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2020 04:27:13.3584 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tdZBNbH+q85o6SQlBMaBFHzszEAiSCJZPVA41P7HNl6JM8buo9jNaNCKrFlMxTwoYneu72rV79k7uahjtCvY+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3408 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org spi is __be32, fix that. Fixes sparse warning: drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec.c:74:64 warning: incorrect type Signed-off-by: Saeed Mahameed --- include/linux/mlx5/accel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mlx5/accel.h b/include/linux/mlx5/accel.h index b919d143a9a6e..96ebaa94a92e5 100644 --- a/include/linux/mlx5/accel.h +++ b/include/linux/mlx5/accel.h @@ -76,7 +76,7 @@ struct aes_gcm_keymat { struct mlx5_accel_esp_xfrm_attrs { enum mlx5_accel_esp_action action; u32 esn; - u32 spi; + __be32 spi; u32 seq; u32 tfc_pad; u32 flags; From patchwork Sat May 30 04:26:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 218144 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 EF91DC433E1 for ; Sat, 30 May 2020 04:27:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C77FF206EB for ; Sat, 30 May 2020 04:27:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="BbtLDPE7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728816AbgE3E1h (ORCPT ); Sat, 30 May 2020 00:27:37 -0400 Received: from mail-db8eur05on2070.outbound.protection.outlook.com ([40.107.20.70]:36101 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728787AbgE3E1f (ORCPT ); Sat, 30 May 2020 00:27:35 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jgA57vOc3Kukn43oDlxPf1h9k8MqSuzOHwPOFT1DbZ4BB7UZV3Bo3NrI9LATUroRLOvG0uSwT5XRxmbqPMpK6qNAnFa60W57PrlCvhwGqroLDnnBNfKhr5A3a+tYp6FbHAcakOxeRMtWOnLGuXhv0S+7TRuzBEXltv+U7exJgqOYTncjMtYs9487of1wv3sMhwukJBxat6ttSu4XVIIXPBGZlk9acWTxj0OM3N7hflZ+34luBq7ErG/pNHaRxDpBqTe+QrsEhk2D2xfQEaTg91oVjXVL42qY4M1gGEFnV7dN5sPJ4vV3BpN84FKHjNWQayo/N3UvpVi9RRAXyiF/Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rey+scZ62xMoGa4nUwm+wzPpdCIBoI8mpwLpzwSJFyo=; b=n04EJjTO7UPi1BoSMybmlYhqUAmBv3G6nO/lip+eMXwwoUlcNWKUSOW7XKZhtrENo5nsY1q469Xc6nD5r7lJpr3hhLyMod3zqnupxO5PYpNi+LTd4qC6ytHU0wtrS43NdpHNIU7JzQDo0Dl8Mc0vglUopr4oriZeknhwvA2go518uCnkpKaDstoYSXPOVzAuT9J9HAmK0RLYM8ILl1z3mwbkypsKTDkbquC1fZONMprrIYbeppbWVMFzPzZKZidDDd3mrZeGaLlrF0xIWBBIll/S6olqSKM0qb8JZAWsnpc5JS4th06bMsTS3qg4+P3FhWRwq8ORdD0j0P4B30Jyfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=rey+scZ62xMoGa4nUwm+wzPpdCIBoI8mpwLpzwSJFyo=; b=BbtLDPE7zmqGvAO62+QlHMFZ3rPAmQgQx/+LnfCobUDJoGryl7K5R8XS6H5yb5ZZJafJWMiB4PhJOLAOpyye3pdM91qL0KOjnJBVrghye9NlF5oKkCZyG5+nZztIWAW0VaDscXh6LpSpTj9P4bRtoOPDq6pWwpMb0gDBBxAzAXc= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB3408.eurprd05.prod.outlook.com (2603:10a6:802:1e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.18; Sat, 30 May 2020 04:27:18 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c%2]) with mapi id 15.20.3045.018; Sat, 30 May 2020 04:27:18 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Saeed Mahameed , Mark Bloch Subject: [net-next 14/15] net/mlx5e: en_tc: Fix cast to restricted __be32 warning Date: Fri, 29 May 2020 21:26:25 -0700 Message-Id: <20200530042626.15837-15-saeedm@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200530042626.15837-1-saeedm@mellanox.com> References: <20200530042626.15837-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR05CA0004.namprd05.prod.outlook.com (2603:10b6:a03:c0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.7 via Frontend Transport; Sat, 30 May 2020 04:27:16 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6417cb68-3ad9-475c-71c1-08d80451bcbd X-MS-TrafficTypeDiagnostic: VI1PR05MB3408: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:510; X-Forefront-PRVS: 041963B986 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Khw1q0uTmIbfa+BM4n8p3h2cyEvjSxDbWWw0Wmuaqtj5GZKxkReZNTDb8SqgbL3cgxhDszYhAJGhWFVgWdLMdx/hJ1bjvLJX6MNtKD4cp3pLxxpfoVH0zTmahplbfS5rzLSPDa4ZSalJWzcOKTwL31qjRL0PKDZ1ckYYjNQk1hXs0tpnpc06qyrVdxmNfz03dhSmCjsKX4XnsEwPJGc34blVtPsFi26sVpxAWx7t3PqHeYCeGxRTC4iMpmobs/7PNXsg5nkif2mtFT0kjDfWFuY2ICyx/xni/7LDnvvmIw4f/x0WLnioD/a7gbOQjJ5ka0YHZAD7741/YKXMAw9wHjAeFGeiqEfBgfXWpJpq3aaMbXHSBLSkqMAn1bPR2bKN X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5102.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(366004)(52116002)(5660300002)(6666004)(107886003)(186003)(66476007)(26005)(16526019)(66946007)(478600001)(1076003)(8676002)(4326008)(6486002)(66556008)(2906002)(956004)(86362001)(6512007)(83380400001)(316002)(6506007)(36756003)(2616005)(8936002)(54906003)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: B7OJjuwEuD4uZ78qlAnUjeRUDl8MWbpXI+YLlt38QpluNOg6h/aG8gnIErbN3s/5DL0x1hfJUakbxUp2VcxQ6TZXS8Fy7cDOsNUsvjGui+A9KfVG2uVT/j0VRDMF1JERoJjtmqS0mJfjUoOIGt7Y6JrZb/DoIm0CbiMCV5I6g7wxIvcE9FTo7GANzAITgYTV/NfqQMC48/Y4TJB84/ov7w0G8MVvkje26pyyf//3O0KqVU0pE2qJu15kIjshjOowREwZUK4Scb73dMqdcdUdNdfsprUj+w8mAltg6Lmjlyjntp3FUu3/QBWaXQkPU95OL9XBxzBe9Yk+4LIyBDYF8dn88lIy52r7+SnrQFo9lyDLDRPGeGgkH29N8GFuA+6/mVuXPxLlOOWJ4czfB6RSihYg2hNR01315Wh0coTjkj6NeVR9qUV448dx1j8Oat2bFbFDcCuS/c6C2Nrt93ePmG4AfEyHHUkUkW7z2YrOQqc= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6417cb68-3ad9-475c-71c1-08d80451bcbd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2020 04:27:18.0607 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Z92ixXFfedDoJtcun5vbTCgnRYuCieGZfPni1Er2FZ+AaAfDXIW0BoyXMLwom+koXdrWVB6gjuiV3dFWpkk/OA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3408 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fixes sparse warnings: warning: cast to restricted __be32 warning: restricted __be32 degrades to integer Signed-off-by: Saeed Mahameed Reviewed-by: Mark Bloch --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index e866f209f2523..3ce177c24d525 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -210,8 +210,8 @@ mlx5e_tc_match_to_reg_match(struct mlx5_flow_spec *spec, fmask = headers_c + soffset; fval = headers_v + soffset; - mask = cpu_to_be32(mask) >> (32 - (match_len * 8)); - data = cpu_to_be32(data) >> (32 - (match_len * 8)); + mask = (__force u32)(cpu_to_be32(mask)) >> (32 - (match_len * 8)); + data = (__force u32)(cpu_to_be32(data)) >> (32 - (match_len * 8)); memcpy(fmask, &mask, match_len); memcpy(fval, &data, match_len); @@ -2815,10 +2815,10 @@ static int offload_pedit_fields(struct mlx5e_priv *priv, continue; if (f->field_bsize == 32) { - mask_be32 = (__be32)mask; + mask_be32 = (__force __be32)(mask); mask = (__force unsigned long)cpu_to_le32(be32_to_cpu(mask_be32)); } else if (f->field_bsize == 16) { - mask_be32 = (__be32)mask; + mask_be32 = (__force __be32)(mask); mask_be16 = *(__be16 *)&mask_be32; mask = (__force unsigned long)cpu_to_le16(be16_to_cpu(mask_be16)); }