From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 20BD141BAE; Thu, 2 Feb 2023 12:11:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01892406A2; Thu, 2 Feb 2023 12:11:31 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2080.outbound.protection.outlook.com [40.107.92.80]) by mails.dpdk.org (Postfix) with ESMTP id DE37F40689 for ; Thu, 2 Feb 2023 12:11:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fXmAsJzpFrZKLIm5yvOGP9TXBVdTzkMCJ+3FwcP/uMPJ9hwv9mY/N2f/aNBpafb/5JfJAFOh3fkPJE0JXgYdgbL+aVZaHAhlr6SZQTnVQIG+Zlodvslg4EJ/a9RuU+gAXRbsfjG5pHWyJ6mAJS/9/flNdf840YXPt/dz3tpbTzyWfJyvjwbh84hzLMH3OT/Eu+jn0YZdBpuf4uZqkk4SZgHcdmxFsbvq9AqtQdTBZsCwL7Ndx0kjRbTjIfwDFGq4FsfvnW91dnMO/KSFVs1wr9rvmOyC/fn+GUoX1ZYYZbrCrUtP/z7FWEXpCJlBLBmCO2NmppWBkENuGvzVVA4XcA== 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=81t0osuQjLsSr3pC3kuMBNCNpdGNINBXCQIJFhevYoo=; b=UyoO8+sKBtTZbh+ukzH1bhH/7E6CyrIEH33PyY9njFIYA3cHK+md9uk6sKenVVJCsC9Da0wmWZLz68ccGTVHF0qUcuxExxfXoNC+B0QcHKZcRC9VvS9G6z9t+5EFuOnJng4yd8mNATDutcd+rKdZwPu2hL/8VTFG3U/6tlOlZmsvpSI7srmICbU+cbdPLBA+getJqw3FvwejWBJWJK8WGUtAM0NyJvIbJdYS0WYHhz1ZCElvGTd1Kchgkq+CfY3tsmuoRHl/ABzflJAyJ1ieWhPMfWCNmQm4328EnTMNehAkoegSmcx1R7CxgDaXhEYGUB8qIt58v+s3/4Bwv0SIwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=81t0osuQjLsSr3pC3kuMBNCNpdGNINBXCQIJFhevYoo=; b=iz5Vve3DcUscP49Z2KFy0rDGmeWJOK01VNqwuECafuu2s8VWDmwuBUVxCUdannxMX9EsBnA96xrkN5m4GslqsqGf0ZXXPYgjwUF55PvIwwwjb+ck69MQLgcqdQH9G3XY1mDiUhD8D57A67WOyGvk4rjy0Cswaq1qgd5cdDnPrLA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by PH7PR12MB6693.namprd12.prod.outlook.com (2603:10b6:510:1b0::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27; Thu, 2 Feb 2023 11:11:26 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%8]) with mapi id 15.20.6064.024; Thu, 2 Feb 2023 11:11:26 +0000 Message-ID: Date: Thu, 2 Feb 2023 11:11:09 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v5 8/8] net: mark all big endian types Content-Language: en-US To: Andrew Rybchenko , Thomas Monjalon , Ori Kam , Olivier Matz Cc: David Marchand , dev@dpdk.org References: <20221025214410.715864-1-thomas@monjalon.net> <20230126161904.864517-1-ferruh.yigit@amd.com> <20230126161904.864517-9-ferruh.yigit@amd.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0123.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2c6::10) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH7PR12MB6693:EE_ X-MS-Office365-Filtering-Correlation-Id: 71bda726-a6e2-44c6-8094-08db050e39f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LZYmyRWcaQ3Egh8TKn1OWMG9tvaFWf3LRNEHywD8q/ahfMp87jf+u2rlocsZHCGfqCwq8WF5fuSNQ2uyQVbAoUFzUSLy8C09HBurs2w+uLIWaq9kxnQj7gGgqsxXqXePD3sJ7duHVM/K8hcH+lgNg1wfWOLTfg6wcWujWTowy4+YGHBRkF2H7qflaHiG9wS5tBlp2HlJy77+FXGCs/uIhx7UfXq5+9cyVcf2r8e2jocK5PMd2oGGHVFocu6Er71/zzQn+YNIbXkjGpCGE6fA9LXycEcKb70JVvWwhX+10adTpAMg2JC8jmS8XwI0SEtjlDeu2OalaQJnggM9gpLaqwhbJY7snrof8BN0DKwINPKoonjIp9vD0yZNNPfy1RaJE3rc1cWjWjORoxFVxKOK2yrVHb2/8qEgIFDMVs1MkewGcFGL+57al3JjHj6tAn+vCvibY5KjurhFVSz33VgKf26Iq781ZxI/q3n4u4eCgv+XXDk9dS1TJB6iaZrNcYpgkB/LE1OoAsj+0LFQa/Kqpx7T5JBAD1T5Z4v4e3CcZzBaHn6NRrV3WmIHCTAVV6bdOxNBLCxlya12mFjKB1pWPISNdMu/823VoIDii8yzEN0SncgAxPaa5DUFGM4/VYztuIDojQgqFXdFekgjqQQsmt4BiUbFmhC14RM22xFUUoi/LXfliyF9qN1R43qTfHnyvc2J4ggI8PTbK6rf1F2Oz6/W6YdQd7tlXRr8ZTYS0jo= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(136003)(366004)(39860400002)(376002)(396003)(346002)(451199018)(8936002)(6486002)(478600001)(110136005)(186003)(53546011)(26005)(6512007)(36756003)(6506007)(316002)(6666004)(5660300002)(86362001)(2906002)(44832011)(4326008)(66946007)(66476007)(66556008)(31696002)(8676002)(41300700001)(2616005)(83380400001)(38100700002)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?T2d4RWpiZUd6NmtBU2srV3p2aHJUcFZFV1c2T01aYm9SMzhSSG1tUExCQjBl?= =?utf-8?B?RmxzQXJEV0NTWE9xUTdaRjB5bUswS1NVUndKZlNMdndxODZ2T0dFYllUVjlY?= =?utf-8?B?U1gzTWxjLzBWVFFsUEFlb3VPR21mYi8rU0FQL1lrRjNBUzdwRjNlOVYvRlFH?= =?utf-8?B?aU5Od1NTMkdsZVBDTVI3Y3pYeSt6L2V3TjFiMlFobW9vd2ZxZmpOZGtxaC9l?= =?utf-8?B?bkFJKzA2blZ5UldpVHhvRUlLcno4WUNUQ2FhQzZHa0w3ZVB5NnNIbUxhOU1S?= =?utf-8?B?WHQvWlNTdnlKbVRXdnp4RGdjSElr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RjZtbVRjVkVq?= =?utf-8?Q?j0/kgZxi73R/ZUu92Lgz452Dh?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 71bda726-a6e2-44c6-8094-08db050e39f3 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 11:11:26.5184 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VtoUeP4acMpx42YBI8ZFxQhzNubUpMCEuetRlui4MLqUeT6HoMcODCoEdGCbBqlQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6693 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2/2/2023 10:01 AM, Andrew Rybchenko wrote: > On 1/26/23 19:19, Ferruh Yigit wrote: >> From: Thomas Monjalon >> >> Some protocols (ARP, MPLS and HIGIG2) were using uint16_t and uint32_t >> types for their 16 and 32-bit fields. >> It was correct but not conveying the big endian nature of these fields. >> >> As for other protocols defined in this directory, >> all types are explicitly marked as big endian fields. >> >> Signed-off-by: Thomas Monjalon > > One nit below, > > Acked-by: Andrew Rybchenko > >> diff --git a/lib/net/rte_arp.h b/lib/net/rte_arp.h >> index 076c8ab314ee..151e6c641fc5 100644 >> --- a/lib/net/rte_arp.h >> +++ b/lib/net/rte_arp.h >> @@ -23,28 +23,28 @@ extern "C" { >>    */ >>   struct rte_arp_ipv4 { >>       struct rte_ether_addr arp_sha;  /**< sender hardware address */ >> -    uint32_t          arp_sip;  /**< sender IP address */ >> +    rte_be32_t            arp_sip;  /**< sender IP address */ >>       struct rte_ether_addr arp_tha;  /**< target hardware address */ >> -    uint32_t          arp_tip;  /**< target IP address */ >> +    rte_be32_t            arp_tip;  /**< target IP address */ >>   } __rte_packed __rte_aligned(2); >>     /** >>    * ARP header. >>    */ >>   struct rte_arp_hdr { >> -    uint16_t arp_hardware;    /* format of hardware address */ >> -#define RTE_ARP_HRD_ETHER     1  /* ARP Ethernet address format */ >> +    rte_be16_t arp_hardware; /** format of hardware address */ >> +#define RTE_ARP_HRD_ETHER     1  /** ARP Ethernet address format */ > > The comment is fixed above, but it is still wrong. It should be > /**<. So, I'd either don't touch it at all, or fix in a right > way. Same for all fields below. > ack >>   -    uint16_t arp_protocol;    /* format of protocol address */ >> -    uint8_t  arp_hlen;    /* length of hardware address */ >> -    uint8_t  arp_plen;    /* length of protocol address */ >> -    uint16_t arp_opcode;     /* ARP opcode (command) */ >> -#define    RTE_ARP_OP_REQUEST    1 /* request to resolve address */ >> -#define    RTE_ARP_OP_REPLY      2 /* response to previous request */ >> -#define    RTE_ARP_OP_REVREQUEST 3 /* request proto addr given >> hardware */ >> -#define    RTE_ARP_OP_REVREPLY   4 /* response giving protocol >> address */ >> -#define    RTE_ARP_OP_INVREQUEST 8 /* request to identify peer */ >> -#define    RTE_ARP_OP_INVREPLY   9 /* response identifying peer */ >> +    rte_be16_t arp_protocol; /** format of protocol address */ >> +    uint8_t    arp_hlen;     /** length of hardware address */ >> +    uint8_t    arp_plen;     /** length of protocol address */ >> +    rte_be16_t arp_opcode;   /** ARP opcode (command) */ >> +#define    RTE_ARP_OP_REQUEST    1  /** request to resolve address */ >> +#define    RTE_ARP_OP_REPLY      2  /** response to previous request */ >> +#define    RTE_ARP_OP_REVREQUEST 3  /** request proto addr given >> hardware */ >> +#define    RTE_ARP_OP_REVREPLY   4  /** response giving protocol >> address */ >> +#define    RTE_ARP_OP_INVREQUEST 8  /** request to identify peer */ >> +#define    RTE_ARP_OP_INVREPLY   9  /** response identifying peer */ >>         struct rte_arp_ipv4 arp_data; >>   } __rte_packed __rte_aligned(2); > > [snip[