From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0C090A0540; Wed, 15 Jul 2020 08:05:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5FED21C002; Wed, 15 Jul 2020 08:05:00 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2086.outbound.protection.outlook.com [40.107.22.86]) by dpdk.org (Postfix) with ESMTP id EC79C1BFFC for ; Wed, 15 Jul 2020 08:04:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hxecotNrGeAQ7xzy/AxW3YPWpMkumS+cgmfVH0AcemLhPOGuzM9DjKUjIyyBVtIiccd/03SCAXNO6HWCdRl1+a1RmPhE7W24t/IwP4HKdGjkqtQLnLU4I3SitN3n7fwhOr47N5Ze8LNxls/0yRmu25y8ou1FQ74ER78gAbCU6PyttuICkZpkvuhy755Bf82vASPuyBrcRxiKNzGeozRk4116CeFm7x3xL6dzEYqIOvBQJXiXjkyrA3v8reEqpqKi3J1KrkOfM3zK48gWe3mXdHR2Au9byAEq+g7e4ZmEDw7QdCC57ymDLZiRm/bcG5E8+He5XuNloiyc8cWLgOahuQ== 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-SenderADCheck; bh=eQbLm0FYMSBcHZtLKBOVpZuWaEcrC7QXEyytNdgIbvg=; b=nQqwrSorvmXn2JtsvTbtufqEJftlLBcX7vhRn4SbO8P3DYRyWzvSuxN56bpv+4Ao4ikBKCYGVWdMvK0WurieRG+Vtgw9TPMtQmF42ERfS1HwA/eQr9u6UdBJsYr4VUKvtYQ+L6PlG3k9noDF1qtKClOQQAKsnsrWacDeXqdj9SI8lA9zB9SvBFlpWi0Dygx9CCJifGVF2kYUkj/FN9xLmESK+LrdH3eSzP1rc7AVz6PKvQW6BGPZR1BuYZVlT3qiBRjGImbuR8fkGfDVBFXTfcG83GbPqBCxcJJw8BbH1/hGT1k9/GQTsecRMF6gNJbTB0R2l04/TlajQZ4oFjXfGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eQbLm0FYMSBcHZtLKBOVpZuWaEcrC7QXEyytNdgIbvg=; b=aWLUY9PP/rjL8LoFM5rMpCr0+e97nqgTsIXU4do5VvMKy9w2H5tzXsbuXO8K9hdRBqU1PxmAJXfUJNEiOWIhaDMocEh5OtZhZJfMQGqb16qENxCwypuRbPztU5WyApgoOzoOKbBQU3rEhrtQWztv2bP3TsTKko2LU0R3EISc8l4= Received: from VI1PR05MB5872.eurprd05.prod.outlook.com (2603:10a6:803:de::17) by VI1PR05MB6493.eurprd05.prod.outlook.com (2603:10a6:803:f5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22; Wed, 15 Jul 2020 06:04:57 +0000 Received: from VI1PR05MB5872.eurprd05.prod.outlook.com ([fe80::ec95:ae9e:77c8:63ae]) by VI1PR05MB5872.eurprd05.prod.outlook.com ([fe80::ec95:ae9e:77c8:63ae%6]) with mapi id 15.20.3174.026; Wed, 15 Jul 2020 06:04:57 +0000 From: Fady Bader To: Olivier Matz CC: "dev@dpdk.org" , Thomas Monjalon , Tasnim Bashar , Tal Shnaiderman , Yohad Tor , "dmitry.kozliuk@gmail.com" , "harini.ramakrishnan@microsoft.com" , "ocardona@microsoft.com" , "pallavi.kadam@intel.com" , "ranjit.menon@intel.com" Thread-Topic: [PATCH v3 2/3] net: replace htons with rte_cpu_to_be_16 Thread-Index: AQHWWSNOdzsB6hQeY0SHYgoYHqF2qqkIKTiw Date: Wed, 15 Jul 2020 06:04:57 +0000 Message-ID: References: <20200610120040.17968-1-fady@mellanox.com> <20200708082525.28504-1-fady@mellanox.com> <20200708082525.28504-3-fady@mellanox.com> <20200713143839.GP5869@platinum> In-Reply-To: <20200713143839.GP5869@platinum> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [79.177.51.194] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 76d84339-89db-4163-bc8e-08d82885008f x-ms-traffictypediagnostic: VI1PR05MB6493: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IpAII58DNVqYWeLUN61a1mGRA4953Ir0HShkdZ5/+FDQUr7+C+Sf5tQdVyj4xuk3bYUwYKgMl/QuKaEziqASWkC0ljKXN5SO+/LUdrjPy8Vg/o9xOthxcKbMy+X1T/XZ107108d5BbU9SKVSxqWoyyIrTiuwp2CNLHEecfo85fJbcj1qg5T7oPwotrUSDW8bmiIkf84xRpoq3uDFat1WqP1kES5BRvrN3eDPOkKBzwWSpFlEdbTBJTsTfeFLkq2TF68PGmb27uCS95xn24kb2VBfhTrdnt2f8BupnoFUiGTx53bmdMSGJa0gwevRvEDF x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5872.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(366004)(396003)(376002)(39860400002)(136003)(2906002)(5660300002)(8936002)(6916009)(316002)(53546011)(186003)(45080400002)(6506007)(71200400001)(33656002)(52536014)(86362001)(8676002)(478600001)(64756008)(9686003)(66446008)(66556008)(66476007)(54906003)(76116006)(66946007)(7696005)(55016002)(4326008)(26005)(83380400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 9pMoQ8Cwf0LKi5vsQi/xnh0Jvp4XpTbnFGVVV2C6s1DNk4wGcIBx9wwiz1so3K6q4S2vqefVlKb+4XaAEo6JslZU5lqFy3HGKqYlbEpryu/o95ipiwsPximGtVgVfQGEgTV8JOD1ELdmRg1DHDBpr1fQXkfuKTi0R4uuaM729CfkrSz9SlhSKSQ+G+L5hIigAsmF7PsLukNMxPMzVx5a6N5L4B1abc2sxMZKsA7qxoZildvfTMvyWBFGB+d/ycuAIQT5neRjMqbHYGw3Uhm16Cd2aEAT8LaKL7DB1jElEaNN0BTGP4wxc1MvxhlETb45LE1bLdidgs3cqZT3gs5goUaeH5Xs+WrWXYqypI95KfWv6CGveRQg1ggWtpcU9w/AciXrpznCIGy7c0CHLiB7kj2FCHxB60j2NLt4z+lno0S20GjI64oZHCRPv9h3lPNz2SH/1YB7DadAD4tSROTPMx7uhgo0bQjX0e5MwZ/onpk= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR05MB5872.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76d84339-89db-4163-bc8e-08d82885008f X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jul 2020 06:04:57.6677 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 4VLdOxQ7RpecC+JMWKEfErl41ee+d0mDrzXTwMCRImWj7Dn9qU2fgc5DeA1Biul0gHnRJglEOMJMGDLnIgSleA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB6493 Subject: Re: [dpdk-dev] [PATCH v3 2/3] net: replace htons with rte_cpu_to_be_16 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" > -----Original Message----- > From: Olivier Matz > Sent: Monday, July 13, 2020 5:39 PM > To: Fady Bader > Cc: dev@dpdk.org; Thomas Monjalon ; Tasnim Bashar > ; Tal Shnaiderman ; Yohad Tor > ; dmitry.kozliuk@gmail.com; > harini.ramakrishnan@microsoft.com; ocardona@microsoft.com; > pallavi.kadam@intel.com; ranjit.menon@intel.com > Subject: Re: [PATCH v3 2/3] net: replace htons with rte_cpu_to_be_16 >=20 > On Wed, Jul 08, 2020 at 11:25:24AM +0300, Fady Bader wrote: > > htons wasn't defined in Windows for the minGW compiler. > > htons was replaced with rte_cpu_to_be_16 in order to compile under > > Windows. > > > > Signed-off-by: Fady Bader > > --- > > lib/librte_net/rte_arp.c | 11 +++++++---- > > 1 file changed, 7 insertions(+), 4 deletions(-) > > > > diff --git a/lib/librte_net/rte_arp.c b/lib/librte_net/rte_arp.c index > > 784b7f48fa..227a6396de 100644 > > --- a/lib/librte_net/rte_arp.c > > +++ b/lib/librte_net/rte_arp.c > > @@ -2,9 +2,12 @@ > > * Copyright(c) 2018 Intel Corporation > > */ > > > > +#ifndef RTE_EXEC_ENV_WINDOWS > > #include > > +#endif >=20 > Is arpa/inet.h still needed if you remove htons? No its no longer needed, I'll remove these lines in the new patch. >=20 > > > > #include > > +#include > > > > #define RARP_PKT_SIZE 64 > > struct rte_mbuf * > > @@ -32,15 +35,15 @@ rte_net_make_rarp_packet(struct rte_mempool > *mpool, > > /* Ethernet header. */ > > memset(eth_hdr->d_addr.addr_bytes, 0xff, RTE_ETHER_ADDR_LEN); > > rte_ether_addr_copy(mac, ð_hdr->s_addr); > > - eth_hdr->ether_type =3D htons(RTE_ETHER_TYPE_RARP); > > + eth_hdr->ether_type =3D rte_cpu_to_be_16(RTE_ETHER_TYPE_RARP); > > > > /* RARP header. */ > > rarp =3D (struct rte_arp_hdr *)(eth_hdr + 1); > > - rarp->arp_hardware =3D htons(RTE_ARP_HRD_ETHER); > > - rarp->arp_protocol =3D htons(RTE_ETHER_TYPE_IPV4); > > + rarp->arp_hardware =3D rte_cpu_to_be_16(RTE_ARP_HRD_ETHER); > > + rarp->arp_protocol =3D rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4); > > rarp->arp_hlen =3D RTE_ETHER_ADDR_LEN; > > rarp->arp_plen =3D 4; > > - rarp->arp_opcode =3D htons(RTE_ARP_OP_REVREQUEST); > > + rarp->arp_opcode =3D rte_cpu_to_be_16(RTE_ARP_OP_REVREQUEST); > > > > rte_ether_addr_copy(mac, &rarp->arp_data.arp_sha); > > rte_ether_addr_copy(mac, &rarp->arp_data.arp_tha); > > -- > > 2.16.1.windows.4 > >