From patchwork Fri Apr 18 21:55:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hefty, Sean" X-Patchwork-Id: 4018731 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5FC5F9F369 for ; Fri, 18 Apr 2014 21:56:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 956AF2026C for ; Fri, 18 Apr 2014 21:56:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D962203A9 for ; Fri, 18 Apr 2014 21:56:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752798AbaDRV4E (ORCPT ); Fri, 18 Apr 2014 17:56:04 -0400 Received: from mga03.intel.com ([143.182.124.21]:9361 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753068AbaDRV4D (ORCPT ); Fri, 18 Apr 2014 17:56:03 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 18 Apr 2014 14:55:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,886,1389772800"; d="scan'208";a="420918642" Received: from cst-linux.jf.intel.com ([10.23.221.72]) by azsmga001.ch.intel.com with ESMTP; 18 Apr 2014 14:55:55 -0700 From: sean.hefty@intel.com To: linux-rdma@vger.kernel.org Cc: Sean Hefty Subject: [PATCH librdmacm 1/4] rsocket: Check max inline data after creating QP Date: Fri, 18 Apr 2014 14:55:40 -0700 Message-Id: <1397858143-22402-1-git-send-email-sean.hefty@intel.com> X-Mailer: git-send-email 1.7.3 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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: Sean Hefty The ipath provider will ignore the max_inline_size specified as input into ibv_create_qp and instead return the size that it supports (which is 0) on output. Update the actual inline size returned from create QP, and check that it meets the minimum requirement for rsockets. Signed-off-by: Sean Hefty --- src/rsocket.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/src/rsocket.c b/src/rsocket.c index 30ea55d..7c5083c 100644 --- a/src/rsocket.c +++ b/src/rsocket.c @@ -860,6 +860,10 @@ static int rs_create_ep(struct rsocket *rs) if (ret) return ret; + rs->sq_inline = qp_attr.cap.max_inline_data; + if (rs->sq_inline < RS_MIN_INLINE) + return ERR(EINVAL); + for (i = 0; i < rs->rq_size; i++) { ret = rs_post_recv(rs); if (ret) @@ -1491,6 +1495,12 @@ static int ds_create_qp(struct rsocket *rs, union socket_addr *src_addr, if (ret) goto err; + rs->sq_inline = qp_attr.cap.max_inline_data; + if (rs->sq_inline < RS_MIN_INLINE) { + ret = ERR(ENOMEM); + goto err; + } + ret = ds_add_qp_dest(qp, src_addr, addrlen); if (ret) goto err;