From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1694C7EE25 for ; Fri, 9 Jun 2023 21:15:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 602FB60AE2; Fri, 9 Jun 2023 21:15:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 602FB60AE2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1686345301; bh=V2tDfDrjxxYsR6Z0FqipD9hLJNJu5pRhUJFuPOtpqck=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=zWcV0irdWp5jkXwktQVj5uZn1FStOIaEXGaCAJvYVNmVPpscY7+UqBmi7nVmhPbOx syOI0HQa+f1pT7uLVCILf4smG9RlI1A53JTiPxWLsaQmyQwQZUpK112QbOUiJtGIYW qzViZFtvaok/hciig0c+YJBYwk+o8oYq8nuDkZYeOt3HMYHgeWAlEhFAUKMjUyETFX uO5u5tCm3KV32oxNYRoTHnEKr2CDrk1Lm3522JAkHGy9gmzFJ4UAaSTALoHD5tCvLb bG+uKBMNvkZ9BidjMTQ4gt0AqtfTUrIF3Oxoe09mXYVAnzBOInssIR0YY9qFKq1QVn sy16pYQeNoxGw== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fTDqkjNbbe32; Fri, 9 Jun 2023 21:15:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 6C60560BAB; Fri, 9 Jun 2023 21:15:00 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 6C60560BAB Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id A13E81BF420 for ; Fri, 9 Jun 2023 21:14:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 77AFB60B74 for ; Fri, 9 Jun 2023 21:14:50 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 77AFB60B74 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xiWTeGcoqEGR for ; Fri, 9 Jun 2023 21:14:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org BA03760AE2 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by smtp3.osuosl.org (Postfix) with ESMTPS id BA03760AE2 for ; Fri, 9 Jun 2023 21:14:49 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6600,9927,10736"; a="356583191" X-IronPort-AV: E=Sophos;i="6.00,230,1681196400"; d="scan'208";a="356583191" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2023 14:14:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10736"; a="823194637" X-IronPort-AV: E=Sophos;i="6.00,230,1681196400"; d="scan'208";a="823194637" Received: from dmert-dev.jf.intel.com ([10.166.241.14]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2023 14:14:48 -0700 From: Dave Ertman To: intel-wired-lan@lists.osuosl.org Date: Fri, 9 Jun 2023 14:16:23 -0700 Message-Id: <20230609211626.621968-8-david.m.ertman@intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230609211626.621968-1-david.m.ertman@intel.com> References: <20230609211626.621968-1-david.m.ertman@intel.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686345289; x=1717881289; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZcktkyReBoekPCrncd60liaRlzuPJdhoC9sOwTVQHXw=; b=mgcZtvJa8W30WjI/nHHuBdFiq3qu09ILiajXDo62LyBDhlTjVxJaHf0q DjnBgdJW4P6hRmKN98vO2CqNNDAlVyj6fLjFQi3gH6ZS1M8/2wSPz5sYQ ZPafAu/0656y+WrLanoCHxpRXKAmxqfoiSk2g+ZgRdVYyETSa8VbB/dvY 5r33s351oh+J6nFXcVR4vNUyG7civ40iXhrYSs5KigXHva8VZi/n245CJ 8P8sjA5adungfJeiZLYvE2r7+Y++QhL+Bljj+ZOZ+yy50ErhHwbWBVKzF 7HuuKDidLl3T7cKynQmra2yKN7wU7gmNfLknwpws5V7OIZVOu9gvCL46F g==; X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=mgcZtvJa Subject: [Intel-wired-lan] [PATCH iwl-next v4 07/10] ice: support non-standard teardown of bond interface X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: simon.horman@corigine.com, daniel.machon@microchip.com, netdev@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Code for supporting removal of the PF driver (NETDEV_UNREGISTER) events for both when the bond has the primary interface as active and when failed over to thew secondary interface. Reviewed-by: Daniel Machon Signed-off-by: Dave Ertman --- drivers/net/ethernet/intel/ice/ice_lag.c | 47 ++++++++++++++++++++---- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c index 1faf4343935e..9e685ee1a181 100644 --- a/drivers/net/ethernet/intel/ice/ice_lag.c +++ b/drivers/net/ethernet/intel/ice/ice_lag.c @@ -1183,15 +1183,16 @@ static void ice_lag_changeupper_event(struct ice_lag *lag, void *ptr) if (!primary_lag && lag->primary) primary_lag = lag; - if (primary_lag) { - if (!lag->primary) { - ice_lag_set_swid(0, lag, false); - } else { + if (!lag->primary) { + ice_lag_set_swid(0, lag, false); + } else { + if (primary_lag && lag->primary) { ice_lag_primary_swid(lag, false); ice_lag_del_prune_list(primary_lag, lag->pf); } - ice_lag_cfg_cp_fltr(lag, false); } + /* remove filter for control packets */ + ice_lag_cfg_cp_fltr(lag, false); } } @@ -1399,6 +1400,38 @@ ice_lag_chk_comp(struct ice_lag *lag, void *ptr) static void ice_lag_unregister(struct ice_lag *lag, struct net_device *event_netdev) { + struct ice_netdev_priv *np; + struct ice_pf *event_pf; + struct ice_lag *p_lag; + + p_lag = ice_lag_find_primary(lag); + np = netdev_priv(event_netdev); + event_pf = np->vsi->back; + + if (p_lag) { + if (p_lag->active_port != p_lag->pf->hw.port_info->lport && + p_lag->active_port != ICE_LAG_INVALID_PORT) { + struct ice_hw *active_hw; + + active_hw = ice_lag_find_hw_by_lport(lag, + p_lag->active_port); + if (active_hw) + ice_lag_reclaim_vf_nodes(p_lag, active_hw); + lag->active_port = ICE_LAG_INVALID_PORT; + } + } + + /* primary processing for primary */ + if (lag->primary && lag->netdev == event_netdev) + ice_lag_primary_swid(lag, false); + + /* primary processing for secondary */ + if (lag->primary && lag->netdev != event_netdev) + ice_lag_del_prune_list(lag, event_pf); + + /* secondary processing for secondary */ + if (!lag->primary && lag->netdev == event_netdev) + ice_lag_set_swid(0, lag, false); } /** @@ -1444,8 +1477,8 @@ static void ice_lag_process_event(struct work_struct *work) case NETDEV_UNREGISTER: if (ice_is_feature_supported(pf, ICE_F_SRIOV_LAG)) { netdev = lag_work->info.bonding_info.info.dev; - if (netdev == lag_work->lag->netdev && - lag_work->lag->bonded) + if ((netdev == lag_work->lag->netdev || + lag_work->lag->primary) && lag_work->lag->bonded) ice_lag_unregister(lag_work->lag, netdev); } break; -- 2.40.1 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan