From patchwork Wed Feb 7 12:59:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127169 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp447087ljc; Wed, 7 Feb 2018 05:01:04 -0800 (PST) X-Google-Smtp-Source: AH8x225ReGaO8fC/PBZXc0xQkdbVAOp/DCM2b/4ST82MAYwWP+8YE/noHrKLczoUOk8MWu+nKMpV X-Received: by 10.55.214.198 with SMTP id p67mr8838175qkl.213.1518008464696; Wed, 07 Feb 2018 05:01:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518008464; cv=none; d=google.com; s=arc-20160816; b=rNAyhossalTmHWeIS59nw2faMGyXY/GM5kN1twYxNPSu1APWoHIPs/Tr7NGEGLcsxu hKlfx1zOZbm2PaK+QNS0V50myawapQABowo7lUIxpWbN30NppSvY4g0eLkfDahyYAg3M nx7UTUPeFOrROLyenPhMY/EB6QMefaVPQN+rIzUdgQr00pOO3m3RUNnAvEiHOLqp8VMZ 0mcyeBHtAq/raCwU8TwIZxkX8ewrmYZy7Ewk14MgIvksRfz3V3u4WzA81Yx/ZYgKhk9w 3doenuwnEOujLRmohYnGMKbLfyzyH5tx1HOWvrjGv7nVkT+VgeJPLjrzlnDvehMWODA4 Dyww== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=sOP/WArNjQVlX5JOYt2ohZK2cW5ODsNZYNMAUucECHQ=; b=FTsMRf7T4rte/Osbnft30dtB0BesCkWNorJb68F623o+m0OhfbfvNwT9YL2qI8DwhF 9UE2IJgl+3qF0cxPFeifKS3ngJ9/tAvnrm1Br3WyVXwzgw7HfjjmCmAFg56rDvxkJs53 X993ugf0Ivj7bL8DyFZF3OaaW/AMLR2tmLPdwLpqLSyTu3FZuteuHQTeNTKQl1uVqZKJ ikmY+nspSvnIkKyF6b0r8JOs9yEYE6o15jX4hm52aA2IUgH+cDwYB3/mUnXeGFCiVU78 EV4LkT6gdIxPQs3N/H3tVC/xl65PDvYAIFEdhOowKW1CA+0ivFR+tA8Pge2OZRW2wjhK OoXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id j32si70547qtb.21.2018.02.07.05.01.03; Wed, 07 Feb 2018 05:01:04 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id B6FFA617D2; Wed, 7 Feb 2018 13:01:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 203B4609AA; Wed, 7 Feb 2018 13:00:33 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 96C4B6087C; Wed, 7 Feb 2018 13:00:19 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id 61F7662779 for ; Wed, 7 Feb 2018 13:00:12 +0000 (UTC) Received: from mxback10j.mail.yandex.net (mxback10j.mail.yandex.net [IPv6:2a02:6b8:0:1619::113]) by forward105o.mail.yandex.net (Yandex) with ESMTP id BF4CF4441F0D for ; Wed, 7 Feb 2018 16:00:10 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback10j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Vnkpk2g1IT-0ABOwAle; Wed, 07 Feb 2018 16:00:10 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0AZmId51; Wed, 07 Feb 2018 16:00:10 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 15:59:56 +0300 Message-Id: <1518008409-31750-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 1/14] linux-gen: packet: implement packet l3/l4 proto types X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ .../include/odp/api/plat/packet_inline_types.h | 3 +++ platform/linux-generic/odp_packet.c | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h index e8ebdabb1..a190b45af 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h @@ -98,6 +98,9 @@ typedef union { uint64_t l3_chksum_done:1; /* L3 checksum validation done */ uint64_t l4_chksum_done:1; /* L4 checksum validation done */ uint64_t ipsec_udp:1; /* UDP-encapsulated IPsec packet */ + + uint64_t l3_type : 8; /* L3 packet type */ + uint64_t l4_type : 8; /* L4 packet type */ }; } _odp_packet_input_flags_t; diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index dc16e9be4..f5151d293 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2197,12 +2197,14 @@ int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr, switch (ethtype) { case _ODP_ETHTYPE_IPV4: prs->input_flags.ipv4 = 1; + prs->input_flags.l3_type = ODP_PROTO_L3_TYPE_IPV4; ip_proto = parse_ipv4(prs, &parseptr, &offset, frame_len); prs->l4_offset = offset; break; case _ODP_ETHTYPE_IPV6: prs->input_flags.ipv6 = 1; + prs->input_flags.l3_type = ODP_PROTO_L3_TYPE_IPV6; ip_proto = parse_ipv6(prs, &parseptr, &offset, frame_len, seg_len); prs->l4_offset = offset; @@ -2210,6 +2212,7 @@ int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr, case _ODP_ETHTYPE_ARP: prs->input_flags.arp = 1; + prs->input_flags.l3_type = ODP_PROTO_L3_TYPE_ARP; ip_proto = 255; /* Reserved invalid by IANA */ break; @@ -2223,6 +2226,7 @@ int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr, /* Set l4 flag only for known ip_proto */ prs->input_flags.l4 = 1; + prs->input_flags.l4_type = ip_proto; /* Parse Layer 4 headers */ switch (ip_proto) { @@ -2267,6 +2271,7 @@ int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr, default: prs->input_flags.l4 = 0; + prs->input_flags.l4_type = ODP_PROTO_L4_TYPE_NONE; break; } @@ -2544,3 +2549,17 @@ int odp_packet_has_ref(odp_packet_t pkt) return 0; } + +odp_proto_l3_type_t odp_packet_l3_type(odp_packet_t pkt) +{ + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + return pkt_hdr->p.input_flags.l3_type; +} + +odp_proto_l4_type_t odp_packet_l4_type(odp_packet_t pkt) +{ + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + return pkt_hdr->p.input_flags.l4_type; +} From patchwork Wed Feb 7 12:59:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127170 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp449062ljc; Wed, 7 Feb 2018 05:02:42 -0800 (PST) X-Google-Smtp-Source: AH8x225bIsY8Wvhk+96hWO1lKtiYfsFHTnx43nzXw4fWLinb82HSdCSUW9cOVzLVBIrNc2q4Op4Q X-Received: by 10.55.100.130 with SMTP id y124mr8126863qkb.307.1518008562200; Wed, 07 Feb 2018 05:02:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518008562; cv=none; d=google.com; s=arc-20160816; b=Ejkvf2qVR1xsckTcv6CfO2r4FalYxBSEJxX1o2Dm3fLpm51zK1smaBTItgUpRWaDGx giKlRmEv1nyEKs3evsDrqs/9GG2qI+XFa5iA6EzTtqQQvZgwtTMKwq7DnHSWCxIbOpM6 /gyJQWewKKTDEDOqx5UWdFQe1/EPehY24qTiNNBTTzhc1cTVzQVWRoMF/ajygVIUnKQC Heg3/nZ8a0EyzoVU3eYeT0l8EUujBO3hgFqcw+LXBQ9JKHbWueaVK25/qByp/radK1D+ G34UKEOkMlQ95N2YrJKxuwqAfy5X2j2CSwKuhNhgivJ/Gg40wOkGDq2BBC7OwlbRUcE5 eqXw== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=CFp+b+ejXG+S7fofMBISZ+hCieNyHoEAqqmMQjL6cV4=; b=PHGDlUhQ9I8c2SX71WJMY+QPUIQTij8LRhQCud48SgyIv5o4wFslHHsuV7UxoinAD4 d7dlI+76gN/JOZHjgmMI7gQVIQ1m6RS2+ZnxeyZ8xBEP9G4DBSw/+4m4eI2GZG0g1hXl 0Je9DmVvUbzMg80sv2ogH3T34fzGuM9HDP7sJ2xHFSupls4Qux/I3ffdIY4bjc73Lh6q UlWZgiiKTGJ/8DjfsQyCruOzGYvpzpOk+8vBgfcspFI+vmmE0Vp5dkuAUc0/GO2EPq6g iEOG6zDky3xaXY1LJUBIz0K4qswojUJRQimTevdRSjg3oMk3KUZWLJ2BeBEymOoYl6Eb lTTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id f9si512744qke.33.2018.02.07.05.02.39; Wed, 07 Feb 2018 05:02:42 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 0D259627C6; Wed, 7 Feb 2018 13:02:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id B8BA160B0E; Wed, 7 Feb 2018 13:00:45 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A1EC061519; Wed, 7 Feb 2018 13:00:25 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id DFF1A6277E for ; Wed, 7 Feb 2018 13:00:12 +0000 (UTC) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 82C8542FC6 for ; Wed, 7 Feb 2018 16:00:11 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id snokLC9F78-0BaO4Tro; Wed, 07 Feb 2018 16:00:11 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0AZ0CfH1; Wed, 07 Feb 2018 16:00:10 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 15:59:57 +0300 Message-Id: <1518008409-31750-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 2/14] validation: api: check l3/l4 proto types after parsing X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ test/validation/api/packet/packet.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index 7d19e0125..f829d0cb1 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -2552,6 +2552,10 @@ void packet_test_parse(void) CU_ASSERT(odp_packet_has_udp(pkt[i])); CU_ASSERT(!odp_packet_has_ipv6(pkt[i])); CU_ASSERT(!odp_packet_has_tcp(pkt[i])); + CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]), + ODP_PROTO_L3_TYPE_IPV4); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]), + ODP_PROTO_L4_TYPE_UDP); } odp_packet_free_multi(pkt, num_pkt); @@ -2582,6 +2586,10 @@ void packet_test_parse(void) CU_ASSERT(odp_packet_has_udp(pkt[i])); CU_ASSERT(!odp_packet_has_ipv6(pkt[i])); CU_ASSERT(!odp_packet_has_tcp(pkt[i])); + CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]), + ODP_PROTO_L3_TYPE_IPV4); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]), + ODP_PROTO_L4_TYPE_UDP); } odp_packet_free_multi(pkt, num_pkt); @@ -2612,6 +2620,10 @@ void packet_test_parse(void) CU_ASSERT(odp_packet_has_tcp(pkt[i])); CU_ASSERT(!odp_packet_has_ipv6(pkt[i])); CU_ASSERT(!odp_packet_has_udp(pkt[i])); + CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]), + ODP_PROTO_L3_TYPE_IPV4); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]), + ODP_PROTO_L4_TYPE_TCP); } odp_packet_free_multi(pkt, num_pkt); @@ -2643,6 +2655,10 @@ void packet_test_parse(void) CU_ASSERT(odp_packet_has_udp(pkt[i])); CU_ASSERT(!odp_packet_has_ipv4(pkt[i])); CU_ASSERT(!odp_packet_has_tcp(pkt[i])); + CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]), + ODP_PROTO_L3_TYPE_IPV6); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]), + ODP_PROTO_L4_TYPE_UDP); } odp_packet_free_multi(pkt, num_pkt); @@ -2674,6 +2690,10 @@ void packet_test_parse(void) CU_ASSERT(odp_packet_has_tcp(pkt[i])); CU_ASSERT(!odp_packet_has_ipv4(pkt[i])); CU_ASSERT(!odp_packet_has_udp(pkt[i])); + CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]), + ODP_PROTO_L3_TYPE_IPV6); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]), + ODP_PROTO_L4_TYPE_TCP); } odp_packet_free_multi(pkt, num_pkt); From patchwork Wed Feb 7 12:59:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127183 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp461686ljc; Wed, 7 Feb 2018 05:16:29 -0800 (PST) X-Google-Smtp-Source: AH8x226LYZDhW1JhKSajfncs3aLi5ahvPJbKx7hhlU9Bb/ZiFuGUuTjJsWQVZL0w8L4TFOhRJW/Q X-Received: by 10.129.62.11 with SMTP id l11mr3719485ywa.244.1518009389780; Wed, 07 Feb 2018 05:16:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518009389; cv=none; d=google.com; s=arc-20160816; b=j4HfmG6q/HL3vtbqkdUsMZHQg0Sd1Ff5JopJqTIq2C+AJOBOjKwzqvrz4GPFgxO6fv aUNSyQHIIh0e91nKLhMvaZsKLaCYh/xXYvGr3V48q8CwywGsIzmFNc18EgQFkREV5m29 +myBUabddB5mWoPYOoYW24jM/dudRNra+XV1pGhtAO+73Wz4zfNUh1liZYnAObgP/vkz EcqI9Avt2h46xHA5Xa+6kPZCImUGVK80i+EabSSCWKcBR3+CWw/ipyE39sh1Cs5xfma3 n2d60mbIQNAvDf08w17LZvFqHdQe+m1P2PnxyTHN4lq329YV2XdA47WLZWD+yuJ+TAH1 NSng== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=3DMhlx8dK8j2m2CM/7+4dFCg/xSdaRIQL/mOe6Vev1o=; b=UpU+JZy8EdDpXsv+/AnBiZZ/G6bPi5t1ogWny2KYTq7MGvplcdDXggsN74Vs7z2HK9 k5epLzmVVTVhUX3K/7sk1pbo6VwEambLvD9ya+zJ6UOousrWeMmo5D3iUMuXKUSYlVEl /GuqoMuMbupljM+GmZPE+grViioTzon9DIuJRUmdTsUOlVkB2gPlAFnBVpdSBAhzplpF pk1lsSFNgXVrccPTCcVpDU//UO7vbirrjV5zsMrYmuorQtD1BhJbce7Qxyj7PiDf7ToK S8pXWwhfUuyJH7NSZ5TCwlPyjp2tFdeliF9/aP3b6h5eTCtaKW0TjPX9M794kd6C3onj F5uA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id g64si410624qtd.449.2018.02.07.05.16.29; Wed, 07 Feb 2018 05:16:29 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 72AEC61819; Wed, 7 Feb 2018 13:16:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 3E4EB627B5; Wed, 7 Feb 2018 13:02:17 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 3ECC060B5F; Wed, 7 Feb 2018 13:00:45 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 7713160B5F for ; Wed, 7 Feb 2018 13:00:19 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward102p.mail.yandex.net (Yandex) with ESMTP id E63F743057E3 for ; Wed, 7 Feb 2018 16:00:11 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id UBaysr4JQb-0BEGDMCv; Wed, 07 Feb 2018 16:00:11 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0BZ8cEQu; Wed, 07 Feb 2018 16:00:11 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 15:59:58 +0300 Message-Id: <1518008409-31750-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 3/14] api: packet: add setters for packet L3/L4 type X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Add API calls to set packet L3/L4 types. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ include/odp/api/spec/packet.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 4be515c7b..95689362f 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -1626,6 +1626,16 @@ int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset); */ odp_proto_l3_type_t odp_packet_l3_type(odp_packet_t pkt); +/** + * Set Layer 3 protocol type + * + * Set layer 3 protocol type. Initial type value is ODP_PROTO_L3_TYPE_NONE. + * + * @param pkt Packet handle + * @param val Layer 3 protocol type + */ +void odp_packet_l3_type_set(odp_packet_t pkt, odp_proto_l3_type_t val); + /** * Layer 4 protocol type * @@ -1637,6 +1647,16 @@ odp_proto_l3_type_t odp_packet_l3_type(odp_packet_t pkt); */ odp_proto_l4_type_t odp_packet_l4_type(odp_packet_t pkt); +/** + * Set Layer 4 protocol type + * + * Set layer 4 protocol type. Initial type value is ODP_PROTO_L4_TYPE_NONE. + * + * @param pkt Packet handle + * @param val Layer 4 protocol type + */ +void odp_packet_l4_type_set(odp_packet_t pkt, odp_proto_l4_type_t val); + /** * Layer 3 checksum check status * From patchwork Wed Feb 7 12:59:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127171 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp450321ljc; Wed, 7 Feb 2018 05:03:49 -0800 (PST) X-Google-Smtp-Source: AH8x224RUjwaJanWlT0due+pVrL8ucKpcJfYOhDjNLViLRgC2sWG71RM9wRhXFgV9FTun41EiL5u X-Received: by 10.55.167.132 with SMTP id q126mr9149379qke.224.1518008629214; Wed, 07 Feb 2018 05:03:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518008629; cv=none; d=google.com; s=arc-20160816; b=wDHV0k8KvinxV94y4LGb87RBHkGOcDdmi+Uc/xmYyS6O0erZHl4xbe8q6YalVM7yyu Ch2HBByp9Sjmth5poipoGwxEIkVJkqI+fSMdoW5aRgycYioxKyIbJUT8i1lgMhINLjls 46XFq2G+HwRxMjJLXHaef//o7sqtdQk4R/H30wH43Ju53qP/q4PJEzUujvt1yk7g45ZV 2/T18+Tl+BvX7tg4/4Lc3sAAGYUJMxRRKCq4C2rNpoZKHpzF1Eci3X3RmduYC/VLdi4c lY4fC+tlHj8GE4vhTpvEQH39xUeTO6EzvgQNhjqvd/f2W2gnnnyXf9JGyQMCtlMgRW8P R0HQ== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=ooByRE60csf4BUNbrU7uIQl63T8ehkOsVlFDopl3YgI=; b=N4bjUAWPxAxSgoEEim/MXhx5XPQtI5p9aSMaErVMRnPHy/bpOpjIsmlTmzU01T+V4T gE0JUq3XSJtsUUY49098APDdxx1eMLOKhDJ9MAlRUSCuO0Bigy5ZhXgf7IhAovGQnaF2 DQT5Znl+0ODI4AcZtJXaZWyNwtHtGbR1oAngRvCX8czNagBkaCAmOx/v8sYSeaMdBUEw 77tn7h83dejnJJV1+if5MQ1GOzr+oXqpJe14/03YuBZUgdcFUwxP+egG2RfV/7pQFKYV 2xIGx3SxwRbi/UpAl9Uxsldyi7Pl7KFrXmsAaz8dGU1dvyZ5Cn+5qMJXQzS3nkGmpqQC k+yQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id 12si110950qkn.430.2018.02.07.05.03.48; Wed, 07 Feb 2018 05:03:49 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id C1C2061746; Wed, 7 Feb 2018 13:03:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 46E82616FF; Wed, 7 Feb 2018 13:00:51 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id B352A61519; Wed, 7 Feb 2018 13:00:27 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 75D9A62789 for ; Wed, 7 Feb 2018 13:00:14 +0000 (UTC) Received: from mxback12j.mail.yandex.net (mxback12j.mail.yandex.net [IPv6:2a02:6b8:0:1619::87]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 5E7155605778 for ; Wed, 7 Feb 2018 16:00:12 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback12j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id NEI4jCoHp4-0CRO1AuB; Wed, 07 Feb 2018 16:00:12 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0BZOXvrc; Wed, 07 Feb 2018 16:00:11 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 15:59:59 +0300 Message-Id: <1518008409-31750-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 4/14] linux-gen: packet: implement L3/L4 type setters X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ platform/linux-generic/odp_packet.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index f5151d293..4b90e9f07 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2557,9 +2557,31 @@ odp_proto_l3_type_t odp_packet_l3_type(odp_packet_t pkt) return pkt_hdr->p.input_flags.l3_type; } +void odp_packet_l3_type_set(odp_packet_t pkt, odp_proto_l3_type_t val) +{ + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + pkt_hdr->p.input_flags.l3_type = val; + pkt_hdr->p.input_flags.arp = (val == ODP_PROTO_L3_TYPE_ARP); + pkt_hdr->p.input_flags.ipv4 = (val == ODP_PROTO_L3_TYPE_IPV4); + pkt_hdr->p.input_flags.ipv6 = (val == ODP_PROTO_L3_TYPE_IPV6); +} + odp_proto_l4_type_t odp_packet_l4_type(odp_packet_t pkt) { odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); return pkt_hdr->p.input_flags.l4_type; } + +void odp_packet_l4_type_set(odp_packet_t pkt, odp_proto_l4_type_t val) +{ + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + pkt_hdr->p.input_flags.l4_type = val; + pkt_hdr->p.input_flags.tcp = (val == ODP_PROTO_L4_TYPE_TCP); + pkt_hdr->p.input_flags.udp = (val == ODP_PROTO_L4_TYPE_UDP); + pkt_hdr->p.input_flags.sctp = (val == ODP_PROTO_L4_TYPE_SCTP); + pkt_hdr->p.input_flags.icmp = (val == ODP_PROTO_L4_TYPE_ICMPV4) || + (val == ODP_PROTO_L4_TYPE_ICMPV6); +} From patchwork Wed Feb 7 13:00:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127182 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp460656ljc; Wed, 7 Feb 2018 05:15:10 -0800 (PST) X-Google-Smtp-Source: AH8x226ONct5c3SrpfT5j4SITany9t09o9mzYVrgb/MJyjzWJhkC6MzQ2nGcZpTp+30rdbgYbHXI X-Received: by 10.55.203.157 with SMTP id u29mr8776537qkl.198.1518009310610; Wed, 07 Feb 2018 05:15:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518009310; cv=none; d=google.com; s=arc-20160816; b=Lmmjb3XPkPZLDXaq8Z5QAbnxwvKVPw6TGXLQbe941BOFsDD6vOyKZ7whw/t4XjDxzR 0qrCRheHEE4h2WO33RtTocX2kaNfq8w38YrLFG7ZPL0qzXw0NJLDYGpO96Ta3wVZ509A KCPTznZsmthP/pBg9s9w7U4zXCw8JCF9yvz41i74rS6lrWD8FG8V8pIbt5fEDsso9wPD p2N1w9BkTkLKuJBpX2cyS6ek7ihbwqJAX3VtU2/w5FKw/nhE3mffMrL8m3OpsoQbIJ6k jd+GRtLk782mFnUEpWVFHJCFppggBJW0zaFDa/SKZ/4/5bSLIBGRp48tdE/FuFCt36JF Zj8A== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=WxYORQLppgP8kHVqsOXnxK6OndNz7YBKlVrSXTkK3v4=; b=0vonguMp5LtBmRab3TPwUQ04d8p36NME60IlNQujl9WuFNR5L/q4zdcZ+jVBpwGIPA iSmAsn2t5+h4JOFPik2mJfniBBuN3OCmpr30EXRR3hbru4JMq2FYmHGOmuqrbmcCSzii DCqTFQGCoD9yp1d+/r9O2grzIgC+9bpWxjF26g6ncbg0kqsDeVxyEZlREnbLgJLNnqYJ G+Gvdg8T6W1DeoKhVKkCIvT2K6EFjnw2+dF5Hdc9LjsJnS9IjkyR4FV/d4RSlqc9080r +BAHngKIhlG4s52P207rZGaMaLFGnolBBiEMHogrFTjvBVEzAz5c0l361d6FQehWnnbF AdNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id o188si1429163qkc.54.2018.02.07.05.15.10; Wed, 07 Feb 2018 05:15:10 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 37CA862801; Wed, 7 Feb 2018 13:15:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C7E87627A2; Wed, 7 Feb 2018 13:02:06 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 07CB660B0E; Wed, 7 Feb 2018 13:00:44 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 72F09608A9 for ; Wed, 7 Feb 2018 13:00:19 +0000 (UTC) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward102p.mail.yandex.net (Yandex) with ESMTP id E8F9143036D0 for ; Wed, 7 Feb 2018 16:00:12 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id MUtQvVOoai-0CDSM8jP; Wed, 07 Feb 2018 16:00:12 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0CZCqmj0; Wed, 07 Feb 2018 16:00:12 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 16:00:00 +0300 Message-Id: <1518008409-31750-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 5/14] example: switch to using odp_packet_l3_type_set() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Use odp_packet_l3_type_set() instead of calling odp_packet_has_ipv4_set() or odp_packet_has_ipv6_set(). Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ example/generator/odp_generator.c | 2 +- example/ipfragreass/odp_ipfragreass_helpers.c | 2 +- example/ipsec/odp_ipsec_stream.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 8ac4dade3..c34457643 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -324,7 +324,7 @@ static odp_packet_t setup_udp_pkt_ref(odp_pool_t pool, /* ip */ odp_packet_l3_offset_set(pkt, ODPH_ETHHDR_LEN); - odp_packet_has_ipv4_set(pkt, 1); + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_IPV4); ip = (odph_ipv4hdr_t *)(buf + ODPH_ETHHDR_LEN); ip->dst_addr = odp_cpu_to_be_32(args->appl.dstip); ip->src_addr = odp_cpu_to_be_32(args->appl.srcip); diff --git a/example/ipfragreass/odp_ipfragreass_helpers.c b/example/ipfragreass/odp_ipfragreass_helpers.c index e7755f242..7a7960cde 100644 --- a/example/ipfragreass/odp_ipfragreass_helpers.c +++ b/example/ipfragreass/odp_ipfragreass_helpers.c @@ -58,7 +58,7 @@ odp_packet_t pack_udp_ipv4_packet(odp_pool_t pool, odp_u16be_t ip_id, header_len = WORDS_TO_BYTES(header_len_words); assert(header_len >= IP_HDR_LEN_MIN && header_len <= IP_HDR_LEN_MAX); odp_packet_l3_offset_set(result, 0); - odp_packet_has_ipv4_set(result, 1); + odp_packet_l3_type_set(result, ODP_PROTO_L3_TYPE_IPV4); buffer = odp_packet_data(result); header = (odph_ipv4hdr_t *)buffer; ipv4hdr_init(header); diff --git a/example/ipsec/odp_ipsec_stream.c b/example/ipsec/odp_ipsec_stream.c index 7487dddf6..45038211a 100644 --- a/example/ipsec/odp_ipsec_stream.c +++ b/example/ipsec/odp_ipsec_stream.c @@ -202,7 +202,7 @@ odp_packet_t create_ipv4_packet(stream_db_entry_t *stream, eth->type = odp_cpu_to_be_16(ODPH_ETHTYPE_IPV4); /* IPv4 */ - odp_packet_has_ipv4_set(pkt, 1); + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_IPV4); ip = (odph_ipv4hdr_t *)data; data += sizeof(*ip); From patchwork Wed Feb 7 13:00:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127177 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp456303ljc; Wed, 7 Feb 2018 05:10:14 -0800 (PST) X-Google-Smtp-Source: AH8x227CSl4XTjrToGiYXzwkIvCAxSJksd1c8v8AwtCYQW4s+JPKvXSuAjBJevoLUGohh0N9grSa X-Received: by 10.233.237.140 with SMTP id c134mr1635053qkg.131.1518009013969; Wed, 07 Feb 2018 05:10:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518009013; cv=none; d=google.com; s=arc-20160816; b=mutMkCFbUYALp8QL+dlyzXJSC1UuiASZ6MGW5rBQrVk7Ts1buBRhAtHhtbs1GSNb8W cuOa5hdG2HXFuHS3hw2ammUkatp8PI1MvSNA6NNJsFDSxQvENCqyqkzf9uMBiAMgIfja rw1k6PK6bpZcfGND9MWW3mR9AhkuY9cVCmLlXMwYiuF8uPPCwthnzF2P9Yy5zL3wi9tK Og1sgJYRG5cs0ZZBGLbdrywSBkwqK6s/AsLv6oZyCzv8zcJXyuNGQlnt23D7ZAFeUn8S luqZvtGBSoQlbA2k7KlZl0HmTMEndG0eajDm4EEst9I2q8ZMBT6xJTbL7bgtfu+JEAut Hzww== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=VLfJ7XnD8V5wEr52ezYsxh1cCjtXY4DA/+yO0f3zll8=; b=0RY5EE5GlLl1cLX+hlJ5N97eugeLwgICoBFrz255mypczBj1odYmqn8MIMEAMM16Rq W6qACHl3sQ36vfeilcLXOgQW6r9sepTODt3SiPdHakPwGtZ6IdknPYGoJXiN0j3smJLh uYGzex0+nf2tj7RIVTp/sscRFIJvOjAf9PiTVbjPHyd8/RtyxScYecLbWS9eBVc+rS7e Suo5Suc27J/VgLSTZZXDEDGHAriV0y9J0vxwDi2zx3Be6fuucC37baLx3MFFCwrlVXpY SKKNOQgGxTodOAU5WJ4UP/MOnkXXU+zZY0Gr7Y7ZqfzYwl2MYluykrELUFGXNJbLpbqH lYhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id w139si1419853qkb.445.2018.02.07.05.10.13; Wed, 07 Feb 2018 05:10:13 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id A0D43627D9; Wed, 7 Feb 2018 13:10:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 226E562790; Wed, 7 Feb 2018 13:01:37 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C143060D3D; Wed, 7 Feb 2018 13:00:34 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id E4E6B6278A for ; Wed, 7 Feb 2018 13:00:14 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward104j.mail.yandex.net (Yandex) with ESMTP id CD68842A38 for ; Wed, 7 Feb 2018 16:00:13 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 7WPGAQDAzk-0DquSDDP; Wed, 07 Feb 2018 16:00:13 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0CZ8LNm4; Wed, 07 Feb 2018 16:00:12 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 16:00:01 +0300 Message-Id: <1518008409-31750-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 6/14] helper: switch to using odp_packet_l3_type_set() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Use odp_packet_l3_type_set() instead of calling odp_packet_has_ipv4_set() or odp_packet_has_ipv6_set(). Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ helper/test/chksum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper/test/chksum.c b/helper/test/chksum.c index 5c7c650e0..292eb2d6d 100644 --- a/helper/test/chksum.c +++ b/helper/test/chksum.c @@ -110,7 +110,7 @@ int main(int argc ODPH_UNUSED, char *argv[] ODPH_UNUSED) ODPH_IPV4HDR_LEN); ip->proto = ODPH_IPPROTO_UDP; ip->id = odp_cpu_to_be_16(1); - odp_packet_has_ipv4_set(test_packet, 1); + odp_packet_l3_type_set(test_packet, ODP_PROTO_L3_TYPE_IPV4); if (odph_ipv4_csum_update(test_packet) < 0) status = -1; From patchwork Wed Feb 7 13:00:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127174 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp454800ljc; Wed, 7 Feb 2018 05:08:36 -0800 (PST) X-Google-Smtp-Source: AH8x226BvChrPNpx16mObVBqO7WY3V604cBrZsp0wj73pTrrbojOkvsJKnewyx3/mH4LFTpiTr3S X-Received: by 10.55.141.67 with SMTP id p64mr8223075qkd.43.1518008916090; Wed, 07 Feb 2018 05:08:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518008916; cv=none; d=google.com; s=arc-20160816; b=qIpQPQs6sAMagTsa2ETEtl/Jkz1abCMPHQJof6T2JTEgNtiV7WGcV0DEPNQrE8Xgoz tUsl+H5gRMPYYJEozNllHT/Bv1roAsYuPz2GoBgWcrU//O+2fLdlizMA5hCG8oVTsYGf 1N+H49Fws3ex0k4GXD/ACjID8iZF2GkPH3qoXTYqhaAfteELTOylA4Qnuf6+QpGv2Y+c wpaR3QFdvjB/Mj7V9I6B7qwV4VUpADE5hUgWb1/a5MjroOjZIvSQFwcGbA22EzmUWb9v rdcJhbBct86bAk+RwlEEK0z/Nt3MNv/hXpVc/W6BWGOjlVVRCN9vgIHygOyKMupvhQ9R W/Jw== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=QzS1cYOuH2+GopYYDi5wWbBAXQss5DpgEg2TJAEkYms=; b=zEjVXSAhq2D1H1gkEY+mYx3XFii+G7ZucR92dEF5LE+YwBHH4THPdIOzmHqCh0BZmT NvZFOR+pvV5XB8908lvwd6EwX4/cW9OurvniyzHZuxFP3oBPcFOd3qqrR8AQSKQuXxqk Vz1oiuMNJmSU4n12H1pt6GpOZGEenT+bo4zgTizTGDSGcZ441YJowuxqsoYqhY95AmjD b2uIjePC2F/8cV+fea8RsahGb+vCw8A8iz7rKPO71nRlBQFt0LjpKx3uZFUBJ86kU/Fx JzJC/h+LKFbI8FlUTV9lGEe/njxJQOLlZwSTfu/4PKy6loAExfCHq3Sb6piP3d336CQx 4uWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id j66si1466757qte.65.2018.02.07.05.08.35; Wed, 07 Feb 2018 05:08:36 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id B60C86279D; Wed, 7 Feb 2018 13:08:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C24476175C; Wed, 7 Feb 2018 13:01:25 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 3BDD1616EA; Wed, 7 Feb 2018 13:00:34 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id 0E07D60674 for ; Wed, 7 Feb 2018 13:00:16 +0000 (UTC) Received: from mxback13g.mail.yandex.net (mxback13g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:92]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 824AF183F2E for ; Wed, 7 Feb 2018 16:00:14 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback13g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xK0s4P1MhE-0Eb40qCU; Wed, 07 Feb 2018 16:00:14 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0DZKHlVV; Wed, 07 Feb 2018 16:00:13 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 16:00:02 +0300 Message-Id: <1518008409-31750-8-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 7/14] validation: switch to using odp_packet_l3_type_set() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Use odp_packet_l3_type_set() instead of calling odp_packet_has_ipv4_set() or odp_packet_has_ipv6_set(). Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ .../api/classification/odp_classification_common.c | 4 ++-- test/validation/api/packet/packet.c | 27 +++++++++++++++++++--- test/validation/api/traffic_mngr/traffic_mngr.c | 4 ++-- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/test/validation/api/classification/odp_classification_common.c b/test/validation/api/classification/odp_classification_common.c index 7b54ef157..191489126 100644 --- a/test/validation/api/classification/odp_classification_common.c +++ b/test/validation/api/classification/odp_classification_common.c @@ -321,10 +321,10 @@ odp_packet_t create_packet(cls_packet_info_t pkt_info) ip->proto = next_hdr; ip->tot_len = odp_cpu_to_be_16(l3_len); ip->ttl = DEFAULT_TTL; - odp_packet_has_ipv4_set(pkt, 1); + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_IPV4); } else { /* ipv6 */ - odp_packet_has_ipv6_set(pkt, 1); + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_IPV6); ipv6 = (odph_ipv6hdr_t *)odp_packet_l3_ptr(pkt, NULL); version = ODPH_IPV6 << ODPH_IPV6HDR_VERSION_SHIFT; tc = DEFAULT_TOS << ODPH_IPV6HDR_TC_SHIFT; diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index f829d0cb1..00228b240 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -1047,9 +1047,6 @@ void packet_test_in_flags(void) TEST_INFLAG(pkt, jumbo); TEST_INFLAG(pkt, vlan); TEST_INFLAG(pkt, vlan_qinq); - TEST_INFLAG(pkt, arp); - TEST_INFLAG(pkt, ipv4); - TEST_INFLAG(pkt, ipv6); TEST_INFLAG(pkt, ip_bcast); TEST_INFLAG(pkt, ip_mcast); TEST_INFLAG(pkt, ipfrag); @@ -1059,6 +1056,30 @@ void packet_test_in_flags(void) TEST_INFLAG(pkt, tcp); TEST_INFLAG(pkt, sctp); TEST_INFLAG(pkt, icmp); + + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_NONE); + CU_ASSERT_EQUAL(odp_packet_l3_type(pkt), ODP_PROTO_L3_TYPE_NONE); + CU_ASSERT(!odp_packet_has_arp(pkt)); + CU_ASSERT(!odp_packet_has_ipv4(pkt)); + CU_ASSERT(!odp_packet_has_ipv6(pkt)); + + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_ARP); + CU_ASSERT_EQUAL(odp_packet_l3_type(pkt), ODP_PROTO_L3_TYPE_ARP); + CU_ASSERT(odp_packet_has_arp(pkt)); + CU_ASSERT(!odp_packet_has_ipv4(pkt)); + CU_ASSERT(!odp_packet_has_ipv6(pkt)); + + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_IPV4); + CU_ASSERT_EQUAL(odp_packet_l3_type(pkt), ODP_PROTO_L3_TYPE_IPV4); + CU_ASSERT(!odp_packet_has_arp(pkt)); + CU_ASSERT(odp_packet_has_ipv4(pkt)); + CU_ASSERT(!odp_packet_has_ipv6(pkt)); + + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_IPV6); + CU_ASSERT_EQUAL(odp_packet_l3_type(pkt), ODP_PROTO_L3_TYPE_IPV6); + CU_ASSERT(!odp_packet_has_arp(pkt)); + CU_ASSERT(!odp_packet_has_ipv4(pkt)); + CU_ASSERT(odp_packet_has_ipv6(pkt)); } void packet_test_error_flags(void) diff --git a/test/validation/api/traffic_mngr/traffic_mngr.c b/test/validation/api/traffic_mngr/traffic_mngr.c index d11fa0542..4b70282b1 100644 --- a/test/validation/api/traffic_mngr/traffic_mngr.c +++ b/test/validation/api/traffic_mngr/traffic_mngr.c @@ -739,7 +739,7 @@ static odp_packet_t make_pkt(odp_pool_t pkt_pool, odp_packet_l3_offset_set(odp_pkt, l3_offset); if (pkt_info->use_ipv6) { /* IPv6 Header */ - odp_packet_has_ipv6_set(odp_pkt, 1); + odp_packet_l3_type_set(odp_pkt, ODP_PROTO_L3_TYPE_IPV6); version = ODPH_IPV6 << ODPH_IPV6HDR_VERSION_SHIFT; tc = pkt_info->ip_tos << ODPH_IPV6HDR_TC_SHIFT; flow = unique_id << ODPH_IPV6HDR_FLOW_LABEL_SHIFT; @@ -754,7 +754,7 @@ static odp_packet_t make_pkt(odp_pool_t pkt_pool, memcpy(ipv6_hdr->dst_addr, IPV6_DST_ADDR, ODPH_IPV6ADDR_LEN); } else { /* IPv4 Header */ - odp_packet_has_ipv4_set(odp_pkt, 1); + odp_packet_l3_type_set(odp_pkt, ODP_PROTO_L3_TYPE_IPV4); ipv4_hdr = (odph_ipv4hdr_t *)(buf + l3_offset); ipv4_hdr->ver_ihl = (ODPH_IPV4 << 4) | ODPH_IPV4HDR_IHL_MIN; ipv4_hdr->tos = pkt_info->ip_tos; From patchwork Wed Feb 7 13:00:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127173 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp453010ljc; Wed, 7 Feb 2018 05:06:33 -0800 (PST) X-Google-Smtp-Source: AH8x227pN5kmd40Dv/wNeXPwyvSWWhSDa+eJh1BXY9rBGZ6gVXm6+DoGKZdyn+lxPpkNi3A0PEHC X-Received: by 10.200.24.4 with SMTP id q4mr9407770qtj.309.1518008793569; Wed, 07 Feb 2018 05:06:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518008793; cv=none; d=google.com; s=arc-20160816; b=YlnWcqA/NbsTSm3QO2wQ7hgn/bUab66IzQyTHENa1BNx4fTwb3pYp3k0Nbk8bZEuX+ pNmL6/YiNpUjmk/a/Y3lxDim0Je3KfsY97qXbgWOES7sSqOIGpkzN6gsAB38XW1PK3GR tWSK2kKt7kCIOEfIST/YRPVrMtNjh8FgiQajWD4wnZeULEIqQeYxomG3/h5+QUzNlZlm h27oxmp/M5XBydF8Ydz/dgz1fY0faE/64fZ1n+EKOk40HqWrx735XHgu0BfqFf7F1Sot tXdiw++PkXTmjEaOuGpjauPoYx5Nbg9f1wQsIpqJDZj3I02FK/6V/AfCsqbG61YkAxNx 2bfw== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=j0CK+utWCrsunNHkMS+cFEl9HuF2Ix3kcQRgVey3olk=; b=JpaTrW3yb40Qi1Rlb2AXosXqxm49z2JkUZu2tpz/0axiqFjjIerta3yNdYvldFD68j C2bVoQzUZdz31srwm1Y8MuJsLG5ILUg9iet1feG4uaO3jR58JuB7IUvX3AaAg339OWsd g2Hag1nIExHsw/sIWlOFrIXGEOa6blaLUglghQUNsPGmHNDVabBCD7ojMkPFFL0ITn3d KnfcAW4FTqle9spi4JZhIBo2tEgRBXicxzE8XVNzO0a2N2y60tMfLy3wsAhg+nzRj7to BMX4YKryfElR7lfIyQoikMqIgHPhk/UoZJh7Wk3s8SENSgSkW8TT9cKHcutxaZrMYLwC AE8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id q42si1450036qtc.164.2018.02.07.05.06.33; Wed, 07 Feb 2018 05:06:33 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 271FC617FA; Wed, 7 Feb 2018 13:06:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 4B54F617BA; Wed, 7 Feb 2018 13:01:12 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D773E61519; Wed, 7 Feb 2018 13:00:32 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id D6D67609AA for ; Wed, 7 Feb 2018 13:00:16 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 08A56784755 for ; Wed, 7 Feb 2018 16:00:15 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Y7QQrlZKT3-0EI8BAbc; Wed, 07 Feb 2018 16:00:14 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0EZaQFwg; Wed, 07 Feb 2018 16:00:14 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 16:00:03 +0300 Message-Id: <1518008409-31750-9-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 8/14] linux-gen: use packet l3 type rather than ipv4/ipv6/arp input flags X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ .../include/odp/api/plat/packet_inline_types.h | 3 -- .../include/odp_classification_inlines.h | 9 ++++-- .../linux-generic/include/odp_packet_internal.h | 7 ++++- platform/linux-generic/odp_classification.c | 8 +++--- platform/linux-generic/odp_packet.c | 6 ---- platform/linux-generic/odp_packet_flags.c | 33 ++++++++++++++++++---- 6 files changed, 43 insertions(+), 23 deletions(-) diff --git a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h index a190b45af..fb54e6402 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h @@ -72,10 +72,7 @@ typedef union { uint64_t vlan_qinq:1; /* Stacked VLAN found, QinQ */ uint64_t snap:1; /* SNAP */ - uint64_t arp:1; /* ARP */ - uint64_t ipv4:1; /* IPv4 */ - uint64_t ipv6:1; /* IPv6 */ uint64_t ip_bcast:1; /* IP broadcast */ uint64_t ip_mcast:1; /* IP multicast */ uint64_t ipfrag:1; /* IP fragment */ diff --git a/platform/linux-generic/include/odp_classification_inlines.h b/platform/linux-generic/include/odp_classification_inlines.h index 3f1d9ce6a..f9462e976 100644 --- a/platform/linux-generic/include/odp_classification_inlines.h +++ b/platform/linux-generic/include/odp_classification_inlines.h @@ -51,7 +51,8 @@ static inline int verify_pmr_ip_proto(const uint8_t *pkt_addr, { const _odp_ipv4hdr_t *ip; uint8_t proto; - if (!pkt_hdr->p.input_flags.ipv4) + + if (!packet_hdr_has_ipv4(pkt_hdr)) return 0; ip = (const _odp_ipv4hdr_t *)(pkt_addr + pkt_hdr->p.l3_offset); proto = ip->proto; @@ -67,7 +68,8 @@ static inline int verify_pmr_ipv4_saddr(const uint8_t *pkt_addr, { const _odp_ipv4hdr_t *ip; uint32_t ipaddr; - if (!pkt_hdr->p.input_flags.ipv4) + + if (!packet_hdr_has_ipv4(pkt_hdr)) return 0; ip = (const _odp_ipv4hdr_t *)(pkt_addr + pkt_hdr->p.l3_offset); ipaddr = _odp_be_to_cpu_32(ip->src_addr); @@ -83,7 +85,8 @@ static inline int verify_pmr_ipv4_daddr(const uint8_t *pkt_addr, { const _odp_ipv4hdr_t *ip; uint32_t ipaddr; - if (!pkt_hdr->p.input_flags.ipv4) + + if (!packet_hdr_has_ipv4(pkt_hdr)) return 0; ip = (const _odp_ipv4hdr_t *)(pkt_addr + pkt_hdr->p.l3_offset); ipaddr = _odp_be_to_cpu_32(ip->dst_addr); diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 83bc27b12..59cb9ded9 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -281,9 +281,14 @@ static inline int packet_hdr_has_eth(odp_packet_hdr_t *pkt_hdr) return pkt_hdr->p.input_flags.eth; } +static inline int packet_hdr_has_ipv4(odp_packet_hdr_t *pkt_hdr) +{ + return pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L3_TYPE_IPV4; +} + static inline int packet_hdr_has_ipv6(odp_packet_hdr_t *pkt_hdr) { - return pkt_hdr->p.input_flags.ipv6; + return pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L3_TYPE_IPV6; } static inline void packet_set_ts(odp_packet_hdr_t *pkt_hdr, odp_time_t *ts) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 36358ab4a..5147db137 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -1026,7 +1026,7 @@ static uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr, tuple_len = 0; hash = 0; - if (pkt_hdr->p.input_flags.ipv4) { + if (packet_hdr_has_ipv4(pkt_hdr)) { if (hash_proto.ipv4) { /* add ipv4 */ ipv4 = (const _odp_ipv4hdr_t *)(base + @@ -1051,7 +1051,7 @@ static uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr, tuple.v4.dport = udp->dst_port; tuple_len += 1; } - } else if (pkt_hdr->p.input_flags.ipv6) { + } else if (packet_hdr_has_ipv6(pkt_hdr)) { if (hash_proto.ipv6) { /* add ipv6 */ ipv6 = (const _odp_ipv6hdr_t *)(base + @@ -1089,11 +1089,11 @@ cos_t *match_qos_l3_cos(pmr_l3_cos_t *l3_cos, const uint8_t *pkt_addr, const _odp_ipv4hdr_t *ipv4; const _odp_ipv6hdr_t *ipv6; - if (hdr->p.input_flags.l3 && hdr->p.input_flags.ipv4) { + if (hdr->p.input_flags.l3 && packet_hdr_has_ipv4(hdr)) { ipv4 = (const _odp_ipv4hdr_t *)(pkt_addr + hdr->p.l3_offset); dscp = _ODP_IPV4HDR_DSCP(ipv4->tos); cos = l3_cos->cos[dscp]; - } else if (hdr->p.input_flags.l3 && hdr->p.input_flags.ipv6) { + } else if (hdr->p.input_flags.l3 && packet_hdr_has_ipv6(hdr)) { ipv6 = (const _odp_ipv6hdr_t *)(pkt_addr + hdr->p.l3_offset); dscp = _ODP_IPV6HDR_DSCP(ipv6->ver_tc_flow); cos = l3_cos->cos[dscp]; diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 4b90e9f07..14ed13bca 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2196,14 +2196,12 @@ int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr, /* Parse Layer 3 headers */ switch (ethtype) { case _ODP_ETHTYPE_IPV4: - prs->input_flags.ipv4 = 1; prs->input_flags.l3_type = ODP_PROTO_L3_TYPE_IPV4; ip_proto = parse_ipv4(prs, &parseptr, &offset, frame_len); prs->l4_offset = offset; break; case _ODP_ETHTYPE_IPV6: - prs->input_flags.ipv6 = 1; prs->input_flags.l3_type = ODP_PROTO_L3_TYPE_IPV6; ip_proto = parse_ipv6(prs, &parseptr, &offset, frame_len, seg_len); @@ -2211,7 +2209,6 @@ int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr, break; case _ODP_ETHTYPE_ARP: - prs->input_flags.arp = 1; prs->input_flags.l3_type = ODP_PROTO_L3_TYPE_ARP; ip_proto = 255; /* Reserved invalid by IANA */ break; @@ -2562,9 +2559,6 @@ void odp_packet_l3_type_set(odp_packet_t pkt, odp_proto_l3_type_t val) odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); pkt_hdr->p.input_flags.l3_type = val; - pkt_hdr->p.input_flags.arp = (val == ODP_PROTO_L3_TYPE_ARP); - pkt_hdr->p.input_flags.ipv4 = (val == ODP_PROTO_L3_TYPE_IPV4); - pkt_hdr->p.input_flags.ipv6 = (val == ODP_PROTO_L3_TYPE_IPV6); } odp_proto_l4_type_t odp_packet_l4_type(odp_packet_t pkt) diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c index 0c33666eb..ab34d0950 100644 --- a/platform/linux-generic/odp_packet_flags.c +++ b/platform/linux-generic/odp_packet_flags.c @@ -83,17 +83,23 @@ int odp_packet_has_vlan_qinq(odp_packet_t pkt) int odp_packet_has_arp(odp_packet_t pkt) { - retflag(pkt, input_flags.arp); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + return pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L3_TYPE_ARP; } int odp_packet_has_ipv4(odp_packet_t pkt) { - retflag(pkt, input_flags.ipv4); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + return pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L3_TYPE_IPV4; } int odp_packet_has_ipv6(odp_packet_t pkt) { - retflag(pkt, input_flags.ipv6); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + return pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L3_TYPE_IPV6; } int odp_packet_has_ip_bcast(odp_packet_t pkt) @@ -226,17 +232,32 @@ void odp_packet_has_vlan_qinq_set(odp_packet_t pkt, int val) void odp_packet_has_arp_set(odp_packet_t pkt, int val) { - setflag(pkt, input_flags.arp, val); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + if (val) + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_ARP); + else if (pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L3_TYPE_ARP) + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_NONE); } void odp_packet_has_ipv4_set(odp_packet_t pkt, int val) { - setflag(pkt, input_flags.ipv4, val); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + if (val) + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_IPV4); + else if (pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L3_TYPE_IPV4) + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_NONE); } void odp_packet_has_ipv6_set(odp_packet_t pkt, int val) { - setflag(pkt, input_flags.ipv6, val); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + if (val) + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_IPV6); + else if (pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L3_TYPE_IPV6) + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_NONE); } void odp_packet_has_ip_bcast_set(odp_packet_t pkt, int val) From patchwork Wed Feb 7 13:00:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127172 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp451626ljc; Wed, 7 Feb 2018 05:05:07 -0800 (PST) X-Google-Smtp-Source: AH8x2257KKKABiySrANccGHAcJtaenZLnSj1gFkx3m+yNzbYCobNEYfv18t7fFoTwOsKcTmRgxaZ X-Received: by 10.200.67.30 with SMTP id z30mr9590453qtm.197.1518008707400; Wed, 07 Feb 2018 05:05:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518008707; cv=none; d=google.com; s=arc-20160816; b=gEZ097jKg+M3dlAihchcM9gSSM5L34s3iXzEECFQFAbxxVeaI/8Ui6jjI3oz8Gj1tn mWJOPsOnB23P3M4FonDZm+4k+na3Fm6yR1Rajtt6S+7CJCz289l5DEJ0xyZX0z2ItZOe 6yRSiQwAnW38ZR6ZStaBMtjNZP8z5xch/aF1ERXJdKfCjCRqRjDypcJaL4NlRjD9i3n4 9Tov2JYp7o7+HYFyr5aTtuaQkiYgoHOhkDAAfcgdGdSqlLhKy9cM8XxScGnRIsLp1SuB CV9iAJTlgrk6jj4HCYlcELnQ77OANsWISh/C6isT70Fg74/C1Xw74mHssnwjPxXL1h5s RsDA== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=7PTNEA2oYQI5h8eQcHM4hUZqwWLXnXgZzlbc0Y3gB5Y=; b=mCGQleMsIKaKRS4rzwVVplkiQREtsPKxnQY9eIY1bLaMk5EpJ0LMg5D6gxYgRHQwCz IRb8uxsYzEVn4HoSaJ3/992eSxbMAyaAmpSqimjL2VZkCTdSQ7tTjbG6Qf8VWVVQOqor Q2H3YChRKpSpkgHNtVvaFrlY7lGBuBhdTIkOfxZI4qpHuLyV4wZvePzQobEvfuy0W8kL YlnUzCtotb3XyTvQX2gYHe4WnU46QRLuZeL1oqSEXgSjvUh36wIw3DoT3dsDnaymBZyl 2FRnnEbdn7+kCkJghWh32WzhhBvgUrEB2FLkbbPXAeoTfJ6POmdXcYe8s+0B8W86QuKi e/UQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id t49si1415328qta.461.2018.02.07.05.05.07; Wed, 07 Feb 2018 05:05:07 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 06FF8627E0; Wed, 7 Feb 2018 13:05:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id CE22E61768; Wed, 7 Feb 2018 13:00:56 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 99B2A61519; Wed, 7 Feb 2018 13:00:30 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 7B22361698 for ; Wed, 7 Feb 2018 13:00:16 +0000 (UTC) Received: from mxback10g.mail.yandex.net (mxback10g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:171]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 6930B5605662 for ; Wed, 7 Feb 2018 16:00:15 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback10g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 4R4D6WjDhc-0Fp0Kj4h; Wed, 07 Feb 2018 16:00:15 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0FZOJAJF; Wed, 07 Feb 2018 16:00:15 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 16:00:04 +0300 Message-Id: <1518008409-31750-10-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 9/14] example: switch to using odp_packet_l4_type_set() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Use odp_packet_l4_type_set() instead of calling odp_packet_has_*_set(). Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ example/generator/odp_generator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index c34457643..3d61e025f 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -338,7 +338,7 @@ static odp_packet_t setup_udp_pkt_ref(odp_pool_t pool, /* udp */ odp_packet_l4_offset_set(pkt, ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN); - odp_packet_has_udp_set(pkt, 1); + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_UDP); udp = (odph_udphdr_t *)(buf + ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN); udp->src_port = odp_cpu_to_be_16(args->appl.srcport); udp->dst_port = odp_cpu_to_be_16(args->appl.dstport); From patchwork Wed Feb 7 13:00:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127179 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp457389ljc; Wed, 7 Feb 2018 05:11:23 -0800 (PST) X-Google-Smtp-Source: AH8x224ZwCyYLgp/G3hgrmEvY57ymWmAeUbL3/fbl7f9M3EvPgU7hytjxj56CsgGC7YghFQZcgYP X-Received: by 10.233.230.13 with SMTP id z13mr8780730qkf.163.1518009083690; Wed, 07 Feb 2018 05:11:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518009083; cv=none; d=google.com; s=arc-20160816; b=hn7yX1trKZcqvUNcClpVzrgwrM4espnrC0LoT3M80GZRvzogCziAsTaQP7+5hOf4rS GjKcHavuWfhJFqw9YzOUf3G8bDbIjR1JpxjLRpFuH/RTLpSjd2yKIFgUYDm/XWGaFPAN zxtURuPjNq7XqHjHQZlT9CroFBIlpJWMPaXVGpx24McX+u6IEEUyq/MZi2Y+n0FnM53B KDMGn1Lga8GfIsgRzJL1odaE4E9eqc/sYIqYFHamV3Ha0hAyfXkBwE0vuTNgqVMVyM5d hBmhpSlkCuq3QSvuZypAVJhKPVgIjknP+QqPjhB/91W+H8COjU9AhOMPKDExMnMb18Jw lQOQ== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=1DrUjhEzgQv+8q72zPsWMuRLmBPPgyz6pyKKuDAzoT8=; b=puXS6KvNlDKhO7Y/oxMLrDo5mE7Grol6zeWOM0bQ9bKaEXYdaSB4oXAXAo4WwzBMsf 66veSplvH8sqqS2e1/bslYcGOOl2Scf1+dNPSmO+wp2fenooCc+vmY0tb4dg7TCXMy4U syj68QHU/W9SrDOch7b/XUWbP+VFeJ93Yll7Yz4h/XsUpKfuPAOlhF++S7CG1hhHvqUe zX/qCD5B4lW3GWsqMk14QdywRBGeXTfUZkIW5+cAQY+uoOhf8r7r+vMIJdxdc6byodzi 9aLmkLidjPmMMNsqUd9iC5Xu7U0U+IzsdTuRqfUE58EsdjLvTkZkCKTJE6g4YcQcei49 WTSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id z22si1546727qkg.405.2018.02.07.05.11.23; Wed, 07 Feb 2018 05:11:23 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 5C21062792; Wed, 7 Feb 2018 13:11:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 773BA6278B; Wed, 7 Feb 2018 13:01:42 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A5B3F616E5; Wed, 7 Feb 2018 13:00:34 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id A19A160D3D for ; Wed, 7 Feb 2018 13:00:17 +0000 (UTC) Received: from mxback8j.mail.yandex.net (mxback8j.mail.yandex.net [IPv6:2a02:6b8:0:1619::111]) by forward106o.mail.yandex.net (Yandex) with ESMTP id F271778351E for ; Wed, 7 Feb 2018 16:00:15 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback8j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id lXVsUFilb4-0FdSX18m; Wed, 07 Feb 2018 16:00:15 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0FZmUnY0; Wed, 07 Feb 2018 16:00:15 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 16:00:05 +0300 Message-Id: <1518008409-31750-11-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 10/14] helper: switch to using odp_packet_l4_type_set() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Use odp_packet_l4_type_set() instead of calling odp_packet_has_*_set(). Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ helper/test/chksum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper/test/chksum.c b/helper/test/chksum.c index 292eb2d6d..97cce38c0 100644 --- a/helper/test/chksum.c +++ b/helper/test/chksum.c @@ -131,7 +131,7 @@ int main(int argc ODPH_UNUSED, char *argv[] ODPH_UNUSED) udp->dst_port = 0; udp->length = odp_cpu_to_be_16(udat_size + ODPH_UDPHDR_LEN); udp->chksum = 0; - odp_packet_has_udp_set(test_packet, 1); + odp_packet_l4_type_set(test_packet, ODP_PROTO_L4_TYPE_UDP); udp->chksum = odph_ipv4_udp_chksum(test_packet); if (udp->chksum == 0) From patchwork Wed Feb 7 13:00:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127185 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp464282ljc; Wed, 7 Feb 2018 05:19:50 -0800 (PST) X-Google-Smtp-Source: AH8x226DWDix/Ug1MA/uwiXa0cNbXeYz56jmqiJxCKz5HZJK06mRK+euhfE/xikbE6Xg4F8Zw3Py X-Received: by 10.55.41.141 with SMTP id p13mr8875981qkp.208.1518009589901; Wed, 07 Feb 2018 05:19:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518009589; cv=none; d=google.com; s=arc-20160816; b=EcriqCBj8g00K0n/p9TbhzyyMh0hyz4n8BZgOivImX12X3FBxK8K/Jtt2qD3008iZr DRWS/6UTq0j9nH5ExIdCW8627SKRfyZRvCeX6O4Q0kr3lAV7sKBi0sGCqNE6AB2x96LZ BN4IjvPA+DCnvJ5Dm7qEU3nCMjYb1d/r+wzcGPlv5Ect7UZdX7lxIRp94KMwhX0URuR/ dk5KO3gEZD1+5kJPQ1KtUJv5PKS+wC4pDxMQNPpcjN05zXIRMo/MChnhForKIUKXhCiu bRZTeMAGCiysJVV/TkJDjUdzjIbYlck+qLHIJvKzEY5Xiv4GJZ+ZG5Rn+jsMGWIuzbKO CPUA== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=2HTHHXTqyzA1ng/7AyEqXo1eJCGEReeW8a71JPVa55Q=; b=Q5ykQiW3qTMkAe16/gvElhbH6WZt1hnRC9MbrirFTzwdJ0pZ+7ktsBMLnz82VRAJJj 8dz8KEBCfRlsEh1TIoU5JjOu9NdgWPC/ttsAaPmD8i2AZpG/aQBdjjncJhBkCm3TyQ5B V/PY6Xk7KFyxsTLSQWgtvqyWffcvW69BP1kV+gS9uRf1uQDJT5dDuJory1cGDvGLM+95 b8/9p2MGa2tu7g5v0n69+JgG5aE6/RqvIwR6JhTT0usTMlyHKA1nDdeIEaMNA3HLjoK3 L+uYgjlAgBO2GbKTcKQ3iFCD2PRks+308463vpn0enkGAPtRSm0dzyYStYy0hM9NNAM7 GEVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id h129si235736qke.362.2018.02.07.05.19.49; Wed, 07 Feb 2018 05:19:49 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 6A90B62808; Wed, 7 Feb 2018 13:19:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 45E71606D0; Wed, 7 Feb 2018 13:02:38 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 1A33261701; Wed, 7 Feb 2018 13:00:50 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 07D036087C for ; Wed, 7 Feb 2018 13:00:21 +0000 (UTC) Received: from mxback1o.mail.yandex.net (mxback1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1b]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 900734305D3B for ; Wed, 7 Feb 2018 16:00:16 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id BF9nzewC6i-0G8eLEV3; Wed, 07 Feb 2018 16:00:16 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0GZOOlbq; Wed, 07 Feb 2018 16:00:16 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 16:00:06 +0300 Message-Id: <1518008409-31750-12-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 11/14] validation: switch to using odp_packet_l4_type_set() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Use odp_packet_l4_type_set() instead of calling odp_packet_has_*_set(). Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ .../api/classification/odp_classification_common.c | 4 +- test/validation/api/packet/packet.c | 60 ++++++++++++++++++++-- test/validation/api/traffic_mngr/traffic_mngr.c | 4 +- 3 files changed, 60 insertions(+), 8 deletions(-) diff --git a/test/validation/api/classification/odp_classification_common.c b/test/validation/api/classification/odp_classification_common.c index 191489126..7d6d24162 100644 --- a/test/validation/api/classification/odp_classification_common.c +++ b/test/validation/api/classification/odp_classification_common.c @@ -350,7 +350,7 @@ odp_packet_t create_packet(cls_packet_info_t pkt_info) udp->dst_port = odp_cpu_to_be_16(CLS_DEFAULT_DPORT); udp->length = odp_cpu_to_be_16(payload_len + ODPH_UDPHDR_LEN); udp->chksum = 0; - odp_packet_has_udp_set(pkt, 1); + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_UDP); if (odph_udp_tcp_chksum(pkt, ODPH_CHKSUM_GENERATE, NULL) != 0) { LOG_ERR("odph_udp_tcp_chksum failed\n"); return ODP_PACKET_INVALID; @@ -360,7 +360,7 @@ odp_packet_t create_packet(cls_packet_info_t pkt_info) tcp->dst_port = odp_cpu_to_be_16(CLS_DEFAULT_DPORT); tcp->hl = ODPH_TCPHDR_LEN / 4; tcp->cksm = 0; - odp_packet_has_tcp_set(pkt, 1); + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_TCP); if (odph_udp_tcp_chksum(pkt, ODPH_CHKSUM_GENERATE, NULL) != 0) { LOG_ERR("odph_udp_tcp_chksum failed\n"); return ODP_PACKET_INVALID; diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index 00228b240..b3174b824 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -1052,10 +1052,6 @@ void packet_test_in_flags(void) TEST_INFLAG(pkt, ipfrag); TEST_INFLAG(pkt, ipopt); TEST_INFLAG(pkt, ipsec); - TEST_INFLAG(pkt, udp); - TEST_INFLAG(pkt, tcp); - TEST_INFLAG(pkt, sctp); - TEST_INFLAG(pkt, icmp); odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_NONE); CU_ASSERT_EQUAL(odp_packet_l3_type(pkt), ODP_PROTO_L3_TYPE_NONE); @@ -1069,17 +1065,73 @@ void packet_test_in_flags(void) CU_ASSERT(!odp_packet_has_ipv4(pkt)); CU_ASSERT(!odp_packet_has_ipv6(pkt)); + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_NONE); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt), ODP_PROTO_L4_TYPE_NONE); + CU_ASSERT(!odp_packet_has_tcp(pkt)); + CU_ASSERT(!odp_packet_has_udp(pkt)); + CU_ASSERT(!odp_packet_has_sctp(pkt)); + CU_ASSERT(!odp_packet_has_icmp(pkt)); + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_IPV4); CU_ASSERT_EQUAL(odp_packet_l3_type(pkt), ODP_PROTO_L3_TYPE_IPV4); CU_ASSERT(!odp_packet_has_arp(pkt)); CU_ASSERT(odp_packet_has_ipv4(pkt)); CU_ASSERT(!odp_packet_has_ipv6(pkt)); + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_ICMPV4); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt), ODP_PROTO_L4_TYPE_ICMPV4); + CU_ASSERT(!odp_packet_has_tcp(pkt)); + CU_ASSERT(!odp_packet_has_udp(pkt)); + CU_ASSERT(!odp_packet_has_sctp(pkt)); + CU_ASSERT(odp_packet_has_icmp(pkt)); + + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_TCP); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt), ODP_PROTO_L4_TYPE_TCP); + CU_ASSERT(odp_packet_has_tcp(pkt)); + CU_ASSERT(!odp_packet_has_udp(pkt)); + CU_ASSERT(!odp_packet_has_sctp(pkt)); + CU_ASSERT(!odp_packet_has_icmp(pkt)); + + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_UDP); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt), ODP_PROTO_L4_TYPE_UDP); + CU_ASSERT(!odp_packet_has_tcp(pkt)); + CU_ASSERT(odp_packet_has_udp(pkt)); + CU_ASSERT(!odp_packet_has_sctp(pkt)); + CU_ASSERT(!odp_packet_has_icmp(pkt)); + + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_SCTP); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt), ODP_PROTO_L4_TYPE_SCTP); + CU_ASSERT(!odp_packet_has_tcp(pkt)); + CU_ASSERT(!odp_packet_has_udp(pkt)); + CU_ASSERT(odp_packet_has_sctp(pkt)); + CU_ASSERT(!odp_packet_has_icmp(pkt)); + + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_AH); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt), ODP_PROTO_L4_TYPE_AH); + CU_ASSERT(!odp_packet_has_tcp(pkt)); + CU_ASSERT(!odp_packet_has_udp(pkt)); + CU_ASSERT(!odp_packet_has_sctp(pkt)); + CU_ASSERT(!odp_packet_has_icmp(pkt)); + + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_ESP); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt), ODP_PROTO_L4_TYPE_ESP); + CU_ASSERT(!odp_packet_has_tcp(pkt)); + CU_ASSERT(!odp_packet_has_udp(pkt)); + CU_ASSERT(!odp_packet_has_sctp(pkt)); + CU_ASSERT(!odp_packet_has_icmp(pkt)); + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_IPV6); CU_ASSERT_EQUAL(odp_packet_l3_type(pkt), ODP_PROTO_L3_TYPE_IPV6); CU_ASSERT(!odp_packet_has_arp(pkt)); CU_ASSERT(!odp_packet_has_ipv4(pkt)); CU_ASSERT(odp_packet_has_ipv6(pkt)); + + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_ICMPV6); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt), ODP_PROTO_L4_TYPE_ICMPV6); + CU_ASSERT(!odp_packet_has_tcp(pkt)); + CU_ASSERT(!odp_packet_has_udp(pkt)); + CU_ASSERT(!odp_packet_has_sctp(pkt)); + CU_ASSERT(odp_packet_has_icmp(pkt)); } void packet_test_error_flags(void) diff --git a/test/validation/api/traffic_mngr/traffic_mngr.c b/test/validation/api/traffic_mngr/traffic_mngr.c index 4b70282b1..c597cffcf 100644 --- a/test/validation/api/traffic_mngr/traffic_mngr.c +++ b/test/validation/api/traffic_mngr/traffic_mngr.c @@ -775,7 +775,7 @@ static odp_packet_t make_pkt(odp_pool_t pkt_pool, if (pkt_info->use_tcp) { /* TCP Header */ - odp_packet_has_tcp_set(odp_pkt, 1); + odp_packet_l4_type_set(odp_pkt, ODP_PROTO_L4_TYPE_TCP); tcp_hdr->src_port = odp_cpu_to_be_16(DEFAULT_TCP_SRC_PORT); tcp_hdr->dst_port = odp_cpu_to_be_16(DEFAULT_TCP_DST_PORT); tcp_hdr->seq_no = odp_cpu_to_be_32(cpu_tcp_seq_num); @@ -790,7 +790,7 @@ static odp_packet_t make_pkt(odp_pool_t pkt_pool, cpu_tcp_seq_num += payload_len; } else { /* UDP Header */ - odp_packet_has_udp_set(odp_pkt, 1); + odp_packet_l4_type_set(odp_pkt, ODP_PROTO_L4_TYPE_UDP); udp_hdr->src_port = odp_cpu_to_be_16(DEFAULT_UDP_SRC_PORT); udp_hdr->dst_port = odp_cpu_to_be_16(DEFAULT_UDP_DST_PORT); udp_hdr->length = odp_cpu_to_be_16(l4_len); From patchwork Wed Feb 7 13:00:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127184 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp462653ljc; Wed, 7 Feb 2018 05:17:42 -0800 (PST) X-Google-Smtp-Source: AH8x224EenwMjYpifLmYh38v29Qrl/mi7+rAL3D/nt4SrHVv252tGse9agrp+TX9VF/EwOg/lXaP X-Received: by 10.200.34.194 with SMTP id g2mr8854073qta.302.1518009462750; Wed, 07 Feb 2018 05:17:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518009462; cv=none; d=google.com; s=arc-20160816; b=RAnr97dbpJmjdjjL+ov3850+QxFbtjHEx3RKZHXY2IZ291nmgAGdjxP1WBfnaE+cRV HDYP3i90dfs7kuqODCua7vxLpzUQvIo+AldrkYXzGckd3SU/6raeS+3DggATeYBtLtnr n6ecmgdUMC6jZxSBjOdGHfDbO93hZvvB0Tu1OXcuTDdDWAo2U9efHlZEMgJSEsEMp2u4 71x8I7M7bwTDuAtwmgIw0dbs0U9MGRNFpHUNPIhTCtAUyJF8KbQq9QQdZBhO0gwgnbco IGha3095k2e4Od/LKjvdPiW5DujpQRhnQ4hB5OxnTJc4bzKEq1vPC90lknYi+ffs5AUc 1f5w== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=79nT2Cs268Jw8v4sUB4rR2MtGbo/ualT5z0ss3Scsfs=; b=Og3PFtMb3y8Z6q6Bwn3TNLbFf+u4d/rEyF7nlIyYbZqbnJB+8KfKV5xMkqitgfHm7+ fq362Uk78PdKHvMsUjZ7PwrQRumG7U6zcOqhk5E5prfWT8mj7CkleUF1BLYIrp7yA2zI /auv0rsk+jIeWU52w/KfL+C0LdQ8SQZ/kl+5DPuLsIK4BdDfYIeCw6WQ2yQljS4tJ+dQ k+LxAIVBBHTyA7FCZ2cnjn1j2fq/Y6af37yB0AgC9qc7B6vDIJaf0wi27dNvbCpyHWAa 6nygdKuQtApyoG6sd9jIMdv1AOUhKyK1yxwqT+cdgiM6uh+1kIadEGFZZeWzRdlTvTtL xuww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id r18si1439890qtr.424.2018.02.07.05.17.42; Wed, 07 Feb 2018 05:17:42 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 4E68E62799; Wed, 7 Feb 2018 13:17:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id BE04F627B9; Wed, 7 Feb 2018 13:02:26 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 208B460B0E; Wed, 7 Feb 2018 13:00:45 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id D308860C4C for ; Wed, 7 Feb 2018 13:00:18 +0000 (UTC) Received: from mxback8g.mail.yandex.net (mxback8g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:169]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 92EA4783887 for ; Wed, 7 Feb 2018 16:00:17 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback8g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Oqc1Kxmj3O-0HTK12Ra; Wed, 07 Feb 2018 16:00:17 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0GZatfNC; Wed, 07 Feb 2018 16:00:16 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 16:00:07 +0300 Message-Id: <1518008409-31750-13-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 12/14] linux-gen: use packet l4 type rather than individual input flags X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ .../include/odp/api/plat/packet_inline_types.h | 7 ---- .../include/odp_classification_inlines.h | 15 ++++--- .../linux-generic/include/odp_packet_internal.h | 10 +++++ platform/linux-generic/odp_classification.c | 8 ++-- platform/linux-generic/odp_packet.c | 16 ++----- platform/linux-generic/odp_packet_flags.c | 49 ++++++++++++++++++---- 6 files changed, 68 insertions(+), 37 deletions(-) diff --git a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h index fb54e6402..008a06bff 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h @@ -80,14 +80,7 @@ typedef union { uint64_t ipsec:1; /* IPSec packet. Required by the odp_packet_has_ipsec_set() func. */ - uint64_t ipsec_ah:1; /* IPSec authentication header */ - uint64_t ipsec_esp:1; /* IPSec encapsulating security - payload */ - uint64_t udp:1; /* UDP */ - uint64_t tcp:1; /* TCP */ uint64_t tcpopt:1; /* TCP options present */ - uint64_t sctp:1; /* SCTP */ - uint64_t icmp:1; /* ICMP */ uint64_t color:2; /* Packet color for traffic mgmt */ uint64_t nodrop:1; /* Drop eligibility status */ diff --git a/platform/linux-generic/include/odp_classification_inlines.h b/platform/linux-generic/include/odp_classification_inlines.h index f9462e976..4d6472355 100644 --- a/platform/linux-generic/include/odp_classification_inlines.h +++ b/platform/linux-generic/include/odp_classification_inlines.h @@ -102,7 +102,8 @@ static inline int verify_pmr_tcp_sport(const uint8_t *pkt_addr, { uint16_t sport; const _odp_tcphdr_t *tcp; - if (!pkt_hdr->p.input_flags.tcp) + + if (!packet_hdr_has_tcp(pkt_hdr)) return 0; tcp = (const _odp_tcphdr_t *)(pkt_addr + pkt_hdr->p.l4_offset); sport = _odp_be_to_cpu_16(tcp->src_port); @@ -118,7 +119,8 @@ static inline int verify_pmr_tcp_dport(const uint8_t *pkt_addr, { uint16_t dport; const _odp_tcphdr_t *tcp; - if (!pkt_hdr->p.input_flags.tcp) + + if (!packet_hdr_has_tcp(pkt_hdr)) return 0; tcp = (const _odp_tcphdr_t *)(pkt_addr + pkt_hdr->p.l4_offset); dport = _odp_be_to_cpu_16(tcp->dst_port); @@ -134,7 +136,8 @@ static inline int verify_pmr_udp_dport(const uint8_t *pkt_addr, { uint16_t dport; const _odp_udphdr_t *udp; - if (!pkt_hdr->p.input_flags.udp) + + if (!packet_hdr_has_udp(pkt_hdr)) return 0; udp = (const _odp_udphdr_t *)(pkt_addr + pkt_hdr->p.l4_offset); dport = _odp_be_to_cpu_16(udp->dst_port); @@ -151,7 +154,7 @@ static inline int verify_pmr_udp_sport(const uint8_t *pkt_addr, uint16_t sport; const _odp_udphdr_t *udp; - if (!pkt_hdr->p.input_flags.udp) + if (!packet_hdr_has_udp(pkt_hdr)) return 0; udp = (const _odp_udphdr_t *)(pkt_addr + pkt_hdr->p.l4_offset); sport = _odp_be_to_cpu_16(udp->src_port); @@ -291,11 +294,11 @@ static inline int verify_pmr_ipsec_spi(const uint8_t *pkt_addr, pkt_addr += pkt_hdr->p.l4_offset; - if (pkt_hdr->p.input_flags.ipsec_ah) { + if (pkt_hdr->p.input_flags.l4_type == ODP_PROTO_L4_TYPE_AH) { const _odp_ahhdr_t *ahhdr = (const _odp_ahhdr_t *)pkt_addr; spi = _odp_be_to_cpu_32(ahhdr->spi); - } else if (pkt_hdr->p.input_flags.ipsec_esp) { + } else if (pkt_hdr->p.input_flags.l4_type == ODP_PROTO_L4_TYPE_ESP) { const _odp_esphdr_t *esphdr = (const _odp_esphdr_t *)pkt_addr; spi = _odp_be_to_cpu_32(esphdr->spi); diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 59cb9ded9..9ef11c677 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -291,6 +291,16 @@ static inline int packet_hdr_has_ipv6(odp_packet_hdr_t *pkt_hdr) return pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L3_TYPE_IPV6; } +static inline int packet_hdr_has_tcp(odp_packet_hdr_t *pkt_hdr) +{ + return pkt_hdr->p.input_flags.l4_type == ODP_PROTO_L4_TYPE_TCP; +} + +static inline int packet_hdr_has_udp(odp_packet_hdr_t *pkt_hdr) +{ + return pkt_hdr->p.input_flags.l4_type == ODP_PROTO_L4_TYPE_UDP; +} + static inline void packet_set_ts(odp_packet_hdr_t *pkt_hdr, odp_time_t *ts) { if (ts != NULL) { diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 5147db137..6937ac4b2 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -1036,14 +1036,14 @@ static uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr, tuple_len += 2; } - if (pkt_hdr->p.input_flags.tcp && hash_proto.tcp) { + if (packet_hdr_has_tcp(pkt_hdr) && hash_proto.tcp) { /* add tcp */ tcp = (const _odp_tcphdr_t *)(base + pkt_hdr->p.l4_offset); tuple.v4.sport = tcp->src_port; tuple.v4.dport = tcp->dst_port; tuple_len += 1; - } else if (pkt_hdr->p.input_flags.udp && hash_proto.udp) { + } else if (packet_hdr_has_udp(pkt_hdr) && hash_proto.udp) { /* add udp */ udp = (const _odp_udphdr_t *)(base + pkt_hdr->p.l4_offset); @@ -1059,13 +1059,13 @@ static uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr, thash_load_ipv6_addr(ipv6, &tuple); tuple_len += 8; } - if (pkt_hdr->p.input_flags.tcp && hash_proto.tcp) { + if (packet_hdr_has_tcp(pkt_hdr) && hash_proto.tcp) { tcp = (const _odp_tcphdr_t *)(base + pkt_hdr->p.l4_offset); tuple.v6.sport = tcp->src_port; tuple.v6.dport = tcp->dst_port; tuple_len += 1; - } else if (pkt_hdr->p.input_flags.udp && hash_proto.udp) { + } else if (packet_hdr_has_udp(pkt_hdr) && hash_proto.udp) { /* add udp */ udp = (const _odp_udphdr_t *)(base + pkt_hdr->p.l4_offset); diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 14ed13bca..cc6ab008f 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2228,10 +2228,11 @@ int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr, /* Parse Layer 4 headers */ switch (ip_proto) { case _ODP_IPPROTO_ICMPV4: - /* Fall through */ + /* Do nothing */ + break; case _ODP_IPPROTO_ICMPV6: - prs->input_flags.icmp = 1; + /* Do nothing */ break; case _ODP_IPPROTO_IPIP: @@ -2241,29 +2242,25 @@ int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr, case _ODP_IPPROTO_TCP: if (odp_unlikely(offset + _ODP_TCPHDR_LEN > seg_len)) return -1; - prs->input_flags.tcp = 1; parse_tcp(prs, &parseptr, NULL); break; case _ODP_IPPROTO_UDP: if (odp_unlikely(offset + _ODP_UDPHDR_LEN > seg_len)) return -1; - prs->input_flags.udp = 1; parse_udp(prs, &parseptr, NULL); break; case _ODP_IPPROTO_AH: prs->input_flags.ipsec = 1; - prs->input_flags.ipsec_ah = 1; break; case _ODP_IPPROTO_ESP: prs->input_flags.ipsec = 1; - prs->input_flags.ipsec_esp = 1; break; case _ODP_IPPROTO_SCTP: - prs->input_flags.sctp = 1; + /* Do nothing */ break; default: @@ -2573,9 +2570,4 @@ void odp_packet_l4_type_set(odp_packet_t pkt, odp_proto_l4_type_t val) odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); pkt_hdr->p.input_flags.l4_type = val; - pkt_hdr->p.input_flags.tcp = (val == ODP_PROTO_L4_TYPE_TCP); - pkt_hdr->p.input_flags.udp = (val == ODP_PROTO_L4_TYPE_UDP); - pkt_hdr->p.input_flags.sctp = (val == ODP_PROTO_L4_TYPE_SCTP); - pkt_hdr->p.input_flags.icmp = (val == ODP_PROTO_L4_TYPE_ICMPV4) || - (val == ODP_PROTO_L4_TYPE_ICMPV6); } diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c index ab34d0950..ce140e600 100644 --- a/platform/linux-generic/odp_packet_flags.c +++ b/platform/linux-generic/odp_packet_flags.c @@ -129,22 +129,31 @@ int odp_packet_has_ipsec(odp_packet_t pkt) int odp_packet_has_udp(odp_packet_t pkt) { - retflag(pkt, input_flags.udp); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + return pkt_hdr->p.input_flags.l4_type == ODP_PROTO_L4_TYPE_UDP; } int odp_packet_has_tcp(odp_packet_t pkt) { - retflag(pkt, input_flags.tcp); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + return pkt_hdr->p.input_flags.l4_type == ODP_PROTO_L4_TYPE_TCP; } int odp_packet_has_sctp(odp_packet_t pkt) { - retflag(pkt, input_flags.sctp); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + return pkt_hdr->p.input_flags.l4_type == ODP_PROTO_L4_TYPE_SCTP; } int odp_packet_has_icmp(odp_packet_t pkt) { - retflag(pkt, input_flags.icmp); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + return pkt_hdr->p.input_flags.l4_type == ODP_PROTO_L4_TYPE_ICMPV4 || + pkt_hdr->p.input_flags.l4_type == ODP_PROTO_L4_TYPE_ICMPV6; } odp_packet_color_t odp_packet_color(odp_packet_t pkt) @@ -287,22 +296,46 @@ void odp_packet_has_ipsec_set(odp_packet_t pkt, int val) void odp_packet_has_udp_set(odp_packet_t pkt, int val) { - setflag(pkt, input_flags.udp, val); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + if (val) + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_UDP); + else if (pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L4_TYPE_UDP) + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_NONE); } void odp_packet_has_tcp_set(odp_packet_t pkt, int val) { - setflag(pkt, input_flags.tcp, val); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + if (val) + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_TCP); + else if (pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L4_TYPE_TCP) + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_NONE); } void odp_packet_has_sctp_set(odp_packet_t pkt, int val) { - setflag(pkt, input_flags.sctp, val); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + if (val) + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_SCTP); + else if (pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L4_TYPE_SCTP) + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_NONE); } void odp_packet_has_icmp_set(odp_packet_t pkt, int val) { - setflag(pkt, input_flags.icmp, val); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + if (val && odp_packet_has_ipv6(pkt)) + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_ICMPV6); + else if (val) + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_ICMPV4); + else if (pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L4_TYPE_ICMPV4) + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_NONE); + else if (pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L4_TYPE_ICMPV6) + odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_NONE); } void odp_packet_has_flow_hash_clr(odp_packet_t pkt) From patchwork Wed Feb 7 13:00:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127180 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp458344ljc; Wed, 7 Feb 2018 05:12:31 -0800 (PST) X-Google-Smtp-Source: AH8x227KvbDNyVegc7ObVwj6WbFrSIg87WBvSixpSiyxfzahf8KDdC/8pCMY9r+5SzAHH4SIW+PG X-Received: by 10.55.42.23 with SMTP id q23mr9293696qkh.80.1518009151245; Wed, 07 Feb 2018 05:12:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518009151; cv=none; d=google.com; s=arc-20160816; b=AXayWFRfiHnjMj3BDgLG85m5hA0nB1F5IMTq9+tKAS1OgAnpGCbVQWyDE1e09eoxvs 2DxGypM7Z8Fy4aeq7TmC8VeB6XWszrL+GAmYfsUpamR78qthCjvovBGpYwJCE9UOuxTR vcgxIsI+1eonT+ipDEsymkbgD6nQjnKkMxSuY3uh+U002U5DQp2k8iYBx4x1hOUZyMz8 yfTFvbUdPwkfwYNXwEMV4cEjZmVYaUv3bkyy3EM8/bRwbJ+y2YNPzL5BU438+xYAKoYq xDxJoTnBMTuqiF9REM5aq5dW250EjDDcl4ywLzF0Qviq/hAwRaFs03QHf6jtE7ufQ1qW 8LoA== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=HFctEopa4JZ5XpGEADnAUjmfRBKKtTf0hJXczF0MauE=; b=V753SPT+CGN0DybTS+CUYNZ+nCTkvzVMulIBVjITJCDgUD0sH54YWzUF5jWPlQH0NT 7pOKpZ3VcxnBAJq46Ml/pk1cmALwb20bo+YwJK/gbkTYMlIJaQUNbG9CTx85xnbHi/bE GdVATEcpH+KbLjCZqk0KCFGjY8GzlGIWRSFuqHAtKSNrwNpYwFDdsnZNwtlH3gfQMJgS OhgzJs9ZcH5ft1Y/SWYg7scfbQzg/J7G+rQf7vWxnXFcFKIBuVnutyXhCEpLCSOdbq7t LWpG9MKIM4X+84r5ifKf0TZUJWgGHWZ0iuuQ9jJlnLlE04N4VujEKTWMdUhHqyBAZBij SU7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id p10si759501qke.471.2018.02.07.05.12.31; Wed, 07 Feb 2018 05:12:31 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id E7D77627DF; Wed, 7 Feb 2018 13:12:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 07393627A6; Wed, 7 Feb 2018 13:01:53 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id BB48B616E5; Wed, 7 Feb 2018 13:00:40 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id 734D660B0E for ; Wed, 7 Feb 2018 13:00:19 +0000 (UTC) Received: from mxback8o.mail.yandex.net (mxback8o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::22]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 295554441B42 for ; Wed, 7 Feb 2018 16:00:18 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback8o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id XHCvKIp6PS-0I3qQsOY; Wed, 07 Feb 2018 16:00:18 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0HZmAJxu; Wed, 07 Feb 2018 16:00:17 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 16:00:08 +0300 Message-Id: <1518008409-31750-14-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 13/14] api: packet: deprecate old L3/L4 flag setters X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ include/odp/api/spec/packet_flags.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/include/odp/api/spec/packet_flags.h b/include/odp/api/spec/packet_flags.h index 500ecc148..e231d00ec 100644 --- a/include/odp/api/spec/packet_flags.h +++ b/include/odp/api/spec/packet_flags.h @@ -21,6 +21,7 @@ extern "C" { #include #include +#include /** @addtogroup odp_packet * Operations on packet metadata flags. @@ -412,28 +413,28 @@ void odp_packet_has_vlan_set(odp_packet_t pkt, int val); void odp_packet_has_vlan_qinq_set(odp_packet_t pkt, int val); /** - * Set flag for ARP + * @deprecated Use odp_packet_l3_type_set instead */ * * @param pkt Packet handle * @param val Value */ -void odp_packet_has_arp_set(odp_packet_t pkt, int val); +void ODP_DEPRECATE(odp_packet_has_arp_set)(odp_packet_t pkt, int val); /** - * Set flag for IPv4 + * @deprecated Use odp_packet_l3_type_set instead */ * * @param pkt Packet handle * @param val Value */ -void odp_packet_has_ipv4_set(odp_packet_t pkt, int val); +void ODP_DEPRECATE(odp_packet_has_ipv4_set)(odp_packet_t pkt, int val); /** - * Set flag for IPv6 + * @deprecated Use odp_packet_l3_type_set instead */ * * @param pkt Packet handle * @param val Value */ -void odp_packet_has_ipv6_set(odp_packet_t pkt, int val); +void ODP_DEPRECATE(odp_packet_has_ipv6_set)(odp_packet_t pkt, int val); /** * Set flag for IP broadcast address @@ -476,36 +477,36 @@ void odp_packet_has_ipopt_set(odp_packet_t pkt, int val); void odp_packet_has_ipsec_set(odp_packet_t pkt, int val); /** - * Set flag for UDP + * @deprecated Use odp_packet_l3_type_set instead */ * * @param pkt Packet handle * @param val Value */ -void odp_packet_has_udp_set(odp_packet_t pkt, int val); +void ODP_DEPRECATE(odp_packet_has_udp_set)(odp_packet_t pkt, int val); /** - * Set flag for TCP + * @deprecated Use odp_packet_l3_type_set instead */ * * @param pkt Packet handle * @param val Value */ -void odp_packet_has_tcp_set(odp_packet_t pkt, int val); +void ODP_DEPRECATE(odp_packet_has_tcp_set)(odp_packet_t pkt, int val); /** - * Set flag for SCTP + * @deprecated Use odp_packet_l3_type_set instead */ * * @param pkt Packet handle * @param val Value */ -void odp_packet_has_sctp_set(odp_packet_t pkt, int val); +void ODP_DEPRECATE(odp_packet_has_sctp_set)(odp_packet_t pkt, int val); /** - * Set flag for ICMP + * @deprecated Use odp_packet_l3_type_set instead */ * * @param pkt Packet handle * @param val Value */ -void odp_packet_has_icmp_set(odp_packet_t pkt, int val); +void ODP_DEPRECATE(odp_packet_has_icmp_set)(odp_packet_t pkt, int val); /** * Clear flag for packet flow hash From patchwork Wed Feb 7 13:00:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127181 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp459566ljc; Wed, 7 Feb 2018 05:13:53 -0800 (PST) X-Google-Smtp-Source: AH8x225BksgXoVrogrvUBqZsZkWk2RxaYHi6ZpfHdpyhxbNW/bdW60+kV1XdjOC3Puzw2W7ySLzn X-Received: by 10.200.16.131 with SMTP id a3mr1284686qtj.65.1518009233578; Wed, 07 Feb 2018 05:13:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518009233; cv=none; d=google.com; s=arc-20160816; b=HYxMkNwBeSItTNVKPgqM8k3yplXausKnSpJGeKGjnlxT97tCLxE6sCrleAQTE9aggg 9jbUN+QcU1QRLxW61nJG4QCa94JHQdh72u1ADCS3gj1T6BDCBSVfRUy5PZXsmQ1LcZgL Vc99N2GfW2MG56x3MzTo5rteGE47RD4qaCE85inMOu5FDb4bW6whaotCh49yrMmbOVJi 2qqUaeXalDmxSFMzCOA5ovQ+cSc+pQnrCWT9h8tHxYoJoaV9cduNUygjGYNoSWGwmxcr ZW2jQJsX/Er0TvEkDHeLK9kKOk/jY+oSXPN15luf5qbnKXGmTFmng1vBlfVvsBAOr541 drQQ== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=5Tt2CIt/ZjP8scSBDqEOX3cEYpImXQuwtzz7OZwrxFM=; b=OqDO9t8UPGGxImojA0ZnFApnia0Wa1LuJr/aVxEUwQAa8UOanMwP9KM+Oe7Xu+TIli clG5MGCWd8M3TlWoOfX1m3PynlRCSjpiWMkZZLlDHcsM+pU51V47UWLCmh7Z8hq1INV8 +pvYtUyDYYAl4cxg+f2YdrF3mGVj7oXE/FgM2pvHZjVK4Og5dLUjeH6EQRzga7FE6Bmd aHuhQcKfFdh9bpuvBMA6MU0bffhcWUIwT3KL+PKIt88sM2pZC9131gfLPiIEOMNWIhFQ +m/16HS63ZTYznEzXeacls8xstHdjRAId9ouVyZSeb0bRe5LuEYBceIYIJKZVi49wQe4 jBPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id o186si988110qkb.67.2018.02.07.05.13.53; Wed, 07 Feb 2018 05:13:53 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 0D0BF627F0; Wed, 7 Feb 2018 13:13:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 68A4C627AC; Wed, 7 Feb 2018 13:02:01 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C8AAD60D3D; Wed, 7 Feb 2018 13:00:42 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 517F5606D0 for ; Wed, 7 Feb 2018 13:00:20 +0000 (UTC) Received: from mxback5j.mail.yandex.net (mxback5j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10e]) by forward103j.mail.yandex.net (Yandex) with ESMTP id F2B9D34C419B for ; Wed, 7 Feb 2018 16:00:18 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback5j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 0nMXO35kP4-0IIGbbks; Wed, 07 Feb 2018 16:00:18 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0IZuBFnM; Wed, 07 Feb 2018 16:00:18 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 16:00:09 +0300 Message-Id: <1518008409-31750-15-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 14/14] linux-gen: packet: deprecate old L3/L4 flag setters X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ platform/linux-generic/odp_packet_flags.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c index ce140e600..7e48397ee 100644 --- a/platform/linux-generic/odp_packet_flags.c +++ b/platform/linux-generic/odp_packet_flags.c @@ -8,6 +8,7 @@ #include #include +#include #include #define retflag(pkt, x) do { \ @@ -239,6 +240,7 @@ void odp_packet_has_vlan_qinq_set(odp_packet_t pkt, int val) setflag(pkt, input_flags.vlan_qinq, val); } +#if ODP_DEPRECATED_API void odp_packet_has_arp_set(odp_packet_t pkt, int val) { odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); @@ -268,6 +270,7 @@ void odp_packet_has_ipv6_set(odp_packet_t pkt, int val) else if (pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L3_TYPE_IPV6) odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_NONE); } +#endif void odp_packet_has_ip_bcast_set(odp_packet_t pkt, int val) { @@ -294,6 +297,7 @@ void odp_packet_has_ipsec_set(odp_packet_t pkt, int val) setflag(pkt, input_flags.ipsec, val); } +#if ODP_DEPRECATED_API void odp_packet_has_udp_set(odp_packet_t pkt, int val) { odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); @@ -337,6 +341,7 @@ void odp_packet_has_icmp_set(odp_packet_t pkt, int val) else if (pkt_hdr->p.input_flags.l3_type == ODP_PROTO_L4_TYPE_ICMPV6) odp_packet_l4_type_set(pkt, ODP_PROTO_L4_TYPE_NONE); } +#endif void odp_packet_has_flow_hash_clr(odp_packet_t pkt) {