From: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
To: intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com,
aleksandr.loktionov@intel.com
Cc: netdev@vger.kernel.org,
Michal Swiatkowski <michal.swiatkowski@intel.com>
Subject: [PATCH iwl-net 9/10] ice: select inner TCP dummy packet when matching on ip_proto TCP without explicit L4 field
Date: Fri, 3 Apr 2026 07:40:27 +0200 [thread overview]
Message-ID: <20260403054029.3789616-10-aleksandr.loktionov@intel.com> (raw)
In-Reply-To: <20260403054029.3789616-1-aleksandr.loktionov@intel.com>
When building an advanced switch rule, ice_find_dummy_packet()
selects the template packet type based on the lookup element
list. It currently checks for ICE_TCP_IL to select the inner
TCP template, but ignores the case where the user matches on
ICE_IPV4_IL with protocol == IPPROTO_TCP without specifying a
TCP L4 field. In that case the default UDP template is chosen,
causing the rule to fail.
Extend the check to also match ICE_IPV4_IL with TCP protocol
field fully masked, fixing tc-flower rules such as:
tc filter add dev vxlan100 ingress protocol ip prio 0 \\
flower ip_proto tcp action mirred egress redirect dev eth0
Fixes: e33163a40d1a ("ice: switch: convert packet template match code to rodata")
Cc: stable@vger.kernel.org
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@intel.com>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
drivers/net/ethernet/intel/ice/ice_switch.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
index bb0f990..c2ac870 100644
--- a/drivers/net/ethernet/intel/ice/ice_switch.c
+++ b/drivers/net/ethernet/intel/ice/ice_switch.c
@@ -5587,7 +5587,10 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
for (i = 0; i < lkups_cnt; i++) {
if (lkups[i].type == ICE_UDP_ILOS)
match |= ICE_PKT_INNER_UDP;
- else if (lkups[i].type == ICE_TCP_IL)
+ else if (lkups[i].type == ICE_TCP_IL ||
+ (lkups[i].type == ICE_IPV4_IL &&
+ lkups[i].h_u.ipv4_hdr.protocol == IPPROTO_TCP &&
+ lkups[i].m_u.ipv4_hdr.protocol == 0xFF))
match |= ICE_PKT_INNER_TCP;
else if (lkups[i].type == ICE_IPV6_OFOS)
match |= ICE_PKT_OUTER_IPV6;
--
2.52.0
next prev parent reply other threads:[~2026-04-03 5:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-03 5:40 [PATCH iwl-net 0/10] ice: bug fixes -- no link, tc-flower, VF rate Aleksandr Loktionov
2026-04-03 5:40 ` [PATCH iwl-net 1/10] ice: fix mirroring to VSI list Aleksandr Loktionov
2026-04-03 5:40 ` [PATCH iwl-net 2/10] ice: update FW on all DCB changes Aleksandr Loktionov
2026-04-03 5:40 ` [PATCH iwl-net 3/10] ice: disallow service task to run while driver is unloading Aleksandr Loktionov
2026-04-03 5:40 ` [PATCH iwl-net 4/10] ice: error out on CONNECTED state for input pin Aleksandr Loktionov
2026-04-03 5:40 ` [PATCH iwl-net 5/10] ice: add 10000baseCR_Full to advertised link speed map Aleksandr Loktionov
2026-04-03 5:40 ` [PATCH iwl-net 6/10] ice: check PHY autoneg capability before rejecting ethtool autoneg setting Aleksandr Loktionov
2026-04-10 18:58 ` Tony Nguyen
2026-04-03 5:40 ` [PATCH iwl-net 7/10] ice: fix missing 50G single-lane ethtool link speed mappings Aleksandr Loktionov
2026-04-03 5:40 ` [PATCH iwl-net 8/10] ice: set ETS TLV willing bit in default MIB sent to firmware Aleksandr Loktionov
2026-04-06 20:22 ` Ertman, David M
2026-04-03 5:40 ` Aleksandr Loktionov [this message]
2026-04-03 5:40 ` [PATCH iwl-net 10/10] ice: allow setting min_tx_rate to 0 to resolve VF bandwidth oversubscription Aleksandr Loktionov
2026-04-10 18:58 ` Tony Nguyen
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=20260403054029.3789616-10-aleksandr.loktionov@intel.com \
--to=aleksandr.loktionov@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=michal.swiatkowski@intel.com \
--cc=netdev@vger.kernel.org \
/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