Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2815944pxb; Tue, 13 Apr 2021 10:48:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9lg5xyOOMaT+fvcxWHYtynqaynuaekVQXrG/zJi/tjnHTHIN+1IBE7FZAIDcFmp9ZQQVB X-Received: by 2002:a17:906:7194:: with SMTP id h20mr33092026ejk.432.1618336122895; Tue, 13 Apr 2021 10:48:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618336122; cv=none; d=google.com; s=arc-20160816; b=QOlNucemlEReIOVQIQd4fvJqQROJcYdjTIJVdfhcb4danz858dtwY3D0oprMv9rdVc DaxKxm8NAXIVnV/AV9qZlY6kfQOP+mxjMLdXHPQLCk8BLmfDCCsUUu2RTMZer/041PA2 Vxwu6wxfQ3U6xlmVe2h1YLQ11akzYbfu6R5tryoBnRlKEPgriCA1IykzzLdmozYPV7cu ohAAlBmiGhb6azNl2qjLYgri77/N1IzS7JrfOK1hIdKNI9nP0yzmSjt1F+Co3crf7MNe j2Fr7TDDyC2AeX+l0Oi3RlQ9spGvoRUH7A49AI2IV3R/gO9F3F5SKJQbPi0Pyvyb3TfR vRsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OjTeqqjqmP/VRVXsd62RU31AcHnxjiX1IbTvgdQ1ezo=; b=z1RbtaBa2LGb83QVX7acqQ2QXcozxOhrvMovRHrthKOQNBAVij/HKhLdluPWUhwQFG G0zXcL1RSADXRiqPkVbMYNJK714odv8yrCjwaQ+IOuac2b2QUePNATyOBLPPMNY0YlKz r0I4TCQnyFv3bMXKaz7sGr8V5w/1kWH/3QKvCefHD1dsGbVueQd0XU44bZOM4mc0HkCt nGhQOze+oxdFwXNAwJXRDJXvBTvfDBNH0+5nXbmQMpX4wpnKWkFmLBR4sbVPvKPva726 /t2pcK0RKLCxSKBXQsYz8gIR7GT3LNpe94fYBk+MIqv9B2KmhRBn9dB2xouyM7LAhCUU dyqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CYsm5jHB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si10192916edq.101.2021.04.13.10.48.16; Tue, 13 Apr 2021 10:48:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CYsm5jHB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243810AbhDMLiF (ORCPT + 99 others); Tue, 13 Apr 2021 07:38:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:39432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238148AbhDMLiC (ORCPT ); Tue, 13 Apr 2021 07:38:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DE12F61244; Tue, 13 Apr 2021 11:37:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618313862; bh=RGZNg9kftVpFHwueFM2mS//vQiDriFVB0rvxdE3Bj0M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CYsm5jHBjyHTSfNLz5owb3ZJx/uyb9g0CMlSlExbjZfOpEHTuqX9AfdRGSZB88/IE xDZ06U049Fhp93e3O0tjFrSdfHDN29lME/DZML2V7OVgdR46CqQ7xdNsepCOuPexbc ztk8pwLWq99C4cHjvkqMB+zJYkceDFFLC97f+2NB8UAn3wRddNSwtTs1FdHRUcrZiJ rS3tmYH0XmFL5wCtumSNJxwhkdBxx7ZpYeF2RJKBgKTaYQYvwPIgOR/FF6vRYfmzck lGFJMdYwkqFFqcS76tzby4Ov9VQIokDFF6cIzS2qNh3DMV5oeYZvSxqNyD0iJJua96 SsOtTKaXBH56g== Date: Tue, 13 Apr 2021 14:37:38 +0300 From: Leon Romanovsky To: Haakon Bugge Cc: Jason Gunthorpe , Santosh Shilimkar , "David S. Miller" , Doug Ledford , OFED mailing list , Parav Pandit , Linux-Net , "rds-devel@oss.oracle.com" , LKML Subject: Re: [PATCH for-next v3 0/2] Introduce rdma_set_min_rnr_timer() and use it in RDS Message-ID: References: <1617216194-12890-1-git-send-email-haakon.bugge@oracle.com> <20210412225847.GA1189461@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 13, 2021 at 11:13:38AM +0000, Haakon Bugge wrote: > > > > On 13 Apr 2021, at 08:29, Leon Romanovsky wrote: > > > > On Mon, Apr 12, 2021 at 07:58:47PM -0300, Jason Gunthorpe wrote: > >> On Wed, Mar 31, 2021 at 08:43:12PM +0200, H?kon Bugge wrote: > >>> ib_modify_qp() is an expensive operation on some HCAs running > >>> virtualized. This series removes two ib_modify_qp() calls from RDS. > >>> > >>> I am sending this as a v3, even though it is the first sent to > >>> net. This because the IB Core commit has reach v3. > >>> > >>> H?kon Bugge (2): > >>> IB/cma: Introduce rdma_set_min_rnr_timer() > >>> rds: ib: Remove two ib_modify_qp() calls > >> > >> Applied to rdma for-next, thanks > > > > Jason, > > > > It should be > > + WARN_ON(id->qp_type != IB_QPT_RC && id->qp_type != IB_QPT_XRC_TGT); > > With no return you will arm the setting of the timer and subsequently get an error from the modify_qp later. The addition of WARN_ON() means that this is programmer error to get such input. Historically, in-kernel API doesn't need to have protection from other kernel developers. Thanks > > > H?kon > > > > > and not > > + if (WARN_ON(id->qp_type != IB_QPT_RC && id->qp_type != IB_QPT_XRC_TGT)) > > + return -EINVAL; > > > > Thanks > > > >> > >> Jason >