From patchwork Wed Dec 30 11:01:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 7932511 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 C5E3F9F349 for ; Wed, 30 Dec 2015 11:01:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C5A8202EC for ; Wed, 30 Dec 2015 11:01:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 491A0202F0 for ; Wed, 30 Dec 2015 11:01:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754454AbbL3LBl (ORCPT ); Wed, 30 Dec 2015 06:01:41 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:56033 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754019AbbL3LBf (ORCPT ); Wed, 30 Dec 2015 06:01:35 -0500 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aEEVZ-0002kn-V6; Wed, 30 Dec 2015 11:01:33 +0000 Date: Wed, 30 Dec 2015 03:01:33 -0800 From: Christoph Hellwig To: "ira.weiny" Cc: Sagi Grimberg , dledford@redhat.com, linux-rdma@vger.kernel.org, Dean Luick Subject: Re: [PATCH] IB/mad: Ensure fairness in ib_mad_completion_handler Message-ID: <20151230110133.GA4859@infradead.org> References: <1449784350-30214-1-git-send-email-ira.weiny@intel.com> <20151229091730.GA8445@infradead.org> <56825797.5030008@dev.mellanox.co.il> <20151229174014.GA329@phlsvsds.ph.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20151229174014.GA329@phlsvsds.ph.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html 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, T_TVD_MIME_EPI, 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 Hi Ira, please take a look at the patches I've attached - they are just WIP that hasn't been tested as I'm on a vacation without access to my IB setup until New Year's Eve. Patch 1 is I think a genuine bug fix caused by the madness (pun intendended) of the wr_id abuses. Patch 2: passes the mad_send_buf explicitily to mad handlers to get rid of that mess. Patch 3 is the CQ API conversion which becomes relatively simple once the prior issues above are sorted out. From a22609131ca353278015b6b4aec3077db06ad9f5 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 30 Dec 2015 11:49:22 +0100 Subject: IB/mad: pass send buf in wr_id in local_completions The sa_query recv_handler expects the send_buf in wr_id, and all other recv handlers ignore wr_id. It seems this is what we should pass, please confirm. Signed-off-by: Christoph Hellwig --- drivers/infiniband/core/mad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index d4d2a61..e0859e5 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c @@ -2734,7 +2734,7 @@ static void local_completions(struct work_struct *work) * before request */ build_smp_wc(recv_mad_agent->agent.qp, - (unsigned long) local->mad_send_wr, + (unsigned long) &local->mad_send_wr->send_buf, be16_to_cpu(IB_LID_PERMISSIVE), local->mad_send_wr->send_wr.pkey_index, recv_mad_agent->agent.port_num, &wc);