Not necessary to create / destroy a parser instance for every raw packet rule. A global parser instance will be created in ice_flow_init and be destroyed in ice_flow_uninit. Also, ice_dev_udp_tunnel_port_add has been hooked to perform corresponding parser configure. This also fix the issue that RSS engine can't support VXLAN inner through raw packet filter. Fixes: 1b9c68120a1c ("net/ice: enable protocol agnostic flow offloading in RSS") Cc: stable@dpdk.org Signed-off-by: Qi Zhang <qi.z.zhang@intel.com> --- v3: - add missing refact in ice_hash.c v2: - typo fix. drivers/net/ice/ice_ethdev.c | 10 ++++++++++ drivers/net/ice/ice_ethdev.h | 1 + drivers/net/ice/ice_fdir_filter.c | 14 ++++---------- drivers/net/ice/ice_generic_flow.c | 8 ++++++++ drivers/net/ice/ice_hash.c | 9 ++++----- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 73e550f5fb..8bb34b874b 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -5621,6 +5621,8 @@ ice_dev_udp_tunnel_port_add(struct rte_eth_dev *dev, { int ret = 0; struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct ice_adapter *ad = + ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); if (udp_tunnel == NULL) return -EINVAL; @@ -5628,6 +5630,9 @@ ice_dev_udp_tunnel_port_add(struct rte_eth_dev *dev, switch (udp_tunnel->prot_type) { case RTE_ETH_TUNNEL_TYPE_VXLAN: ret = ice_create_tunnel(hw, TNL_VXLAN, udp_tunnel->udp_port); + if (!ret && ad->psr != NULL) + ice_parser_vxlan_tunnel_set(ad->psr, + udp_tunnel->udp_port, true); break; default: PMD_DRV_LOG(ERR, "Invalid tunnel type"); @@ -5645,6 +5650,8 @@ ice_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, { int ret = 0; struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct ice_adapter *ad = + ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); if (udp_tunnel == NULL) return -EINVAL; @@ -5652,6 +5659,9 @@ ice_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, switch (udp_tunnel->prot_type) { case RTE_ETH_TUNNEL_TYPE_VXLAN: ret = ice_destroy_tunnel(hw, udp_tunnel->udp_port, 0); + if (!ret && ad->psr != NULL) + ice_parser_vxlan_tunnel_set(ad->psr, + udp_tunnel->udp_port, false); break; default: PMD_DRV_LOG(ERR, "Invalid tunnel type"); diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h index 3ab310628f..3d8427225f 100644 --- a/drivers/net/ice/ice_ethdev.h +++ b/drivers/net/ice/ice_ethdev.h @@ -561,6 +561,7 @@ struct ice_adapter { struct ice_rss_prof_info rss_prof_info[ICE_MAX_PTGS]; /* True if DCF state of the associated PF is on */ bool dcf_state_on; + struct ice_parser *psr; #ifdef RTE_ARCH_X86 bool rx_use_avx2; bool rx_use_avx512; diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c index 7954c6d8ea..0982478feb 100644 --- a/drivers/net/ice/ice_fdir_filter.c +++ b/drivers/net/ice/ice_fdir_filter.c @@ -1826,7 +1826,6 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, struct ice_fdir_v4 *p_v4 = NULL; struct ice_fdir_v6 *p_v6 = NULL; struct ice_parser_result rslt; - struct ice_parser *psr; uint8_t item_num = 0; for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) { @@ -1861,6 +1860,9 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, switch (item_type) { case RTE_FLOW_ITEM_TYPE_RAW: { + if (ad->psr == NULL) + return -rte_errno; + raw_spec = item->spec; raw_mask = item->mask; @@ -1872,7 +1874,6 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, (uint8_t *)(uintptr_t)raw_spec->pattern; unsigned char *tmp_mask = (uint8_t *)(uintptr_t)raw_mask->pattern; - uint16_t udp_port = 0; uint16_t tmp_val = 0; uint8_t pkt_len = 0; uint8_t tmp = 0; @@ -1921,15 +1922,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, pkt_len /= 2; - if (ice_parser_create(&ad->hw, &psr)) - return -rte_errno; - if (ice_get_open_tunnel_port(&ad->hw, TNL_VXLAN, - &udp_port)) - ice_parser_vxlan_tunnel_set(psr, udp_port, - true); - if (ice_parser_run(psr, tmp_spec, pkt_len, &rslt)) + if (ice_parser_run(ad->psr, tmp_spec, pkt_len, &rslt)) return -rte_errno; - ice_parser_destroy(psr); if (!tmp_mask) return -rte_errno; diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c index 53b1c0b69a..57eb002bde 100644 --- a/drivers/net/ice/ice_generic_flow.c +++ b/drivers/net/ice/ice_generic_flow.c @@ -1831,6 +1831,9 @@ ice_flow_init(struct ice_adapter *ad) TAILQ_INIT(&pf->dist_parser_list); rte_spinlock_init(&pf->flow_ops_lock); + if (ice_parser_create(&ad->hw, &ad->psr) != ICE_SUCCESS) + PMD_INIT_LOG(WARNING, "Failed to initialize DDP parser, raw packet filter will not be supported"); + RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) { if (engine->init == NULL) { PMD_INIT_LOG(ERR, "Invalid engine type (%d)", @@ -1885,6 +1888,11 @@ ice_flow_uninit(struct ice_adapter *ad) TAILQ_REMOVE(&pf->dist_parser_list, p_parser, node); rte_free(p_parser); } + + if (ad->psr != NULL) { + ice_parser_destroy(ad->psr); + ad->psr = NULL; + } } static struct ice_parser_list * diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index afbb357fa3..f35727856e 100644 --- a/drivers/net/ice/ice_hash.c +++ b/drivers/net/ice/ice_hash.c @@ -653,13 +653,15 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad, const struct rte_flow_item_raw *raw_spec, *raw_mask; struct ice_parser_profile prof; struct ice_parser_result rslt; - struct ice_parser *psr; uint8_t *pkt_buf, *msk_buf; uint8_t spec_len, pkt_len; uint8_t tmp_val = 0; uint8_t tmp_c = 0; int i, j; + if (ad->psr == NULL) + return -rte_errno; + raw_spec = item->spec; raw_mask = item->mask; @@ -713,11 +715,8 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad, msk_buf[j] = tmp_val * 16 + tmp_c - '0'; } - if (ice_parser_create(&ad->hw, &psr)) - return -rte_errno; - if (ice_parser_run(psr, pkt_buf, pkt_len, &rslt)) + if (ice_parser_run(ad->psr, pkt_buf, pkt_len, &rslt)) return -rte_errno; - ice_parser_destroy(psr); if (ice_parser_profile_init(&rslt, pkt_buf, msk_buf, pkt_len, ICE_BLK_RSS, true, &prof)) -- 2.31.1
> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Friday, April 8, 2022 12:06 AM
> To: Guo, Junfeng <junfeng.guo@intel.com>; Xu, Ting <ting.xu@intel.com>
> Cc: dev@dpdk.org; Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; stable@dpdk.org
> Subject: [PATCH v3] net/ice: refact parser API usage
>
> Not necessary to create / destroy a parser instance for every raw packet rule.
> A global parser instance will be created in ice_flow_init and be destroyed in
> ice_flow_uninit.
>
> Also, ice_dev_udp_tunnel_port_add has been hooked to perform
> corresponding parser configure. This also fix the issue that RSS engine can't
> support VXLAN inner through raw packet filter.
>
> Fixes: 1b9c68120a1c ("net/ice: enable protocol agnostic flow offloading in
> RSS")
> Cc: stable@dpdk.org
>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
>
> v3:
> - add missing refact in ice_hash.c
>
> v2:
> - typo fix.
>
> drivers/net/ice/ice_ethdev.c | 10 ++++++++++
> drivers/net/ice/ice_ethdev.h | 1 +
> drivers/net/ice/ice_fdir_filter.c | 14 ++++----------
> drivers/net/ice/ice_generic_flow.c | 8 ++++++++
> drivers/net/ice/ice_hash.c | 9 ++++-----
> 5 files changed, 27 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index
> 73e550f5fb..8bb34b874b 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -5621,6 +5621,8 @@ ice_dev_udp_tunnel_port_add(struct rte_eth_dev
> *dev, {
> int ret = 0;
> struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> + struct ice_adapter *ad =
> + ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
>
> if (udp_tunnel == NULL)
> return -EINVAL;
> @@ -5628,6 +5630,9 @@ ice_dev_udp_tunnel_port_add(struct rte_eth_dev
> *dev,
> switch (udp_tunnel->prot_type) {
> case RTE_ETH_TUNNEL_TYPE_VXLAN:
> ret = ice_create_tunnel(hw, TNL_VXLAN, udp_tunnel-
> >udp_port);
> + if (!ret && ad->psr != NULL)
> + ice_parser_vxlan_tunnel_set(ad->psr,
> + udp_tunnel->udp_port, true);
> break;
> default:
> PMD_DRV_LOG(ERR, "Invalid tunnel type"); @@ -5645,6
> +5650,8 @@ ice_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, {
> int ret = 0;
> struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> + struct ice_adapter *ad =
> + ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
>
> if (udp_tunnel == NULL)
> return -EINVAL;
> @@ -5652,6 +5659,9 @@ ice_dev_udp_tunnel_port_del(struct rte_eth_dev
> *dev,
> switch (udp_tunnel->prot_type) {
> case RTE_ETH_TUNNEL_TYPE_VXLAN:
> ret = ice_destroy_tunnel(hw, udp_tunnel->udp_port, 0);
> + if (!ret && ad->psr != NULL)
> + ice_parser_vxlan_tunnel_set(ad->psr,
> + udp_tunnel->udp_port, false);
> break;
> default:
> PMD_DRV_LOG(ERR, "Invalid tunnel type"); diff --git
> a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h index
> 3ab310628f..3d8427225f 100644
> --- a/drivers/net/ice/ice_ethdev.h
> +++ b/drivers/net/ice/ice_ethdev.h
> @@ -561,6 +561,7 @@ struct ice_adapter {
> struct ice_rss_prof_info rss_prof_info[ICE_MAX_PTGS];
> /* True if DCF state of the associated PF is on */
> bool dcf_state_on;
> + struct ice_parser *psr;
> #ifdef RTE_ARCH_X86
> bool rx_use_avx2;
> bool rx_use_avx512;
> diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
> index 7954c6d8ea..0982478feb 100644
> --- a/drivers/net/ice/ice_fdir_filter.c
> +++ b/drivers/net/ice/ice_fdir_filter.c
> @@ -1826,7 +1826,6 @@ ice_fdir_parse_pattern(__rte_unused struct
> ice_adapter *ad,
> struct ice_fdir_v4 *p_v4 = NULL;
> struct ice_fdir_v6 *p_v6 = NULL;
> struct ice_parser_result rslt;
> - struct ice_parser *psr;
> uint8_t item_num = 0;
>
> for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END;
> item++) { @@ -1861,6 +1860,9 @@ ice_fdir_parse_pattern(__rte_unused
> struct ice_adapter *ad,
>
> switch (item_type) {
> case RTE_FLOW_ITEM_TYPE_RAW: {
> + if (ad->psr == NULL)
> + return -rte_errno;
> +
> raw_spec = item->spec;
> raw_mask = item->mask;
>
> @@ -1872,7 +1874,6 @@ ice_fdir_parse_pattern(__rte_unused struct
> ice_adapter *ad,
> (uint8_t *)(uintptr_t)raw_spec->pattern;
> unsigned char *tmp_mask =
> (uint8_t *)(uintptr_t)raw_mask->pattern;
> - uint16_t udp_port = 0;
> uint16_t tmp_val = 0;
> uint8_t pkt_len = 0;
> uint8_t tmp = 0;
> @@ -1921,15 +1922,8 @@ ice_fdir_parse_pattern(__rte_unused struct
> ice_adapter *ad,
>
> pkt_len /= 2;
>
> - if (ice_parser_create(&ad->hw, &psr))
> - return -rte_errno;
> - if (ice_get_open_tunnel_port(&ad->hw, TNL_VXLAN,
> - &udp_port))
> - ice_parser_vxlan_tunnel_set(psr, udp_port,
> - true);
> - if (ice_parser_run(psr, tmp_spec, pkt_len, &rslt))
> + if (ice_parser_run(ad->psr, tmp_spec, pkt_len, &rslt))
> return -rte_errno;
> - ice_parser_destroy(psr);
>
> if (!tmp_mask)
> return -rte_errno;
> diff --git a/drivers/net/ice/ice_generic_flow.c
> b/drivers/net/ice/ice_generic_flow.c
> index 53b1c0b69a..57eb002bde 100644
> --- a/drivers/net/ice/ice_generic_flow.c
> +++ b/drivers/net/ice/ice_generic_flow.c
> @@ -1831,6 +1831,9 @@ ice_flow_init(struct ice_adapter *ad)
> TAILQ_INIT(&pf->dist_parser_list);
> rte_spinlock_init(&pf->flow_ops_lock);
>
> + if (ice_parser_create(&ad->hw, &ad->psr) != ICE_SUCCESS)
> + PMD_INIT_LOG(WARNING, "Failed to initialize DDP parser,
> raw packet
> +filter will not be supported");
> +
> RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
> if (engine->init == NULL) {
> PMD_INIT_LOG(ERR, "Invalid engine type (%d)", @@
> -1885,6 +1888,11 @@ ice_flow_uninit(struct ice_adapter *ad)
> TAILQ_REMOVE(&pf->dist_parser_list, p_parser, node);
> rte_free(p_parser);
> }
> +
> + if (ad->psr != NULL) {
> + ice_parser_destroy(ad->psr);
> + ad->psr = NULL;
> + }
> }
>
> static struct ice_parser_list *
> diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index
> afbb357fa3..f35727856e 100644
> --- a/drivers/net/ice/ice_hash.c
> +++ b/drivers/net/ice/ice_hash.c
> @@ -653,13 +653,15 @@ ice_hash_parse_raw_pattern(struct ice_adapter
> *ad,
> const struct rte_flow_item_raw *raw_spec, *raw_mask;
> struct ice_parser_profile prof;
> struct ice_parser_result rslt;
> - struct ice_parser *psr;
> uint8_t *pkt_buf, *msk_buf;
> uint8_t spec_len, pkt_len;
> uint8_t tmp_val = 0;
> uint8_t tmp_c = 0;
> int i, j;
>
> + if (ad->psr == NULL)
> + return -rte_errno;
> +
> raw_spec = item->spec;
> raw_mask = item->mask;
>
> @@ -713,11 +715,8 @@ ice_hash_parse_raw_pattern(struct ice_adapter
> *ad,
> msk_buf[j] = tmp_val * 16 + tmp_c - '0';
> }
>
> - if (ice_parser_create(&ad->hw, &psr))
> - return -rte_errno;
> - if (ice_parser_run(psr, pkt_buf, pkt_len, &rslt))
> + if (ice_parser_run(ad->psr, pkt_buf, pkt_len, &rslt))
> return -rte_errno;
> - ice_parser_destroy(psr);
>
> if (ice_parser_profile_init(&rslt, pkt_buf, msk_buf,
> pkt_len, ICE_BLK_RSS, true, &prof))
> --
> 2.31.1
Acked-by: Xu Ting <ting.xu@intel.com>
> -----Original Message-----
> From: Xu, Ting <ting.xu@intel.com>
> Sent: Wednesday, April 13, 2022 3:23 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Guo, Junfeng
> <junfeng.guo@intel.com>
> Cc: dev@dpdk.org; Yang, Qiming <qiming.yang@intel.com>;
> stable@dpdk.org
> Subject: RE: [PATCH v3] net/ice: refact parser API usage
>
> > -----Original Message-----
> > From: Zhang, Qi Z <qi.z.zhang@intel.com>
> > Sent: Friday, April 8, 2022 12:06 AM
> > To: Guo, Junfeng <junfeng.guo@intel.com>; Xu, Ting <ting.xu@intel.com>
> > Cc: dev@dpdk.org; Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; stable@dpdk.org
> > Subject: [PATCH v3] net/ice: refact parser API usage
> >
> > Not necessary to create / destroy a parser instance for every raw packet
> rule.
> > A global parser instance will be created in ice_flow_init and be
> > destroyed in ice_flow_uninit.
> >
> > Also, ice_dev_udp_tunnel_port_add has been hooked to perform
> > corresponding parser configure. This also fix the issue that RSS
> > engine can't support VXLAN inner through raw packet filter.
> >
> > Fixes: 1b9c68120a1c ("net/ice: enable protocol agnostic flow
> > offloading in
> > RSS")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> > ---
> >
> > v3:
> > - add missing refact in ice_hash.c
> >
> > v2:
> > - typo fix.
> >
> > drivers/net/ice/ice_ethdev.c | 10 ++++++++++
> > drivers/net/ice/ice_ethdev.h | 1 +
> > drivers/net/ice/ice_fdir_filter.c | 14 ++++----------
> > drivers/net/ice/ice_generic_flow.c | 8 ++++++++
> > drivers/net/ice/ice_hash.c | 9 ++++-----
> > 5 files changed, 27 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/net/ice/ice_ethdev.c
> > b/drivers/net/ice/ice_ethdev.c index 73e550f5fb..8bb34b874b 100644
> > --- a/drivers/net/ice/ice_ethdev.c
> > +++ b/drivers/net/ice/ice_ethdev.c
> > @@ -5621,6 +5621,8 @@ ice_dev_udp_tunnel_port_add(struct
> rte_eth_dev
> > *dev, {
> > int ret = 0;
> > struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data-
> > >dev_private);
> > + struct ice_adapter *ad =
> > + ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> >
> > if (udp_tunnel == NULL)
> > return -EINVAL;
> > @@ -5628,6 +5630,9 @@ ice_dev_udp_tunnel_port_add(struct
> rte_eth_dev
> > *dev,
> > switch (udp_tunnel->prot_type) {
> > case RTE_ETH_TUNNEL_TYPE_VXLAN:
> > ret = ice_create_tunnel(hw, TNL_VXLAN, udp_tunnel-
> > >udp_port);
> > + if (!ret && ad->psr != NULL)
> > + ice_parser_vxlan_tunnel_set(ad->psr,
> > + udp_tunnel->udp_port, true);
> > break;
> > default:
> > PMD_DRV_LOG(ERR, "Invalid tunnel type"); @@ -5645,6
> > +5650,8 @@ ice_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, {
> > int ret = 0;
> > struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data-
> > >dev_private);
> > + struct ice_adapter *ad =
> > + ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> >
> > if (udp_tunnel == NULL)
> > return -EINVAL;
> > @@ -5652,6 +5659,9 @@ ice_dev_udp_tunnel_port_del(struct
> rte_eth_dev
> > *dev,
> > switch (udp_tunnel->prot_type) {
> > case RTE_ETH_TUNNEL_TYPE_VXLAN:
> > ret = ice_destroy_tunnel(hw, udp_tunnel->udp_port, 0);
> > + if (!ret && ad->psr != NULL)
> > + ice_parser_vxlan_tunnel_set(ad->psr,
> > + udp_tunnel->udp_port, false);
> > break;
> > default:
> > PMD_DRV_LOG(ERR, "Invalid tunnel type"); diff --git
> > a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h index
> > 3ab310628f..3d8427225f 100644
> > --- a/drivers/net/ice/ice_ethdev.h
> > +++ b/drivers/net/ice/ice_ethdev.h
> > @@ -561,6 +561,7 @@ struct ice_adapter {
> > struct ice_rss_prof_info rss_prof_info[ICE_MAX_PTGS];
> > /* True if DCF state of the associated PF is on */
> > bool dcf_state_on;
> > + struct ice_parser *psr;
> > #ifdef RTE_ARCH_X86
> > bool rx_use_avx2;
> > bool rx_use_avx512;
> > diff --git a/drivers/net/ice/ice_fdir_filter.c
> > b/drivers/net/ice/ice_fdir_filter.c
> > index 7954c6d8ea..0982478feb 100644
> > --- a/drivers/net/ice/ice_fdir_filter.c
> > +++ b/drivers/net/ice/ice_fdir_filter.c
> > @@ -1826,7 +1826,6 @@ ice_fdir_parse_pattern(__rte_unused struct
> > ice_adapter *ad,
> > struct ice_fdir_v4 *p_v4 = NULL;
> > struct ice_fdir_v6 *p_v6 = NULL;
> > struct ice_parser_result rslt;
> > - struct ice_parser *psr;
> > uint8_t item_num = 0;
> >
> > for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END;
> > item++) { @@ -1861,6 +1860,9 @@ ice_fdir_parse_pattern(__rte_unused
> > struct ice_adapter *ad,
> >
> > switch (item_type) {
> > case RTE_FLOW_ITEM_TYPE_RAW: {
> > + if (ad->psr == NULL)
> > + return -rte_errno;
> > +
> > raw_spec = item->spec;
> > raw_mask = item->mask;
> >
> > @@ -1872,7 +1874,6 @@ ice_fdir_parse_pattern(__rte_unused struct
> > ice_adapter *ad,
> > (uint8_t *)(uintptr_t)raw_spec->pattern;
> > unsigned char *tmp_mask =
> > (uint8_t *)(uintptr_t)raw_mask->pattern;
> > - uint16_t udp_port = 0;
> > uint16_t tmp_val = 0;
> > uint8_t pkt_len = 0;
> > uint8_t tmp = 0;
> > @@ -1921,15 +1922,8 @@ ice_fdir_parse_pattern(__rte_unused struct
> > ice_adapter *ad,
> >
> > pkt_len /= 2;
> >
> > - if (ice_parser_create(&ad->hw, &psr))
> > - return -rte_errno;
> > - if (ice_get_open_tunnel_port(&ad->hw, TNL_VXLAN,
> > - &udp_port))
> > - ice_parser_vxlan_tunnel_set(psr, udp_port,
> > - true);
> > - if (ice_parser_run(psr, tmp_spec, pkt_len, &rslt))
> > + if (ice_parser_run(ad->psr, tmp_spec, pkt_len, &rslt))
> > return -rte_errno;
> > - ice_parser_destroy(psr);
> >
> > if (!tmp_mask)
> > return -rte_errno;
> > diff --git a/drivers/net/ice/ice_generic_flow.c
> > b/drivers/net/ice/ice_generic_flow.c
> > index 53b1c0b69a..57eb002bde 100644
> > --- a/drivers/net/ice/ice_generic_flow.c
> > +++ b/drivers/net/ice/ice_generic_flow.c
> > @@ -1831,6 +1831,9 @@ ice_flow_init(struct ice_adapter *ad)
> > TAILQ_INIT(&pf->dist_parser_list);
> > rte_spinlock_init(&pf->flow_ops_lock);
> >
> > + if (ice_parser_create(&ad->hw, &ad->psr) != ICE_SUCCESS)
> > + PMD_INIT_LOG(WARNING, "Failed to initialize DDP parser,
> > raw packet
> > +filter will not be supported");
> > +
> > RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
> > if (engine->init == NULL) {
> > PMD_INIT_LOG(ERR, "Invalid engine type (%d)", @@
> > -1885,6 +1888,11 @@ ice_flow_uninit(struct ice_adapter *ad)
> > TAILQ_REMOVE(&pf->dist_parser_list, p_parser, node);
> > rte_free(p_parser);
> > }
> > +
> > + if (ad->psr != NULL) {
> > + ice_parser_destroy(ad->psr);
> > + ad->psr = NULL;
> > + }
> > }
> >
> > static struct ice_parser_list *
> > diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
> > index afbb357fa3..f35727856e 100644
> > --- a/drivers/net/ice/ice_hash.c
> > +++ b/drivers/net/ice/ice_hash.c
> > @@ -653,13 +653,15 @@ ice_hash_parse_raw_pattern(struct ice_adapter
> > *ad,
> > const struct rte_flow_item_raw *raw_spec, *raw_mask;
> > struct ice_parser_profile prof;
> > struct ice_parser_result rslt;
> > - struct ice_parser *psr;
> > uint8_t *pkt_buf, *msk_buf;
> > uint8_t spec_len, pkt_len;
> > uint8_t tmp_val = 0;
> > uint8_t tmp_c = 0;
> > int i, j;
> >
> > + if (ad->psr == NULL)
> > + return -rte_errno;
> > +
> > raw_spec = item->spec;
> > raw_mask = item->mask;
> >
> > @@ -713,11 +715,8 @@ ice_hash_parse_raw_pattern(struct ice_adapter
> > *ad,
> > msk_buf[j] = tmp_val * 16 + tmp_c - '0';
> > }
> >
> > - if (ice_parser_create(&ad->hw, &psr))
> > - return -rte_errno;
> > - if (ice_parser_run(psr, pkt_buf, pkt_len, &rslt))
> > + if (ice_parser_run(ad->psr, pkt_buf, pkt_len, &rslt))
> > return -rte_errno;
> > - ice_parser_destroy(psr);
> >
> > if (ice_parser_profile_init(&rslt, pkt_buf, msk_buf,
> > pkt_len, ICE_BLK_RSS, true, &prof))
> > --
> > 2.31.1
>
> Acked-by: Xu Ting <ting.xu@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi