[v2] net/iavf: fix wrong FDIR L3 field set for IPv4 fragment packets

Message ID 20210817064955.160102-1-wenjun1.wu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v2] net/iavf: fix wrong FDIR L3 field set for IPv4 fragment packets |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Wenjun Wu Aug. 17, 2021, 6:49 a.m. UTC
  Originally, the value of field_selector for IPV4_FRAG header hdr1 is
the same as the previous header hdr2. For IPv4 packets, field_selector
for hdr2 can be any value between 0 and 4, depending on the selected
field. Actually, this value for IPV4_FRAG should be constant 0,
which denotes the field packet ID.

This patch adds an assignment to hdr1->field_selector to make sure that
it is always 0.

Fixes: 3334513ef484 ("net/iavf: support flow director for IP fragment")

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>

---
v2: reword commit log
---
 drivers/net/iavf/iavf_fdir.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Qi Zhang Aug. 29, 2021, 11:18 a.m. UTC | #1
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Wenjun Wu
> Sent: Tuesday, August 17, 2021 2:50 PM
> To: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>
> Cc: Wu, Wenjun1 <wenjun1.wu@intel.com>
> Subject: [dpdk-dev] [PATCH v2] net/iavf: fix wrong FDIR L3 field set for IPv4
> fragment packets
> 
> Originally, the value of field_selector for IPV4_FRAG header hdr1 is the same as
> the previous header hdr2. For IPv4 packets, field_selector for hdr2 can be any
> value between 0 and 4, depending on the selected field. Actually, this value for
> IPV4_FRAG should be constant 0, which denotes the field packet ID.
> 
> This patch adds an assignment to hdr1->field_selector to make sure that it is
> always 0.
> 
> Fixes: 3334513ef484 ("net/iavf: support flow director for IP fragment")
> 
> Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  

Patch

diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c
index 2869a8b424..32b06044f2 100644
--- a/drivers/net/iavf/iavf_fdir.c
+++ b/drivers/net/iavf/iavf_fdir.c
@@ -664,6 +664,7 @@  iavf_fdir_add_fragment_hdr(struct virtchnl_proto_hdrs *hdrs, int layer)
 	/* adding dummy fragment header */
 	hdr1 = &hdrs->proto_hdr[layer];
 	VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV4_FRAG);
+	hdr1->field_selector = 0;
 	hdrs->count = ++layer;
 }