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 6E74EA0487 for ; Thu, 4 Jul 2019 09:33:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2F61C1B950; Thu, 4 Jul 2019 09:33:24 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70079.outbound.protection.outlook.com [40.107.7.79]) by dpdk.org (Postfix) with ESMTP id 3664B5B34; Thu, 4 Jul 2019 09:33:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6BIrmHRXaWlLD9xNfQi2KZ0y8IQMWZEOVt4Ny+wr66E=; b=qb+UZ9IkYjoNxrqPp0ZInBQvKGIqA4JGEuB8FnpKADZ0F19GJ9lYcsCZA2Tkwlr+z4DA5iFBZVuLbNxNh/tqXJTSF5tvJUlLj5UWwOaBsJcnZZgT2uSBFtMBfLqdJtRQ+TGlFI07DBXUwuUCJNzAn45x6oBkKpdyvWPQmlTl2+0= Received: from DB7PR05MB5479.eurprd05.prod.outlook.com (20.177.192.84) by DB7PR05MB5177.eurprd05.prod.outlook.com (20.178.41.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Thu, 4 Jul 2019 07:33:20 +0000 Received: from DB7PR05MB5479.eurprd05.prod.outlook.com ([fe80::484b:f910:ee4f:e95e]) by DB7PR05MB5479.eurprd05.prod.outlook.com ([fe80::484b:f910:ee4f:e95e%2]) with mapi id 15.20.2032.019; Thu, 4 Jul 2019 07:33:19 +0000 From: Saleh Alsouqi To: "ferruh.yigit@intel.com" , "roszenrami@gmail.com" CC: "wenzhuo.lu@intel.com" , "jingjing.wu@intel.com" , "bernard.iremonger@intel.com" , "dev@dpdk.org" , Ori Kam , "stable@dpdk.org" , "olivier.matz@6wind.com" , Saleh Alsouqi Thread-Topic: [PATCH v3 1/2] librte_net/rte_ip: define ipv4 ihl and vhl Thread-Index: AQHVMjrAFxAZeOX2W0aFpu2shL8G5w== Date: Thu, 4 Jul 2019 07:33:19 +0000 Message-ID: <1562225578-5818-2-git-send-email-salehals@mellanox.com> References: <1545136604-22816-1-git-send-email-salehals@mellanox.com> <1562225578-5818-1-git-send-email-salehals@mellanox.com> In-Reply-To: <1562225578-5818-1-git-send-email-salehals@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: VI1PR06CA0159.eurprd06.prod.outlook.com (2603:10a6:803:c8::16) To DB7PR05MB5479.eurprd05.prod.outlook.com (2603:10a6:10:59::20) authentication-results: spf=none (sender IP is ) smtp.mailfrom=salehals@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cd5ab297-2d1b-437d-1bf5-08d70051e28a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:DB7PR05MB5177; x-ms-traffictypediagnostic: DB7PR05MB5177: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 0088C92887 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(366004)(376002)(346002)(39860400002)(396003)(199004)(189003)(476003)(2906002)(66066001)(66476007)(486006)(99286004)(81156014)(81166006)(8676002)(446003)(6506007)(64756008)(66446008)(73956011)(6436002)(6306002)(76176011)(3846002)(305945005)(25786009)(102836004)(7736002)(2616005)(4326008)(11346002)(8936002)(66946007)(66556008)(386003)(6116002)(68736007)(186003)(54906003)(50226002)(5660300002)(14454004)(53936002)(107886003)(6512007)(26005)(2501003)(86362001)(110136005)(316002)(71200400001)(71190400001)(256004)(52116002)(6486002)(478600001)(66574012)(36756003)(966005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB5177; H:DB7PR05MB5479.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: mCH1J5HtPzWqEChbnxu+wKfUjnf42ZrtJihmLHvS2XV16qu1dCF5h0SG+cd5WhB2zNl7Az8QDEcuwyIV/I4pTjkEa8dd4Vb9E5qS4fGxqFLh9m+oi2VStPa+ExwExQ5aRVcqRhs3Qf8gioI6ZgMSMTvA1MRujCo2JqsSOBP0KXp+HNG1oTd93ilJOKrbzf7xW5CGko+vlsK7JvRpcJiD3XcFWmHCKVTM5eeJ/y4CxUtJ8WlejlJjTqipgyOwQacvjAXTcuHCUg90lQJU2wNIAwhl0sfM0qE+CAaZNZeOOVmnXiROtfOSGWUr+KxkVGrit/WsU308pLQAbV3xS0Bt6Xsini8PLQ/f1YxYvACuyiaf6RqH6GDKEY8aaKXZmuK/cmT7QWHehpsKQp0ihN0m6hzrVwxTm5bPGA224ASyz/A= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd5ab297-2d1b-437d-1bf5-08d70051e28a X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2019 07:33:19.8572 (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: salehals@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5177 Subject: [dpdk-dev] [PATCH v3 1/2] librte_net/rte_ip: define ipv4 ihl and vhl 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" Define IPv4 Minimum IHL and VHL according to rfc791 (see [1]) "The Version field indicates the format of the internet header." "Internet Header Length (ihl) is the length of the internet header in 32 bit words, and thus points to the beginning of the data. Note that the minimum value for a correct header is 5." [1] https://tools.ietf.org/html/rfc791 Signed-off-by: Saleh AlSouqi --- lib/librte_net/rte_ip.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h index e69b863..26b089e 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -16,7 +16,9 @@ */ =20 #include +#include #include +#include =20 #include #include @@ -96,6 +98,10 @@ struct rte_ipv4_hdr { ((x) >=3D RTE_IPV4_MIN_MCAST && (x) <=3D RTE_IPV4_MAX_MCAST) /**< check if IPv4 address is multicast */ =20 +/* IPv4 default fields values */ +#define RTE_IPV4_MIN_IHL (0x5) +#define RTE_IPV4_VHL_DEF (IPVERSION | RTE_IPV4_MIN_IHL) + /** * @internal Calculate a sum of all words in the buffer. * Helper routine for the rte_raw_cksum(). --=20 2.7.4