From patchwork Fri Aug 4 08:59:59 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: 109380 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp1884438qge; Fri, 4 Aug 2017 02:06:45 -0700 (PDT) X-Received: by 10.55.42.104 with SMTP id q101mr1971456qkh.84.1501837605104; Fri, 04 Aug 2017 02:06:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501837605; cv=none; d=google.com; s=arc-20160816; b=siQBQ5vw7MyuGm9pnnnX1B8MJhagGse6GNmu6k4n78beg6U4c2YwdvtF+svyIxJWGD 9WZgAA0IBK8kDpVhKgu5f6rQJ7JOr9c46HpDFBbH9LxZBoxHjswTmdG5spnonf/0WYHG +rOwRpddrbh5EzFQ60hSSw3LH5O8W10/Uadc1w5G7LNz2dx7+5zsnAy0QI1qETn8+Q7R s5+0+A++LfJLRKiqfdKMWpvHdfqffNvy8dR3QmYJ6AksK/FZF74rMISTadT3l40KVNGm n2mufa7kc40M+nHOIO3TiFAUmEfT0DyF7UIpRUrsVjso0h5fTZLOQ6Ka5qAXX0lB3CYv sjcw== 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=3p0xFxP7jjyUOhJCQXkEMNhhW1QuINZs+awWCIani5M=; b=GIya/S9ddy7kNcxsiBkoJfUDsi6EHi7yGGWfyEehrFD49IqAg7GUCHHup5vnKubZBR lo1YK0x3n8r4hRMMku64vU4Kmtx9DrF+Vu0ry6c++pJ/2idgUp+HTkCfKQtz3V79NjBs G7Wb3Of5shc80lP5yAa31V9zeo1uYTwosVij5Rtghi3V8+7ba00zUibUzRTAfmLD+XOh dUcmh0m3eePE/t4L/bAfd8Dx0Uv6JWFfEEe3Fp2MFeikKpvL+j6Evb8ORg2XYSI8BddC BFFyPnJOFdpYZGKNRg8Hy/GlNTPCc2WUHa1vPgLatNkjTyysxSP6nRK2AioaNAczA5dn nk8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p188si1135031qkc.290.2017.08.04.02.06.44; Fri, 04 Aug 2017 02:06:45 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 A1F91644C2; Fri, 4 Aug 2017 09:06:44 +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,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 542F164471; Fri, 4 Aug 2017 09:02:53 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 83B0B62D11; Fri, 4 Aug 2017 09:02:48 +0000 (UTC) Received: from forward2m.cmail.yandex.net (forward2m.cmail.yandex.net [5.255.216.20]) by lists.linaro.org (Postfix) with ESMTPS id 3477362D11 for ; Fri, 4 Aug 2017 09:00:45 +0000 (UTC) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::25]) by forward2m.cmail.yandex.net (Yandex) with ESMTP id D5AFD2149A for ; Fri, 4 Aug 2017 12:00:43 +0300 (MSK) Received: from smtp1o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1o.mail.yandex.net (Yandex) with ESMTP id 9BA1F1300D16 for ; Fri, 4 Aug 2017 12:00:26 +0300 (MSK) Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id kkQJPUXR1g-0QGqaJcv; Fri, 04 Aug 2017 12:00:26 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 4 Aug 2017 11:59:59 +0300 Message-Id: <1501837208-7450-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501837208-7450-1-git-send-email-odpbot@yandex.ru> References: <1501837208-7450-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 108 Subject: [lng-odp] [PATCH API-NEXT v1 4/13] linux-gen: classification: mark several functions as static 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 108 (lumag:symbols-cleanup) ** https://github.com/Linaro/odp/pull/108 ** Patch: https://github.com/Linaro/odp/pull/108.patch ** Base sha: 8390f890d4bd2babb63a24f7b15d2f4763e44050 ** Merge commit sha: 44fd671a0d2772a32395c7f0574aa545d2a9aa71 **/ .../include/odp_classification_internal.h | 84 ---------------------- platform/linux-generic/odp_classification.c | 38 ++++++++++ 2 files changed, 38 insertions(+), 84 deletions(-) diff --git a/platform/linux-generic/include/odp_classification_internal.h b/platform/linux-generic/include/odp_classification_internal.h index aca8e8c6..c8dba135 100644 --- a/platform/linux-generic/include/odp_classification_internal.h +++ b/platform/linux-generic/include/odp_classification_internal.h @@ -30,16 +30,6 @@ extern "C" { /** @internal -match_qos_cos - -Select a CoS for the given Packet based on QoS values -This function returns the COS object matching the L2 and L3 QoS -based on the l3_preference value of the pktio -**/ -cos_t *match_qos_cos(pktio_entry_t *entry, const uint8_t *pkt_addr, - odp_packet_hdr_t *hdr); -/** -@internal Packet Classifier @@ -59,39 +49,11 @@ This function should be called during pktio initialization. **/ int pktio_classifier_init(pktio_entry_t *pktio); -/** -@internal -match_pmr_cos - -Match a PMR chain with a Packet and return matching CoS -This function gets called recursively to check the chained PMR Term value -with the packet. - -**/ -cos_t *match_pmr_cos(cos_t *cos, const uint8_t *pkt_addr, pmr_t *pmr, - odp_packet_hdr_t *hdr); -/** -@internal -CoS associated with L3 QoS value - -This function returns the CoS associated with L3 QoS value -**/ -cos_t *match_qos_l3_cos(pmr_l3_cos_t *l3_cos, const uint8_t *pkt_addr, - odp_packet_hdr_t *hdr); - void _odp_cls_update_hash_proto(cos_t *cos, odp_pktin_hash_proto_t hash_proto); /** @internal -CoS associated with L2 QoS value - -This function returns the CoS associated with L2 QoS value -**/ -cos_t *match_qos_l2_cos(pmr_l2_cos_t *l2_cos, const uint8_t *pkt_addr, - odp_packet_hdr_t *hdr); -/** -@internal Flow Signature Calculation This function calculates the Flow Signature for a packet based on @@ -99,52 +61,6 @@ CoS and updates in Packet Meta Data **/ int update_flow_signature(uint8_t *pkt_addr, cos_t *cos); -/** -@internal -Allocate a odp_pmr_t Handle -*/ -odp_pmr_t alloc_pmr(pmr_t **pmr); - -/** -@internal -Pointer to pmr_t Handle -This function checks for validity of odp_pmr_t Handle -*/ -pmr_t *get_pmr_entry(odp_pmr_t pmr_id); - -/** -@internal -Pointer to pmr_t Handle -*/ -pmr_t *get_pmr_entry_internal(odp_pmr_t pmr_id); - -/** -@internal -Pointer to odp_cos_t Handle -*/ -cos_t *get_cos_entry(odp_cos_t cos_id); - -/** -@internal -Pointer to odp_cos_t Handle -This function checks for validity of odp_cos_t Handle -*/ -cos_t *get_cos_entry_internal(odp_cos_t cos_id); - -/** -@internal -Verify PMR with a Packet - -This function goes through each PMR_TERM value in pmr_t structure and -calls verification function for each term.Returns 1 if PMR matches or 0 -Otherwise. -**/ -int verify_pmr(pmr_t *pmr, const uint8_t *pkt_addr, odp_packet_hdr_t *pkt_hdr); - -uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr, - odp_cls_hash_proto_t hash_proto, - const uint8_t *base); - #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 892d2fad..78063a72 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -33,6 +33,7 @@ static cos_tbl_t *cos_tbl; static pmr_tbl_t *pmr_tbl; static _cls_queue_grp_tbl_t *queue_grp_tbl; +static const rss_key default_rss = { .u8 = { 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, @@ -43,11 +44,13 @@ const rss_key default_rss = { } }; +static cos_t *get_cos_entry_internal(odp_cos_t cos_id) { return &cos_tbl->cos_entry[_odp_typeval(cos_id)]; } +static pmr_t *get_pmr_entry_internal(odp_pmr_t pmr_id) { return &pmr_tbl->pmr[_odp_typeval(pmr_id)]; @@ -273,6 +276,10 @@ odp_cos_t odp_cls_cos_create(const char *name, odp_cls_cos_param_t *param) return ODP_COS_INVALID; } +/* + * Allocate an odp_pmr_t Handle + */ +static odp_pmr_t alloc_pmr(pmr_t **pmr) { int i; @@ -293,6 +300,7 @@ odp_pmr_t alloc_pmr(pmr_t **pmr) return ODP_PMR_INVAL; } +static cos_t *get_cos_entry(odp_cos_t cos_id) { if (_odp_typeval(cos_id) >= CLS_COS_MAX_ENTRY || @@ -303,6 +311,7 @@ cos_t *get_cos_entry(odp_cos_t cos_id) return &cos_tbl->cos_entry[_odp_typeval(cos_id)]; } +static pmr_t *get_pmr_entry(odp_pmr_t pmr_id) { if (_odp_typeval(pmr_id) >= CLS_PMR_MAX_ENTRY || @@ -707,6 +716,11 @@ odp_pool_t odp_cls_cos_pool(odp_cos_t cos_id) return cos->s.pool; } +/* + * This function goes through each PMR_TERM value in pmr_t structure and calls + * verification function for each term.Returns 1 if PMR matches or 0 otherwise. + */ +static int verify_pmr(pmr_t *pmr, const uint8_t *pkt_addr, odp_packet_hdr_t *pkt_hdr) { int pmr_failure = 0; @@ -825,6 +839,12 @@ int verify_pmr(pmr_t *pmr, const uint8_t *pkt_addr, odp_packet_hdr_t *pkt_hdr) return true; } +/* + * Match a PMR chain with a Packet and return matching CoS + * This function gets called recursively to check the chained PMR Term value + * with the packet. + */ +static cos_t *match_pmr_cos(cos_t *cos, const uint8_t *pkt_addr, pmr_t *pmr, odp_packet_hdr_t *hdr) { @@ -871,6 +891,10 @@ int pktio_classifier_init(pktio_entry_t *entry) return 0; } +static +cos_t *match_qos_cos(pktio_entry_t *entry, const uint8_t *pkt_addr, + odp_packet_hdr_t *hdr); + /** Select a CoS for the given Packet based on pktio @@ -914,6 +938,11 @@ static inline cos_t *cls_select_cos(pktio_entry_t *entry, return cls->default_cos; } +static +uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr, + odp_cls_hash_proto_t hash_proto, + const uint8_t *base); + /** * Classify packet * @@ -969,6 +998,7 @@ int cls_classify_packet(pktio_entry_t *entry, const uint8_t *base, return 0; } +static uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr, odp_cls_hash_proto_t hash_proto, const uint8_t *base) @@ -1037,6 +1067,7 @@ uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr, return hash; } +static cos_t *match_qos_l3_cos(pmr_l3_cos_t *l3_cos, const uint8_t *pkt_addr, odp_packet_hdr_t *hdr) { @@ -1058,6 +1089,7 @@ cos_t *match_qos_l3_cos(pmr_l3_cos_t *l3_cos, const uint8_t *pkt_addr, return cos; } +static cos_t *match_qos_l2_cos(pmr_l2_cos_t *l2_cos, const uint8_t *pkt_addr, odp_packet_hdr_t *hdr) { @@ -1077,6 +1109,12 @@ cos_t *match_qos_l2_cos(pmr_l2_cos_t *l2_cos, const uint8_t *pkt_addr, return cos; } +/* + * Select a CoS for the given Packet based on QoS values + * This function returns the COS object matching the L2 and L3 QoS + * based on the l3_preference value of the pktio +*/ +static cos_t *match_qos_cos(pktio_entry_t *entry, const uint8_t *pkt_addr, odp_packet_hdr_t *hdr) {