From patchwork Fri Mar 20 06:31:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 46130 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EE5532153C for ; Fri, 20 Mar 2015 06:32:28 +0000 (UTC) Received: by wghb13 with SMTP id b13sf7136500wgh.3 for ; Thu, 19 Mar 2015 23:32:28 -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=LTJSY/5Nnw8a8cSrXRG+OLGRodtk0Jls0hLgS7ZnWHI=; b=R2aZf9gL4Y7INg4rN9pK9gCkNGF147yybvp6kxAU/2ZOIEz5wIb/x01aiBElSVciOp RiHXGbgqIx+wfYbA0OTjnlS99NwblRYa1rvZID3I3T+gWoS2ftjEhgl4KHN7FX5Yewex NWzhSX2EKv7q0bnStCC0zOxmG0C5Z9FICWGesZE60c/vBtPOOixuuy7VeN7eEKbIdNCu bzbpbVvbbMgGCqyz0OmgeL2YCFqpR7Hl3LK68H8OuEIEYVIhhsetmPf2EsW17RjaEIdJ mpvj7SvLpcrJIRZZ/0k9urXPfFgeJD+qO3Ca7RsyaQDZwhC1ACvHkIG/6dYxM9vhVNAr Ap2g== X-Gm-Message-State: ALoCoQlMigLrJZ/pQQ5Bfr14f4wip2YXzTvW3g9vnw1YKDQgtTv628PBopGFc8tGPHcCUzxPTbck X-Received: by 10.180.90.175 with SMTP id bx15mr2416455wib.3.1426833148298; Thu, 19 Mar 2015 23:32:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.25.193 with SMTP id e1ls394940lag.80.gmail; Thu, 19 Mar 2015 23:32:28 -0700 (PDT) X-Received: by 10.112.137.164 with SMTP id qj4mr59775879lbb.17.1426833147999; Thu, 19 Mar 2015 23:32:27 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id n1si2516552lae.91.2015.03.19.23.32.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 23:32:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by labe2 with SMTP id e2so4361644lab.3 for ; Thu, 19 Mar 2015 23:32:27 -0700 (PDT) X-Received: by 10.112.55.103 with SMTP id r7mr88780lbp.29.1426833147574; Thu, 19 Mar 2015 23:32:27 -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.35.133 with SMTP id h5csp834273lbj; Thu, 19 Mar 2015 23:32:27 -0700 (PDT) X-Received: by 10.140.148.216 with SMTP id 207mr103915958qhu.62.1426833146396; Thu, 19 Mar 2015 23:32:26 -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 a36si3547479qgf.104.2015.03.19.23.32.24 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Mar 2015 23:32:26 -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 1YYqTm-0000aM-Kj; Fri, 20 Mar 2015 06:32:22 +0000 Received: from mail-oi0-f45.google.com ([209.85.218.45]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YYqTg-0000Z7-Ej for lng-odp@lists.linaro.org; Fri, 20 Mar 2015 06:32:16 +0000 Received: by oier21 with SMTP id r21so84057794oie.1 for ; Thu, 19 Mar 2015 23:32:11 -0700 (PDT) X-Received: by 10.60.45.165 with SMTP id o5mr22912938oem.44.1426833131102; Thu, 19 Mar 2015 23:32:11 -0700 (PDT) Received: from localhost.localdomain ([111.93.218.67]) by mx.google.com with ESMTPSA id xo12sm2093242oeb.10.2015.03.19.23.32.09 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Mar 2015 23:32:10 -0700 (PDT) From: bala.manoharan@linaro.org To: lng-odp@lists.linaro.org Date: Fri, 20 Mar 2015 12:01:56 +0530 Message-Id: <1426833116-26580-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 2.0.1.472.g6f92e5f X-Topics: patch Subject: [lng-odp] [PATCHv1] 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.215.52 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 --- platform/linux-generic/odp_classification.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 9fb034f..b7a4fe6 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,7 @@ 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)