Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5517293imm; Tue, 12 Jun 2018 09:00:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI1OnVuse9fxAk4NCRC5CJJ2UIaUBOrH7ZIRxX/98L9J5fiN0b7ZYZvbiS61vjIK9HQQN/7 X-Received: by 2002:a62:c809:: with SMTP id z9-v6mr983479pff.5.1528819234490; Tue, 12 Jun 2018 09:00:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528819234; cv=none; d=google.com; s=arc-20160816; b=aFOSLPLW0H3+sUDJqgpPzbucqeE4urpdLrRrVnUwl+ZAvmGuHQmbtv2bxKQM9ivGlJ +e38TNRq10lX2yf0IFhIoINRyqBi2LZMv7yNMGMSmO+T9UyGKcd8t2zU9npPTLYLibj6 1Je0shzrvM6jnPVWJpQFPqrGxKOGj0Up/5R4gd1qCUbitvV0KRuMT7/QJ+lVzwztSzW8 Uj7P+a5gAjZ+ROBIVprTMTK7fjdlj2og3na3OWoAWF47BeohDEwB6/Xd5QVhp8YLBlwY hxNnn4L0VCu4kK75OjvJ4iceczFVcJ6IKM5A2weOo9KkyxGmlTGzRxhF9fwT4hUZxd45 A01Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=6srdUGDMIVnDtA/ksB62yI5BOyICDwDPaYi+LrFPkoM=; b=MV0joELWYBKbW7dNpDstntT5Z59dCLPERTdgpU2mK5NSbY46EdJio6lXnLefkFbNuy EkjS7+YHthzGhp+CqAHUtP4Nqld4u3tigYF3cb8fZW64DA4vco6YGqmM3H15HrfXsxv4 OJdra5LKWSasLBjaVtXh11193qRlIUHgg4w0klC9qsXAs0pNal05zCXnplIV/k5twibl p6nkgTcGsQpfTAXp7p/Y5zCRZW3k1vAERXBagUIyhXLSfduhIrU9ouKVn6WRyH8RKrz8 +agrXk832Gc5Edh7JXnFk6Ab52PndRJ6w46rnZwMuBAHLWOiiWqebq2WkyCgptGeEWRr FZRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kudzu-us.20150623.gappssmtp.com header.s=20150623 header.b=a1K854le; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h21-v6si314482pgn.279.2018.06.12.09.00.19; Tue, 12 Jun 2018 09:00:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kudzu-us.20150623.gappssmtp.com header.s=20150623 header.b=a1K854le; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934495AbeFLP7e (ORCPT + 99 others); Tue, 12 Jun 2018 11:59:34 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:38196 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934050AbeFLP7d (ORCPT ); Tue, 12 Jun 2018 11:59:33 -0400 Received: by mail-io0-f194.google.com with SMTP id l19-v6so28677121ioj.5 for ; Tue, 12 Jun 2018 08:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kudzu-us.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6srdUGDMIVnDtA/ksB62yI5BOyICDwDPaYi+LrFPkoM=; b=a1K854le4jRBfszXa2OQH+ZQUEmnwE9H6T5q6uJxZzyyKNEpgEnFI5meycWQ+tympX 1Tu//IKu14Vr31GiQBdbkGDRxJeL4zpwCsZAxtFg1qVjkNo/9/7outZeP9OzZ4PSTeZp Jqj5gqeTSGrk2Fmr2YJx24W7fErlxTTqXc/NhjmgOdkkql96l2JS6Jjq8/vh3sT/kPeh RNR+Oh1ZMwLepTnveNxUuDMmn3srt3CA+fM7mSYkhnqLmT/4t/p7c3v4PXRm41ud7TyI U3EtEfVzwUAy9lPLWEhcdOQsBlYbzhwc3GM2CqIw16qxks90EFgOstuXxE76iIFk/R7i EXxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6srdUGDMIVnDtA/ksB62yI5BOyICDwDPaYi+LrFPkoM=; b=SfwFfnoD3uQnAwW2s3nEZtyGYdFMyFrJmucAVC28jQTTIC4uN+bTx1V8zRTeZeBeUP oyO01ANnmvIx8mlCu6yN5ZIOHCBGs83uSgHwj0L0WzquHJGygp/F4A2HgK5ewmvRhyB5 QmqX+mPGACRSQ0CB9zUK4PtsMGER10XZsaqd20Kz9fZuVWyquI/26WlbkWOJR91AQi9e v+pNVfh+QgL9c1t6raMCku+7IvzI1sFWrT9FWXLndZKF90VXqBJQ7GDjPlDKhGOSG9lI /tbA6kq5aFddKS83z8TNPnQr2li8gYFFl2qApCpcFet+WyK0vuW86aklWwaXdDkum3pP onTg== X-Gm-Message-State: APt69E3lxImvShJvc4yg4P8ecO6rHvi4pXOxUQWYKKWC3lSxGfvUmBnj WB0Xq99OBSW+Mz/aEVJ3MxqXu8Aobwve5tFq7qlTxg== X-Received: by 2002:a6b:82c7:: with SMTP id m68-v6mr1070146ioi.118.1528819173077; Tue, 12 Jun 2018 08:59:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ad5:5147:0:0:0:0:0 with HTTP; Tue, 12 Jun 2018 08:59:32 -0700 (PDT) In-Reply-To: <20180609000819.13883-4-logang@deltatee.com> References: <20180609000819.13883-1-logang@deltatee.com> <20180609000819.13883-4-logang@deltatee.com> From: Jon Mason Date: Tue, 12 Jun 2018 11:59:32 -0400 Message-ID: Subject: Re: [PATCH 3/8] NTB: Fix the default port and peer numbers for legacy drivers To: Logan Gunthorpe Cc: linux-kernel , linux-ntb , Dave Jiang , Allen Hubbe , Serge Semin , Shyam Sundar S K , Shuah Khan Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 8, 2018 at 8:08 PM, Logan Gunthorpe wrote: > When the commit adding ntb_default_port_number() and > ntb_default_peer_port_number() entered the kernel there was no > users of it so it was impossible to tell what the API needed. > > When a user finally landed a year later (ntb_pingpong) there were > more NTB topologies were created and no consideration was considered > to how other drivers had changed. > > Now that there is a user it can be fixed to provide a sensible default > for the legacy drivers that do not implement ntb_{peer_}port_number(). > Seeing ntb_pingpong doesn't check error codes returning EINVAL was also > not sensible. > > Patches for ntb_pingpong and ntb_perf follow (which are broken > otherwise) to support hardware that doesn't have port numbers. This is > important not only to not break support with existing drivers but for > the cross link topology which, due to its perfect symmetry, cannot > assign unique port numbers to each side. This is a very long way of saying "no clients are checking the error codes, so removing them". :) I think the history and references to follow-on patches are not necessary in the commit message and belong more in a 0/X. This is more of a feature than a bug fix. Can you break this (and the pingpong and perf changes caused by this) off into a separate series, as I'll want to apply this to the ntb-next and not bugfixes branch? Thanks, Jon > Fixes: 1e5301196a88 ("NTB: Add indexed ports NTB API") > Signed-off-by: Logan Gunthorpe > --- > drivers/ntb/ntb.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/ntb/ntb.c b/drivers/ntb/ntb.c > index 93f24440d11d..d955a92a095a 100644 > --- a/drivers/ntb/ntb.c > +++ b/drivers/ntb/ntb.c > @@ -225,10 +225,8 @@ int ntb_default_port_number(struct ntb_dev *ntb) > case NTB_TOPO_B2B_DSD: > return NTB_PORT_SEC_DSD; > default: > - break; > + return 0; > } > - > - return -EINVAL; > } > EXPORT_SYMBOL(ntb_default_port_number); > > @@ -251,10 +249,8 @@ int ntb_default_peer_port_number(struct ntb_dev *ntb, int pidx) > case NTB_TOPO_B2B_DSD: > return NTB_PORT_PRI_USD; > default: > - break; > + return 0; > } > - > - return -EINVAL; > } > EXPORT_SYMBOL(ntb_default_peer_port_number); > > @@ -326,4 +322,3 @@ static void __exit ntb_driver_exit(void) > bus_unregister(&ntb_bus); > } > module_exit(ntb_driver_exit); > - > -- > 2.11.0 >