From patchwork Wed Dec 13 12:52:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121762 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5432120qgn; Wed, 13 Dec 2017 04:54:13 -0800 (PST) X-Google-Smtp-Source: ACJfBotF5fgpX/+hzLvW/PduDpMNssIKxtsGfHMuDiXSTIthYoX3cmN4Ukbihhm+M+YAZh3Hvlml X-Received: by 10.223.164.20 with SMTP id d20mr2266822wra.103.1513169653878; Wed, 13 Dec 2017 04:54:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513169653; cv=none; d=google.com; s=arc-20160816; b=l/WW6AjIjJ5wQcijlKOfHUgYFhYtG8bhVoQUFf7IA1nJT68tdIWTcUFb00LeerUenU E5rZyNtQfK7D5byskprbK+IWKgOoR1a2Ts3bTLDfCm21nJDr+bDu4egKVshA5UkXPjz1 FePjKtma34SlZnSujPJO3BHk851E6Wr70YXcTtNGHXHsHRFGnQBZ3JVswbufTwY3u8ei EQUMXb119f8bJMtT5CCXOEUw1EKFi0QqiLxiH6PBNivW3pFd/4zguRA7ZFUdWsPJXbk0 NZojjf49f1dQIIu8YcjTTKh9EpLZ0H67v8vZkUXTaSC9C4YVSdclNdzoDQJiNR2NPEN+ Bubw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from :arc-authentication-results; bh=eVs96R+1G0tMjiIcaY5z3LluFZ3+dPAGEitdHTeKSGU=; b=dwpco8EdxRqkcfFmGRvVIQmF6sVKy4vBy2VWyN2CKeV1Kz/6Cpr2gYZNTmxMj+dYG2 df+Gqrqt0rqElakUztfTscEIBuixWOfGx7miSmi4/GDK9JwZyehpdxIwRs6D0c104TRO ajmvE5UlNx5EhVhg/fhIaHkCZccBXk1sRjLshbGfRaUbxYGUAr7XuDn3P7ENKDxiiPG6 3rOCqynLgTXEUd9fK2Pf3BUql3cqmGJBWkrBLDcIALQfjiz8xlF5SGQZk1I7wtHvMTAz mUGWhhwQzmH5A7CDaCJ/rlnsNkAyjaV0/OHZ7SBG4E8gvfN2kRZX4rBei598zRmzncxM RkDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id 204si1441545wmb.71.2017.12.13.04.54.13; Wed, 13 Dec 2017 04:54:13 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E6BC17D34; Wed, 13 Dec 2017 13:54:07 +0100 (CET) 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 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; 3:5kRKKUih/Vf8iRd90iZWANb4SZP6i5zeS/i5S18LzZdQr1j3nNVxQ8fByFL9L2ffdNFP8HU2d4WieOvgk9h/cClZVYPzFbnp5qs+EA1tvmqWa5kGODaYL+KQzEgeocDtQUPKjWawXc2y1o3eBR6AcAioSUY8yrZBpPw4je+DpwuPSQb/EwOvmOvgMQWYUDb4jzfXmWmxfs8CWL7z5EsMxTQ86MMzvlwLbgHvJ2PDpJw3ylvWTfWuIl8Niq5PL9agTYrF/yisruVHz6cP0ApZYrD08/SlXPAd2Jt1OF7hgSVdl4/2aJIrkRTWlUKyPpUzt5iZHP1yjyqdDcYjEjwpESM+atwu4y/nybfo+1ACrx8=; 25:/yr03hZKFsKLeytYltpha8sE/YpR0izBnZrBvW+hw4Q3GWVIkEk1O94/DN7ev8z2Z1xFVOGjBlBHF7xyGF7BOhOpkBM5QSa4U4XqIGaMs7Cypu1pKkBy2rVWsJdyNZB8UYlca/MhaIyrylsxK8x00INPzaIrMLHhrFlZuDPsKbVTFCfBTDGg7/B5yUv2Zori2Pi0V9LF/amZgbwah4JeMNOnf8qWKw+XFLZ5PH/nJGkj4FrQAQAFulGWLWNoIVuM0kSXoxgOMOMvdiURHhfltMm6KUZvbK0/GyMNSTj9aLSJ0f4Kn+ONiVZPvhWFULagoysgNOvXaU04P5ODlhffPyQyC6LArI8qmpx4xv184PM= X-MS-TrafficTypeDiagnostic: CY1PR03MB2362: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2362; 31:W6gyNbYScqyRFCF7vYm74AI+l8rqfqAKv5RGw1/Upq2j2KFEzEKC2KxlExCyCkalqzd17l8M7GmTKbyF/itEpEE/x0VaZ69sWJh700/cHEg15Sd59vJ1bYVjEGfVVRPCP3iqouqthY8FgPDUPUi1m0E8KeN8wRUKKshwzKtoFxJSflH3bkiTJhf1cupltpJpAkFwCj2+Jrjxxs5tH7WoXwMFg57l2zZJ8Jo2wP+X2dk=; 4:U2rkbaGQ9f6CgHWuDLrq2jsMRWydt6Q+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?q?1=3BCY1PR03MB2362=3B23=3Arwqu?= =?utf-8?q?pa8EBUQGmBKSiKuRNZyOqd4Je/40gCVy7kIc/TrN5h93EgJrJhpil3cY?= =?utf-8?q?GEA/3Ik1T7e8UfQj8RghMgw95mBoo0fWtVDGAGU31wsm4TZFENIpOW59?= =?utf-8?q?CCjUcWUl05D/l/Obq9XGjwE9W8YMerCFsoy8fDjN14c6o1Aoi4HdZB2f?= =?utf-8?q?uErWLbf8i0y4Lx5oMPHvN9hOyINtb2cbeRO7LBZuhvN3lXwovtepMPVv?= =?utf-8?q?b0B41NfYpNTqgYJd81E0tlJCsjg21VyJtSRejULh/urtIN2ayUYKwFC/?= =?utf-8?q?LbCCjISlUvl6uSTRSdrEui76KTLJx9v5J9l9MU8Y1r9FlBQ6eB8XRAD6?= =?utf-8?q?w65q7TfklpR/si0s41ZmSHwR9cGXiOi616n6V2t2HGrS6EsW5yapw4Tp?= =?utf-8?q?y1O5Jzs48wH66uZ11fvclZtBCFZQgL0tazbH2YQXf52eqAtBuFbi4HIx?= =?utf-8?q?7sPD8jZCTuqUHYJ3BOAvIzhLwJze55zbVzw9VDokaD3HI5J2my+xOTRb?= =?utf-8?q?C5TfZ29GYOZtqpty5FvBRvfXFbqfZU/aN9CK+4b5A60PIwa9Yoe/xJgw?= =?utf-8?q?B03/JrreI9SsWdpFJndm/I9sTkczcQzEstxJ6H+WT/LIMcIwDu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ezIWOgDHLK7soYVyJ7AsK1cdL9XABElJIzH0g3WBchHeIGGzzCXgad+RjkiPmsfgLeklP3aV9dWXJQF0xoFrINz0cBJ8wfEVYI+oftTkXO0bDpMVas8lvL3CuPt8UNKA15Mn0u0uxaBx8Wg4J8ztGr3wlfRAi7rEm08=; 24:RBh6z57+Tn/FfLbpSUvywcZFo54BgxOl/HlBCHUE+OyR0CCYZCKxUDNJAVIZUS8YUroAQnSm9NhoMqIbQx5sh2CTYrNTEJ/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-dev] [PATCH v2 2/5] lpm: fix compilation on ARM BE X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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(+) -- 2.7.4 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. */