From patchwork Wed Feb 7 10:59:55 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: 127144 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp353833ljc; Wed, 7 Feb 2018 03:01:27 -0800 (PST) X-Google-Smtp-Source: AH8x224CKnSQdUSKeRk/eCgQtah24x8896HN3R2kuAa6iFBNWEfFvyn2qPsB4OAR+iJS53KQQvQe X-Received: by 10.55.79.68 with SMTP id d65mr8437472qkb.153.1518001287389; Wed, 07 Feb 2018 03:01:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001287; cv=none; d=google.com; s=arc-20160816; b=e7MQjkhn7Ou9Locd1KNplk2sAufaEGponmexO5jbb+4U+/w6sXD7Jrma96SQ9zjzqC wrhkPpHJQZqlxZtwcIkd/Sjdq8pSvREIN4YwpWg91IOQLdBytWrEKUEKRMxJ75I9KVD6 Ey6ilaZZn5NHzpAOFu15r7RGVk+/3XWUcpb6ogJ6Bdfn7uMGTMf/FRCgXALLFAN4FAb1 mAGwaQNfKfujnuYXWNqH1RXvV9KkLMm5ZGAGzxSYCY5F5AUnfusSLs6Ncqt+rSVqHiCk 3jy4YbQxlsJN/VtfFAL4fxAh/YzSFErro0wsP3whrNGk0scH8dnIXnEhELulthOSVmrX VUcg== 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=b55NfiCkT5s4UwhE3kbuojHeC/oPD48ffKxtbc0Vn+E=; b=OphOVcbZNl/fPkWDQBcsFVjw1B0yLcHJhiQL2FsFEBi2zc4SwpxQfJOBPoNnq9yHgb nQ1uckc+YGtK6MFds99zg3wZWvwNH5GyxT6QA2J+8NqGWgYbzcwx73pCVI5ybgg3Uko1 X2ylZOOIVbQcjMW21nBCYzVTm4hjSggJ4K8UEFxqJomaEibu5sXOgP8IoBS+2WNG3CLv PD2hRw0p7bL5YpFRKnT7RGWcbfdby6me7teI0BYSJ3Wwblyvk/01IcAuHRFQTUsejarW lpFs/ngEbA04tP8mWADr3YJP7YWBikRTCioYeXKy1qm5n1M3lhm99Lih3oFQIavoO3sJ T9pg== 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 d13si827296qta.452.2018.02.07.03.01.27; Wed, 07 Feb 2018 03:01:27 -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 04303617AF; Wed, 7 Feb 2018 11:01:27 +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 979E5616FC; Wed, 7 Feb 2018 11: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 A192561555; Wed, 7 Feb 2018 11:00:32 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id 9584B607D5 for ; Wed, 7 Feb 2018 11:00:26 +0000 (UTC) Received: from mxback12g.mail.yandex.net (mxback12g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:91]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 805CA4499D for ; Wed, 7 Feb 2018 14:00:22 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback12g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id mpUaYFWw7k-0Mn8e9Hs; Wed, 07 Feb 2018 14:00:22 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-0FVWvxeP; Wed, 07 Feb 2018 14: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 13:59:55 +0300 Message-Id: <1518001208-29529-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 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: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ .../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 10: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: 127145 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp355080ljc; Wed, 7 Feb 2018 03:02:34 -0800 (PST) X-Google-Smtp-Source: AH8x225d/+rSfvDgxxTgQUWzVwSkTBbHXfSThcNDDhRJwMH1GeC19kPXeLyAbg0ptRY5jkeDLRPQ X-Received: by 10.200.3.237 with SMTP id z45mr1032229qtg.119.1518001353940; Wed, 07 Feb 2018 03:02:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001353; cv=none; d=google.com; s=arc-20160816; b=pZdaqqTwGQw8JJahcy4XVeJYw+EjLqOoFd7KGp4iw32E/Osj8Gi50GeRag/nOWA+yi 75bIZtKUkI6NZ8WCSfRmMc8CpI3sNVci/3c7x6oB9BbQeFbigVo3d495sNRwSaTkLxNm Cbet6Xb6XI5YUPPr7EVbMe8erOtvK171E4wv233K/U5JPG27EAjWwV7f0wsZZ+44rTts sLFGX0mIJvIjCnBTqEWPo/juI5tI/kb78fNGia0GA1Fch6IiGkwWRSuUYzVze0dlnTLK tQAxV+6WWp2xDhGP27sII8uD5MM1SxhCWxnyz8l0qDZWZW9LFbk85UWBiDIxoPbuDo29 YKdg== 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=o7/esj6VriAPlnmHX8+s+7/9SSqFsRHW/vwaNUL4Dyc=; b=zs/U1C8/vBXzbzho8wnn6WsHPBJ98pt3fu/0TdKYEUZvGjWpfRca9i/zcyocrV4GrM kYA6wvrFCOL1zdkc0WvnkgCooerMTGVTSmBgd/0krGw6lv/Cdkxh+sTY1917D0yba5qE d3l/dfXngViFTOKWIDDMC57YfViPD5K3T0I+ejA++xJ1nimIPEdDxii+vBxo0KPjS/Eg rVv/M/mpJRJdbvjAytBbU1n4YeumQMhMBmSeDDlKisE3cFhLZVrN0MCdFlD5XMTONmXA vVmwaYPd3wYRVBo3I6ONo5zxSpJ675rLNU+EAwYHGPb4pb3gAJnNNIsU563CHAVP2BQ0 Km8w== 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 i5si1256690qka.304.2018.02.07.03.02.33; Wed, 07 Feb 2018 03:02: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 983A3618E4; Wed, 7 Feb 2018 11:02: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 83CCA61700; Wed, 7 Feb 2018 11:02:15 +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 BC8DD616F5; Wed, 7 Feb 2018 11:02:12 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id 0F5A3616F5 for ; Wed, 7 Feb 2018 11:00:49 +0000 (UTC) Received: from mxback10g.mail.yandex.net (mxback10g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:171]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 5372E782EB6 for ; Wed, 7 Feb 2018 14:00:47 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback10g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id X20oFyemQP-0lpOoJPJ; Wed, 07 Feb 2018 14:00:47 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-0MVGtmP7; Wed, 07 Feb 2018 14:00:22 +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 13:59:56 +0300 Message-Id: <1518001208-29529-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 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: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ 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 10: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: 127147 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp356756ljc; Wed, 7 Feb 2018 03:04:12 -0800 (PST) X-Google-Smtp-Source: AH8x224KnVU98/mEjQTh7hsGxoGrK/B+MiaRmUKLxHQqQk22Q/C3ZfUUsVaoxBTNFQADhexb2i7U X-Received: by 10.200.48.136 with SMTP id v8mr8558158qta.296.1518001452331; Wed, 07 Feb 2018 03:04:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001452; cv=none; d=google.com; s=arc-20160816; b=EeG6iXTljQUMLFHAzNN8P/zbi3wFcySpuoxMqhFnADtJgz5lZMMeEcynP0IGfFB9NP e5sZI/t0YI1b4vs2m3Y8EseX/s1ZuqsoPGCkyAIk5UVM0bX7ACCvbrvplM40jgDRtC38 HeA+4RISd5izLJuhTYm5Loc9mJkz+dZl5JCm/PDwv+7e42KwHBbnPAAg/mlSN8zuo/xo P2BG6450/ZK3taZeB8WHGEkvABd2NC27/c4hb1K2coUsmCrasVc071uVB+Ixxwzgyd9t RBuONINnfp1Lg/64X6SXbNQBzIyNXoJX4H9+4QsZPEXSubLtv9WaLG6O2O/WKc3JgoCg i/nQ== 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=AbaIVhOIIHUY9LRTIdz1UK/hX5jEJvNFz1eTKTAw/vc=; b=WD4LE6Xr7dYEeYbu5fIW/gnmwnhG9GZyH/XiX3ZKy6w2BTCfs7uNfZ2sDW9JrayFZy hO82ipw7BSJHKnnupL5cbVuWpzWsA6F4fiwg8BxninQjUZsQ2cg5vSEZO/Wovq3DFXRG MMBBTqrkdqiiuT+jHcX2Vy4RE5xMvVAazgrl8iuVsEAD7/OXZKI1LVT1mnY7uDU9vZHG 8+sHe+Vo8XGX12qhYRtx/Yn7Gj00EMgvm9Txy/8Wu+jTz6iGBaZydeLG9LPPa9g1UQ/D EOJHZOb/tyko8R1OFEr6SxYSc+3FMloRXSSczIiWPaAYgqpu/XmgIdms1fd5AGRUx62K ni8A== 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 a7si82179qte.173.2018.02.07.03.04.12; Wed, 07 Feb 2018 03:04:12 -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 01D92627B7; Wed, 7 Feb 2018 11:04:11 +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 5ED5B617A3; Wed, 7 Feb 2018 11:02:29 +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 EEB33617C9; Wed, 7 Feb 2018 11:02:18 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id 929F861767 for ; Wed, 7 Feb 2018 11:00:55 +0000 (UTC) Received: from mxback20j.mail.yandex.net (mxback20j.mail.yandex.net [IPv6:2a02:6b8:0:1619::114]) by forward104o.mail.yandex.net (Yandex) with ESMTP id ECD48704E72 for ; Wed, 7 Feb 2018 14:00:53 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback20j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id jYuNiZ4ba1-0rhStYb5; Wed, 07 Feb 2018 14:00:53 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-0lV85kVZ; Wed, 07 Feb 2018 14:00:47 +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 13:59:57 +0300 Message-Id: <1518001208-29529-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 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: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ 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 10: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: 127146 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp355982ljc; Wed, 7 Feb 2018 03:03:23 -0800 (PST) X-Google-Smtp-Source: AH8x227buATc0Tj/TMf5HKwROa/+waNt46rkprQg3lPNDt+ummRIDbvwIg5G8eE/ABVJsAQ51oc9 X-Received: by 10.237.33.130 with SMTP id l2mr1755895qtc.100.1518001403326; Wed, 07 Feb 2018 03:03:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001403; cv=none; d=google.com; s=arc-20160816; b=N9yFBOG5cde0w7P1P2dCG0FRrPp2pxaGxUSTDuQMh5m/PLZhNIqE7LTvUaDAm05xUt 0LvC3zXW98CDFDZqR0CUkqDsGUpnrqutjV92OX165UTPl5TyrxfLK326PqMdPdJB6iNT ljsPibdA7e0fuPERt9x4YGldYxZVNU1bhuYHDB0WnKnYBUFEeECQKGU2sKibFouahvYV TgIMAXlaWcQ3W8WYmsTPeW3VcbRVObadmUysGc5J1dXswZeIpCd05HRE+w4Vlo1+PD03 OHb2nHZiY9jGBy9V1+7mGzDR/Qx9rNLViAOF8rNePQWNaHw8GpHDVCW9sUXMhGt+eIEw EdUw== 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=NOciIT1axqvb+Q+wjnQytVWG3gJqtzIyRrD1xLUJTGs=; b=ql/zRyBvCDjq1g6VHtv/7MghgrQBI15jfAx6gENPnmQZq9xvxy5C09ZgPX4dZ5yJrr nbJ774a0ZqxRtpulUynamDZDmkSuekMQh4r6omwIp7GldwWECGhuv8LKf+XhwhAJBHAl +DCwK/H/OQEVXzqvuky6MKXYU/avbiPsVGV9W18beESBNsJBuC7OjydRnjTSKOS6JDOB ruB1mAdv2LZaQRvdQt9KzonS8bSayJ5OmISk9ebw89sXMg7Og/u9NPVsEpF2ig7iNaV4 Xr6eeM8VOQtgwqK+t+/UCgiZV0e6ZOwlYPD7cqn5uBhOpwlFp0AW1u/zrmsSoejJIpBU LvBA== 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 v22si1198924qka.234.2018.02.07.03.03.23; Wed, 07 Feb 2018 03:03: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 00701622AC; Wed, 7 Feb 2018 11:03:22 +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 EC9CE617C9; Wed, 7 Feb 2018 11:02:20 +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 5EFA161819; Wed, 7 Feb 2018 11:02:17 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id D0BC560A6E for ; Wed, 7 Feb 2018 11:01:01 +0000 (UTC) Received: from mxback6o.mail.yandex.net (mxback6o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::20]) by forward103j.mail.yandex.net (Yandex) with ESMTP id BA91234C5040 for ; Wed, 7 Feb 2018 14:01:00 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback6o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ekefHLjGz0-10UiUMx1; Wed, 07 Feb 2018 14:01:00 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-0sVaEUHo; Wed, 07 Feb 2018 14:00:54 +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 13:59:58 +0300 Message-Id: <1518001208-29529-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 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: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ platform/linux-generic/odp_packet.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index f5151d293..fce5a730b 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2557,9 +2557,30 @@ 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.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 10: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: 127148 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp357482ljc; Wed, 7 Feb 2018 03:05:01 -0800 (PST) X-Google-Smtp-Source: AH8x224Izov2peouo417YNCjhpSXRpeCk5WIQsJsYA15kDj6Jc+02Ye6gUB/vQTwG0AXyPbGLwv/ X-Received: by 10.200.16.11 with SMTP id z11mr8299725qti.292.1518001501634; Wed, 07 Feb 2018 03:05:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001501; cv=none; d=google.com; s=arc-20160816; b=tlWPs2+Bfa0V86CfIZGE4jtj7aOq2jCkE2IxA5uy895ofX08dCHBMxm6rvaTtBAxup x2toBL6SGdjTI8VXyQN13fVnuJw9pij3CCW6BVw4fsOXA4NkI2CStLZJu6iyk2j/Pmae u3WNbEuLJ1iKlbv4xiYiWgsqs8+67MsuuO20jG3jj4cdrzl54OOvD/Jh63SY+/BqiKC4 x87VhntWKDslvSVo4rf2NN+u5snNBhPp9WcjBlYRznw2R7i6WJibFF3VArrJQ7ZXzGuW gELe+LzW0LHkcK5sUUKBJuSo5wezrHPuZ3e7Dr49mBPnd4R8xJ+bWGUX18J5/pv/+xfc 0kFA== 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=tbqK+6yfuwDZzsH8x5Dh57/539tZntNjSRDSHbmKn+k=; b=bqQ3Jux+vibcy+wcuxnkjJqkoCmqMS7jfspyWAs1plTK7+e9kH0SOdWxjr+aHQxqdh UJEhr9G4OqDcAMSgRXmGSqQ+tnoNuU71fTu2YXA8AI2JEjtwe1uCQdowJG/g5RAYo8Pj 0SjroOH7oniCa9YHqmGw2IbmqNHwE12RsuiKHS8v1r+iSrq3m7ajeVVhDsYyntPHpwv+ RUxvxcx/YRn5yjvyzjiQcwOG6uPVqbdzDKa9hWSgo9NPB2k+c9E/7pcFG2SU1xtZ4mhf jqekgchTwznmVeBw3EyUGC2yzq//4j4eCBa5r34eG8q/X21QYMykmp4xynE6Bo7aqMNu V95w== 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 r7si1203993qtd.178.2018.02.07.03.05.01; Wed, 07 Feb 2018 03:05:01 -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 0339D62778; Wed, 7 Feb 2018 11:05:01 +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 9B2B6619BF; Wed, 7 Feb 2018 11:02:36 +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 84191616D9; Wed, 7 Feb 2018 11:02:25 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id 122F6616D9 for ; Wed, 7 Feb 2018 11:01:09 +0000 (UTC) Received: from mxback10o.mail.yandex.net (mxback10o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::24]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 7B13C18254B for ; Wed, 7 Feb 2018 14:01:07 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback10o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id SpkDeqlYKY-17gCUmDH; Wed, 07 Feb 2018 14:01:07 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-10Vqw8VE; Wed, 07 Feb 2018 14:01:00 +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 13:59:59 +0300 Message-Id: <1518001208-29529-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 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: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ 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 11: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: 127152 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp360956ljc; Wed, 7 Feb 2018 03:08:59 -0800 (PST) X-Google-Smtp-Source: AH8x226RhNphsTuRq3X6/FIGRuAdzjOL+4lP+vrLqjNFcUBKmcd8kF1rzRmQEnqDemRb8lsBaaS1 X-Received: by 10.55.150.71 with SMTP id y68mr8602500qkd.74.1518001739632; Wed, 07 Feb 2018 03:08:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001739; cv=none; d=google.com; s=arc-20160816; b=RuUKCNPznwnWrxHlbszqzCtWtZz8vEWnIyJF2YcqAvHk0+SOK9ct1IXe1q1Y13da1T vmIK3FAIdzhf646T82PSwkD5jVdF57uwF6NDL59t8kBpDAPcfdLbJd4HehoNdyw4109o ntsUTL49pyWOmzR1ntcUl+BE9v2mrhwgX/hIRn0V+Eu2kDM4pTLK0mNMPEYZ4XObBqg4 lf0SzxREc1344DV8+NxdB54pCwoccvLnFwg6i6lzGq2jdRyTEcu8K/t2ENLF7sP8KsWf IlqcC51MNTbrCf6FTZe5CjSRB/okJAwXW8LD63XXVTFYVVjopxg+Erosg+ItYzdDCt9P z3LQ== 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=UFzQB7EiGxqjs7379YeFYHPocjSfp72It+BB6vGk+0E=; b=1CjTQW0MPDfYgV5z6BXdYzOhObjlf2XM5RhXRelyUOXFn3q5gWjfJluztCf8qIynz8 +X+QLh9LQAs6ElJy4DrxU/jzIzLJtCmUxz0hD8cRtmQ68rkBkFnrYlY0pV3nPtKCArPV g7GV4VnPHh3O29qnDPyDglVgqPfAHwNZLgxfiNZFo4En50keSarTefLSofh7dTZjoh68 +7UTvyklMLxzPPZ+1y1K39T/RE4PFd51rFjFgPx21PxzksXgz1gtqXa6PZLfsf1mOWwX oja4G61Yk1iOgn5kEw0PHaK93xmWwwJbTXMxyv2FDBYjBL5vfem+Tj7swG5sEFct0fLG 6YwA== 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 u18si1266565qke.325.2018.02.07.03.08.59; Wed, 07 Feb 2018 03:08:59 -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 4EDF661809; Wed, 7 Feb 2018 11:08:59 +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 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 4A64861817; Wed, 7 Feb 2018 11:03: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 2A76361810; Wed, 7 Feb 2018 11:03:14 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id BCF4B6097D for ; Wed, 7 Feb 2018 11:01:40 +0000 (UTC) Received: from mxback10j.mail.yandex.net (mxback10j.mail.yandex.net [IPv6:2a02:6b8:0:1619::113]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 290C05105BAB for ; Wed, 7 Feb 2018 14:01:14 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback10j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ZpqO1FTPXY-1EBOmsmE; Wed, 07 Feb 2018 14:01:14 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-17VG28U6; Wed, 07 Feb 2018 14:01:07 +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 14:00:00 +0300 Message-Id: <1518001208-29529-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 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: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ 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 11: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: 127150 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp359243ljc; Wed, 7 Feb 2018 03:06:58 -0800 (PST) X-Google-Smtp-Source: AH8x224HFu5VFf9juhQmdMYuWJxpxbzkMD0k8uj82qSTsb1xSZFw/Ob0Ng5B/cA3IUX1muR+w7vd X-Received: by 10.200.15.164 with SMTP id b33mr8538039qtk.301.1518001618025; Wed, 07 Feb 2018 03:06:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001618; cv=none; d=google.com; s=arc-20160816; b=TF8SCe+92qhEIKLcktI2QMePc8h1h9xR95/dp8BbRcTiIfe1wLh5+BOYd+Y6llc3hy Cl/y126fCOeQWuf3BniXyf0e5zN/VjpgoyeZHnVXwo1fpSJ/UGJ987022URShcl9v+AD HvNlRzZN1mRqbveOqCR7XIBBC+pSX89MKlK4QpZ2ea4NfHRHjJsQHI6EHDc5PYXLXnFN bjIDZxeiBCrVn8WELgJarcDwuaGmtu9nHpkcPFK717Hu4WrCA6kFmMATbtpQIZzsoSaL kH2XfltNNLbCCxTFlDnlOJPz9VWPKgrBHjAEks4TQtdQd7EzWwZ136OlaqK+uvANyxZD GpiQ== 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=vnx8EJ6Uj4orV3gceAyaOnw4g72Dkauz/LXpfm2KrKc=; b=l5rTsHTE4AxyDQXig2SsOcf7j7zOj3XfxdirXLOu1Qm0QUxmT1yJP9yErR3hCBdNRQ xHFgIjUd/QXwgNSFGK7NtodpQ79ok51v5JSPVPecnGaCkkVwvjlf6485DXrPzWTrpdhT HFsdnJki3N1XDfS4iaqLiUtunaHrnnUvI8K5KFudJMTwGmhq+w3q/04RkwDs/Lq2QZa6 yVhFHdCJ9aLUmjPSDj1JOvqoJyLbAC9y7m4TI6iQBeJ++LwdI9aSTx3DxmdPSdbrt2O/ zmTHYK0yawymCcjD6WTu0+Oauys7gu5vGFrIMphfdWoEOGY66eGcnMeLaZ/I82x6gTv4 ryCA== 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 y190si1217966qkd.8.2018.02.07.03.06.57; Wed, 07 Feb 2018 03:06:58 -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 A1E3761767; Wed, 7 Feb 2018 11:06:57 +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 5936F62779; Wed, 7 Feb 2018 11:02: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 DE8F861811; Wed, 7 Feb 2018 11:02:28 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id 75025617A3 for ; Wed, 7 Feb 2018 11:01:22 +0000 (UTC) Received: from mxback8j.mail.yandex.net (mxback8j.mail.yandex.net [IPv6:2a02:6b8:0:1619::111]) by forward101j.mail.yandex.net (Yandex) with ESMTP id ABE581242F97 for ; Wed, 7 Feb 2018 14:01:20 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback8j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id CgrMNIE3ry-1Kdm0O03; Wed, 07 Feb 2018 14:01:20 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-1EVuSQga; Wed, 07 Feb 2018 14:01: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 14:00:01 +0300 Message-Id: <1518001208-29529-8-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 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: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ .../api/classification/odp_classification_common.c | 4 ++-- test/validation/api/packet/packet.c | 17 +++++++++++++++-- test/validation/api/traffic_mngr/traffic_mngr.c | 4 ++-- 3 files changed, 19 insertions(+), 6 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..6771100cd 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -1048,8 +1048,6 @@ void packet_test_in_flags(void) 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 +1057,21 @@ 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_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_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_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 11: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: 127149 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp358328ljc; Wed, 7 Feb 2018 03:05:54 -0800 (PST) X-Google-Smtp-Source: AH8x226s6MUUX3aFEhNLF8GTatIhpQKYzcnV/6VamnT0S/EbvbLmGtYOg1zAJ4Dmkw05dVUNqgv1 X-Received: by 10.55.3.132 with SMTP id 126mr8471023qkd.95.1518001554479; Wed, 07 Feb 2018 03:05:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001554; cv=none; d=google.com; s=arc-20160816; b=ZLEpzAunDoWOsk50lPxT/YkNG2ze9rzi8CpNFCEB7Gq6f0QCfCfrGacD88Smo3CTPV jKp43NlqAWlbzMKYKfR4pDcu71FARrtGVm8F8VII19zxZsyX6w8AKSeVYCcX69gfM3CD xGFRZ1G1fh+0vUOklw2DI7OMeIz11eruKUW9oVg62G3eYx0GnN88JNjj3vl958SPzqfq /bIhb2kLO70YHa4SKzKpUCKIUhqPFOhLzYfdL51YEEv2jdJPZEPbp3N9ymbNyDBQvLD6 CByHg90201Q96tYwbRzF+88rEizY/Pjx7pzUCaMZUWhb/vtqr26dxEGkd9S2AeWCYceN iU9g== 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=8tBNoNN4fFm5w7yIC9eGenGj4qyQVe6MSA5S+sUrohw=; b=gOeD2WehzpwFYB7LlSQmVA3tM+uTGWMQeilFfVQZDLFa8Yg2KsC3ZrwvlzfonvXjMj S823nY4/C2DpkQlscQafXemMw7/cHEkBVfZkzmQNLp1rkvRN7Tv7pcy19Nfo0T8tmueZ AoBQkr6Q0imgatOkXFN3jEpKhr0AVLZyXZ5TT08km34CJ9lN6lxnCmdxCGo2nnb6z35e XNRNw1L81cdXYIj/8a2f7nKoqItf6borQcJTMKpU+a7uy0psHlkK04NR09I7xS49C+EP TMlgKOhbbtmYSZIftQkyA1YZEJOMS8HZwnWVFV6tmQpwmkMSoulu1aSdrZB5SYTRuTdN cd8g== 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 d81si1297806qkc.60.2018.02.07.03.05.54; Wed, 07 Feb 2018 03:05:54 -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 E4AED616FF; Wed, 7 Feb 2018 11:05: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 E904162771; Wed, 7 Feb 2018 11:02:39 +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 EFCD5607D5; Wed, 7 Feb 2018 11:02:26 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 9F4DE607D5 for ; Wed, 7 Feb 2018 11:01:28 +0000 (UTC) Received: from mxback3j.mail.yandex.net (mxback3j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10c]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 704AD34C0C96 for ; Wed, 7 Feb 2018 14:01:27 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback3j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id AbNPxrhSo4-1R2WM0sP; Wed, 07 Feb 2018 14:01:27 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-1KVWeuVn; Wed, 07 Feb 2018 14:01:20 +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 14:00:02 +0300 Message-Id: <1518001208-29529-9-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 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: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ .../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 | 5 ---- platform/linux-generic/odp_packet_flags.c | 33 ++++++++++++++++++---- 6 files changed, 43 insertions(+), 22 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 fce5a730b..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,8 +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.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 11: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: 127154 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp362153ljc; Wed, 7 Feb 2018 03:10:31 -0800 (PST) X-Google-Smtp-Source: AH8x226+55tdOoTqeKKYhk2E8cF6lA6kVxD3/NMKcigeQuwnKz9CYw13W33A0WPbWwVUQ5OX3Lci X-Received: by 10.55.5.17 with SMTP id 17mr8310083qkf.277.1518001831627; Wed, 07 Feb 2018 03:10:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001831; cv=none; d=google.com; s=arc-20160816; b=Lhbx+rtcKkj32qzZlet42Q3JWuAUd1wRuX6gbmB0dwrEBR0YMFlyHS6ze/FyN0Bt/O v6sejKnlOct0HUa5EWaemzvF6arg99fBkIP+mQb7vdLomTOoEKi83bSO/hKkILcqeKK5 VcSpTlS634Uvh6x5DZBLISvONkER2i+v06rm/gkn92WdOdd/wrpDooe78G3yPLYQy30z 6pUlM/5NxFdgTAEt1/4umXcob4oBFBCcB0QffNc/oQNpSi7YCwGDTwLNvKir0a5SMCwZ lRd34VHqjtP+OVj0XIyTfsk81s5S8fEubRJuSCeLHppmwsTSnd/+TlNoSxiTu+0jj0TG kBAw== 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=SrfrD4hXE5XNPIcwFHNPjR+siATWPnELaCFFB2vUsVg=; b=ar53CsFrGPfZOZtFhV55h8cJZrGzS2icyW1AvwNSJDBs8quTk6230S5Z1m/zTjcbzc HPPQgaUaizELXA6gkdGPgnYQNZa8cYTk+6u3Erll1WGG26Pwk7Q6psdl2JpttKIPSPiD bDxVGY0RloMSqVK3jPlVaIt/mLgiFeB5XXRc1PRA6s3vVtkab2ywq25tMuZLKH5Vqm90 SX36XWv7dp/tblp1j7EXubJvbjGShmFOaOb+jDs3XCqFop2i3OM/Q1Ah9i818thGDEvm JSa+ueWTGV5Ac+gUhMDL75v8cnUxiP57AzvbfoMn27/adMBkLbbro/krZNeH2GJSSP4K x6qg== 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 39si482578qtm.311.2018.02.07.03.10.30; Wed, 07 Feb 2018 03:10: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 8C976617AA; Wed, 7 Feb 2018 11:10: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 F2BCE62792; Wed, 7 Feb 2018 11:03:34 +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 867D461806; Wed, 7 Feb 2018 11:03:17 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 2B2C9616FC for ; Wed, 7 Feb 2018 11:01:55 +0000 (UTC) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward102o.mail.yandex.net (Yandex) with ESMTP id DA01E5A053B9 for ; Wed, 7 Feb 2018 14:01:33 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 4ROjaQMTSs-1XDG48Vq; Wed, 07 Feb 2018 14:01:33 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-1RVGKhm7; Wed, 07 Feb 2018 14:01:27 +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 14:00:03 +0300 Message-Id: <1518001208-29529-10-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 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: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ 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 11: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: 127151 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp360561ljc; Wed, 7 Feb 2018 03:08:32 -0800 (PST) X-Google-Smtp-Source: AH8x227ZJum0SqfZCdLIsmnb6/KiMZrNuUVBMkTy86x5qeLa/WXv3PA+Vy49Koidv1yB8RaQfBXF X-Received: by 10.200.7.133 with SMTP id l5mr926029qth.154.1518001712118; Wed, 07 Feb 2018 03:08:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001712; cv=none; d=google.com; s=arc-20160816; b=Ud3BDp64+MAhLL/IKAchW+IxGdH5PTAtm9p/CqVCMKS5Fbu8wBZ46XPPLeKLJxwRRv Ryfq/1Wa4+pId5wEMx+ipUvmUMQijtT6dxvZ8VaR17TJT90jILk6mS0fKHIvF1En5ufz PSr42PJdyWhDHQCuqnPL/x8p5u6lZdCAtnVws5/UNPEgJYoqgE+1Tw9DkzZetBMvyQzO qe7fEcUQq1SSWUqxSefVES9kyXL/OImv5dZKmMru/ULOvmI2MPjrdT1wGFFczjLaOD4Z nRuowTQmpPj5FIcet/vVMIbZFGkcDEEz0OdMTFHe736LuY+JkrINMjHxITtpFpI4fyEc 2Ubw== 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=v+9t48agivdUTdOdsPDIDUG2FbkHn+V+Gdrapz8rr2w=; b=OsfRZj714bZmBDSc7Rg0WKu26Ul+SVDFiDZ7w6ycrmQoVBAQfsOfGbq28mli8GlB0b UamxnsFD/+ckC3Mv56MGu6c6/2AXUjXs7mvMUMMsFVQmg2wWOLa3ONd/vrNEYLcl2u4i 6mxBR2FC6Y5C+Htza3mb/per/6vRnlFNv0l4AV82Z1fXkdqWux2Te5gl0Zb3nChOxdQs eEOzhchmqazBBiVmFLs6oJaCuQO3tw+tczrUBoPEeL4762iCHK6kF5x7CisOT8mCgvqt 8ofLCIvHQZJkDTsxE08DaxN6cv5yLf9doEH2UtIzut9+n5PbwEZD1mgrVpYTiF4eCsOq Cyzw== 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 o8si1251411qtf.230.2018.02.07.03.08.31; Wed, 07 Feb 2018 03:08:32 -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 C963E617E2; Wed, 7 Feb 2018 11:08:31 +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 0B63D61806; Wed, 7 Feb 2018 11:03:20 +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 E318D62785; Wed, 7 Feb 2018 11:03:12 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id ED49E6173F for ; Wed, 7 Feb 2018 11:01:42 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 83BAC21821B8 for ; Wed, 7 Feb 2018 14:01:40 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id QewpltnZ5x-1eG8PuJm; Wed, 07 Feb 2018 14:01:40 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-1XVKbQ02; Wed, 07 Feb 2018 14:01:33 +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 14:00:04 +0300 Message-Id: <1518001208-29529-11-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 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: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ 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 11: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: 127153 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp361443ljc; Wed, 7 Feb 2018 03:09:36 -0800 (PST) X-Google-Smtp-Source: AH8x224iqOZDU2aGDkipWyv+ply8kb2gLlmChbeXnSTumConITxABsKdAKoYAIJhkrEBISESrbja X-Received: by 10.233.216.131 with SMTP id u125mr8817512qkf.293.1518001776596; Wed, 07 Feb 2018 03:09:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001776; cv=none; d=google.com; s=arc-20160816; b=qaKGtUiJuAt7/4TGX5oTp1xY6Y4B2MRDXYp/S+xFM7eMvrXsMyli1tnpdcCVBZ8yAq OLD1qv+81Z7vblPnv+k/dHxYRxxlEdcSNU2dETpB6O1IqOAmY8RbZ2TUH0L33CKDjG6m RjDNkjx1DPa+ZlRvZ2vJlshwZwXFCHhPZ9TAfU2GE/QU9Mc3AyctG9LKMx08cI5FBe7I pok94N7nVxEZG7EBujwyqO1LrUMLye2ebWoxkuwYA2LmOoEEYAe2E98ELtuA3v3NuXuA UfPnWunz94zifUy5OxpLBtf0ZOtdMxxt8l8yMvHA6dPtxhvyZSpGwbmKHTtgPbUZT0hy chGw== 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=lAYWmhI7CvMmLRp+Z+jwgNWUxiathoavJfAZ1W2aII4=; b=0wXQj5uVBYjTjD+S0+0EDMXX4EwblFivI0muAMIWfYnohcfF4pQKuB270PSdTrRIEh a21uL+Za0VlK3vV6Q3FQ6FiGY7iK2OmFnrpT0b3dqkGfsYIgpjaM6cDBZIHlpv77bfq+ aFUunXHNuzMQ4e2Xtm3pnLXzAqGiATpJymhIrCgg/PawOOJd0WswHgGEe0jDEFNaF48o lM+YIGPgSxxtXIJCp+SSfzmPyMsaU/w+OGItJdJvWjYEITlw1YcRMmjAW02YxjFH6Vci G+O9uhhSD8Td+O14mtVRVUn1cb80Ethn/nDnb2FKXhrw1n8iW0xya1KQXBqQiAurluA2 MU4A== 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 74si1325723qkb.129.2018.02.07.03.09.36; Wed, 07 Feb 2018 03:09: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 37EE3619C9; Wed, 7 Feb 2018 11:09:36 +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 A081F62788; Wed, 7 Feb 2018 11:03:29 +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 4947D61806; Wed, 7 Feb 2018 11:03:17 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id 4402F61809 for ; Wed, 7 Feb 2018 11:01:48 +0000 (UTC) Received: from mxback15g.mail.yandex.net (mxback15g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:94]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 2B3D244629 for ; Wed, 7 Feb 2018 14:01:47 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback15g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id CAuTQXjI9z-1ljmjBN0; Wed, 07 Feb 2018 14:01:47 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-1eVKD7BP; Wed, 07 Feb 2018 14:01:40 +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 14:00:05 +0300 Message-Id: <1518001208-29529-12-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 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: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ .../api/classification/odp_classification_common.c | 4 +- test/validation/api/packet/packet.c | 68 ++++++++++++++++++++-- test/validation/api/traffic_mngr/traffic_mngr.c | 4 +- 3 files changed, 68 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 6771100cd..0ba4fe2de 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -1053,25 +1053,85 @@ 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); 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)); + CU_ASSERT(!odp_packet_has_ipsec(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_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)); + CU_ASSERT(!odp_packet_has_ipsec(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)); + CU_ASSERT(!odp_packet_has_ipsec(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)); + CU_ASSERT(!odp_packet_has_ipsec(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)); + CU_ASSERT(!odp_packet_has_ipsec(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)); + CU_ASSERT(odp_packet_has_ipsec(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)); + CU_ASSERT(odp_packet_has_ipsec(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_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)); + CU_ASSERT(!odp_packet_has_ipsec(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 11: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: 127155 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp362699ljc; Wed, 7 Feb 2018 03:11:11 -0800 (PST) X-Google-Smtp-Source: AH8x226UVn3iSz13h4sTWSltgbOo+8YjlShCHWI5APg+JHTkWttadhUU6o1OUWprm4YbHJ8pr3EW X-Received: by 10.55.20.42 with SMTP id e42mr7760686qkh.132.1518001871813; Wed, 07 Feb 2018 03:11:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001871; cv=none; d=google.com; s=arc-20160816; b=MfSmE9QkFoPi9HGafylRsgqJKVIAnRL1G8ONO3I+Qnnk0O+RYfd40LG7FQ7VeG1TVy 48facPpH65gaMuln7qMxJErqq+fZ0vqsUhDrsEj3DpgsmMT6SHi0x83BpcysWcGVyo7n Ex2AZksGGCRdlNMpYcrnmtB9YjtQaNOH4eJpwM6fAC5UaI7l7WAxH7+MaUnk3RTdbVzK l5GRdLtVRAb5lxwZDbxSX8UVB5ggUHi3xxDbmiDnU9CM8++aBWtN+NuJ4+wqDVjKEJDL t26b+evO0KareDehJvMDp4sCA33tvpkbssqv8LArzx4PariGTzpOsKODOfiV3yBArpDz 9Jdg== 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=52IxIOv/lajm89xmXCZEqI4t6WO0M8HM+/pwjDq7fRc=; b=DvGDxX5NJNmUcSfTI+Ej1tQD6h2Fb4qECAGT0alhxC0BDifiNuoblPI8FAa+drK9aI 5OnrWPofz/+YTsPDvAeHunEN/0QM1vfTvaLMb4PEgvLr+AILaK5O7lmXEJ8lZH53hEY8 uECMi9jx2VE0ZyxF9fAN194OPMW6IjgZ4z2zE277R3hSxQLDN3LQNwU4ey4+hfVK8Bb1 CT7Vbn6C5XmX8SfPfTCQRK486w4jNq76pzm8Ewem7zwS7HNb7LFEjn8X11iUxLKkNwcR rCCSGs6Ry//LmFXlYre5LCdxHksSYXEtbq2kf7yAo0k1S8JAxdXTy2nYJUCE3yGSs0g2 lE7A== 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 w55si1025340qtw.129.2018.02.07.03.11.11; Wed, 07 Feb 2018 03:11:11 -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 7EA5B617F3; Wed, 7 Feb 2018 11:11:11 +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 7538E62796; Wed, 7 Feb 2018 11:03:49 +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 9F13C6279C; Wed, 7 Feb 2018 11:03:44 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 6C97B6180D for ; Wed, 7 Feb 2018 11:02:03 +0000 (UTC) Received: from mxback8o.mail.yandex.net (mxback8o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::22]) by forward102o.mail.yandex.net (Yandex) with ESMTP id BB5695A050C6 for ; Wed, 7 Feb 2018 14:01:53 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback8o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id g6iLMQPHUb-1r3qxW2V; Wed, 07 Feb 2018 14:01:53 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-1lVaAthh; Wed, 07 Feb 2018 14:01:47 +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 14:00:06 +0300 Message-Id: <1518001208-29529-13-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 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: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ .../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 11: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: 127156 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp362960ljc; Wed, 7 Feb 2018 03:11:32 -0800 (PST) X-Google-Smtp-Source: AH8x224rqzvmq15t2VjDZex01+0z5hEOjNjxteTgUznWxib8sbN/e0gENK6AI73CTHZLbKmkbdL+ X-Received: by 10.55.191.69 with SMTP id p66mr8644593qkf.315.1518001891883; Wed, 07 Feb 2018 03:11:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001891; cv=none; d=google.com; s=arc-20160816; b=Y2t7ZAHWfnhBiPOE92TxNO019Rs4LYEehoE5zrGalDL+Ajg+M/FkJaWr8SJwud0nRW 8BQtC8tElcVkuWse/KgG8sYDZhBzjO0SfzULh3LY+J/VkrZlK8764JB0XXQCygKGrSPB mBOKNmD3vndtccHNh0Fvj5GdTs4oCDhmkUMubIqy02p8yDquHSL2pO0yyD9L52gTNw6J JwSK9+IVS72E+X7qMLW26+2JTMXIK9/w8zHvfsWRpdMYL/sfe+U7pZ9VQS6jZEkik6Zo IJtPqD4U7u8b5AYX1WJY1UI1lH44OeNoeNQl3culg7wikPY63NiLH7hj79kX1veh+WDM U/Fw== 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=I4Jth+WVVqLeLk0EMSYSrbU3H+p9VDtSKsC3hAbhCqM=; b=g29Kxb8gJ5h4eb/jmdhQRk60L/Zs7qxxNYteiy8Gw1WjIQCbsnkEa0eBZr8kDaUxG1 JcmvD09SmmFAeV6JU85XnrOFyxCrozm7voDE++MTuNNLAUafNHIqg5tUbK7TlUJGD8ru SPUYGjpRhwkkCsBZK1mDClyird94RpGN1mvAG1lcm9aPdffWttktzyw0yGIlu4qWoFhC Un1a3e4YF6LqjmM3WN//ilpT4qV1f0H/4OCJtjvaK0ymFRvq/4cDCxyPFFyo42edcMLQ bXL227H+eDqL3lqNfbh7vQ40UQ2CtU0vyXS3aYPc4PtNr5OclfIoIb4Cihnv0WG+CFGs e2OA== 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 b66si1202577qkd.296.2018.02.07.03.11.31; Wed, 07 Feb 2018 03:11: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 8763161835; Wed, 7 Feb 2018 11:11:31 +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 1D3FD617AF; Wed, 7 Feb 2018 11:03:59 +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 C5C1C60A6E; Wed, 7 Feb 2018 11:03:48 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id BB28560A6E for ; Wed, 7 Feb 2018 11:02:19 +0000 (UTC) Received: from mxback8g.mail.yandex.net (mxback8g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:169]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 5B3D95D824A4 for ; Wed, 7 Feb 2018 14:02:17 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback8g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id zaERMd5EJI-2HTCsfFX; Wed, 07 Feb 2018 14:02:17 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-1rVa9SEN; Wed, 07 Feb 2018 14:01:53 +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 14:00:07 +0300 Message-Id: <1518001208-29529-14-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 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: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ include/odp/api/spec/packet_flags.h | 64 +++++++++---------------------------- 1 file changed, 15 insertions(+), 49 deletions(-) diff --git a/include/odp/api/spec/packet_flags.h b/include/odp/api/spec/packet_flags.h index 500ecc148..8ca46f3bf 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. @@ -411,29 +412,14 @@ 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 - * - * @param pkt Packet handle - * @param val Value - */ -void odp_packet_has_arp_set(odp_packet_t pkt, int val); +/** @deprecated Use odp_packet_l3_type_set instead */ +void ODP_DEPRECATE(odp_packet_has_arp_set)(odp_packet_t pkt, int val); -/** - * Set flag for IPv4 - * - * @param pkt Packet handle - * @param val Value - */ -void odp_packet_has_ipv4_set(odp_packet_t pkt, int val); +/** @deprecated Use odp_packet_l3_type_set instead */ +void ODP_DEPRECATE(odp_packet_has_ipv4_set)(odp_packet_t pkt, int val); -/** - * Set flag for IPv6 - * - * @param pkt Packet handle - * @param val Value - */ -void odp_packet_has_ipv6_set(odp_packet_t pkt, int val); +/** @deprecated Use odp_packet_l3_type_set instead */ +void ODP_DEPRECATE(odp_packet_has_ipv6_set)(odp_packet_t pkt, int val); /** * Set flag for IP broadcast address @@ -475,37 +461,17 @@ 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 - * - * @param pkt Packet handle - * @param val Value - */ -void odp_packet_has_udp_set(odp_packet_t pkt, int val); +/** @deprecated Use odp_packet_l4_type_set instead */ +void ODP_DEPRECATE(odp_packet_has_udp_set)(odp_packet_t pkt, int val); -/** - * Set flag for TCP - * - * @param pkt Packet handle - * @param val Value - */ -void odp_packet_has_tcp_set(odp_packet_t pkt, int val); +/** @deprecated Use odp_packet_l4_type_set instead */ +void ODP_DEPRECATE(odp_packet_has_tcp_set)(odp_packet_t pkt, int val); -/** - * Set flag for SCTP - * - * @param pkt Packet handle - * @param val Value - */ -void odp_packet_has_sctp_set(odp_packet_t pkt, int val); +/** @deprecated Use odp_packet_l4_type_set instead */ +void ODP_DEPRECATE(odp_packet_has_sctp_set)(odp_packet_t pkt, int val); -/** - * Set flag for ICMP - * - * @param pkt Packet handle - * @param val Value - */ -void odp_packet_has_icmp_set(odp_packet_t pkt, int val); +/** @deprecated Use odp_packet_l4_type_set instead */ +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 11: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: 127157 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp363612ljc; Wed, 7 Feb 2018 03:12:28 -0800 (PST) X-Google-Smtp-Source: AH8x226HlsNfcy1zfR24qV9l7v85dNkTc8Rdw3CnPJsg0yLwp3ZvRLpkciyZtI/mDVeqXgv9yxo5 X-Received: by 10.55.12.7 with SMTP id 7mr9039093qkm.56.1518001948624; Wed, 07 Feb 2018 03:12:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001948; cv=none; d=google.com; s=arc-20160816; b=xY3cwFJadts+N5tSnRJ7ljWWEjXjUj5XeQI+uk0W7V8FkVd3CeNjKaA02xsyLOvGIe 9dJ4fj+L1kacnUS5OhHt75HIvYi3TcoFYUZEB4UG7X37fCbOvR1NXBaZg7GL8buMsjh4 BWDxhj8cgnPUzJcETc7oUJ6XjeQ3hQwcDfsBIXEV4R6PIVGE79SMFngaIo7WzJbwQyVz qEhQrOzwkxBXfrazGG9qJ2RGXgPAwtIVDcWflZf3KuTueIyL/oZMTdrwgnrHg27xaCuv Wr5MtYVX3pdeD+gGyzxeh7NxVzVEHggUph/InCN175anG/akZNc89QV2++pOhPQ26xbU z6Dg== 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=PV5ANtW3tEx5gYNWx8RYW2ujIHeiJ/+mHZH3yoZ02FE=; b=IzJhaFZoszg2u7HevK2d6mdCrBZkkAJDYB5PsP20YmRe9B+O6QEh1S5NBmCo5OEIhY 41SZgKyN7tmRhARSf99zgzwCNizAtUWe6ebxTVY+1Nj9vsouiSqEv9EHk1sR44A8AgPm JLJWBd9dJrdCV9bnqzQ3fQfwYnX003jzytNRKI/Z3tisAMgSOcs3AeqMo2N7AEVU75yN WxFn904dZ5Ake0o/D9obh1k4Q/wrMY+nBd7MLxOkwmbtVvfmQkc1oLJ/9jXDQQvMEzT6 /eL1ZryBhSh76fGxIypD2oM+OarC8IUbwZRM3Nss0CMjXm/GeR2gB66wYsmKRXw4LllL RWTw== 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 l1si551000qtc.484.2018.02.07.03.12.28; Wed, 07 Feb 2018 03:12:28 -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 45FCB62773; Wed, 7 Feb 2018 11:12:28 +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 72CD0627A1; Wed, 7 Feb 2018 11:04:00 +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 627F76279D; Wed, 7 Feb 2018 11:03:51 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id 27D6F61555 for ; Wed, 7 Feb 2018 11:02:25 +0000 (UTC) Received: from mxback3j.mail.yandex.net (mxback3j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10c]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 1D51E21833E9 for ; Wed, 7 Feb 2018 14:02:24 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback3j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id x7dUSdVFo3-2N2K97vB; Wed, 07 Feb 2018 14:02:23 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-2HVi6krH; Wed, 07 Feb 2018 14:02: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 14:00:08 +0300 Message-Id: <1518001208-29529-15-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 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: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ 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) {