dpdk: fix variable type in pattern parsing
[vpp.git] / build / external / patches / dpdk_23.03 / v1-0001-net-fix-pkt-length-type-for-raw-pattern.patch
1 From 6429e38ae77c7998c84d5a0ed26b4fb0d81424c1 Mon Sep 17 00:00:00 2001
2 From: Ting Xu <ting.xu@intel.com>
3 Date: Thu, 15 Jun 2023 01:33:37 +0000
4 Subject: [PATCH v1] net: fix pkt length type for raw pattern
5
6 In current pattern parsing function for raw pattern, the packet length
7 variable is defined as uint8_t, which is too small for a large packet,
8 such as srv6. Change the type to uint16_t.
9
10 Fixes: 1b9c68120a1c ("net/ice: enable protocol agnostic flow offloading
11 in RSS")
12
13 Signed-off-by: Ting Xu <ting.xu@intel.com>
14 ---
15  drivers/net/iavf/iavf_hash.c      | 2 +-
16  drivers/net/ice/ice_fdir_filter.c | 2 +-
17  drivers/net/ice/ice_hash.c        | 2 +-
18  3 files changed, 3 insertions(+), 3 deletions(-)
19
20 diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
21 index ae6fb38594..cf4d677101 100644
22 --- a/drivers/net/iavf/iavf_hash.c
23 +++ b/drivers/net/iavf/iavf_hash.c
24 @@ -886,8 +886,8 @@ iavf_hash_parse_raw_pattern(const struct rte_flow_item *item,
25                         struct iavf_rss_meta *meta)
26  {
27         const struct rte_flow_item_raw *raw_spec, *raw_mask;
28 +       uint16_t spec_len, pkt_len;
29         uint8_t *pkt_buf, *msk_buf;
30 -       uint8_t spec_len, pkt_len;
31         uint8_t tmp_val = 0;
32         uint8_t tmp_c = 0;
33         int i, j;
34 diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
35 index 480b369af8..e8842bc242 100644
36 --- a/drivers/net/ice/ice_fdir_filter.c
37 +++ b/drivers/net/ice/ice_fdir_filter.c
38 @@ -1876,7 +1876,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
39                                 (uint8_t *)(uintptr_t)raw_mask->pattern;
40                         uint8_t *tmp_spec, *tmp_mask;
41                         uint16_t tmp_val = 0;
42 -                       uint8_t pkt_len = 0;
43 +                       uint16_t pkt_len = 0;
44                         uint8_t tmp = 0;
45                         int i, j;
46  
47 diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
48 index f35727856e..52646e9408 100644
49 --- a/drivers/net/ice/ice_hash.c
50 +++ b/drivers/net/ice/ice_hash.c
51 @@ -653,8 +653,8 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,
52         const struct rte_flow_item_raw *raw_spec, *raw_mask;
53         struct ice_parser_profile prof;
54         struct ice_parser_result rslt;
55 +       uint16_t spec_len, pkt_len;
56         uint8_t *pkt_buf, *msk_buf;
57 -       uint8_t spec_len, pkt_len;
58         uint8_t tmp_val = 0;
59         uint8_t tmp_c = 0;
60         int i, j;
61 -- 
62 2.25.1
63