From patchwork Mon Aug 14 17:00:03 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: 110057 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp4588991qge; Mon, 14 Aug 2017 10:00:59 -0700 (PDT) X-Received: by 10.55.183.197 with SMTP id h188mr32769644qkf.206.1502730059345; Mon, 14 Aug 2017 10:00:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502730059; cv=none; d=google.com; s=arc-20160816; b=lQBJokq3TjYiIEvieWfbGbSGnGjEUiYpsNNfjq06Z2L+dFqsD6NHk9WHCkv7Xh75dP VWfremJHSBySGOqUryDnvQC0XAb0EmILG6djZvQqirgE1ZTwdAeFQtalVDJH03JQIy0E YmaGmzwH1KkiKqm1Q3AzV28unrvbdbjEk84VmaMcoTfaH/uZqERv0U3RbTih8Cm7pIKi K+cz6b9HvT3P6NqVoF+9Qs0OBd/QQ8pb1A+hqYKFxYjb/r7A11GrSe9eGqNlI7a8BUIc CmkyoVum0syCSeQt/IS/bQu1JI3HZ3G2rNKUjlr+DE4Anx2sCbLs2g9ehddyS/Yyspcm GNfQ== 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=55Nz8KsK877S4jQivfXnzawh7juTOBnAI1y+AjCn6ZY=; b=g55y7tzvicyKBR1QgClhZANiplu3wuGRwwT1xPjQIbJ14jghn72MVpDxFBjDeSTKEN X5E/5lEqBLPR33g9N7OJQOkgFYWrm/iFCar6+87/hUa0fPCSzhk+nbEmL7IBV/jmRruH +R7wclBNdoFOWCPB4l41E5fXlGRMrhVG41OYD7vT8CYweDJseDLVgKKmX/Sd2pOMrQsZ h6KlSKiBZZmfM1XF1AOZwf+obbzIn5Iw7gB2aah0VTt+LKmHYWIdB2sTNdImYW0EE2fI yKR6svRFHu2Tcius7NRGSnTCg85q49uQCeiQLuFieG4xBRodVRGyOL//Oae4YBW2F0WZ /60A== 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 r60si6850357qtd.134.2017.08.14.10.00.59; Mon, 14 Aug 2017 10:00:59 -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 144D060B25; Mon, 14 Aug 2017 17:00: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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 713B36444A; Mon, 14 Aug 2017 17:00: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 C618E64486; Mon, 14 Aug 2017 17:00:24 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 84D5B6444A for ; Mon, 14 Aug 2017 17:00:22 +0000 (UTC) Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward102o.mail.yandex.net (Yandex) with ESMTP id E49AA5A01740 for ; Mon, 14 Aug 2017 20:00:20 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback7o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id uC02leLhh9-0KRGLWBX; Mon, 14 Aug 2017 20:00:20 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id mlYyN0Wfya-0Koimu0X; Mon, 14 Aug 2017 20:00: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: Mon, 14 Aug 2017 20:00:03 +0300 Message-Id: <1502730005-8444-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502730005-8444-1-git-send-email-odpbot@yandex.ru> References: <1502730005-8444-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 126 Subject: [lng-odp] [PATCH v1 1/3] linux-generic: pktio: update classifier enable boolean 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: Balasubramanian Manoharan sets classifer enable based on boolean setting on odp_pktin_queue_param_t Fixes https://bugs.linaro.org/show_bug.cgi?id=3177 Signed-off-by: Balasubramanian Manoharan Signed-off-by: Maxim Uvarov --- /** Email created from pull request 126 (muvarov:monarch_lts) ** https://github.com/Linaro/odp/pull/126 ** Patch: https://github.com/Linaro/odp/pull/126.patch ** Base sha: 759b6d5da6617af244765983d0b8bfbb26f41890 ** Merge commit sha: 2c095e7e4fe1c0fc39b552b84d2374988f5920ca **/ platform/linux-generic/odp_packet_io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 0b9939bd..9f8bade2 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -1216,6 +1216,8 @@ int odp_pktin_queue_config(odp_pktio_t pktio, return -1; } + pktio_cls_enabled_set(entry, param->classifier_enable); + if (num_queues > capa.max_input_queues) { ODP_DBG("pktio %s: too many input queues\n", entry->s.name); return -1; From patchwork Mon Aug 14 17:00:04 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: 110059 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp4590832qge; Mon, 14 Aug 2017 10:02:26 -0700 (PDT) X-Received: by 10.200.56.54 with SMTP id q51mr34265007qtb.338.1502730146005; Mon, 14 Aug 2017 10:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502730145; cv=none; d=google.com; s=arc-20160816; b=faF/Q4F9UekC2dYBM1fDKSHp65DLXeBKT1lZgRIQ3NxxO7VXGo7HsL8BA7dae1SxjS rOFxbItcJZG2Y0+6qgq7zVsX7cvBhKiuYTtDqHP5VoynZq9lW4GjAs42U4+wrJNa+NK4 eNJ5e+ykXpj9m8DXTaknnoPMngXLpRKcB0+AU/ahHX4VUXCj0HHJO63uyQrwH68T/0oj 82Jtsb46zL+vgJnwZL+jYonCJnYD/2ya/Nsr0elHVsQSxX7d2DbD5+rfr7bdi2NwXUZv D6PvCZapGKF/yizy+E51X5rgwiDkgybn+jQhb7/cSlX9u1MyZZNAgliS/8qdyWmGpg8m IgiQ== 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=4aYNNK3kdUhiiPZq3pDu90DV3TaoYmdElibaM4gS9nc=; b=dzPZRWTxvAa+kdSp9pzfqzWCO0GpVU4TncbnKna678mF0MJr6LT56znWWOfVCwtMQx 40Ua3MO12CCSG8cmhMDV0pOXfykatC4iBJrjNKoSMBZoZVVbhvqtMtN4Kk5r/iVn6f+0 8osi1yNC7PvU4mpBlpseyG6x5Pqse+7QYi5UwMHiIEGdp0jERDBsATbGNdqngGxA9Onl gEakCnBU3aPZpjKvWvZbuvlXLg03KLWduaLBwGQvRjb30kdpTBdaJrlDI5th5q0dEq8E pXsQ7CrU+7FzRQXPqQxPzF4eUnbbfznz/8pi16CQ+Vv+7UhJF5NemCHEznIJAFWcr+Dv 6f6Q== 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 a27si2790534qka.191.2017.08.14.10.02.25; Mon, 14 Aug 2017 10:02:25 -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 A660D635F8; Mon, 14 Aug 2017 17:02:25 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, 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 28C446449E; Mon, 14 Aug 2017 17:00:37 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 16C0064469; Mon, 14 Aug 2017 17:00:29 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id 1690A635F8 for ; Mon, 14 Aug 2017 17:00:23 +0000 (UTC) Received: from mxback12j.mail.yandex.net (mxback12j.mail.yandex.net [IPv6:2a02:6b8:0:1619::87]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 9D950180365A for ; Mon, 14 Aug 2017 20:00:21 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback12j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id qcEMldg9pp-0LaCB3GH; Mon, 14 Aug 2017 20:00:21 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id mlYyN0Wfya-0Lo4mu0X; Mon, 14 Aug 2017 20:00:21 +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: Mon, 14 Aug 2017 20:00:04 +0300 Message-Id: <1502730005-8444-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502730005-8444-1-git-send-email-odpbot@yandex.ru> References: <1502730005-8444-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 126 Subject: [lng-odp] [PATCH v1 2/3] linux-generic: classification: update classifier enable boolean 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: Balasubramanian Manoharan removes classifier enable boolean default setting Fixes https://bugs.linaro.org/show_bug.cgi?id=3177 Signed-off-by: Balasubramanian Manoharan Signed-off-by: Maxim Uvarov --- /** Email created from pull request 126 (muvarov:monarch_lts) ** https://github.com/Linaro/odp/pull/126 ** Patch: https://github.com/Linaro/odp/pull/126.patch ** Base sha: 759b6d5da6617af244765983d0b8bfbb26f41890 ** Merge commit sha: 2c095e7e4fe1c0fc39b552b84d2374988f5920ca **/ platform/linux-generic/odp_classification.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index ea223bfb..05dea14e 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -331,7 +331,6 @@ int odp_pktio_default_cos_set(odp_pktio_t pktio_in, odp_cos_t default_cos) } entry->s.cls.default_cos = cos; - pktio_cls_enabled_set(entry, 1); return 0; } @@ -406,7 +405,6 @@ int odp_cos_with_l2_priority(odp_pktio_t pktio_in, l2_cos->cos[qos_table[i]] = cos; } } - pktio_cls_enabled_set(entry, 1); UNLOCK(&l2_cos->lock); return 0; } @@ -439,7 +437,6 @@ int odp_cos_with_l3_qos(odp_pktio_t pktio_in, l3_cos->cos[qos_table[i]] = cos; } } - pktio_cls_enabled_set(entry, 1); UNLOCK(&l3_cos->lock); return 0; } From patchwork Mon Aug 14 17: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: 110058 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp4589650qge; Mon, 14 Aug 2017 10:01:28 -0700 (PDT) X-Received: by 10.200.34.162 with SMTP id f31mr31700667qta.132.1502730088626; Mon, 14 Aug 2017 10:01:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502730088; cv=none; d=google.com; s=arc-20160816; b=DJyWvM6MnSIMwFt8oOLsf7j5p6CZYj1zuB2+xs8pmd8tntpeyeO9Kll5SHTpigpwL5 Esox4Zgs0GjAFZN+i//OyYXEu+tiCaNRd4Cc4Te9SLlJF+GdmNqCnRVrR7ItrZ8BwLh3 ANPo2goLoBNViiadMRfV9SEkXLYWBL2JH8r5OVIsBo56x7ZMAy94DNP0KZrkrwwl3Uqg VTmFPGXlc4G5Uz8dGs3l8fRqvLXyJ/zsbnzGvO7QbyDrl/yZS65yLrN8KfeY3pJYUDgr 9fnxkmYiL+kbAjn4VI0OaSdgNK+61PpHXCQY84RDA0E8eeYMolsN8dZWwdfW53WeZefn 7SOg== 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=PzksQ6SgII09vfcKyPGDaBBfoUaxjpmHKY7KNbT4iK8=; b=NPFiLg/t7LguCLO3eZFxIHSN+HFfvq8/8P+F2gXCl6hc7GNOFWjF4VQ+6W9g2exWP0 s3sKnn4hxAtgjBflQF93z1bPj7jN6kqacoiXRqtF+3Gn5lPTMW8g+Tf/utwc8fEUw3Zc AJFttFYExguxloald/9/OquJr6cAv49WUzyKWbWDQ4n0b+F8B+ffgbeBi1a0ub6S4zWz vMz7CMK1Y8wGd6BiuN3E/vokkLaKD4tV0x+/cRvS1F/eBWUILWgr1Qb+PokqTrK5XKdN rCHplQYn8EpgGXyjWBibP8RiHorZha7yc1V0tiGR6D4B7kpuMUtwrz27NMV1jLp89S4f 9LfA== 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 r25si6975149qtr.142.2017.08.14.10.01.28; Mon, 14 Aug 2017 10:01:28 -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 448EA60CFC; Mon, 14 Aug 2017 17:01: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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 CC982644A0; Mon, 14 Aug 2017 17:00:35 +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 C727164496; Mon, 14 Aug 2017 17:00:27 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 7421564469 for ; Mon, 14 Aug 2017 17:00:23 +0000 (UTC) Received: from mxback8g.mail.yandex.net (mxback8g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:169]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 658705A01848 for ; Mon, 14 Aug 2017 20:00:22 +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 KeHL6XyRlE-0MmiEJop; Mon, 14 Aug 2017 20:00:22 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id mlYyN0Wfya-0LoS7tUP; Mon, 14 Aug 2017 20:00:21 +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: Mon, 14 Aug 2017 20:00:05 +0300 Message-Id: <1502730005-8444-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502730005-8444-1-git-send-email-odpbot@yandex.ru> References: <1502730005-8444-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 126 Subject: [lng-odp] [PATCH v1 3/3] validation: classification: add test case for classifier enable boolean 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: Balasubramanian Manoharan updates test suite to enable classifier in odp_pktin_queue_param_t config adds test case for classifier enable boolean Fixes https://bugs.linaro.org/show_bug.cgi?id=3177 Signed-off-by: Balasubramanian Manoharan Signed-off-by: Maxim Uvarov --- /** Email created from pull request 126 (muvarov:monarch_lts) ** https://github.com/Linaro/odp/pull/126 ** Patch: https://github.com/Linaro/odp/pull/126.patch ** Base sha: 759b6d5da6617af244765983d0b8bfbb26f41890 ** Merge commit sha: 2c095e7e4fe1c0fc39b552b84d2374988f5920ca **/ test/validation/classification/classification.h | 1 + .../classification/odp_classification_basic.c | 4 +- .../classification/odp_classification_common.c | 5 +- .../classification/odp_classification_test_pmr.c | 118 +++++++++++++++++++-- .../classification/odp_classification_tests.c | 2 + .../classification/odp_classification_testsuites.h | 3 +- 6 files changed, 119 insertions(+), 14 deletions(-) diff --git a/test/validation/classification/classification.h b/test/validation/classification/classification.h index d73c8216..629484d0 100644 --- a/test/validation/classification/classification.h +++ b/test/validation/classification/classification.h @@ -77,6 +77,7 @@ void classification_test_pmr_term_udp_sport(void); void classification_test_pmr_term_ipproto(void); void classification_test_pmr_term_dmac(void); void classification_test_pmr_term_packet_len(void); +void classification_test_pktin_classifier_flag(void); /* test arrays: */ extern odp_testinfo_t classification_suite_basic[]; diff --git a/test/validation/classification/odp_classification_basic.c b/test/validation/classification/odp_classification_basic.c index 372377d8..9e83fc3d 100644 --- a/test/validation/classification/odp_classification_basic.c +++ b/test/validation/classification/odp_classification_basic.c @@ -89,7 +89,7 @@ void classification_test_create_pmr_match(void) pkt_pool = pool_create("pkt_pool"); CU_ASSERT_FATAL(pkt_pool != ODP_POOL_INVALID); - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool); + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); configure_default_cos(pktio, &default_cos, @@ -273,7 +273,7 @@ void classification_test_pmr_composite_create(void) pkt_pool = pool_create("pkt_pool"); CU_ASSERT_FATAL(pkt_pool != ODP_POOL_INVALID); - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool); + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); configure_default_cos(pktio, &default_cos, diff --git a/test/validation/classification/odp_classification_common.c b/test/validation/classification/odp_classification_common.c index 7a42ac74..e0012cdc 100644 --- a/test/validation/classification/odp_classification_common.c +++ b/test/validation/classification/odp_classification_common.c @@ -17,7 +17,8 @@ typedef struct cls_test_packet { odp_u32be_t seq; } cls_test_packet_t; -odp_pktio_t create_pktio(odp_queue_type_t q_type, odp_pool_t pool) +odp_pktio_t create_pktio(odp_queue_type_t q_type, odp_pool_t pool, + odp_bool_t cls_enable) { odp_pktio_t pktio; odp_pktio_param_t pktio_param; @@ -43,6 +44,8 @@ odp_pktio_t create_pktio(odp_queue_type_t q_type, odp_pool_t pool) odp_pktin_queue_param_init(&pktin_param); pktin_param.queue_param.sched.sync = ODP_SCHED_SYNC_ATOMIC; + pktin_param.classifier_enable = cls_enable; + pktin_param.hash_enable = false; if (odp_pktin_queue_config(pktio, &pktin_param)) { fprintf(stderr, "pktin queue config failed.\n"); diff --git a/test/validation/classification/odp_classification_test_pmr.c b/test/validation/classification/odp_classification_test_pmr.c index 7c7d07ea..c9c0fe39 100644 --- a/test/validation/classification/odp_classification_test_pmr.c +++ b/test/validation/classification/odp_classification_test_pmr.c @@ -85,6 +85,102 @@ int classification_suite_pmr_term(void) return retcode; } +void classification_test_pktin_classifier_flag(void) +{ + odp_packet_t pkt; + odph_tcphdr_t *tcp; + uint32_t seqno; + uint16_t val; + uint16_t mask; + int retval; + odp_pktio_t pktio; + odp_queue_t queue; + odp_queue_t retqueue; + odp_queue_t default_queue; + odp_cos_t default_cos; + odp_pool_t default_pool; + odp_pmr_t pmr; + odp_cos_t cos; + char cosname[ODP_COS_NAME_LEN]; + odp_cls_cos_param_t cls_param; + odp_pool_t pool; + odp_pool_t pool_recv; + odp_pmr_param_t pmr_param; + odph_ethhdr_t *eth; + + val = CLS_DEFAULT_DPORT; + mask = 0xffff; + seqno = 0; + + /* classifier is disabled in pktin queue configuration */ + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, false); + CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); + retval = start_pktio(pktio); + CU_ASSERT(retval == 0); + + configure_default_cos(pktio, &default_cos, + &default_queue, &default_pool); + + queue = queue_create("tcp_dport1", true); + CU_ASSERT(queue != ODP_QUEUE_INVALID); + + pool = pool_create("tcp_dport1"); + CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); + + sprintf(cosname, "tcp_dport"); + odp_cls_cos_param_init(&cls_param); + cls_param.pool = pool; + cls_param.queue = queue; + cls_param.drop_policy = ODP_COS_DROP_POOL; + + cos = odp_cls_cos_create(cosname, &cls_param); + CU_ASSERT(cos != ODP_COS_INVALID); + + odp_cls_pmr_param_init(&pmr_param); + pmr_param.term = ODP_PMR_TCP_DPORT; + pmr_param.match.value = &val; + pmr_param.match.mask = &mask; + pmr_param.val_sz = sizeof(val); + + pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); + CU_ASSERT(pmr != ODP_PMR_INVAL); + + pkt = create_packet(pkt_pool, false, &seq, true); + CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); + seqno = cls_pkt_get_seq(pkt); + CU_ASSERT(seqno != TEST_SEQ_INVALID); + eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); + odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); + odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); + + tcp = (odph_tcphdr_t *)odp_packet_l4_ptr(pkt, NULL); + tcp->dst_port = odp_cpu_to_be_16(CLS_DEFAULT_DPORT); + + enqueue_pktio_interface(pkt, pktio); + + /* since classifier flag is disabled in pktin queue configuration + packet will not be delivered in classifier queues */ + pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); + CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); + pool_recv = odp_packet_pool(pkt); + /* since classifier is disabled packet should not be received in + pool and queue configured with classifier */ + CU_ASSERT(pool != pool_recv); + CU_ASSERT(retqueue != queue); + CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); + + odp_packet_free(pkt); + odp_cos_destroy(cos); + odp_cos_destroy(default_cos); + odp_cls_pmr_destroy(pmr); + stop_pktio(pktio); + odp_queue_destroy(queue); + odp_queue_destroy(default_queue); + odp_pool_destroy(pool); + odp_pool_destroy(default_pool); + odp_pktio_close(pktio); +} + void classification_test_pmr_term_tcp_dport(void) { odp_packet_t pkt; @@ -113,7 +209,7 @@ void classification_test_pmr_term_tcp_dport(void) mask = 0xffff; seqno = 0; - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool); + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); retval = start_pktio(pktio); CU_ASSERT(retval == 0); @@ -227,7 +323,7 @@ void classification_test_pmr_term_tcp_sport(void) mask = 0xffff; seqno = 0; - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool); + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); retval = start_pktio(pktio); CU_ASSERT(retval == 0); @@ -339,7 +435,7 @@ void classification_test_pmr_term_udp_dport(void) mask = 0xffff; seqno = 0; - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool); + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); retval = start_pktio(pktio); CU_ASSERT(retval == 0); @@ -452,7 +548,7 @@ void classification_test_pmr_term_udp_sport(void) mask = 0xffff; seqno = 0; - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool); + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); retval = start_pktio(pktio); CU_ASSERT(retval == 0); @@ -563,7 +659,7 @@ void classification_test_pmr_term_ipproto(void) mask = 0xff; seqno = 0; - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool); + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); retval = start_pktio(pktio); CU_ASSERT(retval == 0); @@ -669,7 +765,7 @@ void classification_test_pmr_term_dmac(void) mask = 0xffffffffffff; seqno = 0; - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool); + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); retval = start_pktio(pktio); CU_ASSERT(retval == 0); @@ -772,7 +868,7 @@ void classification_test_pmr_term_packet_len(void) mask = 0xff00; seqno = 0; - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool); + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); retval = start_pktio(pktio); CU_ASSERT(retval == 0); @@ -880,7 +976,7 @@ static void classification_test_pmr_pool_set(void) mask = 0xff; seqno = 0; - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool); + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); retval = start_pktio(pktio); CU_ASSERT(retval == 0); @@ -976,7 +1072,7 @@ static void classification_test_pmr_queue_set(void) mask = 0xff; seqno = 0; - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool); + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); retval = start_pktio(pktio); CU_ASSERT(retval == 0); @@ -1068,7 +1164,8 @@ static void classification_test_pmr_term_daddr(void) const char *dst_addr = "10.0.0.99/32"; odph_ethhdr_t *eth; - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool); + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); + CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); retval = start_pktio(pktio); CU_ASSERT(retval == 0); @@ -1159,5 +1256,6 @@ odp_testinfo_t classification_suite_pmr[] = { ODP_TEST_INFO(classification_test_pmr_queue_set), ODP_TEST_INFO(classification_test_pmr_term_daddr), ODP_TEST_INFO(classification_test_pmr_term_packet_len), + ODP_TEST_INFO(classification_test_pktin_classifier_flag), ODP_TEST_INFO_NULL, }; diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c index ed45518b..85f422dc 100644 --- a/test/validation/classification/odp_classification_tests.c +++ b/test/validation/classification/odp_classification_tests.c @@ -49,6 +49,8 @@ int classification_suite_init(void) odp_pktin_queue_param_init(&pktin_param); pktin_param.queue_param.sched.sync = ODP_SCHED_SYNC_ATOMIC; + pktin_param.classifier_enable = true; + pktin_param.hash_enable = false; if (odp_pktin_queue_config(pktio_loop, &pktin_param)) { fprintf(stderr, "pktin queue config failed.\n"); diff --git a/test/validation/classification/odp_classification_testsuites.h b/test/validation/classification/odp_classification_testsuites.h index aea3de1b..1f3e084b 100644 --- a/test/validation/classification/odp_classification_testsuites.h +++ b/test/validation/classification/odp_classification_testsuites.h @@ -28,7 +28,8 @@ odp_packet_t create_packet_len(odp_pool_t pool, bool vlan, uint16_t len); int cls_pkt_set_seq(odp_packet_t pkt); uint32_t cls_pkt_get_seq(odp_packet_t pkt); -odp_pktio_t create_pktio(odp_queue_type_t q_type, odp_pool_t pool); +odp_pktio_t create_pktio(odp_queue_type_t q_type, odp_pool_t pool, + odp_bool_t cls_enable); void configure_default_cos(odp_pktio_t pktio, odp_cos_t *cos, odp_queue_t *queue, odp_pool_t *pool); int parse_ipv4_string(const char *ipaddress, uint32_t *addr, uint32_t *mask);