diff mbox series

[ovs-dev,ovs-dev,v2] odp-util: clearing padding in the nd_extension

Message ID 20200804015456.4047-1-hepeng.0320@bytedance.com
State Accepted
Delegated to: Ilya Maximets
Headers show
Series [ovs-dev,ovs-dev,v2] odp-util: clearing padding in the nd_extension | expand

Commit Message

.贺鹏 Aug. 4, 2020, 1:54 a.m. UTC
From: Peng He <hepeng.0320@bytedance.com>

Silimar to the patch 67eb8110171f ("odp-util: Fix passing
uninitialized bytes in OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV*.")
when change from flow into the netlink format, the tail
padding of nd_extension should be cleared.

this fixes the following warning logs:

2020-07-28T05:54:33.298Z|00001|15081|ofproto_dpif_upcall(pmd-c71/id:14)|WARN|Conflicting ukey for flows:
ufid:763c7d3b-4d0c-4bff-aafc-fdfb6089c2ba
skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(6),packet_type(ns=0,id=0),eth(src=fa:16:3e:75:b3:a9,dst=33:33:ff:00:00:01),eth_type(0x86dd),ipv6(src=fdbd:dc02:ff:1:1:225:72:102,dst=ff02::1:ff00:1,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=135,code=0),nd(target=fdbd:dc02:ff:1:1::1,sll=fa:16:3e:75:b3:a9,tll=00:00:00:00:00:00),nd_ext(nd_reserved=0x0,nd_options_type=1)
ufid:763c7d3b-4d0c-4bff-aafc-fdfb6089c2ba
skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(6),packet_type(ns=0,id=0),eth(src=fa:16:3e:75:b3:a9,dst=33:33:ff:00:00:01),eth_type(0x86dd),ipv6(src=fdbd:dc02:ff:1:1:225:72:102,dst=ff02::1:ff00:1,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=135,code=0),nd(target=fdbd:dc02:ff:1:1::1,sll=fa:16:3e:75:b3:a9,tll=00:00:00:00:00:00),nd_ext(nd_reserved=0x0,nd_options_type=1)
2020-07-28T05:54:33.298Z|00002|15081|ofproto_dpif_upcall(pmd-c71/id:14)|WARN|upcall_cb failure: ukey installation fails

Fixes: 9b2b84973db7 ("Support for match & set ICMPv6 reserved and options type fields")
Signed-off-by: Peng He <hepeng.0320@bytedance.com>
---
 lib/odp-util.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ilya Maximets Aug. 7, 2020, 1:49 p.m. UTC | #1
On 8/4/20 3:54 AM, hepeng.0320 wrote:
> From: Peng He <hepeng.0320@bytedance.com>
> 
> Silimar to the patch 67eb8110171f ("odp-util: Fix passing
> uninitialized bytes in OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV*.")
> when change from flow into the netlink format, the tail
> padding of nd_extension should be cleared.
> 
> this fixes the following warning logs:
> 
> 2020-07-28T05:54:33.298Z|00001|15081|ofproto_dpif_upcall(pmd-c71/id:14)|WARN|Conflicting ukey for flows:
> ufid:763c7d3b-4d0c-4bff-aafc-fdfb6089c2ba
> skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(6),packet_type(ns=0,id=0),eth(src=fa:16:3e:75:b3:a9,dst=33:33:ff:00:00:01),eth_type(0x86dd),ipv6(src=fdbd:dc02:ff:1:1:225:72:102,dst=ff02::1:ff00:1,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=135,code=0),nd(target=fdbd:dc02:ff:1:1::1,sll=fa:16:3e:75:b3:a9,tll=00:00:00:00:00:00),nd_ext(nd_reserved=0x0,nd_options_type=1)
> ufid:763c7d3b-4d0c-4bff-aafc-fdfb6089c2ba
> skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(6),packet_type(ns=0,id=0),eth(src=fa:16:3e:75:b3:a9,dst=33:33:ff:00:00:01),eth_type(0x86dd),ipv6(src=fdbd:dc02:ff:1:1:225:72:102,dst=ff02::1:ff00:1,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=135,code=0),nd(target=fdbd:dc02:ff:1:1::1,sll=fa:16:3e:75:b3:a9,tll=00:00:00:00:00:00),nd_ext(nd_reserved=0x0,nd_options_type=1)
> 2020-07-28T05:54:33.298Z|00002|15081|ofproto_dpif_upcall(pmd-c71/id:14)|WARN|upcall_cb failure: ukey installation fails
> 
> Fixes: 9b2b84973db7 ("Support for match & set ICMPv6 reserved and options type fields")
> Signed-off-by: Peng He <hepeng.0320@bytedance.com>
> ---

Seems I forgot to reply to this patch, sorry.

I applied it some time ago.  Also backported down to 2.12.
Thanks!

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/lib/odp-util.c b/lib/odp-util.c
index e54a78b43..5989381e9 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -6357,7 +6357,9 @@  odp_flow_key_from_flow__(const struct odp_flow_key_parms *parms,
                     struct ovs_key_nd_extensions *nd_ext_key;
 
                     if (data->igmp_group_ip4 != 0 || data->tcp_flags != 0) {
-                        nd_ext_key = nl_msg_put_unspec_uninit(buf,
+                        /* 'struct ovs_key_nd_extensions' has padding,
+                         * clear it. */
+                        nd_ext_key = nl_msg_put_unspec_zero(buf,
                                             OVS_KEY_ATTR_ND_EXTENSIONS,
                                             sizeof *nd_ext_key);
                         nd_ext_key->nd_reserved = data->igmp_group_ip4;