From patchwork Thu Apr 21 06:19:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 66307 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2860363qge; Wed, 20 Apr 2016 23:21:06 -0700 (PDT) X-Received: by 10.55.71.143 with SMTP id u137mr17519536qka.1.1461219666050; Wed, 20 Apr 2016 23:21:06 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 63si629640qha.99.2016.04.20.23.21.05; Wed, 20 Apr 2016 23:21:06 -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=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id B586868A5C; Thu, 21 Apr 2016 06:21:05 +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=-0.5 required=5.0 tests=BAYES_00, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_WEB,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 A091268A6D; Thu, 21 Apr 2016 06:20:14 +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 7196B68572; Thu, 21 Apr 2016 06:20:05 +0000 (UTC) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by lists.linaro.org (Postfix) with ESMTPS id 1A8E5673EF for ; Thu, 21 Apr 2016 06:19:33 +0000 (UTC) Received: by mail-pa0-f50.google.com with SMTP id er2so25750842pad.3 for ; Wed, 20 Apr 2016 23:19:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6zpxN0hOAAxy71YxTbPE8HvrP2Yk5K9NqzOo0O8QuvY=; b=UoTz5cPSvsgF1yyQ+ZqZ91tp9qubnpBvtOQcMGEYLzDT8WR6KEBtxNvYD/CYU61fgK FMOvNyDYBWyKtHf4Htv9cLrgjWe6okxdwyyIDrdTZ7d4KTd93kKKZCVhH/1jNXmaDkm7 KDZVJa8JzIcaJwCmpRyVfOU7NIKoIZVXjZGuGZ1+cdTLZoPbiiRiUD4qG0GBdDDqv8S9 ucu2sYlDuCX1xXXhPATnyv4bGeX/XDmwJPM9bCB45YNiV1SpPCURKpSBHunCir2hlIqb f57tBTrzWipNEif+2/23DnE+BLCYo0LDudY17e0F1ysEcvgQaB/D6MwoYIxV/uDOt9TW 01Xg== X-Gm-Message-State: AOPr4FUpmzNLmgqdqb5uXfKodwLGai1fwAcwVuRUPlJw2624g224LCdAlaMo5fh+1mTKA1g+m5I= X-Received: by 10.66.48.164 with SMTP id m4mr18250664pan.57.1461219572375; Wed, 20 Apr 2016 23:19:32 -0700 (PDT) Received: from localhost.localdomain ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id v189sm1722577pfb.85.2016.04.20.23.19.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Apr 2016 23:19:31 -0700 (PDT) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Thu, 21 Apr 2016 11:49:05 +0530 Message-Id: <1461219545-14545-4-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461219545-14545-1-git-send-email-bala.manoharan@linaro.org> References: <1461219545-14545-1-git-send-email-bala.manoharan@linaro.org> Cc: petri.savolainen@nokia.com Subject: [lng-odp] [API-NEXT 4/4] example: classifier: incorporates capability and PMR range 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Modifies the classifier example to support classification capability and PMR range funcionality. Signed-off-by: Balasubramanian Manoharan --- example/classifier/odp_classifier.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index 612ce22..a50a5c1 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -393,6 +393,7 @@ static void configure_cos(odp_cos_t default_cos, appl_args_t *args) char pool_name[ODP_POOL_NAME_LEN]; odp_pool_param_t pool_params; odp_cls_cos_param_t cls_param; + odp_pmr_param_t pmr_param; int i; global_statistics *stats; odp_queue_param_t qparam; @@ -438,15 +439,14 @@ static void configure_cos(odp_cos_t default_cos, appl_args_t *args) cls_param.drop_policy = ODP_COS_DROP_POOL; stats->cos = odp_cls_cos_create(cos_name, &cls_param); - const odp_pmr_match_t match = { - .term = stats->rule.term, - .val = &stats->rule.val, - .mask = &stats->rule.mask, - .val_sz = stats->rule.val_sz, - .offset = stats->rule.offset - }; + odp_cls_pmr_param_init(&pmr_param); + pmr_param.term = stats->rule.term; + pmr_param.match.value = &stats->rule.val; + pmr_param.match.mask = &stats->rule.mask; + pmr_param.val_sz = stats->rule.val_sz; + pmr_param.offset = stats->rule.offset; - stats->pmr = odp_cls_pmr_create(&match, 1, default_cos, + stats->pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, stats->cos); if (stats->pmr == ODP_PMR_INVAL) { EXAMPLE_ERR("odp_pktio_pmr_cos failed");