From patchwork Wed Aug 2 18:00:13 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: 109276 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp3086617qge; Wed, 2 Aug 2017 11:02:19 -0700 (PDT) X-Received: by 10.237.42.226 with SMTP id t89mr31124836qtd.242.1501696939293; Wed, 02 Aug 2017 11:02:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501696939; cv=none; d=google.com; s=arc-20160816; b=Vr9Y0e5jCdyPkpy/2CTdFO1OH1psIpnZaQjUgQQD7EGHpMF/Tw1qtTWXFOnSTmFc7g 5r8oLYvcD6s3tYgRvsdW4C1U/R7RIUrpaIluucOdiy9U8pUXZ/i/iaoCyre9SrLv0L9l LprAS+U+eYEAXUJ89dTskgnTC7IzO3zHcWAMo50oic6uhhir00zhjfVc0aR0TIAkJRxw ccgobVpod+KtAVLNDmU3OoZaRSW4JqeRTdGOHueBQKRGiCkiLDKtqhRFpAu1APu9fDLa 6g+EAujacXNR59ICcJg53+wt8/VasveJ733JEwCdlxnJuPxSsyr22UcD3jSLkvIgVDLa fcAw== 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=7VllxxWaKbCCvYuTMVtdA4UvZao4OujSBllXvGfgVT0=; b=k8cBw0b/HifJOIZymHDAaOf4oF2hnEyBhYy2JF1CWrwrWgi5QPQVGF4zHnyj61W6+J W8fCjQyWkA1fpvJVtukrQzdScHTkI+2jUCG+dS8Uw+BFdOxT+hNahvcRV2ONeEsixatE RoD4831mG3po1y3aZUuV7leCsn6RazyPOyCT7HPXOSwLpgLaB2jBGdxal57KN1XQ+89D 6p+4mOYyaSsIW67YKbZ1w535JXbfwptCpDd2x3FuZ10lH9iXjCR8Ue83IqrxlrzrfmvH kxiotDxnFPeeYEBsfVTJD5p3NfyserIAOt2eCziWtBD0nw8lw//brRpM1JRaI7W3UeUX Txhw== 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 z35si29069682qtc.481.2017.08.02.11.02.18; Wed, 02 Aug 2017 11:02:19 -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 84809609DB; Wed, 2 Aug 2017 18:02: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=-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 02964609FB; Wed, 2 Aug 2017 18:01:27 +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 C66386091C; Wed, 2 Aug 2017 18:01:13 +0000 (UTC) Received: from forward2h.cmail.yandex.net (forward2h.cmail.yandex.net [87.250.230.17]) by lists.linaro.org (Postfix) with ESMTPS id 4F49560856 for ; Wed, 2 Aug 2017 18:00:26 +0000 (UTC) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [IPv6:2a02:6b8:0:801::ac]) by forward2h.cmail.yandex.net (Yandex) with ESMTP id BD43220EA1 for ; Wed, 2 Aug 2017 21:00:24 +0300 (MSK) Received: from smtp2j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2j.mail.yandex.net (Yandex) with ESMTP id 84B7E3EC118E for ; Wed, 2 Aug 2017 21:00:19 +0300 (MSK) Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id XO7ASlov7E-0JdCsoNp; Wed, 02 Aug 2017 21:00:19 +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: Wed, 2 Aug 2017 21:00:13 +0300 Message-Id: <1501696815-12605-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501696815-12605-1-git-send-email-odpbot@yandex.ru> References: <1501696815-12605-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 103 Subject: [lng-odp] [PATCH v3 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 --- /** Email created from pull request 103 (bala-manoharan:BUG3177) ** https://github.com/Linaro/odp/pull/103 ** Patch: https://github.com/Linaro/odp/pull/103.patch ** Base sha: a2040db93b114fb9e1da9aeca1d0a1ea91699448 ** Merge commit sha: 151694be43f01415fcea482cb2f33c85993f840e **/ 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 64c6e452..b4523389 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -1234,6 +1234,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 Wed Aug 2 18: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: 109275 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp3086032qge; Wed, 2 Aug 2017 11:01:51 -0700 (PDT) X-Received: by 10.237.62.233 with SMTP id o38mr31285323qtf.116.1501696911547; Wed, 02 Aug 2017 11:01:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501696911; cv=none; d=google.com; s=arc-20160816; b=jsdjaDMWaeteMhiyXRQNzV9bDwXD5ORvuw5ucngjNOJ4hjTsm2W3N92qQrX5pek9uW +AYaixOuwOh2Qk1eutbexBONHV2nfpLyebvDMfjjy38bG1NGAm8yFNlydCHXmnksdFd3 IAfRiNjPro29zziR2G2Rmw36Ntrp0BKyMoninfFOauBFx99PfrfUzcTFPNJxqtZQ1J3A eUZUat/lLpkFBra8aOCrpyNc2E6u1IYU1dV7Y6b0STjOtQH/hiR+qSveYyPe1uDuAQga hf39mZHleXz04uF++CsxiwtNOy1siCthB/lflYqN26EhG+RXX7nI2OWS95EzF4vA6NSg 1ATQ== 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=h+HKoKZjRIM+MlDDvzbazyzuWSBJ9MEhnEcUUv1Jums=; b=WDJlToux93vJfNH9EogmlCs++79TphPkX2P6rGN8BXmieZwe+lXeNBypafU2fUKzlH xQvs10hTygUaoVmuQbpvnS+mo8xyNFd7eYtY5+fsqkBjWDFfwIVgsx+lqbkWoKpDi4if jlOZrYyE8h7/+VfYmBx0oigTNNCgpgLmW6QqCT7rlQ3UgMvMjH9dbmzZwKKgwdmoVCSE bbzBP6bWbF2PSxWfX+F90WtVmtyIghUHvrqk1A78QEwYG6ID+dZ+aZQSuxwfz3j7IKNR mFcj+j5iz4ZpLhyApGFKsQMEY0eQ5PtunlUw52nN02+BqBfxRbjKkAYbq+BURj3EplgC Fnhg== 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 19si992569qtr.317.2017.08.02.11.01.51; Wed, 02 Aug 2017 11:01:51 -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 2DCB1609A8; Wed, 2 Aug 2017 18:01:51 +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 7D2B860928; Wed, 2 Aug 2017 18:01: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 BD023609A8; Wed, 2 Aug 2017 18:01:13 +0000 (UTC) Received: from forward2h.cmail.yandex.net (forward2h.cmail.yandex.net [87.250.230.17]) by lists.linaro.org (Postfix) with ESMTPS id B6882609C9 for ; Wed, 2 Aug 2017 18:00:28 +0000 (UTC) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [95.108.130.60]) by forward2h.cmail.yandex.net (Yandex) with ESMTP id B884020EA1 for ; Wed, 2 Aug 2017 21:00:27 +0300 (MSK) Received: from smtp2j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2j.mail.yandex.net (Yandex) with ESMTP id 9696D3EC10C0 for ; Wed, 2 Aug 2017 21:00:26 +0300 (MSK) Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id XO7ASlov7E-0KdmvBpP; Wed, 02 Aug 2017 21:00:20 +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: Wed, 2 Aug 2017 21:00:14 +0300 Message-Id: <1501696815-12605-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501696815-12605-1-git-send-email-odpbot@yandex.ru> References: <1501696815-12605-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 103 Subject: [lng-odp] [PATCH v3 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 --- /** Email created from pull request 103 (bala-manoharan:BUG3177) ** https://github.com/Linaro/odp/pull/103 ** Patch: https://github.com/Linaro/odp/pull/103.patch ** Base sha: a2040db93b114fb9e1da9aeca1d0a1ea91699448 ** Merge commit sha: 151694be43f01415fcea482cb2f33c85993f840e **/ 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 cc08b9f4..08b09078 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -328,7 +328,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; } @@ -403,7 +402,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; } @@ -436,7 +434,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 Wed Aug 2 18:00:15 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: 109277 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp3087271qge; Wed, 2 Aug 2017 11:02:51 -0700 (PDT) X-Received: by 10.55.48.18 with SMTP id w18mr33908077qkw.3.1501696971384; Wed, 02 Aug 2017 11:02:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501696971; cv=none; d=google.com; s=arc-20160816; b=LDqOSIHn3eLMTo2eNRwATfgRhCECTTKciFFmhZ3mMgXuUh/0CxlarUuCpDjiYCXTKE v5CoR5u4HSOAiFI60jnBNR9387JOAqnVC+O39QoneNua8oD/FkN8768pc/9stGtmWUnd 6mKLSNrT3zOPl1e8RPfPWDnPRVWBlhUj4bUWRhUNEeXCejYcw42ttzM7k5TeabLNcQdz 0Hw8KnmwZq+6Y52QZBl5NMAgJIWuNhoNtIZKBJXpdci4ytKCvcULp3Oi55h2s3JAVfq8 +z86edYYiYL4N3+KziZxJXa2RdChAN07e8HktXOZqMMUs/bddXpXCfAs7hhk8lOukdYj lP2w== 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=IS+u3yCmxE2jD2XAsq0p2DihtKtN21d2HBdvzgZJq10=; b=stPEGlYrD0arZruexfXfBee2VH4snBmfuzXEbiFz2SO5vRClq40X9OH9FjKOACYxkk xS1DYc35AvQkSuKX6B0CT6mYCFLUXEmyZeTVG22zkBsupHdZB660x3HHekYjQdwh7Lsc 7YRgF0BlebyaW+CDdWvG88zqnJ1ElhCOZB0D6Q0uOybVDHKLZnEYk4xkC9cMduEFbv1c fJ9i0B2nu+IQS3ZtFIydFWkVf0qjOuIj40zL50yAh2yw8Hl8TaU/K6Jjkn1v3FjJsn6E Fu7Aj8oVHDlcPvJSV154cNC8KqW8LB29GpsMVuR71sAMgNIwH/cthgq+DxQa1Vr4/Pc+ yrbg== 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 n78si29212048qkl.333.2017.08.02.11.02.50; Wed, 02 Aug 2017 11:02:51 -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 CFE1760A02; Wed, 2 Aug 2017 18:02:50 +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 970DF60A03; Wed, 2 Aug 2017 18:01: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 C7CE760928; Wed, 2 Aug 2017 18:01:19 +0000 (UTC) Received: from forward3p.cmail.yandex.net (forward3p.cmail.yandex.net [77.88.31.18]) by lists.linaro.org (Postfix) with ESMTPS id D6B77609FB for ; Wed, 2 Aug 2017 18:00:36 +0000 (UTC) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [95.108.130.60]) by forward3p.cmail.yandex.net (Yandex) with ESMTP id C183F2065D for ; Wed, 2 Aug 2017 21:00:34 +0300 (MSK) Received: from smtp2j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2j.mail.yandex.net (Yandex) with ESMTP id 572FA3EC10E8 for ; Wed, 2 Aug 2017 21:00:33 +0300 (MSK) Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id XO7ASlov7E-0RduZC8R; Wed, 02 Aug 2017 21:00:27 +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: Wed, 2 Aug 2017 21:00:15 +0300 Message-Id: <1501696815-12605-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501696815-12605-1-git-send-email-odpbot@yandex.ru> References: <1501696815-12605-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 103 Subject: [lng-odp] [PATCH v3 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 --- /** Email created from pull request 103 (bala-manoharan:BUG3177) ** https://github.com/Linaro/odp/pull/103 ** Patch: https://github.com/Linaro/odp/pull/103.patch ** Base sha: a2040db93b114fb9e1da9aeca1d0a1ea91699448 ** Merge commit sha: 151694be43f01415fcea482cb2f33c85993f840e **/ .../validation/api/classification/classification.h | 1 + .../api/classification/odp_classification_basic.c | 4 +- .../api/classification/odp_classification_common.c | 5 +- .../classification/odp_classification_test_pmr.c | 131 ++++++++++++++++++--- .../api/classification/odp_classification_tests.c | 2 + .../classification/odp_classification_testsuites.h | 3 +- 6 files changed, 126 insertions(+), 20 deletions(-) diff --git a/test/common_plat/validation/api/classification/classification.h b/test/common_plat/validation/api/classification/classification.h index 53c527f3..326177ad 100644 --- a/test/common_plat/validation/api/classification/classification.h +++ b/test/common_plat/validation/api/classification/classification.h @@ -102,6 +102,7 @@ void classification_test_pmr_term_vlan_id_0(void); void classification_test_pmr_term_vlan_id_x(void); void classification_test_pmr_term_eth_type_0(void); void classification_test_pmr_term_eth_type_x(void); +void classification_test_pktin_classifier_flag(void); /* test arrays: */ extern odp_testinfo_t classification_suite_basic[]; diff --git a/test/common_plat/validation/api/classification/odp_classification_basic.c b/test/common_plat/validation/api/classification/odp_classification_basic.c index 9817287e..3f4a82ed 100644 --- a/test/common_plat/validation/api/classification/odp_classification_basic.c +++ b/test/common_plat/validation/api/classification/odp_classification_basic.c @@ -87,7 +87,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, @@ -271,7 +271,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/common_plat/validation/api/classification/odp_classification_common.c b/test/common_plat/validation/api/classification/odp_classification_common.c index eca30b87..de8a9327 100644 --- a/test/common_plat/validation/api/classification/odp_classification_common.c +++ b/test/common_plat/validation/api/classification/odp_classification_common.c @@ -24,7 +24,8 @@ static uint8_t IPV6_DST_ADDR[ODPH_IPV6ADDR_LEN] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 10, 0, 0, 100 }; -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; @@ -50,6 +51,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/common_plat/validation/api/classification/odp_classification_test_pmr.c b/test/common_plat/validation/api/classification/odp_classification_test_pmr.c index d9524205..e6b496a1 100644 --- a/test/common_plat/validation/api/classification/odp_classification_test_pmr.c +++ b/test/common_plat/validation/api/classification/odp_classification_test_pmr.c @@ -86,6 +86,104 @@ 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(default_pkt_info); + 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_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 +211,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 +325,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); @@ -340,7 +438,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); @@ -456,7 +554,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); @@ -570,7 +668,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); @@ -679,7 +777,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); @@ -786,7 +884,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); @@ -898,7 +996,7 @@ void classification_test_pmr_term_vlan_id_0(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); @@ -1011,7 +1109,7 @@ void classification_test_pmr_term_vlan_id_x(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); @@ -1124,7 +1222,7 @@ void classification_test_pmr_term_eth_type_0(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); @@ -1234,7 +1332,7 @@ void classification_test_pmr_term_eth_type_x(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); @@ -1347,7 +1445,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); @@ -1446,7 +1544,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); @@ -1539,7 +1637,7 @@ 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); retval = start_pktio(pktio); CU_ASSERT(retval == 0); @@ -1650,7 +1748,7 @@ static void classification_test_pmr_term_ipv6daddr(void) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool); + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); retval = start_pktio(pktio); CU_ASSERT(retval == 0); @@ -1760,7 +1858,7 @@ static void classification_test_pmr_term_ipv6saddr(void) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool); + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); retval = start_pktio(pktio); CU_ASSERT(retval == 0); @@ -1860,5 +1958,6 @@ odp_testinfo_t classification_suite_pmr[] = { ODP_TEST_INFO(classification_test_pmr_term_vlan_id_x), ODP_TEST_INFO(classification_test_pmr_term_eth_type_0), ODP_TEST_INFO(classification_test_pmr_term_eth_type_x), + ODP_TEST_INFO(classification_test_pktin_classifier_flag), ODP_TEST_INFO_NULL, }; diff --git a/test/common_plat/validation/api/classification/odp_classification_tests.c b/test/common_plat/validation/api/classification/odp_classification_tests.c index 4f430826..a0f73e39 100644 --- a/test/common_plat/validation/api/classification/odp_classification_tests.c +++ b/test/common_plat/validation/api/classification/odp_classification_tests.c @@ -52,6 +52,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/common_plat/validation/api/classification/odp_classification_testsuites.h b/test/common_plat/validation/api/classification/odp_classification_testsuites.h index d296923a..e1624162 100644 --- a/test/common_plat/validation/api/classification/odp_classification_testsuites.h +++ b/test/common_plat/validation/api/classification/odp_classification_testsuites.h @@ -35,7 +35,8 @@ int classification_suite_pmr_init(void); odp_packet_t create_packet(cls_packet_info_t pkt_info); 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);