From patchwork Wed Dec 13 13:00:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 121767 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5441498qgn; Wed, 13 Dec 2017 05:02:15 -0800 (PST) X-Google-Smtp-Source: ACJfBotXuHutyexmIElW+Czq5PPyNuYbx+0wYwcGHJQFTn0mbG2xvkssMdSV16OPq033vSFhOw90 X-Received: by 10.237.60.206 with SMTP id e14mr11021710qtf.157.1513170135471; Wed, 13 Dec 2017 05:02:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513170135; cv=none; d=google.com; s=arc-20160816; b=u2GFC79KhbtlyPAf3VZpJ6Wf8s0YwsRuCGBbIgE9Z1iM8kdzt/AKKEpIlLAuylsus6 cCjXQA0ZBoMakx29mGkTNc32HYw+AOu/LzKNeYMTvQ9y6b2APn9FT8RBsY636n70DYP4 3KCgmcoQ7T9DEaPdaM639Jnkv7omqUvddv7Uafk0WvsIRWtG2NUNNFwpd9eeraBt5V+B hRi4wDB9+Q1PxdW7RTjqWAFCTaEuTdUEISHZwulBqLpiPTUcbVAdzbL47DMRxYSE1Ng0 Ai+jtcyamaN5v8t8wpQxMAgJDJZc2kdiLHivGhtq2Q27WrGmWidBTTSzqH4EFO4xnTkC fRhA== 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=GuVPJQ9162iAWn5WjfRSU1qcC0X4AwkByQKPZ9JE1+Q=; b=Kqs3pph28FT1V3RvKS8WetKJ3Vp/4+yDdO5iLFzyQyhcnRF77+6VXNmVEBkB3LEEWg Edg8lajFAkInidqMuMJs77jaY/4mjfXA2jhORnPv9trzeYmnQYvUnBb8TuuiC5H8zzAM zpY3/uE8HYeQsntmk4WXwIfUBDmKPGogS8nG5aEIdErsE79WgDrLWIzTHVsYzEWVvjPJ OXBOfd8/ik67JS/2suw2QoIcVUCQom5k6bZJXu3zYHgXOxIWPrV9ZDVrXFSI7bTbRJy5 xGcUBMd3uIkXXd5uWTFFOk6S8QFgLdstfMYjMEU/P7/AodSzfXtgnXzrxyPWJnkK0+JT J8Hg== 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 q54si1830516qtf.201.2017.12.13.05.02.12; Wed, 13 Dec 2017 05:02:15 -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 39C0E608EE; Wed, 13 Dec 2017 13:02:12 +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,URIBL_BLOCKED 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 A732260732; Wed, 13 Dec 2017 13:01:18 +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 2B52060902; Wed, 13 Dec 2017 13:01:11 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 7A0E860655 for ; Wed, 13 Dec 2017 13:00:34 +0000 (UTC) Received: from mxback11g.mail.yandex.net (mxback11g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:90]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 11B264300D2F for ; Wed, 13 Dec 2017 16:00:30 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback11g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 5AlbawAMrc-0UZKklJA; Wed, 13 Dec 2017 16:00:30 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ZKo7wGnMCt-0NUOF9TV; Wed, 13 Dec 2017 16:00:23 +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, 13 Dec 2017 16:00:05 +0300 Message-Id: <1513170009-9281-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513170009-9281-1-git-send-email-odpbot@yandex.ru> References: <1513170009-9281-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 338 Subject: [lng-odp] [PATCH API-NEXT v1 2/6] linux-gen: adapt to odp_pktio_parser_layer_t removal 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 338 (lumag:pktio_parse_layer) ** https://github.com/Linaro/odp/pull/338 ** Patch: https://github.com/Linaro/odp/pull/338.patch ** Base sha: d96a8207591fbcaac25b79286d7d72a537354c1f ** Merge commit sha: 874b90ec6730e9189edd69774044ef32d7f0d95f **/ platform/linux-generic/include/odp_packet_internal.h | 4 ++-- platform/linux-generic/odp_classification.c | 2 +- platform/linux-generic/odp_ipsec.c | 14 +++++++------- platform/linux-generic/odp_packet.c | 10 +++++----- platform/linux-generic/odp_packet_io.c | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index a16ec3161..40f3edc1e 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -296,11 +296,11 @@ int packet_alloc_multi(odp_pool_t pool_hdl, uint32_t len, /* Perform packet parse up to a given protocol layer */ int packet_parse_layer(odp_packet_hdr_t *pkt_hdr, - odp_pktio_parser_layer_t layer); + odp_proto_layer_t layer); /* Perform L3 and L4 parsing up to a given protocol layer */ int packet_parse_l3_l4(odp_packet_hdr_t *pkt_hdr, - odp_pktio_parser_layer_t layer, + odp_proto_layer_t layer, uint32_t l3_offset, uint16_t ethtype); diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 025f12593..276430923 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -973,7 +973,7 @@ int cls_classify_packet(pktio_entry_t *entry, const uint8_t *base, packet_set_len(pkt_hdr, pkt_len); packet_parse_common(&pkt_hdr->p, base, pkt_len, seg_len, - ODP_PKTIO_PARSER_LAYER_ALL); + ODP_PROTO_LAYER_ALL); cos = cls_select_cos(entry, base, pkt_hdr); if (cos == NULL) diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index 8735e6052..61ce48758 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -200,22 +200,22 @@ static const uint8_t ipsec_padding[255] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, }; -static inline odp_pktio_parser_layer_t parse_layer(odp_ipsec_proto_layer_t l) +static inline odp_proto_layer_t parse_layer(odp_ipsec_proto_layer_t l) { switch (l) { case ODP_IPSEC_LAYER_NONE: - return ODP_PKTIO_PARSER_LAYER_NONE; + return ODP_PROTO_LAYER_NONE; case ODP_IPSEC_LAYER_L2: - return ODP_PKTIO_PARSER_LAYER_L2; + return ODP_PROTO_LAYER_L2; case ODP_IPSEC_LAYER_L3: - return ODP_PKTIO_PARSER_LAYER_L3; + return ODP_PROTO_LAYER_L3; case ODP_IPSEC_LAYER_L4: - return ODP_PKTIO_PARSER_LAYER_L4; + return ODP_PROTO_LAYER_L4; case ODP_IPSEC_LAYER_ALL: - return ODP_PKTIO_PARSER_LAYER_ALL; + return ODP_PROTO_LAYER_ALL; } - return ODP_PKTIO_PARSER_LAYER_NONE; + return ODP_PROTO_LAYER_NONE; } static ipsec_sa_t *ipsec_in_single(odp_packet_t pkt, diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 5b5a9827c..50e8aa068 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2200,7 +2200,7 @@ int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr, prs->l3_offset = offset; - if (layer <= ODP_PKTIO_PARSER_LAYER_L2) + if (layer <= ODP_PROTO_LAYER_L2) return prs->error_flags.all != 0; /* Set l3 flag only for known ethtypes */ @@ -2231,7 +2231,7 @@ int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr, ip_proto = 255; /* Reserved invalid by IANA */ } - if (layer == ODP_PKTIO_PARSER_LAYER_L3) + if (layer == ODP_PROTO_LAYER_L3) return prs->error_flags.all != 0; /* Set l4 flag only for known ip_proto */ @@ -2303,7 +2303,7 @@ int packet_parse_common(packet_parser_t *prs, const uint8_t *ptr, parseptr = ptr; offset = 0; - if (layer == ODP_PKTIO_PARSER_LAYER_NONE) + if (layer == ODP_PROTO_LAYER_NONE) return 0; /* Assume valid L2 header, no CRC/FCS check in SW */ @@ -2322,7 +2322,7 @@ int packet_parse_common(packet_parser_t *prs, const uint8_t *ptr, * Simple packet parser */ int packet_parse_layer(odp_packet_hdr_t *pkt_hdr, - odp_pktio_parser_layer_t layer) + odp_proto_layer_t layer) { uint32_t seg_len = packet_first_seg_len(pkt_hdr); void *base = packet_data(pkt_hdr); @@ -2332,7 +2332,7 @@ int packet_parse_layer(odp_packet_hdr_t *pkt_hdr, } int packet_parse_l3_l4(odp_packet_hdr_t *pkt_hdr, - odp_pktio_parser_layer_t layer, + odp_proto_layer_t layer, uint32_t l3_offset, uint16_t ethtype) { diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index aa6cdb068..ffbc73b26 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -998,7 +998,7 @@ void odp_pktio_config_init(odp_pktio_config_t *config) { memset(config, 0, sizeof(odp_pktio_config_t)); - config->parser.layer = ODP_PKTIO_PARSER_LAYER_ALL; + config->parser.layer = ODP_PROTO_LAYER_ALL; } int odp_pktio_info(odp_pktio_t hdl, odp_pktio_info_t *info) @@ -1203,7 +1203,7 @@ int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa) /* The same parser is used for all pktios */ if (ret == 0) - capa->config.parser.layer = ODP_PKTIO_PARSER_LAYER_ALL; + capa->config.parser.layer = ODP_PROTO_LAYER_ALL; return ret; }