From patchwork Thu Jul 28 20:02:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saleem, Shiraz" X-Patchwork-Id: 9251669 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A73F6077C for ; Thu, 28 Jul 2016 20:03:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A38027DCD for ; Thu, 28 Jul 2016 20:03:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E52C27E66; Thu, 28 Jul 2016 20:03:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 481DD27DCD for ; Thu, 28 Jul 2016 20:03:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757676AbcG1UC4 (ORCPT ); Thu, 28 Jul 2016 16:02:56 -0400 Received: from mga03.intel.com ([134.134.136.65]:58624 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757669AbcG1UCz (ORCPT ); Thu, 28 Jul 2016 16:02:55 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 28 Jul 2016 13:02:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,434,1464678000"; d="scan'208";a="1025809622" Received: from ssaleem-mobl4.amr.corp.intel.com ([10.122.33.86]) by orsmga002.jf.intel.com with ESMTP; 28 Jul 2016 13:02:34 -0700 From: Shiraz Saleem To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, swise@opengridcomputing.com, e1000-rdma@lists.sourceforge.net, Mustafa Ismail , Shiraz Saleem Subject: [PATCH V3] Add flow control to the portmapper Date: Thu, 28 Jul 2016 15:02:26 -0500 Message-Id: <1469736146-17640-1-git-send-email-shiraz.saleem@intel.com> X-Mailer: git-send-email 2.8.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mustafa Ismail During connection establishment with a large number of connections, it is possible that the connection requests might fail. Adding flow control prevents this failure. Change ibnl_unicast to use blocking to enable flow control. Signed-off-by: Mustafa Ismail Signed-off-by: Faisal Latif Signed-off-by: Shiraz Saleem --- V3: update to use blocking ver. of netlink_unicast() in ibnl_unicast(), instead of creating new function in netlink header for this purpose; as was done in V1. V2: update commit message with justification for flow control. CC'ing linux-netdev mailing list. drivers/infiniband/core/netlink.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c index 9b8c20c..a6b3acb 100644 --- a/drivers/infiniband/core/netlink.c +++ b/drivers/infiniband/core/netlink.c @@ -229,7 +229,13 @@ static void ibnl_rcv(struct sk_buff *skb) int ibnl_unicast(struct sk_buff *skb, struct nlmsghdr *nlh, __u32 pid) { - return nlmsg_unicast(nls, skb, pid); + int err; + + err = netlink_unicast(nls, skb, pid, 0); + if (err > 0) + err = 0; + + return err; } EXPORT_SYMBOL(ibnl_unicast); @@ -252,6 +258,7 @@ int __init ibnl_init(void) return -ENOMEM; } + nls->sk_sndtimeo = 10 * HZ; return 0; }