From patchwork Mon Nov 2 06:37:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 7534231 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 44E14BEEA4 for ; Mon, 2 Nov 2015 06:56:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F089202EB for ; Mon, 2 Nov 2015 06:56:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 63AD820377 for ; Mon, 2 Nov 2015 06:56:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752575AbbKBG4M (ORCPT ); Mon, 2 Nov 2015 01:56:12 -0500 Received: from cmrelayp1.emulex.com ([138.239.112.140]:53001 "EHLO CMRELAYP1.ad.emulex.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752337AbbKBG4L (ORCPT ); Mon, 2 Nov 2015 01:56:11 -0500 X-Greylist: delayed 1021 seconds by postgrey-1.27 at vger.kernel.org; Mon, 02 Nov 2015 01:56:11 EST Received: from neo01-el71.iig.avagotech.net ([10.192.205.132]) by CMRELAYP1.ad.emulex.com with Microsoft SMTPSVC(7.5.7601.17514); Sun, 1 Nov 2015 22:37:32 -0800 From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: Devesh Sharma Subject: [PATCH 2/4] RDMA/libocrdma: set vlan present bit for UD Date: Mon, 2 Nov 2015 01:37:23 -0500 Message-Id: <1446446245-534-3-git-send-email-devesh.sharma@avagotech.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1446446245-534-1-git-send-email-devesh.sharma@avagotech.com> References: <1446446245-534-1-git-send-email-devesh.sharma@avagotech.com> X-OriginalArrivalTime: 02 Nov 2015 06:37:32.0444 (UTC) FILETIME=[F3E15DC0:01D11538] 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, T_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 This patch tells f/w about the presence of VLAN tag in the AH being supplied to the QP. Signed-off-by: Devesh Sharma --- src/ocrdma_abi.h | 7 ++++--- src/ocrdma_main.h | 7 +++++++ src/ocrdma_verbs.c | 8 ++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/ocrdma_abi.h b/src/ocrdma_abi.h index ad7abd4..8102c1c 100644 --- a/src/ocrdma_abi.h +++ b/src/ocrdma_abi.h @@ -51,14 +51,14 @@ enum { }; #define OCRDMA_DB_CQ_RING_ID_MASK 0x3FF /* bits 0 - 9 */ -#define OCRDMA_DB_CQ_RING_ID_EXT_MASK 0x0C00 /* bits 10-11 of qid placing at 12-11 */ -#define OCRDMA_DB_CQ_RING_ID_EXT_MASK_SHIFT 0x1 /* qid #2 msbits placing at 12-11 */ +#define OCRDMA_DB_CQ_RING_ID_EXT_MASK 0x0C00 /* bits 10-11 of qid placing at 12-11 */ +#define OCRDMA_DB_CQ_RING_ID_EXT_MASK_SHIFT 0x1 /* qid #2 msbits placing at 12-11 */ #define OCRDMA_DB_CQ_NUM_POPPED_SHIFT (16) /* bits 16 - 28 */ /* Rearm bit */ #define OCRDMA_DB_CQ_REARM_SHIFT (29) /* bit 29 */ /* solicited bit */ -#define OCRDMA_DB_CQ_SOLICIT_SHIFT (31) /* bit 31 */ +#define OCRDMA_DB_CQ_SOLICIT_SHIFT (31) /* bit 31 */ struct ocrdma_get_context { struct ibv_get_context cmd; @@ -291,6 +291,7 @@ enum { OCRDMA_FLAG_FENCE_R = 0x8, OCRDMA_FLAG_SOLICIT = 0x10, OCRDMA_FLAG_IMM = 0x20, + OCRDMA_FLAG_AH_VLAN_PR = 0x40, /* Stag flags */ OCRDMA_LKEY_FLAG_LOCAL_WR = 0x1, diff --git a/src/ocrdma_main.h b/src/ocrdma_main.h index 5a386bb..4e7be75 100644 --- a/src/ocrdma_main.h +++ b/src/ocrdma_main.h @@ -211,10 +211,17 @@ struct ocrdma_qp { int signaled; /* signaled QP */ }; +enum { + OCRDMA_AH_ID_MASK = 0x3FF, + OCRDMA_AH_VLAN_VALID_MASK = 0x01, + OCRDMA_AH_VLAN_VALID_SHIFT = 0x1F +}; + struct ocrdma_ah { struct ibv_ah ibv_ah; struct ocrdma_pd *pd; uint16_t id; + uint8_t isvlan; }; #define get_ocrdma_xxx(xxx, type) \ diff --git a/src/ocrdma_verbs.c b/src/ocrdma_verbs.c index ab90b4f..d80ab27 100644 --- a/src/ocrdma_verbs.c +++ b/src/ocrdma_verbs.c @@ -1196,6 +1196,9 @@ static void ocrdma_build_ud_hdr(struct ocrdma_qp *qp, ud_hdr->rsvd_dest_qpn = wr->wr.ud.remote_qpn; ud_hdr->qkey = wr->wr.ud.remote_qkey; ud_hdr->rsvd_ahid = ah->id; + if (ah->isvlan) + hdr->cw |= (OCRDMA_FLAG_AH_VLAN_PR << + OCRDMA_WQE_FLAGS_SHIFT); } static void ocrdma_build_sges(struct ocrdma_hdr_wqe *hdr, @@ -2156,9 +2159,10 @@ struct ibv_ah *ocrdma_create_ah(struct ibv_pd *ibpd, struct ibv_ah_attr *attr) if (status) goto cmd_err; - ah->id = pd->uctx->ah_tbl[ahtbl_idx]; + ah->id = pd->uctx->ah_tbl[ahtbl_idx] & OCRDMA_AH_ID_MASK; + ah->isvlan = (pd->uctx->ah_tbl[ahtbl_idx] >> + OCRDMA_AH_VLAN_VALID_SHIFT); return &ah->ibv_ah; - cmd_err: ocrdma_free_ah_tbl_id(pd->uctx, ahtbl_idx); tbl_err: