stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Wentao Jia <wentao.jia@corigine.com>,
	Simon Horman <simon.horman@corigine.com>,
	Louis Peens <louis.peens@corigine.com>,
	Jakub Kicinski <kuba@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.15 40/76] nfp: flower: add goto_chain_index for ct entry
Date: Wed, 13 Mar 2024 12:41:47 -0400	[thread overview]
Message-ID: <20240313164223.615640-41-sashal@kernel.org> (raw)
In-Reply-To: <20240313164223.615640-1-sashal@kernel.org>

From: Wentao Jia <wentao.jia@corigine.com>

[ Upstream commit 3e44d19934b92398785b3ffc2353b9eba264140e ]

The chain_index has different means in pre ct entry and post ct entry.
In pre ct entry, it means chain index, but in post ct entry, it means
goto chain index, it is confused.

chain_index and goto_chain_index may be present in one flow rule, It
cannot be distinguished by one field chain_index, both chain_index
and goto_chain_index are required in the follow-up patch to support
multiple ct zones

Another field goto_chain_index is added to record the goto chain index.
If no goto action in post ct entry, goto_chain_index is 0.

Signed-off-by: Wentao Jia <wentao.jia@corigine.com>
Acked-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Louis Peens <louis.peens@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: cefa98e806fd ("nfp: flower: add hardware offload check for post ct entry")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/netronome/nfp/flower/conntrack.c | 8 ++++++--
 drivers/net/ethernet/netronome/nfp/flower/conntrack.h | 2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
