From patchwork Wed Jun 5 14:17:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Szycik X-Patchwork-Id: 1943877 X-Patchwork-Delegate: anthony.l.nguyen@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=gQieh1sD; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VvTym3FFKz20WK for ; Thu, 6 Jun 2024 00:16:00 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 93E7F610FE; Wed, 5 Jun 2024 14:15:58 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Q_m3kRDe8lnd; Wed, 5 Jun 2024 14:15:56 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org C586B610BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1717596956; bh=UWGILxHigLUFmKycJwtDRjY4irgf/oAJBi97/+KqI7g=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=gQieh1sDRvFFKDpdYV4vhe6EdwhAEqgYIWcTuR29fYZTl5NNU9S5XqxXnf000ghFb BcOzyQ3/v+5lb9BgHkHcUlbMWa0hehgyOegAXewo0QBfDozvAlaIOig5cyYKVGQaEU wFKckHSsKWaK/Tb0S9AiUFymsv0JjKt/1F5X7Dvf6Zkmeac/YyVLgXB9keANHk1hhk oVepvd57DtqnsPl8OS6xOMIFS7TATkM5GBcpTKKa59lVK1vXW9Z3bAQ8L9Et2K6bFZ ZikU1ZaS0Wr7w8AEvPBcscq6OUr9nO7M+fORvjvBiorbqAhYYzR92s5iBfZHUsSzdr NOpk7pFU+1b8A== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id C586B610BD; Wed, 5 Jun 2024 14:15:56 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 6C9CA1BF23C for ; Wed, 5 Jun 2024 14:15:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 6526C40B83 for ; Wed, 5 Jun 2024 14:15:55 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 2SJsFYVo5Evf for ; Wed, 5 Jun 2024 14:15:54 +0000 (UTC) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=198.175.65.20; helo=mgamail.intel.com; envelope-from=marcin.szycik@linux.intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 080B540AF9 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 080B540AF9 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by smtp2.osuosl.org (Postfix) with ESMTPS id 080B540AF9 for ; Wed, 5 Jun 2024 14:15:53 +0000 (UTC) X-CSE-ConnectionGUID: LxqCkLmyRxiHjtvKAUFLYQ== X-CSE-MsgGUID: uy4u1XQ2QSmqhnO0htE2fA== X-IronPort-AV: E=McAfee;i="6600,9927,11093"; a="14052654" X-IronPort-AV: E=Sophos;i="6.08,216,1712646000"; d="scan'208";a="14052654" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2024 07:15:53 -0700 X-CSE-ConnectionGUID: NdV6qpahS1yE7X3L5n8ZlQ== X-CSE-MsgGUID: w6mSOVe0RnWzAhH1SkiS1A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,216,1712646000"; d="scan'208";a="38177138" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by orviesa008.jf.intel.com with ESMTP; 05 Jun 2024 07:15:51 -0700 Received: from mystra-4.igk.intel.com (mystra-4.igk.intel.com [10.123.220.40]) by irvmail002.ir.intel.com (Postfix) with ESMTP id CDB0F33BC3; Wed, 5 Jun 2024 15:15:49 +0100 (IST) From: Marcin Szycik To: intel-wired-lan@lists.osuosl.org Date: Wed, 5 Jun 2024 16:17:45 +0200 Message-ID: <20240605141744.601582-2-marcin.szycik@linux.intel.com> X-Mailer: git-send-email 2.45.0 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=1717596955; x=1749132955; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=qNGcKSHzMUHaoXNNVdVj1QrqBWKJMJw+NEabirszjXc=; b=Qk20v7fTas3R2FednNJLXg1tsq6HULvCVmXlTnxaomMt1ANTNUM9Mcoe 3despyuDJvNZ+oE5ioaCNLJ3IdnLyjH72KMOkP4ESwFz35kw0QFYGQTHx PO7pJm8Wxe5dKDBLWMYiCgLabY0zb7kMJ8ck3ALzD1lxUFQ6mCyF+eqz6 cNUgShowPbVsBx1bTreewcsFGe1fhswWBqUyoHYQad7O2EoIcVQwOlMuL M3r/xVWtjjQ2465obQiPnwBHVtKoaOIfLGPWHLYfveak2KqAEkpoBmrvX 1LqTrey8ajMw+VyCTPtk0qFzxw6NqlJVEC7qqA+etO1Hg+FRphtC9R6zZ w==; X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=none (p=none dis=none) header.from=linux.intel.com X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Qk20v7fT Subject: [Intel-wired-lan] [PATCH iwl-net] ice: Fix VSI list rule with ICE_SW_LKUP_LAST type 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: netdev@vger.kernel.org, Marcin Szycik , Przemek Kitszel , Michal Swiatkowski Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Adding/updating VSI list rule, as well as allocating/freeing VSI list resource are called several times with type ICE_SW_LKUP_LAST, which fails because ice_update_vsi_list_rule() and ice_aq_alloc_free_vsi_list() consider it invalid. Allow calling these functions with ICE_SW_LKUP_LAST. This fixes at least one issue in switchdev mode, where the same rule with different action cannot be added, e.g.: tc filter add dev $PF1 ingress protocol arp prio 0 flower skip_sw \ dst_mac ff:ff:ff:ff:ff:ff action mirred egress redirect dev $VF1_PR tc filter add dev $PF1 ingress protocol arp prio 0 flower skip_sw \ dst_mac ff:ff:ff:ff:ff:ff action mirred egress redirect dev $VF2_PR Fixes: 0f94570d0cae ("ice: allow adding advanced rules") Suggested-by: Michal Swiatkowski Reviewed-by: Michal Swiatkowski Reviewed-by: Przemek Kitszel Signed-off-by: Marcin Szycik Reviewed-by: Jacob Keller Reviewed-by: Simon Horman Tested-by: Sujai Buvaneswaran --- drivers/net/ethernet/intel/ice/ice_switch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c index 94d6670d0901..1191031b2a43 100644 --- a/drivers/net/ethernet/intel/ice/ice_switch.c +++ b/drivers/net/ethernet/intel/ice/ice_switch.c @@ -1899,7 +1899,8 @@ ice_aq_alloc_free_vsi_list(struct ice_hw *hw, u16 *vsi_list_id, lkup_type == ICE_SW_LKUP_ETHERTYPE_MAC || lkup_type == ICE_SW_LKUP_PROMISC || lkup_type == ICE_SW_LKUP_PROMISC_VLAN || - lkup_type == ICE_SW_LKUP_DFLT) { + lkup_type == ICE_SW_LKUP_DFLT || + lkup_type == ICE_SW_LKUP_LAST) { sw_buf->res_type = cpu_to_le16(ICE_AQC_RES_TYPE_VSI_LIST_REP); } else if (lkup_type == ICE_SW_LKUP_VLAN) { if (opc == ice_aqc_opc_alloc_res) @@ -2922,7 +2923,8 @@ ice_update_vsi_list_rule(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi, lkup_type == ICE_SW_LKUP_ETHERTYPE_MAC || lkup_type == ICE_SW_LKUP_PROMISC || lkup_type == ICE_SW_LKUP_PROMISC_VLAN || - lkup_type == ICE_SW_LKUP_DFLT) + lkup_type == ICE_SW_LKUP_DFLT || + lkup_type == ICE_SW_LKUP_LAST) rule_type = remove ? ICE_AQC_SW_RULES_T_VSI_LIST_CLEAR : ICE_AQC_SW_RULES_T_VSI_LIST_SET; else if (lkup_type == ICE_SW_LKUP_VLAN)