From patchwork Thu Dec 24 18:14:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 7919801 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 61067BEEE5 for ; Thu, 24 Dec 2015 18:31:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BCF1420483 for ; Thu, 24 Dec 2015 18:31:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6FDF22046F for ; Thu, 24 Dec 2015 18:31:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755482AbbLXSbh (ORCPT ); Thu, 24 Dec 2015 13:31:37 -0500 Received: from cmrelayp1.emulex.com ([138.239.112.140]:50940 "EHLO CMRELAYP1.ad.emulex.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1755477AbbLXSbg (ORCPT ); Thu, 24 Dec 2015 13:31:36 -0500 X-Greylist: delayed 1021 seconds by postgrey-1.27 at vger.kernel.org; Thu, 24 Dec 2015 13:31:36 EST Received: from neo01-el71.iig.avagotech.net ([10.192.205.132]) by CMRELAYP1.ad.emulex.com with Microsoft SMTPSVC(7.5.7601.17514); Thu, 24 Dec 2015 10:14:43 -0800 From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: dledford@redhat.com, Devesh Sharma , Matan Barak Subject: [PATCH 1/4] RDMA/ocrdma: Fix vlan-id assignment in qp parameters Date: Thu, 24 Dec 2015 13:14:05 -0500 Message-Id: <1450980848-18945-2-git-send-email-devesh.sharma@avagotech.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1450980848-18945-1-git-send-email-devesh.sharma@avagotech.com> References: <1450980848-18945-1-git-send-email-devesh.sharma@avagotech.com> X-OriginalArrivalTime: 24 Dec 2015 18:14:43.0677 (UTC) FILETIME=[F6B7F8D0:01D13E76] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP vlan-id is wrongly getting as 0 when PFC is enabled. Set vlan-id configured by user in QP parameters. In case vlan interface is not used, flash a warning to user to configure vlan and assign vlan-id as 0 in qp params. Fixes: dbf727de7440 ('IB/core: Use GID table in AH creation and dmac resolution') Cc: Matan Barak Signed-off-by: Devesh Sharma --- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c index 30f67be..4fc2bb4 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c @@ -2515,9 +2515,10 @@ static int ocrdma_set_av_params(struct ocrdma_qp *qp, ocrdma_cpu_to_le32(&cmd->params.sgid[0], sizeof(cmd->params.sgid)); cmd->params.vlan_dmac_b4_to_b5 = mac_addr[4] | (mac_addr[5] << 8); - if (vlan_id < 0x1000) { - if (dev->pfc_state) { - vlan_id = 0; + if (vlan_id == 0xFFFF) + vlan_id = 0; + if (vlan_id || dev->pfc_state) { + if (!vlan_id) { pr_err("ocrdma%d:Using VLAN with PFC is recommended\n", dev->id); pr_err("ocrdma%d:Using VLAN 0 for this connection\n",