From patchwork Wed Feb 28 15:59:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larysa Zaremba X-Patchwork-Id: 207906 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3442456dyb; Wed, 28 Feb 2024 08:06:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV+O/zAJQbbGOpXW9GCXqYAHE7rm5bqkm/rcjGQ5+SLFUYFj+ZTr+IMfySx7OCiccSc3+8M0zSxSjMMyv9K2m4lq8dGyg== X-Google-Smtp-Source: AGHT+IHrthVU7gSiEsPrYpEFQaXxJAncqmgPryKgIrKD8sjdz5va6FjGk3H2vHzgFnl2OW0Y3t+S X-Received: by 2002:a05:6359:4588:b0:17b:571e:b507 with SMTP id no8-20020a056359458800b0017b571eb507mr16640438rwb.4.1709136391723; Wed, 28 Feb 2024 08:06:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709136391; cv=pass; d=google.com; s=arc-20160816; b=JWf0E2HSjnXtVFB02z+OHBTtk9M8n4H2kwxBU+bWAILYQqlWFgKl8dEdOw2//sGx+5 /mzHd37dx4Y/1L+TWPZWWEixYdUmnMjh/ccA6omTHkhyQzHhTxTtoWzLH7LMoxz4VXa6 /WV+WtdsHQHDKpUvonWHUej0SB0GhzfhyDIjSfEv99upyumLIMch2/4uOf2lJoeZ/lCs EzF+BXuKlVVHvrWZ0SwFv2L0NRdCSiQw2yw2+YCRpbKBekHxGPZ9/EFUqq6W9INMVjZu /AB4Vz9WXUAolxYJTztjH4TFsrTwjcQpyGS/wKxmRdEnBdEpHwFxd/+lITyiyFfXuXBP MeMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=gC9DWd/VFnGYj2PYaWvqnwuz3ak6t7n9xovrBIk2kyA=; fh=XF5dR1hZ6bmHhiCesO+5NPfXhTaDjas2E0STvyrxXLQ=; b=fJzNEoc4656gZ1+Rn8Ok83Tdy3LEdOXWiAUTJpREv1g4mm9BtSE/UxKYStH1sW4r8e pxTpOzdyVwvBSVDtSN2AROdYdQw9xW9RUiG59a87lBwsrYOYbOmVPUPPEK5ljJfJmEBV dH5oZ0LFAFNOBS4MjI+RNl3H/Jakxh8TQkFDd5EAe47n4B4jqeQrOg6IrzTyRxcZRSke lFGfO8xF5Toy5IHBLbE/bLSyGSpj4AuBUBye3gGXT41FxoqmjjCLAp8nWdLotwkATEqo XqW4qObgRgQR9yv778otx/3c0GqR5oJqSOzUfaw0RtQj3or3Xf9YgHn7wZn0//cAV/Me 9iHA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lI0S+4B7; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85319-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85319-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d10-20020ac85d8a000000b0042e74a36807si10499961qtx.555.2024.02.28.08.06.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 08:06:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85319-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lI0S+4B7; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85319-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85319-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3FA151C26213 for ; Wed, 28 Feb 2024 16:05:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 98402163A97; Wed, 28 Feb 2024 16:04:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="lI0S+4B7" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A3D515E5DD; Wed, 28 Feb 2024 16:04:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709136264; cv=none; b=WFDvYLIB9r8S4zsMOVV7nvAlBzq3VENk0HcqmJDFxQFajEwuquOcYW80O//WxDJbt3KOUjtZrWY/nyaMNzhZbF0MRinsB/Lwaj9UiymeBnXzbqTZihNc7wQYgChqh7/KhxdzaN+n0IVdcgcuQEAEr/ZouGe8F6V3FK8bQUwYIRM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709136264; c=relaxed/simple; bh=uZmeeZD3VWIvcaruww88Mst1ibscMXXKLJg4+styrpY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mNpEmRmPongRRYWcy4U7qbJQGsKp4vXuDrzJsezdsCQFpWN2LA+/Px3R4vtf/etkTnr8Ay8bOovoAG8dHxt0FuinSdLqKGY3jMw1B4Dkui3VRS5m1kztKiaWArOiJwJJ5ZmmjapCsV6XqQk4Qzjc6CnlVLeNUGtOwTVYbI20zdE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=lI0S+4B7; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709136262; x=1740672262; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uZmeeZD3VWIvcaruww88Mst1ibscMXXKLJg4+styrpY=; b=lI0S+4B7cxeuLuzbA68hlJ6rLR0LXZYOFQcjhBs6T76QVLTKbdKoIIcJ Ywc2LW8ymOHgwGAT56dNUki9XlViBxVWgB500Scy65Lk5NubMT2JPwWIb 4DV2/wzaOPSs2D/y2I4BNhBRkSuI1CuKe9t0Z7pinvTCUKEAqTlM/qCD+ suXQeSir30CzLnAKJyXQSlN9328205k74J/KD1H/wgUeBaKpOxahUA4ii 0YQ0N3llMtoDjiwM5VGEa5IxFRq9YWxuPOBy+++ZfxjLjd1FGYplv03s6 Xur3CsSQvfqBqajR4Sz/XXmFoz6b0xsRFkOLoAlAM9rxvLXBySMe/ldKo g==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="3706623" X-IronPort-AV: E=Sophos;i="6.06,190,1705392000"; d="scan'208";a="3706623" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 08:04:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,190,1705392000"; d="scan'208";a="7527778" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by orviesa009.jf.intel.com with ESMTP; 28 Feb 2024 08:04:14 -0800 Received: from lincoln.igk.intel.com (lincoln.igk.intel.com [10.102.21.235]) by irvmail002.ir.intel.com (Postfix) with ESMTP id 0D7E536820; Wed, 28 Feb 2024 16:04:11 +0000 (GMT) From: Larysa Zaremba To: intel-wired-lan@lists.osuosl.org Cc: Larysa Zaremba , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Mateusz Pacuszka , Tony Nguyen , Lukasz Plachno , Jakub Buchocki , Pawel Kaminski , Przemek Kitszel , Michal Swiatkowski , Mateusz Polchlopek , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Pawel Chmielewski , Jesse Brandeburg Subject: [PATCH iwl-net 3/5] ice: Do not add LLDP-specific filter Date: Wed, 28 Feb 2024 16:59:47 +0100 Message-ID: <20240228155957.408036-4-larysa.zaremba@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240228155957.408036-1-larysa.zaremba@intel.com> References: <20240228155957.408036-1-larysa.zaremba@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792159401081531955 X-GMAIL-MSGID: 1792159401081531955 Commit 34295a3696fbd0d90ee7 ("ice: implement new LLDP filter command") has introduced the ability to use LLDP-specific filter that directs all LLDP traffic to a single VSI. However, current goal is for all trusted VFs to be able to see LLDP neighbors. Therefore, replace the functionality with previously used generic ethernet protocol filter. The command was added as a way to solve an "issue with some NVMs where an already existent LLDP filter is blocking the creation of a filter to allow LLDP packets". Preserve this utility and remove LLDP-specific filter before configuring another one. Signed-off-by: Larysa Zaremba --- .../net/ethernet/intel/ice/ice_adminq_cmd.h | 1 - drivers/net/ethernet/intel/ice/ice_common.c | 26 --------------- drivers/net/ethernet/intel/ice/ice_common.h | 2 -- drivers/net/ethernet/intel/ice/ice_lib.c | 33 +++++++++++++++---- 4 files changed, 26 insertions(+), 36 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h index 8040317c9561..2855c955d8b4 100644 --- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h @@ -1883,7 +1883,6 @@ struct ice_aqc_lldp_stop_start_specific_agent { /* LLDP Filter Control (direct 0x0A0A) */ struct ice_aqc_lldp_filter_ctrl { u8 cmd_flags; -#define ICE_AQC_LLDP_FILTER_ACTION_ADD 0x0 #define ICE_AQC_LLDP_FILTER_ACTION_DELETE 0x1 u8 reserved1; __le16 vsi_num; diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index 9266f25a9978..f5cca0e2ead6 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -5911,32 +5911,6 @@ bool ice_fw_supports_lldp_fltr_ctrl(struct ice_hw *hw) ICE_FW_API_LLDP_FLTR_PATCH); } -/** - * ice_lldp_fltr_add_remove - add or remove a LLDP Rx switch filter - * @hw: pointer to HW struct - * @vsi_num: absolute HW index for VSI - * @add: boolean for if adding or removing a filter - */ -int -ice_lldp_fltr_add_remove(struct ice_hw *hw, u16 vsi_num, bool add) -{ - struct ice_aqc_lldp_filter_ctrl *cmd; - struct ice_aq_desc desc; - - cmd = &desc.params.lldp_filter_ctrl; - - ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_filter_ctrl); - - if (add) - cmd->cmd_flags = ICE_AQC_LLDP_FILTER_ACTION_ADD; - else - cmd->cmd_flags = ICE_AQC_LLDP_FILTER_ACTION_DELETE; - - cmd->vsi_num = cpu_to_le16(vsi_num); - - return ice_aq_send_cmd(hw, &desc, NULL, 0, NULL); -} - /** * ice_lldp_execute_pending_mib - execute LLDP pending MIB request * @hw: pointer to HW struct diff --git a/drivers/net/ethernet/intel/ice/ice_common.h b/drivers/net/ethernet/intel/ice/ice_common.h index 32fd10de620c..900926e6414c 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.h +++ b/drivers/net/ethernet/intel/ice/ice_common.h @@ -267,8 +267,6 @@ int ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size, struct ice_sq_cd *cd); bool ice_fw_supports_lldp_fltr_ctrl(struct ice_hw *hw); -int -ice_lldp_fltr_add_remove(struct ice_hw *hw, u16 vsi_num, bool add); int ice_lldp_execute_pending_mib(struct ice_hw *hw); int ice_aq_read_i2c(struct ice_hw *hw, struct ice_aqc_link_topo_addr topo_addr, diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 60e0d824195e..a774bcdcc0c4 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -2039,6 +2039,27 @@ static void ice_vsi_set_tc_cfg(struct ice_vsi *vsi) ice_vsi_set_dcb_tc_cfg(vsi); } +/** + * ice_lldp_fltr_remove_from_port - Remove a LLDP Rx filter from the port + * @hw: port + * + * Remove a LLDP Rx switch filter from the port. For some NVMs, + * such leftover filter can prevent us from configuring another one. + */ +static void ice_lldp_fltr_remove_from_port(struct ice_hw *hw) +{ + struct ice_aqc_lldp_filter_ctrl *cmd; + struct ice_aq_desc desc; + + cmd = &desc.params.lldp_filter_ctrl; + + ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_filter_ctrl); + + cmd->cmd_flags = ICE_AQC_LLDP_FILTER_ACTION_DELETE; + + ice_aq_send_cmd(hw, &desc, NULL, 0, NULL); +} + /** * ice_cfg_sw_lldp - Config switch rules for LLDP packet handling * @vsi: the VSI being configured @@ -2060,13 +2081,11 @@ void ice_cfg_sw_lldp(struct ice_vsi *vsi, bool tx, bool create) status = eth_fltr(vsi, ETH_P_LLDP, ICE_FLTR_TX, ICE_DROP_PACKET); } else { - if (ice_fw_supports_lldp_fltr_ctrl(&pf->hw)) { - status = ice_lldp_fltr_add_remove(&pf->hw, vsi->vsi_num, - create); - } else { - status = eth_fltr(vsi, ETH_P_LLDP, ICE_FLTR_RX, - ICE_FWD_TO_VSI); - } + if (create && ice_fw_supports_lldp_fltr_ctrl(&pf->hw)) + ice_lldp_fltr_remove_from_port(&vsi->back->hw); + + status = eth_fltr(vsi, ETH_P_LLDP, ICE_FLTR_RX, + ICE_FWD_TO_VSI); } if (status)