From patchwork Fri Jan 5 11:03:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Malz X-Patchwork-Id: 1883125 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T6HDw2mljz1yPH for ; Sat, 6 Jan 2024 08:50:08 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rLs4l-0000aE-Ka; Fri, 05 Jan 2024 21:49:59 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rLhyq-0001y5-H4 for kernel-team@lists.ubuntu.com; Fri, 05 Jan 2024 11:03:12 +0000 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 3AE353F18E for ; Fri, 5 Jan 2024 11:03:12 +0000 (UTC) Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a28f6b75283so41138866b.1 for ; Fri, 05 Jan 2024 03:03:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704452591; x=1705057391; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ef7gZIlo2E1ga4aPXEZ6gsooDQITyZOWw+BL0MZ+nqI=; b=lOv4U2f+YyR0AWlblMM3NP+4b89fdMBXkwpNOPLLtjzeZt5uLs+Cku/MB8Eczgif7p dyJLB/Glo2PtCePItaepy8rqz0I+cnO+jkZnPtf6bei2BKwRhxwwPuP3rALVCSmK/MYh bkzZfuszUDjhMkt9orWYf0y2H6Y+ex+bVUt+F9D3QKFpiCM8YEUdT9IWahiCpzpFNrWj f71rtVzdytB1x1M9QYKI0fUIKdgXj3StFkl2zwTQmPe9BChn3d8sbe3c1KMh1E6oLEkC P7WUB4OZ6GA+KJ/Gw8x8QXieK/6zX7EPORsS1Dr2gpFz2aq8VQuSW18SDc69n3kV2yhF AM5w== X-Gm-Message-State: AOJu0Yyp395gXbn6IdpQwMyCOiXjNPkLaKkWxFVtJYZmSWmMoFyHYjkE Y9swFUdzokenU280I1N62q1DBpDd85RJTd92dETcgyfJtu0L/ozsLYunAOqO1Q8i0aE22w+Oraq xlX1hgE6AUs4tK33PsG2mQ0Dm7UhX1kbfJhLR/aV7iEEGBhT/Ncp/fHhW X-Received: by 2002:a17:907:20d0:b0:a23:119d:d2cb with SMTP id qq16-20020a17090720d000b00a23119dd2cbmr959597ejb.141.1704452591129; Fri, 05 Jan 2024 03:03:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEbCDo/BSCix9Mx9QcUxTs9Jv6CTvIlyXQmWZ5cmD3iqzYWLkBUcayMh3D2AENICpQnr+P3Kg== X-Received: by 2002:a17:907:20d0:b0:a23:119d:d2cb with SMTP id qq16-20020a17090720d000b00a23119dd2cbmr959592ejb.141.1704452590799; Fri, 05 Jan 2024 03:03:10 -0800 (PST) Received: from rmalz.. (89-64-27-150.dynamic.chello.pl. [89.64.27.150]) by smtp.gmail.com with ESMTPSA id u20-20020a170906409400b00a269e651abesm764673ejj.176.2024.01.05.03.03.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 03:03:10 -0800 (PST) From: Robert Malz To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1][SRU][J] ice: alter feature support check for SRIOV and LAG Date: Fri, 5 Jan 2024 12:03:09 +0100 Message-Id: <20240105110309.1455539-2-robert.malz@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240105110309.1455539-1-robert.malz@canonical.com> References: <20240105110309.1455539-1-robert.malz@canonical.com> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 05 Jan 2024 21:49:37 +0000 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Dave Ertman BugLink: https://bugs.launchpad.net/bugs/2036239 Previously, the ice driver had support for using a handler for bonding netdev events to ensure that conflicting features were not allowed to be activated at the same time. While this was still in place, additional support was added to specifically support SRIOV and LAG together. These both utilized the netdev event handler, but the SRIOV and LAG feature was behind a capabilities feature check to make sure the current NVM has support. The exclusion part of the event handler should be removed since there are users who have custom made solutions that depend on the non-exclusion of features. Wrap the creation/registration and cleanup of the event handler and associated structs in the probe flow with a feature check so that the only systems that support the full implementation of LAG features will initialize support. This will leave other systems unhindered with functionality as it existed before any LAG code was added. Fixes: bb52f42acef6 ("ice: Add driver support for firmware changes for LAG") Reviewed-by: Jesse Brandeburg Signed-off-by: Dave Ertman Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen (backported from commit 4d50fcdc2476eef94c14c6761073af5667bb43b6) [rmalz: additionally backported necessary changes from bb52f42] Signed-off-by: Robert Malz --- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 3 +++ drivers/net/ethernet/intel/ice/ice_common.c | 8 ++++++++ drivers/net/ethernet/intel/ice/ice_lag.c | 3 +++ drivers/net/ethernet/intel/ice/ice_type.h | 2 ++ 4 files changed, 16 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h index 21b4c7cd6f05..9a721f9d38ee 100644 --- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h @@ -118,6 +118,9 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_PENDING_NET_VER 0x004D #define ICE_AQC_CAPS_RDMA 0x0051 #define ICE_AQC_CAPS_NVM_MGMT 0x0080 +#define ICE_AQC_CAPS_FW_LAG_SUPPORT 0x0092 +#define ICE_AQC_BIT_ROCEV2_LAG 0x01 +#define ICE_AQC_BIT_SRIOV_LAG 0x02 u8 major_ver; u8 minor_ver; diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index 3de6f16f985a..f8d9b2be26c8 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -2022,6 +2022,14 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, ice_debug(hw, ICE_DBG_INIT, "%s: max_mtu = %d\n", prefix, caps->max_mtu); break; + case ICE_AQC_CAPS_FW_LAG_SUPPORT: + caps->roce_lag = !!(number & ICE_AQC_BIT_ROCEV2_LAG); + ice_debug(hw, ICE_DBG_INIT, "%s: roce_lag = %u\n", + prefix, caps->roce_lag); + caps->sriov_lag = !!(number & ICE_AQC_BIT_SRIOV_LAG); + ice_debug(hw, ICE_DBG_INIT, "%s: sriov_lag = %u\n", + prefix, caps->sriov_lag); + break; default: /* Not one of the recognized common capabilities */ found = false; diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c index 4f954db01b92..01030346398d 100644 --- a/drivers/net/ethernet/intel/ice/ice_lag.c +++ b/drivers/net/ethernet/intel/ice/ice_lag.c @@ -391,6 +391,9 @@ int ice_init_lag(struct ice_pf *pf) struct ice_vsi *vsi; int err; + if (!pf->hw.dev_caps.common_cap.sriov_lag) + return 0; + pf->lag = kzalloc(sizeof(*lag), GFP_KERNEL); if (!pf->lag) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h index d33d1906103c..fcee84c6fa6e 100644 --- a/drivers/net/ethernet/intel/ice/ice_type.h +++ b/drivers/net/ethernet/intel/ice/ice_type.h @@ -268,6 +268,8 @@ struct ice_hw_common_caps { u8 dcb; u8 ieee_1588; u8 rdma; + u8 roce_lag; + u8 sriov_lag; bool nvm_update_pending_nvm; bool nvm_update_pending_orom;