Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2353575pxb; Mon, 20 Sep 2021 19:52:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXko3n9GbxWNIm1zL3XUIFgc0/vIocvYpiTYjktL76DoDeWsLFtbn5h+XbliO6Eh6lDtM1 X-Received: by 2002:a05:6e02:12a6:: with SMTP id f6mr20258628ilr.38.1632192723032; Mon, 20 Sep 2021 19:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192723; cv=none; d=google.com; s=arc-20160816; b=miSyc7U1ZKtgN03lhUf8ZzuiLtl8rZqClBbWMP2AH9VpG3eWlROe6ngCGQQrmxyKP1 baqMTXLRa/FiakuNZFJHG/Nstqnl8CE/Ut+JaN8QIFm1vdw7WZXisW5W+Mhr1kFWrXQA E+jaFxcH55HO1o2wNo7n0hQBvncjJ3lgbJ5P4nk+TCfKnjJGxRDlJY5E64sh4h8u+TMO jWT9BI0uoTF0lU4hk/HN0KO2aziAze1i1rweVKp2GR9bUIax6/w/Ik2FUfDTZ3qvjv9D bWnyd+FLFndFgAGfF9aruUZlBn6wtBs9iRVspt8G+7rnR4r6NLRCPvaPlnUV/8ucIYdN 0RjA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nBZBH2jrbNyTWs8Oevgxu6sG2lqqEUVI47sRxnvDG5s=; b=luIgtBJI24PR/5en+NR2mpOgbHqsGM2i59cT6Rbskpb2RDYlRL7EDz0rfZHYQnRadN w9Zf5MHqlkmnhIw0oRciqgDIQ67MfiZy7HxMlei+l1JvjgUvZt7nLT7/AJ0G+OTY/tAV AW6u2rpr5JTmPGsQtIR0DnC/GzANLQSGJiK4NuzdI+D+4Wk4k2gZnywMmm4QypkE8+3T ahgWuR9aKghan6YxiS+0xce4naMPwZT7AWREi3QqcVphY+zeqpxx2f8npe/Bsb7vGVPh mAKT3GYH8661I1X9rbJDYjPE36DVgoUpVFyYL2VpWhyuCIuwByfnz2q0aWgQFcErzEOO sXUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RxvU5Mte; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q12si3385715jac.12.2021.09.20.19.51.51; Mon, 20 Sep 2021 19:52:03 -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=@linuxfoundation.org header.s=korg header.b=RxvU5Mte; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354582AbhITSrS (ORCPT + 99 others); Mon, 20 Sep 2021 14:47:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:56456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382750AbhITSmT (ORCPT ); Mon, 20 Sep 2021 14:42:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 62A6C61AD2; Mon, 20 Sep 2021 17:31:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632159113; bh=g4eGBlnRG6fPLk2XoxMXa24CVhwkz+Ttj833hlqG8Kw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RxvU5MtetcsDNJDsjI9qvUI6GecD5+hMDwbDL5btZrgqBzrXHYtqSEU+j9ID4krLG 63Vst7y9MFj+QSpiZgt6RDSHjO54hh8bWYMHY+4mfqr40f3Ck38ZJ1WTqkEwHjc+xI IsZMpwxTaL40kefBgTDJegYW3P268KtGwGHkt2fs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yongxin Liu , Dave Ertman , Tony Nguyen , "David S. Miller" , Sasha Levin Subject: [PATCH 5.14 082/168] ice: Correctly deal with PFs that do not support RDMA Date: Mon, 20 Sep 2021 18:43:40 +0200 Message-Id: <20210920163924.334287100@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163921.633181900@linuxfoundation.org> References: <20210920163921.633181900@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Ertman [ Upstream commit bfe84435090a6c85271b02a42b1d83fef9ff7cc7 ] There are two cases where the current PF does not support RDMA functionality. The first is if the NVM loaded on the device is set to not support RDMA (common_caps.rdma is false). The second is if the kernel bonding driver has included the current PF in an active link aggregate. When the driver has determined that this PF does not support RDMA, then auxiliary devices should not be created on the auxiliary bus. Without a device on the auxiliary bus, even if the irdma driver is present, there will be no RDMA activity attempted on this PF. Currently, in the reset flow, an attempt to create auxiliary devices is performed without regard to the ability of the PF. There needs to be a check in ice_aux_plug_dev (as the central point that creates auxiliary devices) to see if the PF is in a state to support the functionality. When disabling and re-enabling RDMA due to the inclusion/removal of the PF in a link aggregate, we also need to set/clear the bit which controls auxiliary device creation so that a reset recovery in a link aggregate situation doesn't try to create auxiliary devices when it shouldn't. Fixes: f9f5301e7e2d ("ice: Register auxiliary device to provide RDMA") Reported-by: Yongxin Liu Signed-off-by: Dave Ertman Signed-off-by: Tony Nguyen Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice.h | 2 ++ drivers/net/ethernet/intel/ice/ice_idc.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h index eadcb9958346..3c4f08d20414 100644 --- a/drivers/net/ethernet/intel/ice/ice.h +++ b/drivers/net/ethernet/intel/ice/ice.h @@ -695,6 +695,7 @@ static inline void ice_set_rdma_cap(struct ice_pf *pf) { if (pf->hw.func_caps.common_cap.rdma && pf->num_rdma_msix) { set_bit(ICE_FLAG_RDMA_ENA, pf->flags); + set_bit(ICE_FLAG_AUX_ENA, pf->flags); ice_plug_aux_dev(pf); } } @@ -707,5 +708,6 @@ static inline void ice_clear_rdma_cap(struct ice_pf *pf) { ice_unplug_aux_dev(pf); clear_bit(ICE_FLAG_RDMA_ENA, pf->flags); + clear_bit(ICE_FLAG_AUX_ENA, pf->flags); } #endif /* _ICE_H_ */ diff --git a/drivers/net/ethernet/intel/ice/ice_idc.c b/drivers/net/ethernet/intel/ice/ice_idc.c index 1f2afdf6cd48..adcc9a251595 100644 --- a/drivers/net/ethernet/intel/ice/ice_idc.c +++ b/drivers/net/ethernet/intel/ice/ice_idc.c @@ -271,6 +271,12 @@ int ice_plug_aux_dev(struct ice_pf *pf) struct auxiliary_device *adev; int ret; + /* if this PF doesn't support a technology that requires auxiliary + * devices, then gracefully exit + */ + if (!ice_is_aux_ena(pf)) + return 0; + iadev = kzalloc(sizeof(*iadev), GFP_KERNEL); if (!iadev) return -ENOMEM; -- 2.30.2