Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2609757imw; Sun, 10 Jul 2022 10:33:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s45p2teeEdsORMomHA01JgOLuYPI54HemCD/iWtqprly2NIah2H7RvF7XsfTi/kkh74eBl X-Received: by 2002:a17:90a:ff94:b0:1ef:8e7b:c93f with SMTP id hf20-20020a17090aff9400b001ef8e7bc93fmr12863981pjb.104.1657474433873; Sun, 10 Jul 2022 10:33:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1657474433; cv=pass; d=google.com; s=arc-20160816; b=FHlzUU8AqjeCMtSpTv7aC9xW9/PEEF2EcYsQzt63NSBXxhl08RTQR9LXxlKNuoa1RV O8UburwmVQjcvbbgGAxR6VVmzxvR4+AY86nkME6mdFoi8UUqJJVd5ax2ZboJemRV9dQc LjmjbgOOWhVkEQcI5YyP2Zj4FC6Er95vIm14vnCf+DNqEaheoscoZwsHJhpxvFl+2SqW v5VOaTdGyK/xSJUs4ANG+tV9NEieDXMbwHxUvmpPIatRqm5lFmfmOSWISuIboeRPpu8C 8tRqSxnOdHtntVEbZ6oaefWme90CD14IfqZ7cBNbjG/87ClviG91CDvawF6U9ljXvxtJ D6JA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ax4Z8QmwAQ8cwH4bLDHV692v4k+bXZnEjQJP2AR4WEY=; b=bAlDY4Xvz4rfXuZEFFCpb0E8JwTM0wx8aSzpLhJkfi12aUpAmj7td/bDgCAYLf00tY rie0NvlS6JsQd+nPgVhNBIVAf46gsCsHGrglunZeSfeQgC8HsIJE8F3kyj2w3m4cjiV6 tUW2x3VEkGM4fbNAn5prmm8IvKimuLw4PsojToWguB6bF8+AvmWBTgZw5dLgx5LiSKHF cCDcu1uQXO5VGTEImX8mJfGh5Qydof8Cwdz6vnaWdcJuRuoa6iPTcSZ+0DJdvKTti8Rq scgYkHpXY7c8I8dMS5kqv/xnLPbP6o2yle4bt95HK9qH9B+jZuLJU3vgOe8wRyWAMSdi guLg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@plvision.eu header.s=selector2 header.b=qyhat7ui; arc=pass (i=1 spf=pass spfdomain=plvision.eu dkim=pass dkdomain=plvision.eu dmarc=pass fromdomain=plvision.eu); 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=plvision.eu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c4-20020a056a000ac400b004fa3a8e001asi7605430pfl.209.2022.07.10.10.33.41; Sun, 10 Jul 2022 10:33:53 -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=@plvision.eu header.s=selector2 header.b=qyhat7ui; arc=pass (i=1 spf=pass spfdomain=plvision.eu dkim=pass dkdomain=plvision.eu dmarc=pass fromdomain=plvision.eu); 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=plvision.eu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229727AbiGJRXd (ORCPT + 99 others); Sun, 10 Jul 2022 13:23:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229712AbiGJRXL (ORCPT ); Sun, 10 Jul 2022 13:23:11 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05hn2245.outbound.protection.outlook.com [52.100.174.245]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3AFC1402D; Sun, 10 Jul 2022 10:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QNKnR6MUTbhYE5tJKblPywpFS/MWAg5q7wod9tCW2FtA5ygBXeFjrCNzjvFZM5JnyyV1UFUe0nyzs/SMjBVCfNS6OSEzdaV/oW5MnE9443MqhJTEEOqwag22wxB3K0F2mJfsxxNqLunMBYaVJ5IN1lEhInCdz4HbLlXPciexGaZqIzT6ln5dEETnKsSbb0W9m0vsxm9OO5U9zM1qt3Qoel3Q9o/gROMIzDGfxlKGt27BFWZCgZgCDoYRphhuQ8dfVRn95fSGOyexIh9aGh+z4y4OELDo44Mh+8RX7aJMCgkCEItphG4Cu+BvXn0br4ADQewJELU1g+PbBW0a5Mcj5g== 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=ax4Z8QmwAQ8cwH4bLDHV692v4k+bXZnEjQJP2AR4WEY=; b=IuyjTVLyUlcKbGC2K7SP/8GqnfN74zv7Ijwl9XnA/wVqD5EUlFw+hkYdJU5Zpp3MmoP03+hPIephPTMYOsIt1+y3QKKQpS1zEAUJhi59ZPr6dA87sNoSneKOKZ1AEqHDlXWarkLmVia4HrnqeY0MYLMv+tsi9DWFaLakUdJwRCTpZ2P0HFH5dK7ULy3VS7PmDP/KDFasyT4SIMWC17wzqwTPOF3upJ66//pbLOEdFJP07V6yQ4mjTE4oB5JrY9R+FhTG9Q4KFaBZMXe/RXXncxUe4UNVv02f7e3WqEluO7bzUPINzg/uYWhIx7Qi/UDvVY45r9/9yMaHb4kSwvQaIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=plvision.eu; dmarc=pass action=none header.from=plvision.eu; dkim=pass header.d=plvision.eu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plvision.eu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ax4Z8QmwAQ8cwH4bLDHV692v4k+bXZnEjQJP2AR4WEY=; b=qyhat7uikUAKowZMTaXGjJ0wUKlvaTTj0ILQiDcYbqqFQufV85lALme08qbG+Co9l4cnXgb2tD+vMNRPlWBdvoU2dr2xqbwnTr+VeTlnTYXBuLUmJz/yic197Gxq78c7fwhprjVM9zchV2OXfmhWSS0Ai+AicoBWrYQkG4/N1tM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=plvision.eu; Received: from PAXP190MB1789.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:283::6) by AS8P190MB1109.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:2e7::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.21; Sun, 10 Jul 2022 17:22:41 +0000 Received: from PAXP190MB1789.EURP190.PROD.OUTLOOK.COM ([fe80::d521:ba19:29db:e42d]) by PAXP190MB1789.EURP190.PROD.OUTLOOK.COM ([fe80::d521:ba19:29db:e42d%3]) with mapi id 15.20.5417.025; Sun, 10 Jul 2022 17:22:41 +0000 From: Yevhen Orlov To: netdev@vger.kernel.org Cc: Volodymyr Mytnyk , Taras Chornyi , Mickey Rachamim , Serhiy Pshyk , Yevhen Orlov , Taras Chornyi , Oleksandr Mazur , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org Subject: [PATCH net-next 5/9] net: marvell: prestera: Add length macros for prestera_ip_addr Date: Sun, 10 Jul 2022 20:22:03 +0300 Message-Id: <20220710172208.29851-6-yevhen.orlov@plvision.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220710172208.29851-1-yevhen.orlov@plvision.eu> References: <20220710172208.29851-1-yevhen.orlov@plvision.eu> Content-Type: text/plain X-ClientProxiedBy: GV3P280CA0058.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:9::28) To PAXP190MB1789.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:283::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 724893ab-237e-45c4-932c-08da6298cb5d X-MS-TrafficTypeDiagnostic: AS8P190MB1109:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:5;SRV:;IPV:NLI;SFV:SPM;H:PAXP190MB1789.EURP190.PROD.OUTLOOK.COM;PTR:;CAT:OSPM;SFS:(13230016)(4636009)(396003)(136003)(346002)(39830400003)(376002)(366004)(26005)(41300700001)(1076003)(6666004)(6486002)(6512007)(316002)(66574015)(2616005)(36756003)(52116002)(6506007)(186003)(38350700002)(2906002)(38100700002)(6916009)(54906003)(86362001)(5660300002)(478600001)(8936002)(66946007)(66556008)(4326008)(44832011)(8676002)(66476007)(59833002);DIR:OUT;SFP:1501; X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?e+h3Qvs+qxEqR2EwwR+ORsCrLiw85NtR6Dtm1IZdGZNYg0CBLOvmUbHrdBFt?= =?us-ascii?Q?UNTYGw6vKS7WXrnW3fR6OdfmXZObSiavfJsdz07CsppKUGBi/a7stopxlCFm?= =?us-ascii?Q?lkKoN614br9v/3lMRyouDDUWijtkjV/gPOD8mmYJpkgogn604wuENkTewdpm?= =?us-ascii?Q?Gn2753winNJ7qg7pkEzzNS82ND+m/GD2t7PztnbzbiNdThlJlZXRzMx5MP9b?= =?us-ascii?Q?/t5yCaywfqzMfGd5bHEdoEUgEFAQyCb8DWE151a0YASb7pinokbTuVvdTv9A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=3D?= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?2EphegT+ZZ+8DbrD/pUI10A+macL6GI+B2iqRqib4iwJ5x/9vwxUa1x726S1?= =?us-ascii?Q?YEHdpJbJjwahmL5ZWOa8b0oRMH0mqoJrLRgHSIfXtlxi9gYm/tzzfLFppiB3?= =?us-ascii?Q?hd4n1ryeDaYRPS4Xtk7ut/MAt2xIEqSvL1DnTHsF9NUEK/UAOOm6X4cDnqhh?= =?us-ascii?Q?aWdZAMIVeBLesTIJrRjUMo4SUjmlDGzYGSs46Fdt8MheQRS9KAAJDp8Mgvkz?= =?us-ascii?Q?mxY687iM2dxEkqXAaGtV5ovYQnaFgEWyq7zXNRqEsKPwZL/CKY9xuW3K1GjS?= =?us-ascii?Q?kqPcFy1H+gJpzd4bntCg2ztrnraxsW0VubcKRQZ3bfikKYpNzNNN2SZC1/Ky?= =?us-ascii?Q?1X8aGxYaCsVvLWJMjOtNyOpuE9ulH6PavwYnWbEIQFiMUpmPwc0Q5EigwW0W?= =?us-ascii?Q?JUvXzvUmYGAsflFpTXt/gTPnix7/norKLkuDmuDW8/1REx88EW3EaayTapJm?= =?us-ascii?Q?1VTSOkgfqfZyZx69aPvShEAb1GMCL+pKLLzLHYBOeUMImgbgcVC22Ds9VzsA?= =?us-ascii?Q?0gkrdW7d3+iUPuy7CVsPwp6KK4ksuJxKk5eROeocuA7X2KbP4flEH9GznHyw?= =?us-ascii?Q?2CDVopPhg3R2i9nuLgmolSGEDdlYZHtsasPqzsAqEgPh4imxACIcYWHS0iGP?= =?us-ascii?Q?nGvwTICtT903IGg6jHuxoGvkGF4qmWDOrx78CrAJe2/+IQqOd5q8FjFjdDfr?= =?us-ascii?Q?A/sKlzWUlb8RKwwp5bi2w3NnxTBB2Jwez9ZBeTo/HEW3XGYYsLDCfIOSZ+CU?= =?us-ascii?Q?EyEXi2LwBeoQtB/AJaKq1nbdVE0zPYhZF1FSIYzWQGLFV7fFgmYVLedjB6pQ?= =?us-ascii?Q?vxLmqcB5EXadthMVwv/v6k3a+sKDXd8XnGvhjJfu1HdRM6yQ/pG8d85eIel7?= =?us-ascii?Q?alsHh8FIBNN1VW3ikllBTTZiz8Ew+/QqVwws7fQ383TCY/M39o0QmRy62b/F?= =?us-ascii?Q?9yukNLeI/77mi3hpij/cj+326Tr/VJ6nMftfjepOQGs6TxQgYaIsxKOgY5em?= =?us-ascii?Q?ey5NDbisUwCHt1BJMgyzfKyTQOlMmoDtHI8+9bOOC40DI+dCgetbw4kGqH4c?= =?us-ascii?Q?4BZJxoLBN4ft4dqTlsqBTksP1azJvdIZ3xy7snzKnuV5RSAgjy9GzmJWh/Ef?= =?us-ascii?Q?kZ8XqwO0BTN8dSS7ISY547F7KBg3MegSxx9A2fsBPccoQX36US6Eb9+cvtS2?= =?us-ascii?Q?4bMbnjijwvLvOO+BjksCPTlJ2O8UQKIEVbCNOAVj1EFeTwuGWEPmSsfhHIhu?= =?us-ascii?Q?TWml+5M+B9x6b2UWuAqFn5X/0M4zgTBw9iX85FcLiEUXvoS/e2g+sbmliu61?= =?us-ascii?Q?VIBG+YqT4qNF0NT1j7eY8jUZ3w9THCMCq+aB4HQ7sF3BW7AzCWTnX6GyKAlH?= =?us-ascii?Q?OuF+TlTiZkAEC+g6Ld7DX6d9hjKgf0s4ogQkXWJAr9EZSSiX6pIwtFpv+aF4?= =?us-ascii?Q?vQY0LnpHBjxjer2CnDOoMB3Ov4WiVBiOeXTC77GnGYWEmyy8bWRm5cMhp3xN?= =?us-ascii?Q?FVtySAMieMprBFYaHun47CUj3SaTdgipmvnrBgW+QlrUqMYaOPaiDqUlW5UZ?= =?us-ascii?Q?7r1ApLQdauhXNxMfM+lhi7XIPx54DksXZU+oxytXdHfZsQPHq80rQZBBkf4u?= =?us-ascii?Q?cg=3D=3D?= X-OriginatorOrg: plvision.eu X-MS-Exchange-CrossTenant-Network-Message-Id: 724893ab-237e-45c4-932c-08da6298cb5d X-MS-Exchange-CrossTenant-AuthSource: PAXP190MB1789.EURP190.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2022 17:22:41.4211 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 03707b74-30f3-46b6-a0e0-ff0a7438c9c4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: u0axz8BNT5cil3gM6SRo2+vs2/KMt77XDXdDYXpTzpPsmLfFVDne4RsiaOZEfcuZS11OGF/Vh/Mmc19HBHRqIR3gFjjYHKG6pqN+BP4vO9A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8P190MB1109 X-Spam-Status: No, score=1.0 required=5.0 tests=AXB_X_FF_SEZ_S,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=no 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 Add macros to determine IP address length (internal driver types). This will be used in next patches for nexthops logic. Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov --- drivers/net/ethernet/marvell/prestera/prestera_router_hw.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/marvell/prestera/prestera_router_hw.h b/drivers/net/ethernet/marvell/prestera/prestera_router_hw.h index 43bad23f38ec..9ca97919c863 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_router_hw.h +++ b/drivers/net/ethernet/marvell/prestera/prestera_router_hw.h @@ -31,6 +31,8 @@ struct prestera_ip_addr { PRESTERA_IPV4 = 0, PRESTERA_IPV6 } v; +#define PRESTERA_IP_ADDR_PLEN(V) ((V) == PRESTERA_IPV4 ? 32 : \ + /* (V) == PRESTERA_IPV6 ? */ 128 /* : 0 */) }; struct prestera_nh_neigh_key { -- 2.17.1