From patchwork Wed Jan 21 06:25:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 43439 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6EC972034D for ; Wed, 21 Jan 2015 06:25:41 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id b57sf7499641eek.0 for ; Tue, 20 Jan 2015 22:25:40 -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=4GI4qExxCHkP49NhSDQrUiHeZNcta3ZDIhD+bAgREQk=; b=RRQPhaFy5iJleXi1k2CMnQYssg9GV4ozq/3nDZMpszP5xpefp00n9nZZgPzbmikNuV r6Y1iYaBFDXD+zTxpUl/Ledmgil80dHtXUr/9H7zls0+/9LsDLZ9H6Ljp1pTXRZr4JjF y+bN2c8syToOxYKe8vTeU/p+Psy1r7J6v7BMtBDysPtviFRgfjXTGr/nA68gOwmxcDTu CpA/PReU2xT+3V9MsHgpg8qIhIFo9Kc0hGOzQaNQ0emUEApmXVUMpQS5xB68WL/4ZKvM EPGJ05LbGkunommr6XIE0NOGdqUpAZVfYJu5GHdJ8SuozXhPUWj3+jKzB23l0OwixZlT nLRg== X-Gm-Message-State: ALoCoQkIeeuRZ3HEF+RRN5kwKzIa9DusmhrAIEN7GEGm7lrrtgJrZ8TvU81np9A2ds4qtPvlCKUW X-Received: by 10.180.94.134 with SMTP id dc6mr1190778wib.2.1421821540345; Tue, 20 Jan 2015 22:25:40 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.180 with SMTP id k20ls191064laa.18.gmail; Tue, 20 Jan 2015 22:25:39 -0800 (PST) X-Received: by 10.152.36.37 with SMTP id n5mr41490289laj.27.1421821539926; Tue, 20 Jan 2015 22:25:39 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id lu3si18526764lac.6.2015.01.20.22.25.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 Jan 2015 22:25:39 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gd6so14723928lab.4 for ; Tue, 20 Jan 2015 22:25:39 -0800 (PST) X-Received: by 10.152.6.132 with SMTP id b4mr42983236laa.59.1421821539764; Tue, 20 Jan 2015 22:25:39 -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 c8csp1668838lbb; Tue, 20 Jan 2015 22:25:39 -0800 (PST) X-Received: by 10.229.172.196 with SMTP id m4mr19130078qcz.19.1421821538464; Tue, 20 Jan 2015 22:25:38 -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 y4si3468910qch.0.2015.01.20.22.25.37 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 20 Jan 2015 22:25:38 -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 1YDojP-0000JI-Nj; Wed, 21 Jan 2015 06:25:35 +0000 Received: from mail-pd0-f171.google.com ([209.85.192.171]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YDojK-0000J5-Hv for lng-odp@lists.linaro.org; Wed, 21 Jan 2015 06:25:30 +0000 Received: by mail-pd0-f171.google.com with SMTP id fp1so26448821pdb.2 for ; Tue, 20 Jan 2015 22:25:25 -0800 (PST) X-Received: by 10.66.233.74 with SMTP id tu10mr1171815pac.135.1421821525076; Tue, 20 Jan 2015 22:25:25 -0800 (PST) Received: from localhost.localdomain ([14.140.2.178]) by mx.google.com with ESMTPSA id in1sm4778814pbc.19.2015.01.20.22.25.23 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 Jan 2015 22:25:24 -0800 (PST) From: bala.manoharan@linaro.org To: lng-odp@lists.linaro.org Date: Wed, 21 Jan 2015 11:55:02 +0530 Message-Id: <1421821503-22936-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 2.0.1.472.g6f92e5f X-Topics: patch Subject: [lng-odp] [PATCH v1 1/2] linux-generic: 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.215.45 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 --- platform/linux-generic/odp_classification.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 7d09cce..f6d482d 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -881,7 +881,6 @@ 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; @@ -890,7 +889,8 @@ cos_t *match_qos_l2_cos(pmr_l2_cos_t *l2_cos, uint8_t *pkt_addr, hdr->input_flags.eth) { eth = (odph_ethhdr_t *)(pkt_addr + hdr->l2_offset); vlan = (odph_vlanhdr_t *)(ð->type); - qos = ((vlan->tci >> 13) & 0xFF); + uint16_t qos = odp_be_to_cpu_16(vlan->tci); + qos = ((qos >> 13) & 0x07); cos = l2_cos->cos[qos]; } return cos;