From patchwork Thu Mar 26 13:30:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 46366 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4109B21584 for ; Thu, 26 Mar 2015 13:31:05 +0000 (UTC) Received: by labss8 with SMTP id ss8sf5691506lab.2 for ; Thu, 26 Mar 2015 06:31:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=hIMJNjElyRzdxNNcKDwd9rS8qg0rnJFTjyloXultT/s=; b=JKGNW0voma3DNuGa62wEIPPPQ58HO1HGRYKzrseec1Gmhoh+i4fEwqokifKSV5RoyT BKJdvM/LfwONpToG5VdvWKc1PtM5YcfhStDMNQ0stwGuJ8xkn5lFLGEBiYpNP0V2/KPy ch/PdPGshRQmDxDDx9JgRhsN5zCGyzX8TZ/CHL09gqhpgKnyvaPnF3j9LCjjqoshxwxU W9JhoxqHAK0xXDxQlPC5dbSr3OfbnXLHKCKyDZ1/+2fObTSF5qRfpF2BKzIHx9LehIJe xVB843hdL7EeZBMnv87kF5AHwJxcVHgU/1BYE7Tt9vCDmcWuWuPXuc05XTsRQj+4sbGr TEsg== X-Gm-Message-State: ALoCoQkmBaJOAwCaXQwHgrcs8DG/hVEAw6R3QppgnsNm2Gw3fbGYkk5uP9qS1rGODI110IZ30Hco X-Received: by 10.194.53.225 with SMTP id e1mr3378662wjp.4.1427376664229; Thu, 26 Mar 2015 06:31:04 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.26.201 with SMTP id n9ls246415lag.41.gmail; Thu, 26 Mar 2015 06:31:04 -0700 (PDT) X-Received: by 10.112.163.229 with SMTP id yl5mr13248413lbb.60.1427376663991; Thu, 26 Mar 2015 06:31:03 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id v6si4598685lby.61.2015.03.26.06.31.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2015 06:31:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbbsy1 with SMTP id sy1so40838226lbb.1 for ; Thu, 26 Mar 2015 06:31:03 -0700 (PDT) X-Received: by 10.152.120.134 with SMTP id lc6mr13153668lab.72.1427376663855; Thu, 26 Mar 2015 06:31:03 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp605414lbq; Thu, 26 Mar 2015 06:31:03 -0700 (PDT) X-Received: by 10.52.69.205 with SMTP id g13mr16741100vdu.83.1427376662267; Thu, 26 Mar 2015 06:31:02 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id jk1si7181160vdb.16.2015.03.26.06.31.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 26 Mar 2015 06:31:02 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Yb7sA-0007lU-9S; Thu, 26 Mar 2015 13:30:58 +0000 Received: from mail-pa0-f46.google.com ([209.85.220.46]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Yb7s4-0007lP-1p for lng-odp@lists.linaro.org; Thu, 26 Mar 2015 13:30:52 +0000 Received: by pacwz10 with SMTP id wz10so12078119pac.2 for ; Thu, 26 Mar 2015 06:30:46 -0700 (PDT) X-Received: by 10.68.215.9 with SMTP id oe9mr3891684pbc.146.1427376646584; Thu, 26 Mar 2015 06:30:46 -0700 (PDT) Received: from localhost.localdomain ([59.90.234.135]) by mx.google.com with ESMTPSA id g11sm5678266pat.24.2015.03.26.06.30.44 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Mar 2015 06:30:45 -0700 (PDT) From: bala.manoharan@linaro.org To: lng-odp@lists.linaro.org Date: Thu, 26 Mar 2015 19:00:31 +0530 Message-Id: <1427376631-9906-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 2.0.1.472.g6f92e5f X-Topics: patch Subject: [lng-odp] [PATCHv2] fix: incorrect pmr_term_value update in odp_pmr_create_xxx() function X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bala.manoharan@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Balasubramanian Manoharan Fix for incorrect pmr_term_value update in odp_pmr_create_match() and odp_pmr_create_range() functions. Fixes https://bugs.linaro.org/show_bug.cgi?id=1381 Signed-off-by: Balasubramanian Manoharan --- v2: Fixes checkpatch issue pointed by Bill platform/linux-generic/odp_classification.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 9fb034f..609faa9 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -438,6 +438,7 @@ odp_pmr_t odp_pmr_create_match(odp_pmr_term_e term, pmr->s.pmr_term_value[0].mask.mask = 0; memcpy(&pmr->s.pmr_term_value[0].mask.val, val, val_sz); memcpy(&pmr->s.pmr_term_value[0].mask.mask, mask, val_sz); + pmr->s.pmr_term_value[0].mask.val &= pmr->s.pmr_term_value[0].mask.mask; UNLOCK(&pmr->s.lock); return id; } @@ -460,7 +461,7 @@ odp_pmr_t odp_pmr_create_range(odp_pmr_term_e term, return ODP_PMR_INVAL; pmr->s.num_pmr = 1; - pmr->s.pmr_term_value[0].match_type = ODP_PMR_MASK; + pmr->s.pmr_term_value[0].match_type = ODP_PMR_RANGE; pmr->s.pmr_term_value[0].term = term; pmr->s.pmr_term_value[0].range.val1 = 0; pmr->s.pmr_term_value[0].range.val2 = 0; @@ -601,6 +602,8 @@ int odp_pmr_match_set_create(int num_terms, odp_pmr_match_t *terms, terms[i].mask.val, val_sz); memcpy(&pmr->s.pmr_term_value[i].mask.mask, terms[i].mask.mask, val_sz); + pmr->s.pmr_term_value[i].mask.val &= pmr->s + .pmr_term_value[i].mask.mask; } else { val_sz = terms[i].range.val_sz; if (val_sz > ODP_PMR_TERM_BYTES_MAX)