From patchwork Wed Jan 24 08:55:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kurt Kanzenbach X-Patchwork-Id: 13528814 X-Patchwork-Delegate: kuba@kernel.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 0270317BAC for ; Wed, 24 Jan 2024 08:56:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706086566; cv=none; b=dienZG5KwxPoNxI2diaPThXLCIWYFdagyL2Nixi7ohag3pxMnMtAN/xlJaUHnz/MID0r6vG1+kdfNGoY+tirOfzS0OEC/iAYzvJbpx1vL79AXoNOjW3MvMOIwLruv7F6iDG2e9u/omaO+LiQVC4n2514s5QeYbYfFLXo1ou63R4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706086566; c=relaxed/simple; bh=EpdHP0d35MbmVpnaWu4SzTREv63NRcNTmug6R29HWX8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=H82YOJGBJtvJsOgbclxXzy1dQEsnLYNp5t3oc8Mi3+SfTyPjqHjPLP5AYhp2MS5pGLLUP80pCpsW2V4HiBN232A10ZyYay6QpbGJePuuDbuX4/aqLqegcafftBXgK0gIFVbcL+rBohn0BOoWwoB2452/4Fovp0bBq8JP3gEXTY8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=LCupJw2w; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=vKSFO5kU; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LCupJw2w"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="vKSFO5kU" From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706086562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PpWQWJpYkDehFFRYCFWE0+2P1/XzZiBiXbECZUVKFfQ=; b=LCupJw2wd2gwM0FwNCEw8xXbBGMOielC/9ZpbF384ybJCD0+NqeQ/s9llYPJKm9bCoNLq+ WxQCdx4q7ElipFh6WilDeo+bleSwVxK5zwp4IsimIldyWlPAJglbgs/2HPOQ4EeOYIBwMa 5QO0vmLcU4twMVUovnTE6Cfch3+xIpE48rY9GWCkmLlq8K19unO4NWYoovp9OsK+ex5p2q KoS9pIfl2SjgmXk1dHMyE9kD5YuIiL0c07Y9gsifMjXGhq6Z/SM1nhPC7TzPG09KP8yAon RkXYAIlLA7Tx0RmxK3qsyms1TRR5DMEmKfG5YqzK9Z/Yh/6r1TDOncUmFd8Y9g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706086562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PpWQWJpYkDehFFRYCFWE0+2P1/XzZiBiXbECZUVKFfQ=; b=vKSFO5kUm6ModsdQyN1FFAPp/jKtL2kasnvIC722qkxgnNRvODuxCXHZBbYw97Zs7H5Jfu w/fNVaragIb05ABA== To: Jesse Brandeburg , Tony Nguyen , Vinicius Costa Gomes Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, Sebastian Andrzej Siewior , Kurt Kanzenbach Subject: [PATCH v2 iwl-next 1/3] igc: Use reverse xmas tree Date: Wed, 24 Jan 2024 09:55:30 +0100 Message-Id: <20240124085532.58841-2-kurt@linutronix.de> In-Reply-To: <20240124085532.58841-1-kurt@linutronix.de> References: <20240124085532.58841-1-kurt@linutronix.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Use reverse xmas tree coding style convention in igc_add_flex_filter(). Signed-off-by: Kurt Kanzenbach Acked-by: Vinicius Costa Gomes Reviewed-by: Simon Horman Tested-by: Naama Meir --- drivers/net/ethernet/intel/igc/igc_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index ba8d3fe186ae..4b3faa9a667f 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -3577,9 +3577,9 @@ static bool igc_flex_filter_in_use(struct igc_adapter *adapter) static int igc_add_flex_filter(struct igc_adapter *adapter, struct igc_nfc_rule *rule) { - struct igc_flex_filter flex = { }; struct igc_nfc_filter *filter = &rule->filter; unsigned int eth_offset, user_offset; + struct igc_flex_filter flex = { }; int ret, index; bool vlan; From patchwork Wed Jan 24 08:55:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kurt Kanzenbach X-Patchwork-Id: 13528816 X-Patchwork-Delegate: kuba@kernel.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 6888717BB6 for ; Wed, 24 Jan 2024 08:56:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706086567; cv=none; b=lIhkdIKxDP2FZcco4ToUemarTAR6gbNUr/g+uIB9/zOIpHDe9GDKWR6C8Dir7D/J7b5INrd2L5sNPTmBOwV5HvYGyhBEFY3ICUMAAqlPgrcbBcVJM8pAmprMuBFtCMyo3PVIMkpjJRkS3JVRNpY6m3hAyVu83FS+sBwqS1cZg14= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706086567; c=relaxed/simple; bh=IOdKibBQ+8O2RWmV4910fyuP4GcLrceVx6ah6XzDV2Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=c6lxPrgls/LNoI1hdXJHS+oC6RmmucQ3U/ySo5Xrp13QFS7RY/vIoiPtOpchqMwxmP5F+LUdrVn7uPSt8CGH4qXFw10N5PToJ4er+0Ge3ZZrSUxAt+2hgKRRJC5MXLqQ/g/KZRf9ctZKgo+IevtQk5/t9RZzAOEULlmjbfmbwc4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=SODs8+U1; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=BnwoQDZF; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="SODs8+U1"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="BnwoQDZF" From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706086562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P3HgGTMv08xeDMeml7R7w42+BDzLJstFhSWbIhGezfY=; b=SODs8+U1XnNNUCJf54MPvol50AGE64Rq55Au6H3r98xLeOTeNOwf7vUKW+uHKOduXoN735 sQK7bkAUBLVTGbd71vnhumYLmv8GWH3moh6OSryMuuzVzzrJWSMOU6H6NOon5zqxCOGJgK /FZWGakGGp+/uqKegJ3fl64N4n6uO21BIAzUnYko6p+JtKw5OQ7ijIYGhDdmGNhw81u9lu ZlvLPD6knca3sa+1f5GblvUzLQQjRbq752gg2bARTH3af7P6OfZUgSkS6BQdamDPXFQvVI bgU/6UPsEm7UCzPnjJ5OkNchMvHznIkiKXRWxLxex2cfkNOuNtTWd2giz6uv+Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706086562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P3HgGTMv08xeDMeml7R7w42+BDzLJstFhSWbIhGezfY=; b=BnwoQDZFoiM6N6Lox0rMRqu5K1QxRjEjJZKH+ebiNAdbRba4DCH8RjidNm+wtXa/BpenoN sMktwdJoZPs65jCw== To: Jesse Brandeburg , Tony Nguyen , Vinicius Costa Gomes Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, Sebastian Andrzej Siewior , Kurt Kanzenbach Subject: [PATCH v2 iwl-next 2/3] igc: Use netdev printing functions for flex filters Date: Wed, 24 Jan 2024 09:55:31 +0100 Message-Id: <20240124085532.58841-3-kurt@linutronix.de> In-Reply-To: <20240124085532.58841-1-kurt@linutronix.de> References: <20240124085532.58841-1-kurt@linutronix.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org All igc filter implementations use netdev_*() printing functions except for the flex filters. Unify it. Signed-off-by: Kurt Kanzenbach Acked-by: Vinicius Costa Gomes Reviewed-by: Simon Horman Tested-by: Naama Meir --- drivers/net/ethernet/intel/igc/igc_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 4b3faa9a667f..91297b561519 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -3385,7 +3385,7 @@ static int igc_flex_filter_select(struct igc_adapter *adapter, u32 fhftsl; if (input->index >= MAX_FLEX_FILTER) { - dev_err(&adapter->pdev->dev, "Wrong Flex Filter index selected!\n"); + netdev_err(adapter->netdev, "Wrong Flex Filter index selected!\n"); return -EINVAL; } @@ -3420,7 +3420,6 @@ static int igc_flex_filter_select(struct igc_adapter *adapter, static int igc_write_flex_filter_ll(struct igc_adapter *adapter, struct igc_flex_filter *input) { - struct device *dev = &adapter->pdev->dev; struct igc_hw *hw = &adapter->hw; u8 *data = input->data; u8 *mask = input->mask; @@ -3434,7 +3433,7 @@ static int igc_write_flex_filter_ll(struct igc_adapter *adapter, * out early to avoid surprises later. */ if (input->length % 8 != 0) { - dev_err(dev, "The length of a flex filter has to be 8 byte aligned!\n"); + netdev_err(adapter->netdev, "The length of a flex filter has to be 8 byte aligned!\n"); return -EINVAL; } @@ -3504,8 +3503,8 @@ static int igc_write_flex_filter_ll(struct igc_adapter *adapter, } wr32(IGC_WUFC, wufc); - dev_dbg(&adapter->pdev->dev, "Added flex filter %u to HW.\n", - input->index); + netdev_dbg(adapter->netdev, "Added flex filter %u to HW.\n", + input->index); return 0; } From patchwork Wed Jan 24 08:55:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kurt Kanzenbach X-Patchwork-Id: 13528815 X-Patchwork-Delegate: kuba@kernel.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 6E93517BBE for ; Wed, 24 Jan 2024 08:56:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706086566; cv=none; b=AJPq2OswKYZnfddl/+h2oqIgBwYXkmydVYTdUsaVwjuMv4aeLP+2TMcd2eB501hG5PbKLtjIXTKJmyXeYW1Zv6jDSo1JiIKWyCxHBU4VXQQgAXNnNhgSnUlIKF6SFwiLinNm0CmgNsis/f2KIPU4Cu9u9/RDWcKzpCwK+sEcTZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706086566; c=relaxed/simple; bh=xkpkkpnHRvJA8bXt7lVbIbvKMVPaTud/waVaeW7Nd0Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IDvfHdrNQlqXGObdESM8oeC3OlGFiTnlaQFgUNzwiWY6fbPK3gJuzAiObTgtHliGKD9iA8r8rH9Cx0U2eibG6paYYrZ5TLhF+AntpIjZvtxq/gw1nF7u+1D3fxzsAtDS8mU6qPTy7inXd6awlva3CXT66VzBRsGiRpQhjuEGA4c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=uFfhancB; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=55cjuQvq; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="uFfhancB"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="55cjuQvq" From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706086563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kPp/GAzZVwAUR9vHijxX4z+k+otb1xET3AboSXDsuRo=; b=uFfhancB2J/PFjmfaDHHf4LguVOx++PDLyn3pgraHfLAHnXIJcGpHtvceddr4AhXNcqCc0 YjsTNh5kF8LQRlekotu5YswL6HhYFn9rYhSbirzhifpfZVkBflrXfpPga7DmFF46NN4CXQ PXLSAv3G9lKgcy/pDvc4H5jmsBO/gLkOgWZer3Q0xIwo+2akk+SVD48OCD/n+gMDaCwCWS on4tZsUOOXlvg6ABu0ou5NgfH5HIRdGvYzlf9ZT2QDDPaU3RdaV2iqMTv4RW9OHKHhah7+ jJs41mT0t+2hH7RTjgsKoBkB3M8j5kXmYCQvjqb9ajbgq5BpegA9fzxSSqcYYQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706086563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kPp/GAzZVwAUR9vHijxX4z+k+otb1xET3AboSXDsuRo=; b=55cjuQvqOP2lMJedsCpYr0aIw73IUJWo4bHquqqrE8FxxIqkE6zF+1U655/ej6Ow3Tk4rV NYP6+Yw320iLXFCg== To: Jesse Brandeburg , Tony Nguyen , Vinicius Costa Gomes Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, Sebastian Andrzej Siewior , Kurt Kanzenbach Subject: [PATCH v2 iwl-next 3/3] igc: Unify filtering rule fields Date: Wed, 24 Jan 2024 09:55:32 +0100 Message-Id: <20240124085532.58841-4-kurt@linutronix.de> In-Reply-To: <20240124085532.58841-1-kurt@linutronix.de> References: <20240124085532.58841-1-kurt@linutronix.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org All filtering parameters such as EtherType and VLAN TCI are stored in host byte order except for the VLAN EtherType. Unify it. Signed-off-by: Kurt Kanzenbach Acked-by: Vinicius Costa Gomes Reviewed-by: Simon Horman Tested-by: Naama Meir --- drivers/net/ethernet/intel/igc/igc.h | 2 +- drivers/net/ethernet/intel/igc/igc_ethtool.c | 4 ++-- drivers/net/ethernet/intel/igc/igc_main.c | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h index 45430e246e9c..158adb1594e9 100644 --- a/drivers/net/ethernet/intel/igc/igc.h +++ b/drivers/net/ethernet/intel/igc/igc.h @@ -585,7 +585,7 @@ enum igc_filter_match_flags { struct igc_nfc_filter { u8 match_flags; u16 etype; - __be16 vlan_etype; + u16 vlan_etype; u16 vlan_tci; u16 vlan_tci_mask; u8 src_addr[ETH_ALEN]; diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c index b95d2c86e803..d31a6f027c83 100644 --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c @@ -981,7 +981,7 @@ static int igc_ethtool_get_nfc_rule(struct igc_adapter *adapter, if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_ETYPE) { fsp->flow_type |= FLOW_EXT; - fsp->h_ext.vlan_etype = rule->filter.vlan_etype; + fsp->h_ext.vlan_etype = htons(rule->filter.vlan_etype); fsp->m_ext.vlan_etype = ETHER_TYPE_FULL_MASK; } @@ -1249,7 +1249,7 @@ static void igc_ethtool_init_nfc_rule(struct igc_nfc_rule *rule, /* VLAN etype matching */ if ((fsp->flow_type & FLOW_EXT) && fsp->h_ext.vlan_etype) { - rule->filter.vlan_etype = fsp->h_ext.vlan_etype; + rule->filter.vlan_etype = ntohs(fsp->h_ext.vlan_etype); rule->filter.match_flags |= IGC_FILTER_FLAG_VLAN_ETYPE; } diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 91297b561519..c3fe62813f43 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -3614,10 +3614,12 @@ static int igc_add_flex_filter(struct igc_adapter *adapter, ETH_ALEN, NULL); /* Add VLAN etype */ - if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_ETYPE) - igc_flex_filter_add_field(&flex, &filter->vlan_etype, 12, - sizeof(filter->vlan_etype), - NULL); + if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_ETYPE) { + __be16 vlan_etype = cpu_to_be16(filter->vlan_etype); + + igc_flex_filter_add_field(&flex, &vlan_etype, 12, + sizeof(vlan_etype), NULL); + } /* Add VLAN TCI */ if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI)