Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3517942pxb; Mon, 9 Nov 2020 13:22:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIkXXt5OGGkhWVMAuHNOCqRgxtlNgGtNPqImgud0fso/PGv+POKhz+AQDqmVGMGSSH2xO5 X-Received: by 2002:a17:906:39d1:: with SMTP id i17mr16458815eje.284.1604956976281; Mon, 09 Nov 2020 13:22:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604956976; cv=none; d=google.com; s=arc-20160816; b=JPir5cvnQhWl5Qcyu2hj1yuUsItOstFhyl4t2twoJ5ezFCe4eQsMRWbUuyui4W8LdU cfJdX5fxf3SOSh0i01o10PD5iur46cyvAYQtquDUYhq18lbHiuX2aq6De2SDKICZdc3l FKGNkuh7FFEpAKOXCyhvcJxXW5t+77Qm7OP3Re3iPylDhDGoCzaYrbUXt7+W3ev2o7LE RcgrmnpYNvMoLDPK98T/MJLVdyrrA+klC/fUCFuVlOit1mDo3j7eWygUDr8QvphtJHQC Hw0iqWu5Hvg9/MXikOY7aJ5NumpOBdvq8bEbQbcZ9GP6b0Z+jcSBxUhUdteFq6NywBn7 BxLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=areiMMXZzlnhm2wpgeZFwm/3fbilrhaLYUTcNjpnIv8=; b=EW456bfer1BDf1aFWHN6YMZ5/mrMK2khlOd/iLdW0yWnFm/MkbQj0atpxGk1T7MGp1 JVLu0cM0o2uSrTK0ri57siEJvLRdYqORWdf9aiA6kNkXqKq2ha5DFt5HNrsHYNkUwIt9 u/yRqEPgktBvWguvpU/asBB2sJELAIx+Imb95DyJzywIaUsMaf4FV5ORb4RnfJhrFK+h D4UDMc8LWI7Kt0A0ZLWtjuNf0fL+6mJCNdzmfd3V0fIwhdytk+NFV1Fee0X3O3129PiO ojTDqczQjFDT6nRQDGesu1vk4WxIWM6+ZHMxGaRedMIbnFUVzI5pJoh4vyTRFlu1Ig3W 9XQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="B9HpvBh/"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si7809333edt.459.2020.11.09.13.22.33; Mon, 09 Nov 2020 13:22:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-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=@gmail.com header.s=20161025 header.b="B9HpvBh/"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730646AbgKIVUp (ORCPT + 99 others); Mon, 9 Nov 2020 16:20:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730490AbgKIVUo (ORCPT ); Mon, 9 Nov 2020 16:20:44 -0500 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A61EDC0613D3 for ; Mon, 9 Nov 2020 13:20:44 -0800 (PST) Received: by mail-qt1-x843.google.com with SMTP id p12so7107602qtp.7 for ; Mon, 09 Nov 2020 13:20:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=areiMMXZzlnhm2wpgeZFwm/3fbilrhaLYUTcNjpnIv8=; b=B9HpvBh/MNXu2M9eSgNLiiT6p+sCWevAqFN88QbHr0tv9aI7A32lVzsXN+7OYa3ZA/ ouCAXEMIVJO+F1VN0SYvz3CpJDiYzmwcXqEjB0q9IdfBdxRaFG57dfJIM354s28nguo+ dDOGZJr+JigXbr1z1xPdjqGCjgFcZl9sI7iyWD5VppqdKvQwdBE10sHFFHkIEPk5WL5P aVfWeJAne0GPpVZMW899zJHavl56ibohMjYUYJCSft0LnUucKvjk4Cv3Z56FgCZmwcGI myVOGiJEebCOYQdkTKPYuN1QiuSGEUgUfizOu/mZvgQsAbAnivTPVH8b/zdVS6kqAbHs ywNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=areiMMXZzlnhm2wpgeZFwm/3fbilrhaLYUTcNjpnIv8=; b=G9EunCWO9OFmYOFdYF7TK/8BtZOLdZCOmvkskHlLsMpK0FkSKYi3j8zYIWoycM0LsO qa0GBzeAAniP3VZiXSw4GeS0gotnDIPbbPTq00RRkWJ125NtQd6mkFOVHyiLpybPdbWk 5vDIlhod4HAvFGP/nA6vTjoERwZgyx8rnJ56MOH2oT0aAC/FdBCXGbFMKvNcS/rGg1LZ M56EV7sqgx7VLVx95FhEbpFsgLPBDxtw7idmyeKoukATMxk52NWyLUKvXYCp8n2zSZex n7J9ltHfXNWdqxIkSw+iEfuOI7ufQ75+pHDRefpP32+5HbuliiX5KVG3QIooB5D3DGRa XImw== X-Gm-Message-State: AOAM533+3wUsu/slkdhNX3Z5pkgJnfCoFmXIKPBB04iXVAxPntZIwBy2 Kl5PPyMPzzMaKp1+4/H1DoipgmCBXkPk X-Received: by 2002:aed:3865:: with SMTP id j92mr3354810qte.318.1604956843557; Mon, 09 Nov 2020 13:20:43 -0800 (PST) Received: from localhost.localdomain (c-68-36-133-222.hsd1.mi.comcast.net. [68.36.133.222]) by smtp.gmail.com with ESMTPSA id d188sm7025241qkb.10.2020.11.09.13.20.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 13:20:42 -0800 (PST) From: trondmy@gmail.com X-Google-Original-From: trond.myklebust@hammerspace.com To: linux-nfs@vger.kernel.org Subject: [PATCH v2 2/5] NFSv4/pNFS: Use connections to a DS that are all of the same protocol family Date: Mon, 9 Nov 2020 16:10:26 -0500 Message-Id: <20201109211029.540993-3-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201109211029.540993-2-trond.myklebust@hammerspace.com> References: <20201109211029.540993-1-trond.myklebust@hammerspace.com> <20201109211029.540993-2-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust If the pNFS metadata server advertises multiple addresses for the same data server, we should try to connect to just one protocol family and transport type on the assumption that homogeneity will improve performance. Signed-off-by: Trond Myklebust --- fs/nfs/pnfs_nfs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c index 679767ac258d..7027dac41cc7 100644 --- a/fs/nfs/pnfs_nfs.c +++ b/fs/nfs/pnfs_nfs.c @@ -860,6 +860,9 @@ static int _nfs4_pnfs_v3_ds_connect(struct nfs_server *mds_srv, .addrlen = da->da_addrlen, .servername = clp->cl_hostname, }; + + if (da->da_addr.ss_family != clp->cl_addr.ss_family) + continue; /* Add this address as an alias */ rpc_clnt_add_xprt(clp->cl_rpcclient, &xprt_args, rpc_clnt_test_and_add_xprt, NULL); @@ -920,6 +923,8 @@ static int _nfs4_pnfs_v4_ds_connect(struct nfs_server *mds_srv, .data = &xprtdata, }; + if (da->da_addr.ss_family != clp->cl_addr.ss_family) + continue; /** * Test this address for session trunking and * add as an alias -- 2.28.0