DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/5] removing the next_type enum
@ 2026-09-15 10:46 Evgeny Sokolov
  2026-09-25 12:42 ` Burakov, Anatoly
  0 siblings, 1 reply; 2+ messages in thread
From: Evgeny Sokolov @ 2026-09-15 10:46 UTC (permalink / raw)
  To: Vladimir Medvedkin; +Cc: dev, stable, simei.su, Sokolov Evgeny

From: Sokolov Evgeny <Evgeny.Sokolov@infotecs.ru>

---
 drivers/net/intel/iavf/iavf_fdir.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/net/intel/iavf/iavf_fdir.c b/drivers/net/intel/iavf/iavf_fdir.c
index 3213464254..ddfa1b97be 100644
--- a/drivers/net/intel/iavf/iavf_fdir.c
+++ b/drivers/net/intel/iavf/iavf_fdir.c
@@ -745,7 +745,6 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
 	struct rte_ecpri_common_hdr ecpri_common;
 	uint64_t input_set = IAVF_INSET_NONE;
 	enum rte_flow_item_type item_type;
-	enum rte_flow_item_type next_type;
 	uint8_t tun_inner = 0;
 	uint16_t ether_type, flags_version;
 	uint8_t item_num = 0;
@@ -835,13 +834,12 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
 		case RTE_FLOW_ITEM_TYPE_ETH:
 			eth_spec = item->spec;
 			eth_mask = item->mask;
-			next_type = (item + 1)->type;
 
 			hdr1 = &hdrs->proto_hdr[layer];
 
 			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, ETH);
 
-			if (next_type == RTE_FLOW_ITEM_TYPE_END &&
+			if (((item + 1)->type == RTE_FLOW_ITEM_TYPE_END) &&
 			    (!eth_spec || !eth_mask)) {
 				rte_flow_error_set(error, EINVAL,
 						RTE_FLOW_ERROR_TYPE_ITEM,
@@ -891,13 +889,11 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
 
 			hdrs->count = ++layer;
 			break;
-
 		case RTE_FLOW_ITEM_TYPE_IPV4:
 			l3 = RTE_FLOW_ITEM_TYPE_IPV4;
 			ipv4_spec = item->spec;
 			ipv4_last = item->last;
 			ipv4_mask = item->mask;
-			next_type = (item + 1)->type;
 
 			hdr = &hdrs->proto_hdr[layer];
 
@@ -1075,7 +1071,6 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
 		case RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT:
 			ipv6_frag_spec = item->spec;
 			ipv6_frag_mask = item->mask;
-			next_type = (item + 1)->type;
 
 			hdr = &hdrs->proto_hdr[layer];
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/5] removing the next_type enum
  2026-09-15 10:46 [PATCH 3/5] removing the next_type enum Evgeny Sokolov
@ 2026-09-25 12:42 ` Burakov, Anatoly
  0 siblings, 0 replies; 2+ messages in thread
From: Burakov, Anatoly @ 2026-09-25 12:42 UTC (permalink / raw)
  To: Evgeny Sokolov, Vladimir Medvedkin; +Cc: dev, stable, simei.su

On 9/15/2026 12:46 PM, Evgeny Sokolov wrote:
> From: Sokolov Evgeny <Evgeny.Sokolov@infotecs.ru>
> 
> ---

This patch is odd.

First of all, the patch headline says it's the third patch of the 
series, but there is no "series" here, it's just a standalone patch. 
Please use appropriate git format-patch/send-email command line 
parameters to send patches with proper threading if this is indeed part 
of a series and not a standalone patch.

Moreover, there's no commit message.

Aside from general commit formatting issues, I'm of two opinions on this 
particular change. Specifically, I think this:


	if (next_type == RTE_FLOW_ITEM_END && ...)

actually looks better than this:

	if (((item + 1)->type == RTE_FLOW_ITEM_TYPE_END) && ...

because there's way less visual noise. So, I would keep next_type as 
local variable.

However, if the intention of this patch was to get rid of the three 
places where we set next_type, then I agree with that direction: we 
should only be setting it once. Perhaps we could set it before the 
switch statement?

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-25 12:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 10:46 [PATCH 3/5] removing the next_type enum Evgeny Sokolov
2026-09-25 12:42 ` Burakov, Anatoly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox