From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 72300A0545; Wed, 21 Dec 2022 03:47:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2631440698; Wed, 21 Dec 2022 03:47:05 +0100 (CET) Received: from inbox.dpdk.org (inbox.dpdk.org [95.142.172.178]) by mails.dpdk.org (Postfix) with ESMTP id CA92740684 for ; Wed, 21 Dec 2022 03:47:04 +0100 (CET) Received: by inbox.dpdk.org (Postfix, from userid 33) id A97E3A0547; Wed, 21 Dec 2022 03:47:04 +0100 (CET) From: bugzilla@dpdk.org To: dev@dpdk.org Subject: [Bug 1155] DPDK 22.07 RTE flow: Segmentation fault seen in i40e_flow_parse_fdir_filter() for raw item type Date: Wed, 21 Dec 2022 02:47:03 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DPDK X-Bugzilla-Component: other X-Bugzilla-Version: 22.07 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: lthammin@usc.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: dev@dpdk.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org https://bugs.dpdk.org/show_bug.cgi?id=3D1155 Bug ID: 1155 Summary: DPDK 22.07 RTE flow: Segmentation fault seen in i40e_flow_parse_fdir_filter() for raw item type Product: DPDK Version: 22.07 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: critical Priority: Normal Component: other Assignee: dev@dpdk.org Reporter: lthammin@usc.edu Target Milestone: --- I am using a RTE_FLOW_ITEM_TYPE_RAW to match a flow with specific src-ip address from IP header. With this, it is recommended to use pre-defined rte_flow_item_raw_mask(default mask) as the mask. /** Default mask for RTE_FLOW_ITEM_TYPE_RAW. */ #ifndef __cplusplus static const struct rte_flow_item_raw rte_flow_item_raw_mask =3D { .relative =3D 1, .search =3D 1, .reserved =3D 0x3fffffff, .offset =3D 0xffffffff, .limit =3D 0xffff, .length =3D 0xffff, .pattern =3D NULL, }; #endif When I use this default mask and call rte_flow_validate(), I get a segmenta= tion fault. But, if I replace the NULL pattern by a non-NULL pointer having some string then I don't see the segmentation fault (uncomment pattern[1].mask = =3D &raw_mask; in below code).=20 Below are my api and gdb backtrace. void dpdk_flow_add_raw_type (dpdk_device_t * xd) { /* create the attribute structure */ struct rte_flow_attr attr =3D { .ingress =3D 1 }; struct rte_flow_item pattern[3]; struct rte_flow_action actions[2]; struct rte_flow_item_raw raw_src_ip; struct rte_flow_item_raw raw_mask; uint8_t src_ip_str[5]; uint8_t raw_mask_str[5]; struct rte_flow_action_queue queue =3D { .index =3D 3 }; struct rte_flow_error error; int rv; /* setting the eth to pass all packets */ pattern[0].type =3D RTE_FLOW_ITEM_TYPE_ETH; pattern[0].spec =3D NULL; pattern[0].mask =3D NULL; pattern[0].last =3D NULL; /* Match src-ip 44.45.46.47 */ src_ip_str[0] =3D 44; src_ip_str[1] =3D 45; src_ip_str[2] =3D 46; src_ip_str[3] =3D 47; src_ip_str[4] =3D '\0'; /* Setting raw item mask's pattern to all 1s. Not sure if this is r= ight */ raw_mask_str[0] =3D 0xff; raw_mask_str[1] =3D 0xff; raw_mask_str[2] =3D 0xff; raw_mask_str[3] =3D 0xff; raw_mask_str[4] =3D '\0'; /* Same as rte_flow_item_raw_mask (default raw mask) except that pattern is non-NULL */ raw_mask.relative =3D 1; raw_mask.search =3D 1; raw_mask.reserved =3D 0x3fffffff; raw_mask.offset =3D 0xffffffff; raw_mask.limit =3D 0xffff; raw_mask.length =3D 0xffff; //raw_mask.pattern =3D NULL, raw_mask.pattern =3D raw_mask_str; pattern[1].type =3D RTE_FLOW_ITEM_TYPE_RAW; raw_src_ip.relative =3D 1; raw_src_ip.search =3D 0; raw_src_ip.offset =3D 12; // src-ip in IP header starts after 12 by= tes raw_src_ip.limit =3D 0; raw_src_ip.length =3D 4; // src-ip is 4 bytes long raw_src_ip.pattern =3D src_ip_str; // Match 44.45.46.47 of length 4= bytes after 12 bytes pattern[1].spec =3D &raw_src_ip; pattern[1].mask =3D &rte_flow_item_raw_mask; //pattern[1].mask =3D &raw_mask; // comment above line and un-comm= ent this. Then segmentation fault is not seen. pattern[1].last =3D NULL; pattern[2].type =3D RTE_FLOW_ITEM_TYPE_END; /* create the queue action */ actions[0].type =3D RTE_FLOW_ACTION_TYPE_QUEUE; actions[0].conf =3D &queue;=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 // redirect to queue 3 actions[1].type =3D RTE_FLOW_ACTION_TYPE_END; /* validate and create the flow rule */ if (!(rv =3D rte_flow_validate(xd->port_id, &attr, pattern, actions, &error))) rte_flow_create(xd->port_id, &attr, pattern, actions, &erro= r); } Thread 1 "vpp_main" received signal SIGSEGV, Segmentation fault. 0x00007fffb4c9b35b in i40e_flow_parse_fdir_filter () from build-root/install-vpp_debug-native/vpp/lib/x86_64-linux-gnu/vpp_plugins/dp= dk_plugin.so (gdb) bt #0 0x00007fffb4c9b35b in i40e_flow_parse_fdir_filter () from build-root/install-vpp_debug-native/vpp/lib/x86_64-linux-gnu/vpp_plugins/dp= dk_plugin.so #1 0x00007fffb4c97c6e in i40e_flow_validate () from build-root/install-vpp_debug-native/vpp/lib/x86_64-linux-gnu/vpp_plugins/dp= dk_plugin.so #2 0x00007fffb4aa50f2 in rte_flow_validate () from build-root/install-vpp_debug-native/vpp/lib/x86_64-linux-gnu/vpp_plugins/dp= dk_plugin.so #3 0x00007fffb4fdab1e in dpdk_flow_add_raw_type (xd=3D0x7fffbda2b200) at=20 Please check this out and let me know. Thanks, Nikhil --=20 You are receiving this mail because: You are the assignee for the bug.=