[22/39] net/ice/base: support new patterns of TCP and UDP

Message ID 20220407105706.18889-23-kevinx.liu@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series support full function of DCF |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Kevin Liu April 7, 2022, 10:56 a.m. UTC
  From: Alvin Zhang <alvinx.zhang@intel.com>

Find training packets for below TCP and UDP patterns:
MAC/VLAN/IPv4/TCP
MAC/VLAN/IPv4/UDP

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
---
 drivers/net/ice/base/ice_switch.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
  

Patch

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index e3658117fc..75cc861e93 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -8616,6 +8616,12 @@  ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
 	}
 
 	if (tun_type == ICE_SW_IPV4_TCP) {
+		if (vlan && tcp) {
+			*pkt = dummy_vlan_tcp_packet;
+			*pkt_len = sizeof(dummy_vlan_tcp_packet);
+			*offsets = dummy_vlan_tcp_packet_offsets;
+			return;
+		}
 		*pkt = dummy_tcp_packet;
 		*pkt_len = sizeof(dummy_tcp_packet);
 		*offsets = dummy_tcp_packet_offsets;
@@ -8623,6 +8629,12 @@  ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
 	}
 
 	if (tun_type == ICE_SW_IPV4_UDP) {
+		if (vlan && udp) {
+			*pkt = dummy_vlan_udp_packet;
+			*pkt_len = sizeof(dummy_vlan_udp_packet);
+			*offsets = dummy_vlan_udp_packet_offsets;
+			return;
+		}
 		*pkt = dummy_udp_packet;
 		*pkt_len = sizeof(dummy_udp_packet);
 		*offsets = dummy_udp_packet_offsets;