From patchwork Wed Dec 13 15:00:14 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: 121779 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5593419qgn; Wed, 13 Dec 2017 07:10:19 -0800 (PST) X-Google-Smtp-Source: ACJfBoun/0jCHvWr7r8Vm+YDzfb4S/8tZ74bjiGP9pQ49Lak4y3RSaMCO4pKsMeUTRBIm4/MToKv X-Received: by 10.55.203.13 with SMTP id d13mr10984330qkj.93.1513177819025; Wed, 13 Dec 2017 07:10:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513177819; cv=none; d=google.com; s=arc-20160816; b=MWyGSW4CRpHV3V7ACbGPv3Yhstr+mt9FlGbG31DWcnI2W0v5ndXDtLjBFYb2hB8TUb MsMPp08EJVhKsgCruFvxxeIaV0mMB2Ckks5UnknR54mtTRPhKxgTn9+N/DFkb1En11jn JL1v2gX7KKOk5mHjkSZSnovriBd2U6t97enGBCKiRxgS/WBtgyHNswVuwaHKCDt5lXqS W+THvdewalIfkqLV+fz9KigqFtT8Z6mBl99QcAQqO8C9xT3GKkAYYFJrgtsiNk6ZvIAc 3JltkYAq3FtzhG2w2QdC1usgw7cm5CVFKp8JHFcMcBWfX+dVdB3qIwjmRxHDgiCzC65D NDXQ== 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=tKHpu8N9LwPs8RcxbMp0jI8I8WWBQ5QY4uVaUlqsyQA=; b=wdwvZa4QdGvbWrSmeahDV9HJz5DLLbzmJ/3VnYQXx7aMyFAE9vDcBU/5ccr3vBXDOx eeDuiLiYkJ8UZWV58v4dadF3Tb8/pLTxQGbbYGrBmHe4rHd3KFQSxzYADsjuh24zVFfR xA9LkgapHWTYhLVjF78At1CD7kw6Gd8lAvkSaP6zl1xKfZsJrq/Go1svVVb85Tkw0SM7 Koof4v2AIr/m1sYvQNZhzrcx39JAF1KOVRpQpdP6AYwZp/tbP1r0olvlldBDkbjs/U4U SuoQPWgZKyuf6Ul50Sp/ZdM/rg1GejCECOVJ1V9KiLCYH1qdFk4Yt+ZLxciVB1A6ujEt 1IrQ== 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 s192si2059249qke.396.2017.12.13.07.10.18; Wed, 13 Dec 2017 07:10:19 -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 9C35860819; Wed, 13 Dec 2017 15:10:18 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 E62FA60840; Wed, 13 Dec 2017 15:01:50 +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 D140D608EE; Wed, 13 Dec 2017 15:01:41 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 040FC60800 for ; Wed, 13 Dec 2017 15:00:21 +0000 (UTC) Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 09E595106A56 for ; Wed, 13 Dec 2017 18:00:20 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback7j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id GUhAX6T5iC-0JvGl7Iw; Wed, 13 Dec 2017 18:00:19 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id TIlNgphY6V-0JwarI3v; Wed, 13 Dec 2017 18:00:19 +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 18:00:14 +0300 Message-Id: <1513177217-8215-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513177217-8215-1-git-send-email-odpbot@yandex.ru> References: <1513177217-8215-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 338 Subject: [lng-odp] [PATCH API-NEXT v2 2/5] 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: 7427c77cd44f5de84a2788e6d7d0cefaf146f479 **/ 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; }