index fc17e9b11d19d..0a5592b12e2d1 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
@@ -1004,7 +1004,7 @@ static int nfp_ct_do_tc_merge(struct nfp_fl_ct_zone_entry *zt,
 	/* Checks that the chain_index of the filter matches the
 	 * chain_index of the GOTO action.
 	 */
-	if (post_ct_entry->chain_index != pre_ct_entry->chain_index)
+	if (post_ct_entry->chain_index != pre_ct_entry->goto_chain_index)
 		return -EINVAL;
 
 	err = nfp_ct_merge_check(post_ct_entry, pre_ct_entry);
@@ -1450,7 +1450,8 @@ int nfp_fl_ct_handle_pre_ct(struct nfp_flower_priv *priv,
 	if (IS_ERR(ct_entry))
 		return PTR_ERR(ct_entry);
 	ct_entry->type = CT_TYPE_PRE_CT;
-	ct_entry->chain_index = ct_goto->chain_index;
+	ct_entry->chain_index = flow->common.chain_index;
+	ct_entry->goto_chain_index = ct_goto->chain_index;
 	list_add(&ct_entry->list_node, &zt->pre_ct_list);
 	zt->pre_ct_count++;
 
@@ -1473,6 +1474,7 @@ int nfp_fl_ct_handle_post_ct(struct nfp_flower_priv *priv,
 	struct nfp_fl_ct_zone_entry *zt;
 	bool wildcarded = false;
 	struct flow_match_ct ct;
+	struct flow_action_entry *ct_goto;
 
 	flow_rule_match_ct(rule, &ct);
 	if (!ct.mask->ct_zone) {
@@ -1497,6 +1499,8 @@ int nfp_fl_ct_handle_post_ct(struct nfp_flower_priv *priv,
 
 	ct_entry->type = CT_TYPE_POST_CT;
 	ct_entry->chain_index = flow->common.chain_index;
+	ct_goto = get_flow_act(flow->rule, FLOW_ACTION_GOTO);
+	ct_entry->goto_chain_index = ct_goto ? ct_goto->chain_index : 0;
 	list_add(&ct_entry->list_node, &zt->post_ct_list);
 	zt->post_ct_count++;
 
diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.h b/drivers/net/ethernet/netronome/nfp/flower/conntrack.h
index beb6cceff9d8e..47607cd8a716d 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.h
+++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.h
@@ -108,6 +108,7 @@ enum nfp_nfp_layer_name {
  * @cookie:	Flow cookie, same as original TC flow, used as key
  * @list_node:	Used by the list
  * @chain_index:	Chain index of the original flow
+ * @goto_chain_index:	goto chain index of the flow
  * @netdev:	netdev structure.
  * @type:	Type of pre-entry from enum ct_entry_type
  * @zt:		Reference to the zone table this belongs to
@@ -120,6 +121,7 @@ struct nfp_fl_ct_flow_entry {
 	unsigned long cookie;
 	struct list_head list_node;
 	u32 chain_index;
+	u32 goto_chain_index;
 	enum ct_entry_type type;
 	struct net_device *netdev;
 	struct nfp_fl_ct_zone_entry *zt;
-- 
2.43.0


  parent reply	other threads:[~2024-03-13 16:43 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 16:41 [PATCH 5.15 00/76] 5.15.152-rc1 review Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 01/76] mmc: mmci: stm32: use a buffer for unaligned DMA requests Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 02/76] mmc: mmci: stm32: fix DMA API overlapping mappings warning Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 03/76] net: lan78xx: fix runtime PM count underflow on link stop Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 04/76] ixgbe: {dis, en}able irqs in ixgbe_txrx_ring_{dis, en}able Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 05/76] i40e: disable NAPI right after disabling irqs when handling xsk_pool Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 06/76] tracing/net_sched: Fix tracepoints that save qdisc_dev() as a string Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 07/76] geneve: make sure to pull inner header in geneve_rx() Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 08/76] net: sparx5: Fix use after free inside sparx5_del_mact_entry Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 09/76] net: ice: Fix potential NULL pointer dereference in ice_bridge_setlink() Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 10/76] net/ipv6: avoid possible UAF in ip6_route_mpath_notify() Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 11/76] cpumap: Zero-initialise xdp_rxq_info struct before running XDP program Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 12/76] net/rds: fix WARNING in rds_conn_connect_if_down Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 13/76] netfilter: nft_ct: fix l3num expectations with inet pseudo family Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 14/76] netfilter: nf_conntrack_h323: Add protection for bmp length out of range Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 15/76] erofs: apply proper VMA alignment for memory mapped files on THP Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 16/76] netrom: Fix a data-race around sysctl_netrom_default_path_quality Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 17/76] netrom: Fix a data-race around sysctl_netrom_obsolescence_count_initialiser Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 18/76] netrom: Fix data-races around sysctl_netrom_network_ttl_initialiser Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 19/76] netrom: Fix a data-race around sysctl_netrom_transport_timeout Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 20/76] netrom: Fix a data-race around sysctl_netrom_transport_maximum_tries Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 21/76] netrom: Fix a data-race around sysctl_netrom_transport_acknowledge_delay Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 22/76] netrom: Fix a data-race around sysctl_netrom_transport_busy_delay Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 23/76] netrom: Fix a data-race around sysctl_netrom_transport_requested_window_size Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 24/76] netrom: Fix a data-race around sysctl_netrom_transport_no_activity_timeout Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 25/76] netrom: Fix a data-race around sysctl_netrom_routing_control Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 26/76] netrom: Fix a data-race around sysctl_netrom_link_fails_count Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 27/76] netrom: Fix data-races around sysctl_net_busy_read Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 28/76] ALSA: usb-audio: Refcount multiple accesses on the single clock Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 29/76] ALSA: usb-audio: Clear fixed clock rate at closing EP Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 30/76] ALSA: usb-audio: Split endpoint setups for hw_params and prepare (take#2) Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 31/76] ALSA: usb-audio: Properly refcounting clock rate Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 32/76] ALSA: usb-audio: Apply mutex around snd_usb_endpoint_set_params() Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 33/76] ALSA: usb-audio: Correct the return code from snd_usb_endpoint_set_params() Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 34/76] ALSA: usb-audio: Avoid superfluous endpoint setup Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 35/76] ALSA: usb-audio: Add quirk for Tascam Model 12 Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 36/76] ALSA: usb-audio: Add new quirk FIXED_RATE for JBL Quantum810 Wireless Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 37/76] ALSA: usb-audio: Fix microphone sound on Nexigo webcam Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 38/76] ALSA: usb-audio: add quirk for RODE NT-USB+ Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 39/76] drm/amd/display: Fix uninitialized variable usage in core_link_ 'read_dpcd() & write_dpcd()' functions Sasha Levin
2024-03-13 16:41 ` Sasha Levin [this message]
2024-03-13 16:41 ` [PATCH 5.15 41/76] nfp: flower: add hardware offload check for post ct entry Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 42/76] selftests/mm: switch to bash from sh Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 43/76] selftests: mm: fix map_hugetlb failure on 64K page size systems Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 44/76] modpost: Include '.text.*' in TEXT_SECTIONS Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 45/76] modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS Sasha Levin
2024-03-13 17:12   ` Nathan Chancellor
2024-03-13 20:13     ` Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 46/76] xhci: process isoc TD properly when there was a transaction error mid TD Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 47/76] xhci: handle isoc Babble and Buffer Overrun events properly Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 48/76] serial: max310x: use regmap methods for SPI batch operations Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 49/76] serial: max310x: use a separate regmap for each port Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 50/76] serial: max310x: prevent infinite while() loop in port startup Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 51/76] drm/amd/pm: do not expose the API used internally only in kv_dpm.c Sasha Levin
2024-03-13 16:41 ` [PATCH 5.15 52/76] drm/amdgpu: Reset IH OVERFLOW_CLEAR bit Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 53/76] selftests: mptcp: decrease BW in simult flows Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 54/76] hv_netvsc: use netif_is_bond_master() instead of open code Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 55/76] hv_netvsc: Register VF in netvsc_probe if NET_DEVICE_REGISTER missed Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 56/76] drm/amd/display: Re-arrange FPU code structure for dcn2x Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 57/76] drm/amd/display: move calcs folder into DML Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 58/76] drm/amd/display: remove DML Makefile duplicate lines Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 59/76] drm/amd/display: Increase frame-larger-than for all display_mode_vba files Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 60/76] getrusage: add the "signal_struct *sig" local variable Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 61/76] getrusage: move thread_group_cputime_adjusted() outside of lock_task_sighand() Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 62/76] getrusage: use __for_each_thread() Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 63/76] getrusage: use sig->stats_lock rather than lock_task_sighand() Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 64/76] proc: Use task_is_running() for wchan in /proc/$pid/stat Sasha Levin
2024-03-14  3:04   ` Kees Cook
2024-03-15 18:31     ` Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 65/76] fs/proc: do_task_stat: move thread_group_cputime_adjusted() outside of lock_task_sighand() Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 66/76] exit: Fix typo in comment: s/sub-theads/sub-threads Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 67/76] exit: wait_task_zombie: kill the no longer necessary spin_lock_irq(siglock) Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 68/76] ALSA: usb-audio: Fix wrong kfree issue in snd_usb_endpoint_free_all Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 69/76] ALSA: usb-audio: Always initialize fixed_rate in snd_usb_find_implicit_fb_sync_format() Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 70/76] ALSA: usb-audio: Add FIXED_RATE quirk for JBL Quantum610 Wireless Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 71/76] ALSA: usb-audio: Sort quirk table entries Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 72/76] regmap: allow to define reg_update_bits for no bus configuration Sasha Levin
2024-03-13 16:46   ` Mark Brown
2024-03-13 17:16     ` Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 73/76] regmap: Add bulk read/write callbacks into regmap_config Sasha Levin
2024-03-13 16:46   ` Mark Brown
2024-03-13 17:14     ` Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 74/76] serial: max310x: make accessing revision id interface-agnostic Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 75/76] serial: max310x: fix IO data corruption in batched operations Sasha Levin
2024-03-13 16:42 ` [PATCH 5.15 76/76] Linux 5.15.152-rc1 Sasha Levin
2024-03-13 19:21 ` [PATCH 5.15 00/76] 5.15.152-rc1 review Daniel Díaz
2024-03-13 20:21   ` Sasha Levin
2024-03-14 15:02 ` Harshit Mogalapalli
2024-03-14 20:14 ` Florian Fainelli
2024-03-14 23:08 ` SeongJae Park
2024-03-15 10:43 ` Shreeya Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240313164223.615640-41-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=louis.peens@corigine.com \
    --cc=simon.horman@corigine.com \
    --cc=stable@vger.kernel.org \
    --cc=wentao.jia@corigine.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).