From patchwork Sat Oct 19 21:55:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Latchesar Ionkov X-Patchwork-Id: 3072731 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B1180BF924 for ; Sat, 19 Oct 2013 21:56:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD97D2055B for ; Sat, 19 Oct 2013 21:56:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 907CE2054D for ; Sat, 19 Oct 2013 21:56:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752951Ab3JSV4A (ORCPT ); Sat, 19 Oct 2013 17:56:00 -0400 Received: from mail-ie0-f181.google.com ([209.85.223.181]:64116 "EHLO mail-ie0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752884Ab3JSVz7 (ORCPT ); Sat, 19 Oct 2013 17:55:59 -0400 Received: by mail-ie0-f181.google.com with SMTP id ar20so8746539iec.40 for ; Sat, 19 Oct 2013 14:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=vWvSK0ufG2GKyJckW4Ysj11Zcfdu33V1HKfSLj8ckDM=; b=ebu4R1Vi/mbqwktCc1nIb5WRNWeyOrH+rgUcw6DnNg8PZ0sQaQofDXkhLZ0TVnZkMH Qm+zPVdQ7h2ytkGRoqrGvrZqd5wo2BRB6OtGw/TxIY2lqohuS6n1CGzlLeynCBQg2lrp 3AncNcSfpbdwK3IYHBjAWBdVB4hoq01Ome7GJvCvoQSRHN6RoXDX48qg8jfGgHgr5IO6 ZEassjusorBWZfcrq/XoVTr+H6pdTwVFJMLL5Heid3gj5mFMk9ky0u0+RzmNvbH68dmc yLuq01HNaZ5dvz8ja0WH8pNKodi5wCZ2yBNdTMknMRjMpxSxn03YzgX7pW9vCT1w1KB/ GkoA== X-Received: by 10.50.61.137 with SMTP id p9mr4254000igr.45.1382219756811; Sat, 19 Oct 2013 14:55:56 -0700 (PDT) Received: from moria (c-174-56-101-226.hsd1.nm.comcast.net. [174.56.101.226]) by mx.google.com with ESMTPSA id i11sm20792515igh.0.2013.10.19.14.55.56 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 19 Oct 2013 14:55:56 -0700 (PDT) Received: by moria (Postfix, from userid 1000) id 1603E26001A; Sat, 19 Oct 2013 15:55:41 -0600 (MDT) Date: Sat, 19 Oct 2013 15:55:41 -0600 From: Latchesar Ionkov To: linux-rdma@vger.kernel.org Subject: [PATCH] IB/core: Pass imm_data from ib_uverbs_send_wr to ib_send_wr correctly when sending UD messages Message-ID: <20131019215540.GA8544@moria> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Currently, the infiniband subsystem doesn't copy the immediate data from the userspace struct to the kernel one when UD messages are being sent. This patch makes sure that the immediate data is set correctly. Signed-off-by: Latchesar Ionkov --- drivers/infiniband/core/uverbs_cmd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index f2b81b9..ba207e1 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -2126,6 +2126,9 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file, } next->wr.ud.remote_qpn = user_wr->wr.ud.remote_qpn; next->wr.ud.remote_qkey = user_wr->wr.ud.remote_qkey; + if (next->opcode == IB_WR_SEND_WITH_IMM) + next->ex.imm_data = + (__be32 __force) user_wr->ex.imm_data; } else { switch (next->opcode) { case IB_WR_RDMA_WRITE_WITH_IMM: