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 B9016A0487 for ; Tue, 2 Jul 2019 15:33:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 581602BC8; Tue, 2 Jul 2019 15:33:52 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 485402BA5; Tue, 2 Jul 2019 15:33:50 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jul 2019 06:33:49 -0700 X-IronPort-AV: E=Sophos;i="5.63,443,1557212400"; d="scan'208";a="315243009" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.30]) ([10.237.221.30]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/AES256-SHA; 02 Jul 2019 06:33:46 -0700 To: Ferruh Yigit , Saleh Alsouqi , "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" References: <1545136604-22816-1-git-send-email-salehals@mellanox.com> <20190325130013.3737-1-salehals@mellanox.com> <95f1467d-d93b-db22-2d60-85245fe30620@intel.com> <3d694042-dbe9-7560-5912-d865da048c7c@intel.com> From: "Yigit, Ferruh" Openpgp: preference=signencrypt Autocrypt: addr=ferruh.yigit@linux.intel.com; keydata= mQINBFXZCFABEADCujshBOAaqPZpwShdkzkyGpJ15lmxiSr3jVMqOtQS/sB3FYLT0/d3+bvy qbL9YnlbPyRvZfnP3pXiKwkRoR1RJwEo2BOf6hxdzTmLRtGtwWzI9MwrUPj6n/ldiD58VAGQ +iR1I/z9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NlOHQi7ChOOZgcf5M+tD3xNh HwUCXOcvZgUJBvIWKAAKCRD5M+tD3xNhHxhBD/9toXMIaPIVFd9w1nKsRDM1GE6gZe4jie8q MJpeHB9O+936fSXA0W2X0het60wJQQ45O8TpTcxpc9nGzcE4MTaLAI3E8TjIXAO0cPqUNLyp g0DXezmTw5BU+SKZ51+jSKOtFmzJCHOJZQaMeCHD+G3CrdUHQVQBb5AeuH3KFv9ltgDcWsc8 YO70o3+tGHwcEnyXLdrI0q05wV7ncnLdkgVo+VUN4092bNMPwYly1TZWcU3Jw5gczOUEfTY7 sgo6E/sGX3B+FzgIs5t4yi1XOweCAQ/mPnb6uFeNENEFyGKyMG1HtjwBqnftbiFO3qitEIUY xWGQH23oKscv7i9lT0gg2D+ktzZhVWwHJVY/2vWSB9aCSWChcH2BT+lWrkwSpoPhy+almM84 Qz2wF72/d4ce4L27pSrS+vOXtXHLGOOGcAn8yr9TV0kM4aR+NbGBRXGKhG6w4lY54uNd9IBa ARIPUhij5JSygxZCBaJKo+X64AHGkk5bXq+f0anwAMNuJXbYC/lz4DEdKmPgQGShOWNs1Y1a N3cI87Hun/RBVwQ0a3Tr1g6OWJ6xK8cYbMcoR8NZ7L9ALMeJeuUDQR39+fEeHg/6sQN0P0mv 0sL+//BAJphCzDk8ztbrFw+JaPtgzZpRSM6JhxnY+YMAsatJRXA0WSpYP5zzl7yu/GZJIgsv VQ== Message-ID: <93c74631-d869-9d66-5670-0d8a40fcd546@linux.intel.com> Date: Tue, 2 Jul 2019 14:33:42 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <3d694042-dbe9-7560-5912-d865da048c7c@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v2] app/testpmd: fix mpls encap ipv4 version and ihl 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" On 4/16/2019 11:02 AM, Ferruh Yigit wrote: > On 4/16/2019 10:59 AM, Ferruh Yigit wrote: >> On 3/25/2019 1:30 PM, Ferruh Yigit wrote: >>> On 3/25/2019 1:01 PM, Saleh Alsouqi wrote: >>>> According to ietf 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." >>>> >>>> Having version and ihl set to 0 would result in a >>>> corrupted/incorrect encapsulating packet for MPLS, >>>> this commit sets these fields to 4 and 5 respectively >>>> as a default value. >>>> >>>> [1] https://tools.ietf.org/html/rfc791 >>>> >>>> Fixes: 3e77031be855 ("app/testpmd: add MPLSoGRE encapsulation") >>>> Fixes: a1191d39cb57 ("app/testpmd: add MPLSoUDP encapsulation") >>>> Cc: stable@dpdk.org >>>> >>>> Signed-off-by: Saleh Alsouqi >>>> --- >>>> v2: >>>> - Include netinet/ip.h in librte_net/rte_ip.h >>>> to use existing definitions instead of defining >>>> our own. >>>> >>>> - Move definitions from testpmd.h to librte_net/rte_ip.h >>>> --- >>>> app/test-pmd/cmdline_flow.c | 6 ++++++ >>>> lib/librte_net/rte_ip.h | 5 +++++ >>>> 2 files changed, 11 insertions(+) >>>> >>>> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c >>>> index 36659a64a..f536307c9 100644 >>>> --- a/app/test-pmd/cmdline_flow.c >>>> +++ b/app/test-pmd/cmdline_flow.c >>>> @@ -3767,11 +3767,14 @@ parse_vc_action_mplsogre_encap(struct context *ctx, const struct token *token, >>>> .src_addr = mplsogre_encap_conf.ipv4_src, >>>> .dst_addr = mplsogre_encap_conf.ipv4_dst, >>>> .next_proto_id = IPPROTO_GRE, >>>> + .version_ihl = IPV4_VHL_DEF, >>>> + .time_to_live = IPDEFTTL, >>>> }, >>>> }; >>>> struct rte_flow_item_ipv6 ipv6 = { >>>> .hdr = { >>>> .proto = IPPROTO_GRE, >>>> + .hop_limits = IPDEFTTL, >>>> }, >>>> }; >>>> struct rte_flow_item_gre gre = { >>>> @@ -3955,11 +3958,14 @@ parse_vc_action_mplsoudp_encap(struct context *ctx, const struct token *token, >>>> .src_addr = mplsoudp_encap_conf.ipv4_src, >>>> .dst_addr = mplsoudp_encap_conf.ipv4_dst, >>>> .next_proto_id = IPPROTO_UDP, >>>> + .version_ihl = IPV4_VHL_DEF, >>>> + .time_to_live = IPDEFTTL, >>>> }, >>>> }; >>>> struct rte_flow_item_ipv6 ipv6 = { >>>> .hdr = { >>>> .proto = IPPROTO_UDP, >>>> + .hop_limits = IPDEFTTL, >>>> }, >>>> }; >>>> struct rte_flow_item_udp udp = { >>>> diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h >>>> index f9b909090..499a2f79c 100644 >>>> --- a/lib/librte_net/rte_ip.h >>>> +++ b/lib/librte_net/rte_ip.h >>>> @@ -17,6 +17,7 @@ >>>> >>>> #include >>>> #include >>>> +#include >>>> >>>> #include >>>> #include >>>> @@ -89,6 +90,10 @@ struct ipv4_hdr { >>>> #define IS_IPV4_MCAST(x) \ >>>> ((x) >= IPV4_MIN_MCAST && (x) <= IPV4_MAX_MCAST) /**< check if IPv4 address is multicast */ >>>> >>>> +/* IPv4 default fields values */ >>>> +#define IPV4_MIN_IHL (0x5) >>>> +#define IPV4_VHL_DEF (IPVERSION | IPV4_MIN_IHL) >>> >>> There are existing defines for this [1], since we have one in public header, can >>> you please replace them too, >>> perhaps in two patches, first one introduces this define and replaces old ones, >>> second one fixes the mpls issue? >>> >>> [1] >>> $ git grep VHL | grep define >>> app/test-pmd/csumonly.c:#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN) >>> app/test-pmd/flowgen.c:#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN) >>> app/test-pmd/txonly.c:#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN) >>> app/test/packet_burst_generator.c:#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN) >>> examples/tep_termination/vxlan_setup.c:#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN) >> >> Let me get this as it is, and I will send another patch to update existing defines. >> >> Reviewed-by: Ferruh Yigit >> > > Ahh, this seems causing build errors in FreeBSD: > http://mails.dpdk.org/archives/test-report/2019-March/077811.html > It seems it is easy to fix the BSD with following change: +#include And now with the recent changes DPDK define should have RTE_ prefix, so new defines "IPV4_MIN_IHL" && "IPV4_VHL_DEF" should have RTE_ prefix. Can you able to send a new version with these changes, please let us know if you can't, perhaps we take care of this since changes looks trivial.