Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp671664pxb; Thu, 9 Sep 2021 09:23:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSkabAZ8GPgpYIaO5HQ6hesjbanFnzhhmO4BUu4rK/NCiWEMvdolKnFN+Gu/qc1MfhfwrP X-Received: by 2002:a6b:b883:: with SMTP id i125mr3408297iof.144.1631204634282; Thu, 09 Sep 2021 09:23:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631204634; cv=none; d=google.com; s=arc-20160816; b=R6ACJd/OtauPwq6EFX+YWccN3YRhwS9SZbg1EFJDTbieBz7tBUH8E2sFpu92kkTWMO JSGqa8pCn+JGjfjVgydUV2gjRLMHQGsYi2Bn3Lx67FXWPNii9D6AHCYEgKzlqIOO2Vz0 hFbWmiabfDRpqHGzMMf2C9oPGD1aQzi//aFn2JIpNDVTp/Tvl73oSbGFGITzoPmChBq7 Su0QzllHV1Q3wSmikaiNHCiLE3Tvy7OyGTwrm2uqQixizEqHkMTl36OowA5qjRMbtI0D aP8NUyKzNZQF+7Qmy43DEjjrSC4JK0f8rp1ABmiQ5DJ2xlcbePzg8symj68h+HxsOwTe r8DQ== 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 :message-id:date:subject:cc:to:from; bh=I1vZf0gbT2MOtENEdCeU8AH8WzbXJubn9VPdsJo2Lxc=; b=PueA3dy81YziPr/fTdqy+K/TjsMGHrJH0n6jIuzMlTD2mB7tZlxMB2c2aTztfqSo6u HwzIqD9bCVKjAnSwOahFsgfNpf5AjNutM22OqkhIYa6UtkLN3bqan6HitfeTzst3DIvh 8fRFJsou+kwzCAKJJP76B9nYRZEXT4L9eXgHugHygtGsf379vTLYOlhX90A04kjcLQxJ U1EGHhq+0BU/AMgUShJKCr8UHSiexDlSjICzfg7/eWfMV0jaqp5Ax726IkwkkzAT7iuS gzY0H+vqnJ0moJwj6qZOP/ZL+fRN4G4L2vkvzRwUAtTJ76w3NKl6exp9gvp9Aj5X4Y6L EDIg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g34si1967791jaa.104.2021.09.09.09.23.41; Thu, 09 Sep 2021 09:23:54 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236840AbhIIQWH (ORCPT + 99 others); Thu, 9 Sep 2021 12:22:07 -0400 Received: from mga02.intel.com ([134.134.136.20]:37187 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236819AbhIIQWG (ORCPT ); Thu, 9 Sep 2021 12:22:06 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10101"; a="208062536" X-IronPort-AV: E=Sophos;i="5.85,280,1624345200"; d="scan'208";a="208062536" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2021 09:18:12 -0700 X-IronPort-AV: E=Sophos;i="5.85,280,1624345200"; d="scan'208";a="450031774" Received: from dmert-dev.jf.intel.com ([10.166.241.5]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2021 09:18:11 -0700 From: Dave Ertman To: davem@davemloft.net, kuba@kernel.org Cc: yongxin.liu@windriver.com, shiraz.saleem@intel.com, anthony.l.nguyen@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jesse.brandeburg@intel.com, intel-wired-lan@lists.osuosl.org Subject: [PATCH net] ice: Correctly deal with PFs that do not support RDMA Date: Thu, 9 Sep 2021 01:56:12 -0700 Message-Id: <20210909085612.570229-1-david.m.ertman@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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.31.1