From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0083.outbound.protection.outlook.com [104.47.32.83]) by dpdk.org (Postfix) with ESMTP id 23B957CE2; Wed, 13 Dec 2017 13:54:03 +0100 (CET) Received: from BN3PR03CA0115.namprd03.prod.outlook.com (10.174.66.33) by CY1PR03MB2362.namprd03.prod.outlook.com (10.166.207.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:54:03 +0000 Received: from BL2FFO11FD045.protection.gbl (2a01:111:f400:7c09::126) by BN3PR03CA0115.outlook.office365.com (2603:10b6:400:4::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:54:02 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD045.mail.protection.outlook.com (10.173.161.207) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:53:55 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDCrsSg021824; Wed, 13 Dec 2017 05:53:59 -0700 From: Hemant Agrawal To: CC: , Michal Kobylinski , , Jun Yang Date: Wed, 13 Dec 2017 18:22:55 +0530 Message-ID: <1513169578-28440-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513169578-28440-1-git-send-email-hemant.agrawal@nxp.com> References: <1509617335-6354-1-git-send-email-hemant.agrawal@nxp.com> <1513169578-28440-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576432356523362; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(7966004)(39380400002)(39860400002)(376002)(346002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(316002)(296002)(59450400001)(2870700001)(4326008)(50466002)(85426001)(2950100002)(498600001)(36756003)(97736004)(53936002)(23676004)(77096006)(5820100001)(54906003)(8656006)(76176011)(2906002)(6916009)(6666003)(105606002)(86362001)(2351001)(106466001)(47776003)(104016004)(68736007)(50226002)(81166006)(356003)(81156014)(305945005)(8936002)(8676002)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2362; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD045; 1:PuM0yXFWb9QvP/S9pPUELvyilSG1z+TNvepWz8hJZYnWFRRBqgQeGtRFmKwsBjbAq957g5f/WuFR5Oyg5OoP2eg9Z4p7WysD/91iG0RFP4B/cSeR14Ji+15jjBdexTku X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7b48a08d-61ed-4acd-1c05-08d5422891e1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CY1PR03MB2362; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2362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Wydt6Q+YDhuDGDoTQgLpzJ9Tj8I4Vr5M+NJw97tle48VwTedjbtLsvU8glXxN3Lz3dXHiCNNf99MvjTx/myNaLlmszx4YldvCVFr6/Vua1HD3ER4L7SvwAeVO69Xf1HAx/d2v0j1I2rRcJY1DZZz66Tah3WYMPz4s2MaBXNtaDGxl/jGPnWXXb/2JI4EO/8JdgaIP1QKACE/Z/OORQjy0ECfo61v0lsoLdhLOKtni3fDy5noPhuGCo4WPCX9S0LUsi9WqeR2aUsfQBTfVdWc8oIhwcndGiFjCn/g99DhslqnEwiYnGeqLKLPB63VRe8rjwgguiBjEFtCYNPhto= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3231023)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123556025)(20161123561025)(20161123559100)(20161123565025)(20161123563025)(201703131430075)(201703131520075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(201708071742011); SRVR:CY1PR03MB2362; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2362; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjAzTUIyMzYyOzIzOnJ3cXVwYThFQlVRR21CS1NpS3VSTlp5T3Fk?= =?utf-8?B?NEplLzQwZ0NWeTdrSWMvVHJONWg5M0VnSnJKaHBpbDNjWUdFQS8zSWsxVDdl?= =?utf-8?B?OFVmUWo4UmdoTWd3OTVtQm9vMGZXdFZER0FHVTMxd3NtNFRaRkVOSXBPVzU5?= =?utf-8?B?Q0NqVWNXVWwwNUQvbC9PYnE5WEdqd0U5VzhZTWVyQ0Zzb3k4ZkRqTjE0YzZv?= =?utf-8?B?MUFvaTRIZFpCMmZ1RXJXTGJmOGkweTRMeDVvTVBIdk45aE95SU50YjJjYmVS?= =?utf-8?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VIZUS8YUroAQnSm9NhoMqIbQx5sh2CTYrNTEJ/59CdbKf4LK8U=; 7:suZ5bnVU9kIU28g4kHpFqeaSTrcFr1OO+lp3KhES8LRGLJdVEBrzshbXh+0sn8WrvauEUyMHQDDHjTJmkmYzT/rYFyGRkvKGR7P9q7FMQRfjXtJfJhlUcAoGqUfJZCCgkYyPWLa78KSWVikDm3T2TIR3/3wnWTtLeKa/yTR9fk7GkcpOciItK6OLNvA5SbMOOV+v7sO5NeytwGyfbs89Kojw3kl0J2xQOOXKJJcF7kRaiqRDQGOQuN5kV1gEvGe0 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:53:55.4651 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b48a08d-61ed-4acd-1c05-08d5422891e1 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2362 Subject: [dpdk-stable] [PATCH v2 2/5] lpm: fix compilation on ARM BE X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Dec 2017 12:54:04 -0000 Compiling on ARM BE using Linaro toolchain caused following error/warnings. rte_lpm.c: In function ‘add_depth_big_v20’: rte_lpm.c:911:4: error: braces around scalar initializer [-Werror] { .group_idx = (uint8_t)tbl8_group_index, }, ^ rte_lpm.c:911:4: note: (near initialization for ‘new_tbl24_entry.depth’) rte_lpm.c:911:6:error: field name not in record or union initializer { .group_idx = (uint8_t)tbl8_group_index, }, ^ rte_lpm.c:911:6: note: (near initialization for ‘new_tbl24_entry.depth’) rte_lpm.c:914:13: error: initialized field overwritten [-Werror=override-init] .depth = 0, Fixes: dc81ebbacaeb ("lpm: extend IPv4 next hop field") Cc: Michal Kobylinski Cc: stable@dpdk.org Signed-off-by: Jun Yang Signed-off-by: Hemant Agrawal Acked-by: Bruce Richardson --- v2: added endianess check in the assignments lib/librte_lpm/rte_lpm.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c index e1f1fad..a47c04f 100644 --- a/lib/librte_lpm/rte_lpm.c +++ b/lib/librte_lpm/rte_lpm.c @@ -912,10 +912,17 @@ add_depth_big_v20(struct rte_lpm_v20 *lpm, uint32_t ip_masked, uint8_t depth, */ struct rte_lpm_tbl_entry_v20 new_tbl24_entry = { +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN { .group_idx = (uint8_t)tbl8_group_index, }, .valid = VALID, .valid_group = 1, .depth = 0, +#else + .depth = 0, + .valid_group = 1, + .valid = VALID, + { .group_idx = (uint8_t)tbl8_group_index, }, +#endif }; lpm->tbl24[tbl24_index] = new_tbl24_entry; @@ -958,10 +965,17 @@ add_depth_big_v20(struct rte_lpm_v20 *lpm, uint32_t ip_masked, uint8_t depth, */ struct rte_lpm_tbl_entry_v20 new_tbl24_entry = { +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN { .group_idx = (uint8_t)tbl8_group_index, }, .valid = VALID, .valid_group = 1, .depth = 0, +#else + .depth = 0, + .valid_group = 1, + .valid = VALID, + { .group_idx = (uint8_t)tbl8_group_index, }, +#endif }; lpm->tbl24[tbl24_index] = new_tbl24_entry; @@ -1365,10 +1379,18 @@ delete_depth_small_v20(struct rte_lpm_v20 *lpm, uint32_t ip_masked, */ struct rte_lpm_tbl_entry_v20 new_tbl24_entry = { +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN {.next_hop = lpm->rules_tbl[sub_rule_index].next_hop,}, .valid = VALID, .valid_group = 0, .depth = sub_rule_depth, +#else + .depth = sub_rule_depth, + .valid_group = 0, + .valid = VALID, + { .next_hop = lpm->rules_tbl[sub_rule_index].next_hop, }, +#endif + }; struct rte_lpm_tbl_entry_v20 new_tbl8_entry = { @@ -1668,10 +1690,17 @@ delete_depth_big_v20(struct rte_lpm_v20 *lpm, uint32_t ip_masked, } else if (tbl8_recycle_index > -1) { /* Update tbl24 entry. */ struct rte_lpm_tbl_entry_v20 new_tbl24_entry = { +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN { .next_hop = lpm->tbl8[tbl8_recycle_index].next_hop, }, .valid = VALID, .valid_group = 0, .depth = lpm->tbl8[tbl8_recycle_index].depth, +#else + .depth = lpm->tbl8[tbl8_recycle_index].depth, + .valid_group = 0, + .valid = VALID, + { .next_hop = lpm->tbl8[tbl8_recycle_index].next_hop, }, +#endif }; /* Set tbl24 before freeing tbl8 to avoid race condition. */ -- 2.7.4