From patchwork Fri Apr 18 21:55:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hefty, Sean" X-Patchwork-Id: 4018751 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 4DE60BFF02 for ; Fri, 18 Apr 2014 21:56:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8B930203AB for ; Fri, 18 Apr 2014 21:56:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A664B2026C for ; Fri, 18 Apr 2014 21:56:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753068AbaDRV4E (ORCPT ); Fri, 18 Apr 2014 17:56:04 -0400 Received: from mga03.intel.com ([143.182.124.21]:36524 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753935AbaDRV4D (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="420918646" Received: from cst-linux.jf.intel.com ([10.23.221.72]) by azsmga001.ch.intel.com with ESMTP; 18 Apr 2014 14:55:56 -0700 From: sean.hefty@intel.com To: linux-rdma@vger.kernel.org Cc: Sean Hefty Subject: [PATCH librdmacm 2/4] rsocket: Dedicate a fixed number of SQEs for control messages Date: Fri, 18 Apr 2014 14:55:41 -0700 Message-Id: <1397858143-22402-2-git-send-email-sean.hefty@intel.com> X-Mailer: git-send-email 1.7.3 In-Reply-To: <1397858143-22402-1-git-send-email-sean.hefty@intel.com> References: <1397858143-22402-1-git-send-email-sean.hefty@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=-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 number of SQEs allocated for control messages is set to 1 of 2 constant values (either 4 or 2). A default value is used unless the size of the SQ is below a certain threshold (16 entries). This results in additional code complexity, and it is highly unlikely that the SQ would ever be allocated smaller than 16 entries. Simplify the code to use a single constant value for the number of SQEs allocated for control messages. This will also help in subsequent patches that will need to deal with HCAs that do not support inline data. Signed-off-by: Sean Hefty --- src/rsocket.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/rsocket.c b/src/rsocket.c index 7c5083c..ea18ba7 100644 --- a/src/rsocket.c +++ b/src/rsocket.c @@ -59,6 +59,7 @@ #define RS_OLAP_START_SIZE 2048 #define RS_MAX_TRANSFER 65536 #define RS_SNDLOWAT 2048 +#define RS_QP_MIN_SIZE 16 #define RS_QP_MAX_SIZE 0xFFFE #define RS_QP_CTRL_SIZE 4 #define RS_CONN_RETRIES 6 @@ -642,15 +643,13 @@ static void rs_set_qp_size(struct rsocket *rs) if (rs->sq_size > max_size) rs->sq_size = max_size; - else if (rs->sq_size < 4) - rs->sq_size = 4; - if (rs->sq_size <= (RS_QP_CTRL_SIZE << 2)) - rs->ctrl_avail = 2; + else if (rs->sq_size < RS_QP_MIN_SIZE) + rs->sq_size = RS_QP_MIN_SIZE; if (rs->rq_size > max_size) rs->rq_size = max_size; - else if (rs->rq_size < 4) - rs->rq_size = 4; + else if (rs->rq_size < RS_QP_MIN_SIZE) + rs->rq_size = RS_QP_MIN_SIZE; } static void ds_set_qp_size(struct rsocket *rs)