Re: [ovs-dev] [PATCH v2 2/4] netdev-offload-tc: Use ipv6_addr_is_set instead of is_all_zeros

2020-06-05 Thread 0-day Robot
Bleep bloop.  Greetings Tonghao Zhang, I am a robot and I have tried out your 
patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
WARNING: Line is 86 characters long (recommended limit is 79)
#146 FILE: lib/tc.c:1750:
VLOG_ERR_RL(_rl, "failed to parse flower classifier terse 
options");

Lines checked: 226, Warnings: 1, Errors: 0


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2 2/4] netdev-offload-tc: Use ipv6_addr_is_set instead of is_all_zeros

2020-06-02 Thread xiangxia . m . yue
From: Tonghao Zhang 

Not bugfix, make the codes more readable.

Cc: Simon Horman 
Cc: Paul Blakey 
Cc: Roi Dayan 
Cc: Ben Pfaff 
Cc: William Tu 
Cc: Ilya Maximets 
Signed-off-by: Tonghao Zhang 
Acked-by: Roi Dayan 
---
 lib/netdev-offload-tc.c | 6 ++
 lib/tc.c| 6 ++
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
index 875ebef71941..9b7c74aae887 100644
--- a/lib/netdev-offload-tc.c
+++ b/lib/netdev-offload-tc.c
@@ -734,13 +734,11 @@ parse_tc_flower_to_match(struct tc_flower *flower,
 nl_msg_put_be32(buf, OVS_TUNNEL_KEY_ATTR_IPV4_DST,
 action->encap.ipv4.ipv4_dst);
 }
-if (!is_all_zeros(>encap.ipv6.ipv6_src,
-  sizeof action->encap.ipv6.ipv6_src)) {
+if (ipv6_addr_is_set(>encap.ipv6.ipv6_src)) {
 nl_msg_put_in6_addr(buf, OVS_TUNNEL_KEY_ATTR_IPV6_SRC,
 >encap.ipv6.ipv6_src);
 }
-if (!is_all_zeros(>encap.ipv6.ipv6_dst,
-  sizeof action->encap.ipv6.ipv6_dst)) {
+if (ipv6_addr_is_set(>encap.ipv6.ipv6_dst)) {
 nl_msg_put_in6_addr(buf, OVS_TUNNEL_KEY_ATTR_IPV6_DST,
 >encap.ipv6.ipv6_dst);
 }
diff --git a/lib/tc.c b/lib/tc.c
index 12af0192b614..a6297445ca33 100644
--- a/lib/tc.c
+++ b/lib/tc.c
@@ -2038,7 +2038,7 @@ nl_msg_put_act_tunnel_key_set(struct ofpbuf *request, 
bool id_present,
 if (ipv4_dst) {
 nl_msg_put_be32(request, TCA_TUNNEL_KEY_ENC_IPV4_SRC, ipv4_src);
 nl_msg_put_be32(request, TCA_TUNNEL_KEY_ENC_IPV4_DST, ipv4_dst);
-} else if (!is_all_zeros(ipv6_dst, sizeof *ipv6_dst)) {
+} else if (ipv6_addr_is_set(ipv6_dst)) {
 nl_msg_put_in6_addr(request, TCA_TUNNEL_KEY_ENC_IPV6_DST,
 ipv6_dst);
 nl_msg_put_in6_addr(request, TCA_TUNNEL_KEY_ENC_IPV6_SRC,
@@ -2135,12 +2135,10 @@ nl_msg_put_act_ct(struct ofpbuf *request, struct 
tc_action *action)
 action->ct.range.ipv4.max);
 }
 } else if (action->ct.range.ip_family == AF_INET6) {
-size_t ipv6_sz = sizeof(action->ct.range.ipv6.max);
 
 nl_msg_put_in6_addr(request, TCA_CT_NAT_IPV6_MIN,
 >ct.range.ipv6.min);
-if (!is_all_zeros(>ct.range.ipv6.max,
-  ipv6_sz)) {
+if (ipv6_addr_is_set(>ct.range.ipv6.max)) {
 nl_msg_put_in6_addr(request, TCA_CT_NAT_IPV6_MAX,
 >ct.range.ipv6.max);
 }
-- 
2.26.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev