Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26825527rwd; Mon, 3 Jul 2023 15:52:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlGX0eUbmW3dzXypeVQv8VTYl/4rz9A8492GeZRUSSzZVUbV5tztZid7Iwx/RcOen19rPMsK X-Received: by 2002:a17:902:c202:b0:1b7:f649:f49a with SMTP id 2-20020a170902c20200b001b7f649f49amr8669648pll.3.1688424763753; Mon, 03 Jul 2023 15:52:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688424763; cv=pass; d=google.com; s=arc-20160816; b=DCD5wtmpPlzPsp5FiaGuihYhwnVCoHz3siIY0GuepqnP58hHo0HYBdptQtqvd63yG5 sdjJ/A9bJszs9wAg83vUD3Ia07uZ84UFMXXY2IRebVksG22Dkkpm6Ij0WmOUQB5wPfbT SWDc2CHsW/6Fjzm5jHgHRUfIsHOjV9zees3gcuFg6R2nTIdXmvlAASD1B5P4xH7pww0w 8BUUc/SttM6pgZFFXDy+hvc0CURQ2wbZoNLIP2kiDzFT3AWDCoO6SWqZHiKm+u3BDTGj fREKEP7ivw4WYgstvS2T//On5szATN+jQAaLcHt0xab8p/ZidrQwy5hOKdbt6VcXRpUo oiIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bcxyD8AZojHmHGQnKc1I7aukbW9ubN01UUK4uK8XJQI=; fh=pFrgy4LPkjwBC+44bTuwwBR3ByXrG2Efdl3AJAb4vIY=; b=V4NHkYRYmfe7KkUoACFSrXwNkgfO71+yLGR9H6VfJ8kr5A4ACGjYe/XZH/ZZWJys0M wXIHzh2XEuvWp+4tLDAfBghYOkq4OM3wp/11YzLwC0kTTvjlpWIERr2GvrHHH+yWLXnr QI02K+ZmUjGdG3SGOEhfOhWKIyo9eM0AgQmdLYY4FzUAUpyZOx/bfeYNLEXCH4AlOLEK rQB/LutAXUIcjNhWtam5fl4h8jhrQXlFw3SKgDbRLE4P9mTEFi4elLXxQhAt/h7vhLTn kuaijwOQdk5J877mF/bq7H0qPqnRruI4RFdZtvz0XC7Ye3/MkUdd0t6ukwpxePZpdS4D qRwA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=sUJhh1fM; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a170902e74200b001b8419bd0f5si995563plf.254.2023.07.03.15.52.31; Mon, 03 Jul 2023 15:52:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=sUJhh1fM; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231444AbjGCWGY (ORCPT + 99 others); Mon, 3 Jul 2023 18:06:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjGCWGX (ORCPT ); Mon, 3 Jul 2023 18:06:23 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2070.outbound.protection.outlook.com [40.107.20.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B970E70; Mon, 3 Jul 2023 15:06:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bmNDEawrZVeF7wxCdsauWhfJA8dWqhcbR8D774Je3hIkN6UdnG9bDSNCX5WAejCXWnHPgoDdIHw7PS/gMr3zaMxVlxWinCgK737JQOgRZwNU2L5X4NkyBS7oDSE4sdvGlgcYC49yxTcp/IeGMH0x1uO/6Hjo5BElYvcUerFXA/HvS9qoFDOjRBAN1rFqVqLN6cFiyILp9jj1eZB6oX+2/Qt/pGv0L4XaXk51yhcibMEhXX9HUPzkPgOEDD7nAs3RGQY/35KRCAVi+vdMdwzWyIszyixu9r6wBrl9obXltPiaioi9Y4zQSDGL8hasewMY6uC0UatbM4ZQEfRxBlsFJQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bcxyD8AZojHmHGQnKc1I7aukbW9ubN01UUK4uK8XJQI=; b=bxtBcQev3AFnj3qCY6UBVEmhPgcvt7pZ7/AUpbdZ6yE5Wl6PbqA0/glmIKxjNvAfl4KParXQW4Gn72amo/k60NzBDbZrgtTjn11vdvHzhUS55KbV1WxdWwBGVJzpDqun3vjC96+wpYVWzIzuDSUnPO+mgh3O5fdb+93KtLhqFX7ME+XM/jpGlba9SEA8DBYIxbCHqzKn8CN9XEXi3Nxj+tncmfCs/YRt+cHJVmQNw7Ie0k/vOyqLQ6spqGeYPcVc7MijlT9TolMPyKcapQQXZluJIW8n2ndUKh5ZSO2e6woWdptsi6ar7dzeGexFgDqmPNkjuHZ39M3lT3jzSyFg3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bcxyD8AZojHmHGQnKc1I7aukbW9ubN01UUK4uK8XJQI=; b=sUJhh1fM9Lt7mcDiNMujCw83aBf5ZTVqU2zmURU3lBo30M/IkPDntbENBTr06896G0DltQ9E1nBbO1WmhdFg+tp0xWl3Yjzvgf27dKR8sAXCwChB3eMmNSk1MnslQZcvGLs7+CLTNbYbLspcqc+j8vu3yx33gCu5jMRq8nNLrmg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by GV1PR04MB9118.eurprd04.prod.outlook.com (2603:10a6:150:25::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 22:06:12 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::c40e:d76:fd88:f460]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::c40e:d76:fd88:f460%5]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023 22:06:12 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, Simon Horman , Florian Fainelli Subject: [PATCH v2 net 1/2] net: dsa: tag_sja1105: fix MAC DA patching from meta frames Date: Tue, 4 Jul 2023 01:05:44 +0300 Message-Id: <20230703220545.3172891-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230703220545.3172891-1-vladimir.oltean@nxp.com> References: <20230703220545.3172891-1-vladimir.oltean@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: VI1PR06CA0152.eurprd06.prod.outlook.com (2603:10a6:803:a0::45) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|GV1PR04MB9118:EE_ X-MS-Office365-Filtering-Correlation-Id: e3c56d63-380d-4cd1-3ae2-08db7c11b660 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LgQyAseS0GksIKM8o56Wjchh2aF4ECLexLQsPbV2sWedhb+jExmuzC5CEm1lqOWfH2Ko08GpIRL20WYoSnb6EZoJTG1v25v2CWN2YaGtZoqwlEzFUwupRI2dxmbZwuKbttDsePDPnaPKqihMMnZIFq5rfmY4rXvRwWltZQKrvYCNl+OhKzwSBu/j1QgMm+4/k8ygfJDdvp/eyXrLEYPjmAh+x2S3Yl3X404A6kJw8y2B6VFrC/b+5G2GGKaqWVUaKM76tOC+4C9fhntWyM1V2HIM+6kJkkvs2Owo2+iXl6hwoKAFMvVCHdmX8pGzl8K5Ujjju8pvLDgvc9qxzbR9Eub/eI31wBvVp/ULlHIC3u3dQ+8i5Cvv/6ckH38jhGC/UklHBDRk4DxnG3CiVbrx1R9uk7vVB5gpfAbmdR30y4obIPntDhACTSdwMRwjGiKSmIJFY+kb3eGByTNjCbIoawjIGEXP1MFm9fsMc0ctybtW3M319GwbjAfjyG4+C0tB4P1ZrTLUgMagsE/+LTSJkwayWfSWlfQmVkQrGzRQ9CBV2oh29UXQnfvaDoe8f4QqrpyHxPVVf4bfga3U7axU43DjRNjAykH/dA82VPjYddMnxkiAQVBDnpXLxnNCCkOf X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(376002)(366004)(346002)(39860400002)(451199021)(2906002)(41300700001)(5660300002)(8676002)(8936002)(44832011)(7416002)(36756003)(86362001)(186003)(2616005)(478600001)(26005)(6506007)(6512007)(1076003)(6666004)(6486002)(52116002)(316002)(6916009)(66476007)(4326008)(66946007)(66556008)(38350700002)(38100700002)(54906003)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?GPIG2ySQUBrG7X9gEsXPlRB/GcWQp8sk5ByHn+BukV7aSa7iKNGwyYOvHTMt?= =?us-ascii?Q?UEbvJMM5uUW6pP9nF0X/auleRTWvckUPWhsuOlBLUhjdbb6baSnYKBmuKDBP?= =?us-ascii?Q?cMXeLgG3N7fzbsMQaV4ybSPNIu8Ftx83qW+c3WClnxxrK55QEgFg/ZSg8acR?= =?us-ascii?Q?foiFt+qOWcKOuiJO+Omj6K0QC+WdQf3KEQFu8njhBV4gsWny+K13sL6d4F6Z?= =?us-ascii?Q?aMwijN5ze6e+JRSJ9I0smz71c5KorhhrXVBpU/el358QAN9us9I7Ka6gcEjR?= =?us-ascii?Q?E3hzNjHhp2p+P2eqigjACM33HlYesKnZ4OUx1Rd/dcNgz28F3HWHNO2TuTsp?= =?us-ascii?Q?AYv6nHNlTWVikiakBhkH+q0wHNgqAIZ2rjfoNDFq5YmOf4bd9Hh+vE0SXTkr?= =?us-ascii?Q?JrxgqvEDHdMLyfd5YL5+SJ4sJQOp23WGquM76oOdA6nXgiORZxy1yfEGu1tJ?= =?us-ascii?Q?+H5LKGg4gPBDmHJJcIoDlqw4ZgpP9MvW/hVf/0i6phM06bGuopwGtYkAGBrM?= =?us-ascii?Q?Q8gkB+ABEFYj6i768FuNsgKcbNk6ZF35tX70Jzd67t97l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J+YuH0lGuFUK4aLJarKGz5Pm1V43gFMjE1MSoCPJAhyvnsFkTHwR0U?= =?us-ascii?Q?nfwcODRHDnZM+KsyLgCq6CjrtO4bZCMJoASczDlW3XNQSJ3G14zXSvro49+h?= =?us-ascii?Q?Ma3cWq93ehPZuVFncXxKm4JCvNYxc80ySWxcCuJag4AwNcochQhgXqsnp1/9?= =?us-ascii?Q?1Q=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3c56d63-380d-4cd1-3ae2-08db7c11b660 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 22:06:12.0848 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: J/ku4yKX4hR1xxj9yjSh1vDSrpTZ5sKp7o84RgXt2u4gjSd5dtOPEWNHeEQ3uqHLpo4W1o2usevclppFj50Apg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9118 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The SJA1105 manual says that at offset 4 into the meta frame payload we have "MAC destination byte 2" and at offset 5 we have "MAC destination byte 1". These are counted from the LSB, so byte 1 is h_dest[ETH_HLEN-2] aka h_dest[4] and byte 2 is h_dest[ETH_HLEN-3] aka h_dest[3]. The sja1105_meta_unpack() function decodes these the other way around, so a frame with MAC DA 01:80:c2:11:22:33 is received by the network stack as having 01:80:c2:22:11:33. Fixes: e53e18a6fe4d ("net: dsa: sja1105: Receive and decode meta frames") Signed-off-by: Vladimir Oltean Reviewed-by: Simon Horman Reviewed-by: Florian Fainelli --- v1->v2: none net/dsa/tag_sja1105.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/dsa/tag_sja1105.c b/net/dsa/tag_sja1105.c index db0a6ac67470..ec48165673ed 100644 --- a/net/dsa/tag_sja1105.c +++ b/net/dsa/tag_sja1105.c @@ -118,8 +118,8 @@ static void sja1105_meta_unpack(const struct sk_buff *skb, * a unified unpacking command for both device series. */ packing(buf, &meta->tstamp, 31, 0, 4, UNPACK, 0); - packing(buf + 4, &meta->dmac_byte_4, 7, 0, 1, UNPACK, 0); - packing(buf + 5, &meta->dmac_byte_3, 7, 0, 1, UNPACK, 0); + packing(buf + 4, &meta->dmac_byte_3, 7, 0, 1, UNPACK, 0); + packing(buf + 5, &meta->dmac_byte_4, 7, 0, 1, UNPACK, 0); packing(buf + 6, &meta->source_port, 7, 0, 1, UNPACK, 0); packing(buf + 7, &meta->switch_id, 7, 0, 1, UNPACK, 0); } -- 2.34.1