From patchwork Thu Jan 11 15:03:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Malz X-Patchwork-Id: 1885655 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 4T9ny50f2Rz1yPm for ; Fri, 12 Jan 2024 02:04:29 +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 1rNwbB-0002Ec-DF; Thu, 11 Jan 2024 15:04:13 +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 1rNwac-0002CL-E4 for kernel-team@lists.ubuntu.com; Thu, 11 Jan 2024 15:03:26 +0000 Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) (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 17CBB3F286 for ; Thu, 11 Jan 2024 15:03:26 +0000 (UTC) Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-50e81d186e2so5487835e87.0 for ; Thu, 11 Jan 2024 07:03:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704985404; x=1705590204; 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=esarWvsDj5LOM3kQ0m+k3G1XC/hi4tUbGxf84zJYUzc=; b=HbYEKlPWG+rJdjejOiT+frvUt6WpOxl3XQjOYLDnh6Ce4Y361Zo8QwodkAksDxospD N54JD9SdkhzK2fIzs9Tx5P8/bdbNevEG0oG02dbMCA5cPg1p79LQNN0pEtrhlvM72mPN ln97ual6Mll5pgxzKClOC6kZXuwmbUpnmVFHPWlTerb1qLhuQV9JPMLMEVhyriIZfiGx Tmq3VjbnaQbIAwBS1kQokC2JTULp1t07kaF+dgrGdMhlqkU5ILG00lmaylBSU50ZNHhU wM1lPUGquA+Q25obhZRG8tbQHK9YL1OYTKJSqmAH7pQINQ2HcvTeX0QCLPbKTfC+GQ6p JGrw== X-Gm-Message-State: AOJu0YxBtfEi+o0v6Z/gmxbPjPWjndwdJv/29hjxXkkfKgX6PMF2mSEH Zf/lHKuMh0AGlaAVt5INro4tNN+4qaOduFWzDEWUIosmxhKQDxEHyhrkd5DGCHtHrIcs+yH1FMk 4eSVpQBPb/DYYgYatXOeBRTJPC3hjNgOpAtRgQiO+CckMlEAcixZXhdLX X-Received: by 2002:ac2:4e52:0:b0:50e:74f0:810e with SMTP id f18-20020ac24e52000000b0050e74f0810emr699554lfr.137.1704985403900; Thu, 11 Jan 2024 07:03:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHF/vAYM0F283nc+RNoQqQrRiE+boIjKSm9uEApkUBDQVO3fhpWuBp8LH5yzduBPVS8R80fSQ== X-Received: by 2002:ac2:4e52:0:b0:50e:74f0:810e with SMTP id f18-20020ac24e52000000b0050e74f0810emr699548lfr.137.1704985403594; Thu, 11 Jan 2024 07:03:23 -0800 (PST) Received: from rmalz.. (89-64-27-150.dynamic.chello.pl. [89.64.27.150]) by smtp.gmail.com with ESMTPSA id t14-20020ac243ae000000b0050e3b654751sm211329lfl.199.2024.01.11.07.03.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 07:03:23 -0800 (PST) From: Robert Malz To: kernel-team@lists.ubuntu.com Subject: [PATCH v2 1/3][SRU][J] ice: Add feature bitmap, helpers and a check for DSCP Date: Thu, 11 Jan 2024 16:03:19 +0100 Message-Id: <20240111150321.760930-2-robert.malz@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240111150321.760930-1-robert.malz@canonical.com> References: <20240111150321.760930-1-robert.malz@canonical.com> MIME-Version: 1.0 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: Anirudh Venkataramanan BugLink: https://bugs.launchpad.net/bugs/2036239 DSCP a.k.a L3 QoS is only supported on certain devices. To enforce this, this patch introduces a bitmap of features and helper functions. The feature bitmap is set based on device IDs on driver init. Currently, DSCP is the only feature in this bitmap, but there will be more in the future. In the DCB netlink flow, check if the feature bit is set before exercising DSCP. Signed-off-by: Anirudh Venkataramanan Tested-by: Gurucharan G Signed-off-by: Tony Nguyen (backported from commit 40b247608bc50b5c046dfb1073c0ee7f57769c86) [rmalz: backported feature bitmap implementation, ignored check for DSCP] Signed-off-by: Robert Malz --- drivers/net/ethernet/intel/ice/ice.h | 6 +++ drivers/net/ethernet/intel/ice/ice_lib.c | 47 +++++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_lib.h | 2 + drivers/net/ethernet/intel/ice/ice_main.c | 2 + 4 files changed, 57 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h index 43fe91213aa5..d08b0d3479b8 100644 --- a/drivers/net/ethernet/intel/ice/ice.h +++ b/drivers/net/ethernet/intel/ice/ice.h @@ -155,6 +155,11 @@ #define ice_pf_to_dev(pf) (&((pf)->pdev->dev)) +enum ice_feature { + ICE_F_DSCP, + ICE_F_MAX +}; + struct ice_txq_meta { u32 q_teid; /* Tx-scheduler element identifier */ u16 q_id; /* Entry in VSI's txq_map bitmap */ @@ -442,6 +447,7 @@ struct ice_pf { /* used to ratelimit the MDD event logging */ unsigned long last_printed_mdd_jiffies; DECLARE_BITMAP(malvfs, ICE_MAX_VF_COUNT); + DECLARE_BITMAP(features, ICE_F_MAX); DECLARE_BITMAP(state, ICE_STATE_NBITS); DECLARE_BITMAP(flags, ICE_PF_FLAGS_NBITS); unsigned long *avail_txqs; /* bitmap to track PF Tx queue usage */ diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 4417238b0e64..f2addcb4c6cc 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -3597,3 +3597,50 @@ int ice_set_link(struct ice_vsi *vsi, bool ena) return 0; } + +/** + * ice_is_feature_supported + * @pf: pointer to the struct ice_pf instance + * @f: feature enum to be checked + * + * returns true if feature is supported, false otherwise + */ +bool ice_is_feature_supported(struct ice_pf *pf, enum ice_feature f) +{ + if (f < 0 || f >= ICE_F_MAX) + return false; + + return test_bit(f, pf->features); +} + +/** + * ice_set_feature_support + * @pf: pointer to the struct ice_pf instance + * @f: feature enum to set + */ +static void ice_set_feature_support(struct ice_pf *pf, enum ice_feature f) +{ + if (f < 0 || f >= ICE_F_MAX) + return; + + set_bit(f, pf->features); +} + +/** + * ice_init_feature_support + * @pf: pointer to the struct ice_pf instance + * + * called during init to setup supported feature + */ +void ice_init_feature_support(struct ice_pf *pf) +{ + switch (pf->hw.device_id) { + case ICE_DEV_ID_E810C_BACKPLANE: + case ICE_DEV_ID_E810C_QSFP: + case ICE_DEV_ID_E810C_SFP: + ice_set_feature_support(pf, ICE_F_DSCP); + break; + default: + break; + } +} diff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h index d5a28bf0fc2c..4512c8513178 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.h +++ b/drivers/net/ethernet/intel/ice/ice_lib.h @@ -116,4 +116,6 @@ bool ice_is_vsi_dflt_vsi(struct ice_sw *sw, struct ice_vsi *vsi); int ice_set_dflt_vsi(struct ice_sw *sw, struct ice_vsi *vsi); int ice_clear_dflt_vsi(struct ice_sw *sw); +bool ice_is_feature_supported(struct ice_pf *pf, enum ice_feature f); +void ice_init_feature_support(struct ice_pf *pf); #endif /* !_ICE_LIB_H_ */ diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 15dc29a7a52c..3c671a03889c 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -4346,6 +4346,8 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent) goto err_exit_unroll; } + ice_init_feature_support(pf); + ice_request_fw(pf); /* if ice_request_fw fails, ICE_FLAG_ADV_FEATURES bit won't be From patchwork Thu Jan 11 15:03:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Malz X-Patchwork-Id: 1885656 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 4T9nyj4rGrz1yPm for ; Fri, 12 Jan 2024 02:05:01 +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 1rNwbw-0002XD-Ps; Thu, 11 Jan 2024 15:04:50 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rNwai-0002CZ-6u for kernel-team@lists.ubuntu.com; Thu, 11 Jan 2024 15:03:33 +0000 Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.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-0.canonical.com (Postfix) with ESMTPS id 1D1AD3F2D1 for ; Thu, 11 Jan 2024 15:03:27 +0000 (UTC) Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-50e91f9d422so4885817e87.2 for ; Thu, 11 Jan 2024 07:03:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704985405; x=1705590205; 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=rJ/Jd57clFHffmOOX76FOfqHNo6oU2AWuIY47mkQJP8=; b=mvuMxL1X6urp/3TB/NKORs4UweddC1sS/5zoj1JtxebrGZtsP7g+1KTTasVOh7ooa5 r77YQl4MHJ0lRWVJNj6v8ulk+z6vi0uevbYl8Ljg+6x2T5TEwzJX1X4v8hgrqKDTAczQ ofmJ/dOySBJTeolHlQMVZmc4s3FsBAQtt09rufZHDPAly6wRCjpuQq5y2Npv27pfW0az AvnHEUTIhRahJhTc/YXtYtGj+2v/6E59eVK8OJ7k1VdQCJqwsai+VN6jVrqqh1Cx5NR+ ZgY9yUoZ43yw8rVI9JmvOdw2xnV4GNJ5BLDaEsYKff1xYGCfT2oSbUCdmANV4owo6/7Q Q+FQ== X-Gm-Message-State: AOJu0YyKUScU86n5gheJpUlMkntHRMR8nMfdmRlwJWM2k7TcVixj7BB3 DCBAQrUd8KpOn7pc3H6Iq6CCSciLmO8vyJNSq3kISgnETq9w6ImPs9+059hVyUiHtoViJ8AjySp Ps3dXdOhzxbbH8NoWXgMGiYzjQ7YgHtcOtNw0qMn2Hj92Ez8uWIT0cZs4 X-Received: by 2002:ac2:5051:0:b0:50e:65f3:cb0b with SMTP id a17-20020ac25051000000b0050e65f3cb0bmr665856lfm.13.1704985405474; Thu, 11 Jan 2024 07:03:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IEg8+vlPi6QoBqo7w8Dp0OfWSjwNpeSki7RRu72HDUA0bc7dFr9743sIizCiF1R2hwimbPeIQ== X-Received: by 2002:ac2:5051:0:b0:50e:65f3:cb0b with SMTP id a17-20020ac25051000000b0050e65f3cb0bmr665849lfm.13.1704985405151; Thu, 11 Jan 2024 07:03:25 -0800 (PST) Received: from rmalz.. (89-64-27-150.dynamic.chello.pl. [89.64.27.150]) by smtp.gmail.com with ESMTPSA id t14-20020ac243ae000000b0050e3b654751sm211329lfl.199.2024.01.11.07.03.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 07:03:23 -0800 (PST) From: Robert Malz To: kernel-team@lists.ubuntu.com Subject: [PATCH v2 2/3][SRU][J] ice: Add driver support for firmware changes for LAG Date: Thu, 11 Jan 2024 16:03:20 +0100 Message-Id: <20240111150321.760930-3-robert.malz@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240111150321.760930-1-robert.malz@canonical.com> References: <20240111150321.760930-1-robert.malz@canonical.com> MIME-Version: 1.0 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 Add the defines, fields, and detection code for FW support of LAG for SRIOV. Also exposes some previously static functions to allow access in the lag code. Clean up code that is unused or not needed for LAG support. Also add an ordered workqueue for processing LAG events. Reviewed-by: Daniel Machon Signed-off-by: Dave Ertman Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen (backported from commit bb52f42acef6ac317ee298d39909ce17bbaddb82) [rmalz: backported changes related to discovering device capabilities, ignored mutex and workqueue implementation, applied changes due to lack of ice_clear_feature_support function] Signed-off-by: Robert Malz --- drivers/net/ethernet/intel/ice/ice.h | 2 + .../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 | 46 +++++++++---------- drivers/net/ethernet/intel/ice/ice_lib.c | 2 +- drivers/net/ethernet/intel/ice/ice_lib.h | 1 + drivers/net/ethernet/intel/ice/ice_type.h | 2 + 7 files changed, 40 insertions(+), 24 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h index d08b0d3479b8..2d5612f3639d 100644 --- a/drivers/net/ethernet/intel/ice/ice.h +++ b/drivers/net/ethernet/intel/ice/ice.h @@ -157,6 +157,8 @@ enum ice_feature { ICE_F_DSCP, + ICE_F_ROCE_LAG, + ICE_F_SRIOV_LAG, ICE_F_MAX }; 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..e5cfeb7a5ec3 100644 --- a/drivers/net/ethernet/intel/ice/ice_lag.c +++ b/drivers/net/ethernet/intel/ice/ice_lag.c @@ -4,6 +4,7 @@ /* Link Aggregation code */ #include "ice.h" +#include "ice_lib.h" #include "ice_lag.h" /** @@ -237,6 +238,26 @@ static void ice_lag_unregister(struct ice_lag *lag, struct net_device *netdev) lag->role = ICE_LAG_NONE; } +/** + * ice_lag_init_feature_support_flag - Check for NVM support for LAG + * @pf: PF struct + */ +static void ice_lag_init_feature_support_flag(struct ice_pf *pf) +{ + struct ice_hw_common_caps *caps; + + caps = &pf->hw.dev_caps.common_cap; + if (caps->roce_lag) + ice_set_feature_support(pf, ICE_F_ROCE_LAG); + else + clear_bit(ICE_F_ROCE_LAG, pf->features); + + if (caps->sriov_lag) + ice_set_feature_support(pf, ICE_F_SRIOV_LAG); + else + clear_bit(ICE_F_SRIOV_LAG, pf->features); +} + /** * ice_lag_changeupper_event - handle LAG changeupper event * @lag: LAG info struct @@ -276,26 +297,6 @@ static void ice_lag_changeupper_event(struct ice_lag *lag, void *ptr) ice_display_lag_info(lag); } -/** - * ice_lag_changelower_event - handle LAG changelower event - * @lag: LAG info struct - * @ptr: opaque data pointer - * - * ptr to be cast to netdev_notifier_changelowerstate_info - */ -static void ice_lag_changelower_event(struct ice_lag *lag, void *ptr) -{ - struct net_device *netdev = netdev_notifier_info_to_dev(ptr); - - if (netdev != lag->netdev) - return; - - netdev_dbg(netdev, "bonding info\n"); - - if (!netif_is_lag_port(netdev)) - netdev_dbg(netdev, "CHANGELOWER rcvd, but netdev not in LAG. Bail\n"); -} - /** * ice_lag_event_handler - handle LAG events from netdev * @notif_blk: notifier block registered by this netdev @@ -322,9 +323,6 @@ ice_lag_event_handler(struct notifier_block *notif_blk, unsigned long event, case NETDEV_CHANGEUPPER: ice_lag_changeupper_event(lag, ptr); break; - case NETDEV_CHANGELOWERSTATE: - ice_lag_changelower_event(lag, ptr); - break; case NETDEV_BONDING_INFO: ice_lag_info_event(lag, ptr); break; @@ -391,6 +389,8 @@ int ice_init_lag(struct ice_pf *pf) struct ice_vsi *vsi; int err; + ice_lag_init_feature_support_flag(pf); + pf->lag = kzalloc(sizeof(*lag), GFP_KERNEL); if (!pf->lag) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index f2addcb4c6cc..2a6564c8f2e2 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -3618,7 +3618,7 @@ bool ice_is_feature_supported(struct ice_pf *pf, enum ice_feature f) * @pf: pointer to the struct ice_pf instance * @f: feature enum to set */ -static void ice_set_feature_support(struct ice_pf *pf, enum ice_feature f) +void ice_set_feature_support(struct ice_pf *pf, enum ice_feature f) { if (f < 0 || f >= ICE_F_MAX) return; diff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h index 4512c8513178..2662745c9310 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.h +++ b/drivers/net/ethernet/intel/ice/ice_lib.h @@ -117,5 +117,6 @@ int ice_set_dflt_vsi(struct ice_sw *sw, struct ice_vsi *vsi); int ice_clear_dflt_vsi(struct ice_sw *sw); bool ice_is_feature_supported(struct ice_pf *pf, enum ice_feature f); +void ice_set_feature_support(struct ice_pf *pf, enum ice_feature f); void ice_init_feature_support(struct ice_pf *pf); #endif /* !_ICE_LIB_H_ */ 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; From patchwork Thu Jan 11 15:03:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Malz X-Patchwork-Id: 1885657 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 4T9nyr5lJYz1yPp for ; Fri, 12 Jan 2024 02:05: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 1rNwc5-0002cH-P2; Thu, 11 Jan 2024 15:04:57 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rNwai-0002Cc-4O for kernel-team@lists.ubuntu.com; Thu, 11 Jan 2024 15:03:33 +0000 Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.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-0.canonical.com (Postfix) with ESMTPS id B4D804102F for ; Thu, 11 Jan 2024 15:03:28 +0000 (UTC) Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-50e73a71c8aso3660032e87.3 for ; Thu, 11 Jan 2024 07:03:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704985406; x=1705590206; 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=7RXUsZPw7M6KC9pOQR59aGoduMg/2e34ETT9pVT6p5w=; b=cR2qFGNpZs0ROCQwP+cSlAYg1g+L31uFt7jDmicQoEvDknVwrRwXMoPInYwijpUsy3 B9Q3IE8pLPPu9TzEHhree4gqZYBFhO/CR14Ek8lHS3AeQ9vdMvoIpcSs8I+hFL9jJlVK KhcM31skI+6ybpo83XfR3o966XOgJYGEvgPm52ADRpM3rQDruR2kicTPWXYwc0GBCPNs mO8i6N1FuqjgVs2m9LWdPzJdO4HdBUF6idVFmaH307C1ZWIfmqj8aOpqZoUJrjk7elyg jd4HbIKUQ/YzOENiZEVsj9vklGAzigsdZ9DWbPIAwzCCUZSXEczZyS9P0fhaOkQziJFa x35g== X-Gm-Message-State: AOJu0YzSv3DRYkgOaUTtYaYgUmivJaGEtWI/rkubAr5+uGpN2BdCt93Q mJIq19BS8Ej7QP2+RGozrrf8CD7s9h/Xq2tJ9unYuq961aBBkFZmmygbUbHXI8fw8+pArVx8BFe /Dm+ZOUS+0Jq8ETcYegYEvrypKJSL2gUe2KV84qqgCTqKJKr0ZNjToL1k X-Received: by 2002:a05:6512:11c8:b0:50e:c081:ae6d with SMTP id h8-20020a05651211c800b0050ec081ae6dmr314228lfr.85.1704985406285; Thu, 11 Jan 2024 07:03:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IF30KsgzN7g1ws1x4zx8Fk+vbFmNLkZZsr0QKDIi+oNT0LZcYahku6xohU+Mm3LkSqeD66Ufw== X-Received: by 2002:a05:6512:11c8:b0:50e:c081:ae6d with SMTP id h8-20020a05651211c800b0050ec081ae6dmr314222lfr.85.1704985405713; Thu, 11 Jan 2024 07:03:25 -0800 (PST) Received: from rmalz.. (89-64-27-150.dynamic.chello.pl. [89.64.27.150]) by smtp.gmail.com with ESMTPSA id t14-20020ac243ae000000b0050e3b654751sm211329lfl.199.2024.01.11.07.03.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 07:03:25 -0800 (PST) From: Robert Malz To: kernel-team@lists.ubuntu.com Subject: [PATCH v2 3/3][SRU][J] ice: alter feature support check for SRIOV and LAG Date: Thu, 11 Jan 2024 16:03:21 +0100 Message-Id: <20240111150321.760930-4-robert.malz@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240111150321.760930-1-robert.malz@canonical.com> References: <20240111150321.760930-1-robert.malz@canonical.com> MIME-Version: 1.0 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 (cherry-picked from commit 4d50fcdc2476eef94c14c6761073af5667bb43b6) Signed-off-by: Robert Malz --- drivers/net/ethernet/intel/ice/ice_lag.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c index e5cfeb7a5ec3..886907750667 100644 --- a/drivers/net/ethernet/intel/ice/ice_lag.c +++ b/drivers/net/ethernet/intel/ice/ice_lag.c @@ -390,6 +390,8 @@ int ice_init_lag(struct ice_pf *pf) int err; ice_lag_init_feature_support_flag(pf); + if (!ice_is_feature_supported(pf, ICE_F_SRIOV_LAG)) + return 0; pf->lag = kzalloc(sizeof(*lag), GFP_KERNEL); if (!pf->lag)