From patchwork Tue Oct 3 11:47:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Amrani, Ram" X-Patchwork-Id: 9982303 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 572606029B for ; Tue, 3 Oct 2017 11:48:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49D9F288C4 for ; Tue, 3 Oct 2017 11:48:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E745288D7; Tue, 3 Oct 2017 11:48:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B83AA288C4 for ; Tue, 3 Oct 2017 11:48:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751820AbdJCLst (ORCPT ); Tue, 3 Oct 2017 07:48:49 -0400 Received: from mail-by2nam01on0068.outbound.protection.outlook.com ([104.47.34.68]:27920 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751104AbdJCLsp (ORCPT ); Tue, 3 Oct 2017 07:48:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=RkTzoX8cT43xyKn0fzkw0jP8WVdcTV0DhFPQe1xAFfQ=; b=QBHmpY+l8SHsestYLcuzssCt/jDxaXpaya09uxCXQQGTM4dSgIRduI2aqLFPLq2PbzKQXN3qO3M82ZLOKzC7PctQonDsMF2juKaJReOtB84PNasHZ7Vf48dRbtkNcl+1pROrC0nRLv1gpW794OHQ8Ivnw5lXl7bdDGr6ZwY7/dg= Received: from CY1PR07CA0009.namprd07.prod.outlook.com (10.166.202.19) by BN4PR07MB2258.namprd07.prod.outlook.com (10.164.63.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 3 Oct 2017 11:48:44 +0000 Received: from BN1AFFO11OLC003.protection.gbl (2a01:111:f400:7c10::191) by CY1PR07CA0009.outlook.office365.com (2a01:111:e400:c60a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.9 via Frontend Transport; Tue, 3 Oct 2017 11:48:43 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1AFFO11OLC003.mail.protection.outlook.com (10.58.53.74) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.77.10 via Frontend Transport; Tue, 3 Oct 2017 11:48:43 +0000 Received: from lb-tlvb-ramrani.il.qlogic.org (10.185.6.119) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 3 Oct 2017 04:48:40 -0700 From: Ram Amrani To: CC: , , Ram Amrani , Michal Kalderon Subject: [PATCH for-rc 1/2] RDMA/qedr: Parse VLAN ID correctly and ignore the value of zero Date: Tue, 3 Oct 2017 14:47:26 +0300 Message-ID: <1507031247-7972-2-git-send-email-Ram.Amrani@cavium.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1507031247-7972-1-git-send-email-Ram.Amrani@cavium.com> References: <1507031247-7972-1-git-send-email-Ram.Amrani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(2980300002)(428002)(199003)(189002)(76176999)(2906002)(101416001)(189998001)(72206003)(54906003)(478600001)(6666003)(50466002)(36756003)(48376002)(6916009)(16586007)(50986999)(47776003)(2950100002)(5003940100001)(316002)(4326008)(69596002)(8936002)(107886003)(8676002)(106466001)(77096006)(81166006)(81156014)(356003)(86362001)(2351001)(105586002)(104016004)(305945005)(5660300001)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR07MB2258; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11OLC003; 1:TmAD/7BH/KmO1+h6rnPDZRu6Mwz8IRStFRzI7HIAi5F++mEwSiEYFyAkp2TONaA7aKzZkI8Qaf+Hdhzm167xQDLQanxCPzmsIfYgYa1r7x6V0Q7PJYc6yAkLjGZmmJM1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e2121fdc-4a96-42fb-894b-08d50a54b2c7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN4PR07MB2258; X-Microsoft-Exchange-Diagnostics: 1; BN4PR07MB2258; 3:KfX9o+bq/82Pa9LJmUcxkoOIoQOZ/nhMWWipxvyPxSQbX/xRf8FYiWCJM9tDkYB4zSWuOxoZFyXkS3xBEaEwxu8qN7TVGEfXhJIEpndNeSdx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amn6yPy5ORgwqz3uTIGh8hi2+2ne3nPRe4kc8AMLZUbwKzHdDNuVGsQhxt7I/Yj2ulk9sB11c/085EPRARBEXVojVhyRzNGXkOfyQa0+5oKBIvYHIM0kWs+npHytixb+BE3p7OuCyb+BE5fthiZpVFuu5kKs7q8u35eYejLh8a5LR6o6+q9mcMpCrtiJlGKuJey147B7OyMSilFNnnD0o3Jvl3E29A3e2zu95fE+AgnF01BgNxG6QdHRMB2uhL7JKVO3s/HM3oL8qzaTZ8xr+60VbfKxF+ddoZRYal0EenZYTEOihQ5IpZgJho3BxlM5kyLGFH/phfosSzRVp X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6041248)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN4PR07MB2258; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN4PR07MB2258; X-Microsoft-Exchange-Diagnostics: 1; BN4PR07MB2258; 4:8zPUI8UecSyGx5vXcvuspEKjG3ZPwFz7H1g/GlcobDXysNu6Q3qlBXCFoQC0+HBKbOyAkg+Svjndvc/EJetzpaznuXbSpuiADUPbfpHoBHDXaJHuH/GVsPOQA26C/GGLY1J01jnxzx9I0lcu/hYBPrqwkZG32v6OJAVnpam1TDa5F3TdTEFxRYwGZh5MNWOekKHgu3MjSLuyIpR5EmgFsH4kcBlGgf47/S/AtHC0ccCE+41TUcaX7HS0JeMcAWiF X-Forefront-PRVS: 044968D9E1 X-Microsoft-Exchange-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tFocXY+3PtGXI1LP6njVr+I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2017 11:48:43.2313 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR07MB2258 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Rename vlan_id field name to vlan as it contains more than the vlan_id. Mask out non vlan id fields from vlan tag of the QED LL2 RX GSI vlan output. As it is expected to be vlan id only. Ignore vlan_id with value of zero. Fixes: abd49676c707 ("qed: Add RoCE ll2 & GSI support") Signed-off-by: Ram Amrani Signed-off-by: Michal Kalderon --- drivers/infiniband/hw/qedr/qedr.h | 2 +- drivers/infiniband/hw/qedr/qedr_cm.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/qedr/qedr.h b/drivers/infiniband/hw/qedr/qedr.h index b2bb42e..254083b 100644 --- a/drivers/infiniband/hw/qedr/qedr.h +++ b/drivers/infiniband/hw/qedr/qedr.h @@ -387,7 +387,7 @@ struct qedr_qp { u8 wqe_size; u8 smac[ETH_ALEN]; - u16 vlan_id; + u16 vlan; int rc; } *rqe_wr_id; diff --git a/drivers/infiniband/hw/qedr/qedr_cm.c b/drivers/infiniband/hw/qedr/qedr_cm.c index 4689e80..5ebbe49 100644 --- a/drivers/infiniband/hw/qedr/qedr_cm.c +++ b/drivers/infiniband/hw/qedr/qedr_cm.c @@ -105,7 +105,7 @@ void qedr_ll2_complete_rx_packet(void *cxt, qp->rqe_wr_id[qp->rq.gsi_cons].rc = data->u.data_length_error ? -EINVAL : 0; - qp->rqe_wr_id[qp->rq.gsi_cons].vlan_id = data->vlan; + qp->rqe_wr_id[qp->rq.gsi_cons].vlan = data->vlan; /* note: length stands for data length i.e. GRH is excluded */ qp->rqe_wr_id[qp->rq.gsi_cons].sg_list[0].length = data->length.data_length; @@ -694,6 +694,7 @@ int qedr_gsi_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) struct qedr_cq *cq = get_qedr_cq(ibcq); struct qedr_qp *qp = dev->gsi_qp; unsigned long flags; + u16 vlan_id; int i = 0; spin_lock_irqsave(&cq->cq_lock, flags); @@ -712,9 +713,12 @@ int qedr_gsi_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) wc[i].wc_flags |= IB_WC_GRH | IB_WC_IP_CSUM_OK; ether_addr_copy(wc[i].smac, qp->rqe_wr_id[qp->rq.cons].smac); wc[i].wc_flags |= IB_WC_WITH_SMAC; - if (qp->rqe_wr_id[qp->rq.cons].vlan_id) { + + vlan_id = qp->rqe_wr_id[qp->rq.cons].vlan & + VLAN_VID_MASK; + if (vlan_id) { wc[i].wc_flags |= IB_WC_WITH_VLAN; - wc[i].vlan_id = qp->rqe_wr_id[qp->rq.cons].vlan_id; + wc[i].vlan_id = vlan_id; } qedr_inc_sw_cons(&qp->rq);