From patchwork Fri May 22 19:22:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arlin Davis X-Patchwork-Id: 6467521 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B1C309F1CC for ; Fri, 22 May 2015 19:22:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC9852045B for ; Fri, 22 May 2015 19:22:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE2482045E for ; Fri, 22 May 2015 19:22:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756720AbbEVTWx (ORCPT ); Fri, 22 May 2015 15:22:53 -0400 Received: from mga02.intel.com ([134.134.136.20]:58696 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757042AbbEVTWv (ORCPT ); Fri, 22 May 2015 15:22:51 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 22 May 2015 12:22:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,477,1427785200"; d="scan'208";a="714399580" Received: from cst-linux.jf.intel.com ([10.23.221.40]) by fmsmga001.fm.intel.com with ESMTP; 22 May 2015 12:22:50 -0700 From: arlin.r.davis@intel.com To: linux-rdma@vger.kernel.org Cc: Arlin Davis Subject: [PATCH 4/7] dapl mpxyd: memset ib_wr structure before post_send on WC and WR requests Date: Fri, 22 May 2015 12:22:44 -0700 Message-Id: <1432322567-9349-4-git-send-email-arlin.r.davis@intel.com> X-Mailer: git-send-email 1.7.3 In-Reply-To: <1432322567-9349-1-git-send-email-arlin.r.davis@intel.com> References: <1432322567-9349-1-git-send-email-arlin.r.davis@intel.com> 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=unavailable 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 From: Arlin Davis Signed-off-by: Arlin Davis --- dapl/svc/mpxy_in.c | 10 ++++++---- dapl/svc/mpxy_out.c | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/dapl/svc/mpxy_in.c b/dapl/svc/mpxy_in.c index fb57304..cdfab35 100644 --- a/dapl/svc/mpxy_in.c +++ b/dapl/svc/mpxy_in.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 Intel Corporation. All rights reserved. + * Copyright (c) 2012-2015 Intel Corporation. All rights reserved. * * This software is available to you under the OpenIB.org BSD license * below: @@ -498,8 +498,7 @@ static int m_pi_send_wc(struct mcm_qp *m_qp, struct mcm_wr_rx *wr_rx, int status if (m_qp->smd->md->indata) { wc_rx_ptr = &wc_rx; - wr.send_flags = IBV_SEND_INLINE; - + sge.lkey = 0; /* inline doesn't need registered */ } else { wc_rx_ptr = (struct mcm_wc_rx *) (m_qp->wc_buf_rx + (sizeof(struct mcm_wc_rx) * wc_idx)); @@ -515,7 +514,7 @@ static int m_pi_send_wc(struct mcm_qp *m_qp, struct mcm_wr_rx *wr_rx, int status return (m_pi_send_wc_local(m_qp, wr_rx, wc_idx)); /* send back a WC with error */ - wr.next = 0; + memset(&wr, 0, sizeof(struct ibv_send_wr)); wr.opcode = IBV_WR_RDMA_WRITE_WITH_IMM; wr.imm_data = htonl(*(uint32_t *)&wrc); wr.num_sge = 1; @@ -526,6 +525,9 @@ static int m_pi_send_wc(struct mcm_qp *m_qp, struct mcm_wr_rx *wr_rx, int status (m_qp->wrc_rem.wc_addr + (m_qp->wrc_rem.wc_sz * wc_idx))); wr.sg_list = &sge; + if (m_qp->smd->md->indata) + wr.send_flags |= IBV_SEND_INLINE; + mlog(4, " WC: RW_imm post: wr_id[%d] %Lx sglist %p sge %d op %d flgs %x" " idata %x WR_rem = raddr %p rkey %x ln %d op %x\n", wr_rx->w_idx, wr.wr_id, wr.sg_list, wr.num_sge, wr.opcode, diff --git a/dapl/svc/mpxy_out.c b/dapl/svc/mpxy_out.c index 01647a7..8df32f7 100644 --- a/dapl/svc/mpxy_out.c +++ b/dapl/svc/mpxy_out.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 Intel Corporation. All rights reserved. + * Copyright (c) 2012-2015 Intel Corporation. All rights reserved. * * This software is available to you under the OpenIB.org BSD license * below: @@ -267,7 +267,6 @@ static int m_po_send_pi(struct mcm_qp *m_qp, struct mcm_wr *m_wr, int wr_idx) if (m_qp->smd->md->indata) { wr_rx_ptr = &wr_rx; - wr.send_flags = IBV_SEND_INLINE; sge.lkey = 0; /* inline doesn't need registered */ } else { wr_rx_ptr = (struct mcm_wr_rx *) @@ -285,12 +284,15 @@ static int m_po_send_pi(struct mcm_qp *m_qp, struct mcm_wr *m_wr, int wr_idx) wrc.type = M_WR_TYPE; wrc.flags = 0; + memset(&wr, 0, sizeof(struct ibv_send_wr)); wr.wr_id = WRID_SET(m_wr, WRID_TX_RW_IMM); - wr.next = 0; wr.sg_list = &sge; wr.num_sge = 1; wr.opcode = IBV_WR_RDMA_WRITE_WITH_IMM; + if (m_qp->smd->md->indata) + wr.send_flags = IBV_SEND_INLINE; + if (m_wr->flags & M_SEND_MP_SIG) { m_qp->post_sig_cnt++; /* sig event pending */ #if MCM_PROFILE /* MCM_QP_PO_PI_RW */ @@ -302,7 +304,7 @@ static int m_po_send_pi(struct mcm_qp *m_qp, struct mcm_wr *m_wr, int wr_idx) #endif } - wr.send_flags |= m_wr->wr.send_flags | IBV_SEND_SIGNALED; + wr.send_flags |= IBV_SEND_SIGNALED; wr.imm_data = htonl(*(uint32_t *)&wrc); wr.wr.rdma.rkey = m_qp->wrc_rem.wr_rkey; wr.wr.rdma.remote_addr =