From patchwork Fri Jan 23 16:44:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 43680 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0BEF7240D9 for ; Fri, 23 Jan 2015 16:45:11 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id x12sf4813411wgg.0 for ; Fri, 23 Jan 2015 08:45:10 -0800 (PST) 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=4BPmPukO3nwFSrxpfjAW4GfnruvAwWCB8GZlsQPfqd4=; b=VanN2qMPTjbvt7BRevles5SQUkVaBwjILVmJloKxZlr5mK8bG0AARkqCp5z2xKoxnG VJG3Yd0tZh+/tHH3uqukJ9OBUy0jFgzsLPUFwGViFUoXJSqefR4YzNWX4opEzsiFCftn 8cSPP5d42IMIU5hSnL9CqyP7piylxbck26BMOjh1epDSjir5ljCg3TCIbrArVkZsJTC+ uUzmr3SeEJg9Hn93i4T1hr79sa9z+J65P1Vfckd4t7grMfBCYCVMqkP+97dV5ldEWYoN S+Xrm00wIMNSJfeza7sC6HvOiJmcjUwiykvbhdYaf647nYqTjjXf36eaDejhM/2125Mc 8jFQ== X-Gm-Message-State: ALoCoQml/u7UyDjyB8YBRio2/ZTTvgd9EpRDOfwB4x9uhmA55Ksljk3sIPem+ppVgz+ve6Nu6re3 X-Received: by 10.152.121.65 with SMTP id li1mr1141226lab.0.1422031510285; Fri, 23 Jan 2015 08:45:10 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.245.43 with SMTP id xl11ls329954lac.54.gmail; Fri, 23 Jan 2015 08:45:10 -0800 (PST) X-Received: by 10.152.30.6 with SMTP id o6mr8521033lah.64.1422031510142; Fri, 23 Jan 2015 08:45:10 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id l9si1861391lah.3.2015.01.23.08.45.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 08:45:10 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id p9so3693504lbv.4 for ; Fri, 23 Jan 2015 08:45:10 -0800 (PST) X-Received: by 10.112.52.229 with SMTP id w5mr8395891lbo.52.1422031509920; Fri, 23 Jan 2015 08:45:09 -0800 (PST) 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.9.200 with SMTP id c8csp315561lbb; Fri, 23 Jan 2015 08:45:09 -0800 (PST) X-Received: by 10.224.7.197 with SMTP id e5mr1218938qae.64.1422031508534; Fri, 23 Jan 2015 08:45:08 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id u31si2514890qge.104.2015.01.23.08.45.06 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 23 Jan 2015 08:45:08 -0800 (PST) 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 1YEhM0-0001gm-9Y; Fri, 23 Jan 2015 16:45:04 +0000 Received: from mail-pa0-f45.google.com ([209.85.220.45]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YEhLr-0001fk-Jm for lng-odp@lists.linaro.org; Fri, 23 Jan 2015 16:44:55 +0000 Received: by mail-pa0-f45.google.com with SMTP id et14so5025396pad.4 for ; Fri, 23 Jan 2015 08:44:50 -0800 (PST) X-Received: by 10.68.69.97 with SMTP id d1mr12706006pbu.126.1422031490146; Fri, 23 Jan 2015 08:44:50 -0800 (PST) Received: from localhost.localdomain ([59.90.234.135]) by mx.google.com with ESMTPSA id fm4sm2374835pdb.88.2015.01.23.08.44.48 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Jan 2015 08:44:49 -0800 (PST) From: bala.manoharan@linaro.org To: lng-odp@lists.linaro.org Date: Fri, 23 Jan 2015 22:14:30 +0530 Message-Id: <1422031471-30427-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 2.0.1.472.g6f92e5f X-Topics: Classification patch Subject: [lng-odp] [PATCH v2 1/2] linux-generic: classification: Fix incorrect L2 qos calculation 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.173 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 Fixes the error in vlan qos calculation due to missing convertion of odp_be_to_cpu_16() Signed-off-by: Balasubramanian Manoharan Reviewed-by: Bill Fischofer Reviewed-by: Anders Roxell --- v2: Incorporates review comments from Anders platform/linux-generic/odp_classification.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 7d09cce..0f58836 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -881,16 +881,17 @@ cos_t *match_qos_l3_cos(pmr_l3_cos_t *l3_cos, uint8_t *pkt_addr, cos_t *match_qos_l2_cos(pmr_l2_cos_t *l2_cos, uint8_t *pkt_addr, odp_packet_hdr_t *hdr) { - uint8_t qos; cos_t *cos = NULL; odph_ethhdr_t *eth; odph_vlanhdr_t *vlan; + uint16_t qos; if (hdr->input_flags.l2 && hdr->input_flags.vlan && hdr->input_flags.eth) { eth = (odph_ethhdr_t *)(pkt_addr + hdr->l2_offset); vlan = (odph_vlanhdr_t *)(ð->type); - qos = ((vlan->tci >> 13) & 0xFF); + qos = odp_be_to_cpu_16(vlan->tci); + qos = ((qos >> 13) & 0x07); cos = l2_cos->cos[qos]; } return cos;