Hi Ben I am not quite getting the below error. I believe this may be coming because of existing macro atomic_read_explicit definition. #define atomic_read_explicit(SRC, DST, ORDER) \ (*(DST) = atomic_load_explicit(SRC, ORDER), \ (void) 0) Where I believe it is cribbing for (void)0 which gcc is cribbing that it may not have any effect. I have corrected the other errors.
I see some discussion of this sort in this URL. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61081 From the discussion if I understood correctly it is a false alarm present from gcc 4.9. >> In file included from ../lib/ovs-atomic.h:331, >> from ../lib/dpif-netdev-perf.h:32, >> from ../lib/dpif-netdev-perf.c:20: >> ../lib/dpif-netdev-perf.c: In function 'pmd_perf_drop_stats_clear': >> ../lib/ovs-atomic-c11.h:31:47: error: right-hand operand of comma >> expression has no effect [-Werror=unused-value] >> (*(DST) = atomic_load_explicit(SRC, ORDER), \ >> ^ >> ../lib/ovs-atomic.h:401:5: note: in expansion of macro >> 'atomic_read_explicit' >> atomic_read_explicit(VAR, DST, memory_order_relaxed) >> ^~~~~~~~~~~~~~~~~~~~ >> ../lib/dpif-netdev-perf.c:474:9: note: in expansion of macro >> 'atomic_read_relaxed' >> atomic_read_relaxed(&s->drop_counters.n.rx_drops[i], >> ^~~~~~~~~~~~~~~~~~~ >> ../lib/ovs-atomic-c11.h:31:47: error: right-hand operand of comma >> expression has no effect [-Werror=unused-value] (*(DST) = atomic_load_explicit(SRC, ORDER), \ Thanks Keshav -----Original Message----- From: Ben Pfaff [mailto:b...@ovn.org] Sent: Saturday, September 08, 2018 1:29 AM To: Keshav Gupta <keshav.gu...@ericsson.com> Cc: d...@openvswitch.org; Anju Thomas <anju.tho...@ericsson.com> Subject: Re: [ovs-dev] [PATCH v3] Improved Packet Drop Statistics in OVS On Sat, Sep 08, 2018 at 03:00:56AM +0530, Keshav Gupta wrote: > Currently OVS maintains explicit packet drop/error counters only on port > level. Packets that are dropped as part of normal OpenFlow processing are > counted in flow stats of “drop” flows or as table misses in table stats. > These can only be interpreted by controllers that know the semantics of > the configured OpenFlow pipeline. Without that knowledge, it is impossible > for an OVS user to obtain e.g. the total number of packets dropped due to > OpenFlow rules. > > Furthermore, there are numerous other reasons for which packets can be > dropped by OVS slow path that are not related to the OpenFlow pipeline. > The generated datapath flow entries include a drop action to avoid further > expensive upcalls to the slow path, but subsequent packets dropped by the > datapath are not accounted anywhere. > > Finally, the datapath itself drops packets in certain error situations. > Also, these drops are today not accounted for. > > This makes it difficult for OVS users to monitor packet drop in an OVS > instance and to alert a management system in case of a unexpected increase > of such drops. Also OVS trouble-shooters face difficulties in analysing > packet drops. > > With this patch we implement following changes to address the issues > mentioned above. > > 1. Account and categorize all the packet drops in OVS. > 2. Account & classify “drop” action packet drops according to the drop > reason. > 3. Identify and account all the silent packet drop scenarios. > 4. Have new cli command to display consolidated packet drop output > 5. Modified ovs-appctl dpcls/dump-flows and ovs-appctl dpif/dump-flows > to print drop reason along with drop action > > A detailed presentation on this was presented at OvS conference 2017 and > link for the corresponding presentation is available at: > > https://www.slideshare.net/LF_OpenvSwitch/lfovs17troubleshooting-the-d > ata-plane-in-ovs-82280329 > > Sample ovs-appctl dpcls/dump-flows & ovs-appctl dpif/dump-flows > displaying drop reason along with drop action. > --------------------------------------------------------------- > > $ ovs-appctl dpctl/dump-flows netdev@ovs-netdev > flow-dump from pmd on cpu core: 0 > > recirc_id(0),in_port(5),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(f > rag=no), packets:12, bytes:1176, used:0.884s, actions:drop:recursion > too deep > > $ ovs-appctl dpif/dump-flows br-int > > recirc_id(0),in_port(5),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), > packets:25, bytes:2450, used:5.008s, actions:drop:recursion too deep > recirc_id(0),in_port(5),packet_type(ns=0,id=0),eth_type(0x0806), > packets:7, bytes:294, used:0.009s, actions:drop:recursion too deep > > Sample drop stats summary output. > --------------------------------- > $ ovs-appctl dpif/show-drop-stats > netdev: > rx-drops :0 > dataplane-processing-drops :59 > drop action :59 > upcall drops :0 > dp error drops :0 > tx-drops :0 > > Sample detailed drop stats output. > --------------------------------- > $ ovs-appctl dpif/show-drop-stats --detail > netdev: > rx-drops: > [IDX] Drop Reason Packets > ------- ------------------------------------- ------------ > 0 interface & policer 0 > 1 parsing error/invalid packet 0 > dataplane-processing-drops: > "drop" action: > 2 pipeline drop 0 > 3 bridge not found 0 > 4 recursion too deep 68 > 5 too many resubmits 0 > 6 stack too deep 0 > 7 no recirculation context 0 > 8 recirculation conflict 0 > 9 too many mpls labels 0 > 10 invalid tunnel metadata 0 > 11 unsupported packet type 0 > 12 ecn mismatch at tunnel decapsulation 0 > 13 forwarding disabled (stp/rstp) 0 > upcall drops: > 14 upcall lock contention drop 0 > 15 upcall error drops 0 > dp error drops: > 16 tunnel pop action errors 0 > 17 tunnel push action errors 0 > 18 nsh decap errors 0 > 19 recirculation errors 0 > 20 sampling error 0 > 21 meter drop 0 > 22 user space action error 0 > 23 invalid port 0 > 24 invalid tunnel port 0 > tx-drops: > 25 interface & policer 0 > > Drop stats clear command. > --------------------------------- > $ ovs-appctl dpif/clear-drop-stats > $ ovs-appctl dpif/show-drop-stats > netdev: > rx-drops :0 > dataplane-processing-drops :0 > drop action :0 > upcall drops :0 > dp error drops :0 > tx-drops :0 > > Co-authored-by: Rohith Basavaraja <rohith.basavar...@gmail.com> > Co-authored-by: Anju Thomas <anju.tho...@ericsson.com> > Signed-off-by: Rohith Basavaraja <rohith.basavar...@gmail.com> > Signed-off-by: Keshav Gupta <keshav.gu...@ericsson.com> > Signed-off-by: Anju Thomas <anju.tho...@ericsson.com> Thanks for the patch. Please don't indent the commit message like that. The commit message should be at the left margin. "Clang" says; ../ofproto/ofproto-dpif.c:5810:14: error: declaration shadows a local variable [-Werror,-Wshadow] ../ofproto/ofproto-dpif.c:5805:9: note: previous declaration is here ../ofproto/ofproto-dpif.c:5843:66: error: unused parameter 'argv' [-Werror,-Wunused-parameter] Makefile:5133: recipe for target 'ofproto/ofproto_libofproto_la-ofproto-dpif.lo' failed GCC says: In file included from ../lib/ovs-atomic.h:331, from ../lib/dpif-netdev-perf.h:32, from ../lib/dpif-netdev-perf.c:20: ../lib/dpif-netdev-perf.c: In function 'pmd_perf_drop_stats_clear': ../lib/ovs-atomic-c11.h:31:47: error: right-hand operand of comma expression has no effect [-Werror=unused-value] (*(DST) = atomic_load_explicit(SRC, ORDER), \ ^ ../lib/ovs-atomic.h:401:5: note: in expansion of macro 'atomic_read_explicit' atomic_read_explicit(VAR, DST, memory_order_relaxed) ^~~~~~~~~~~~~~~~~~~~ ../lib/dpif-netdev-perf.c:474:9: note: in expansion of macro 'atomic_read_relaxed' atomic_read_relaxed(&s->drop_counters.n.rx_drops[i], ^~~~~~~~~~~~~~~~~~~ ../lib/ovs-atomic-c11.h:31:47: error: right-hand operand of comma expression has no effect [-Werror=unused-value] (*(DST) = atomic_load_explicit(SRC, ORDER), \ ^ ../lib/ovs-atomic.h:401:5: note: in expansion of macro 'atomic_read_explicit' atomic_read_explicit(VAR, DST, memory_order_relaxed) ^~~~~~~~~~~~~~~~~~~~ ../lib/dpif-netdev-perf.c:478:9: note: in expansion of macro 'atomic_read_relaxed' atomic_read_relaxed(&s->drop_counters.n.drop_action_drops[i], ^~~~~~~~~~~~~~~~~~~ ../lib/ovs-atomic-c11.h:31:47: error: right-hand operand of comma expression has no effect [-Werror=unused-value] (*(DST) = atomic_load_explicit(SRC, ORDER), \ ^ ../lib/ovs-atomic.h:401:5: note: in expansion of macro 'atomic_read_explicit' atomic_read_explicit(VAR, DST, memory_order_relaxed) ^~~~~~~~~~~~~~~~~~~~ ../lib/dpif-netdev-perf.c:482:9: note: in expansion of macro 'atomic_read_relaxed' atomic_read_relaxed(&s->drop_counters.n.dp_drops[i], ^~~~~~~~~~~~~~~~~~~ ../lib/ovs-atomic-c11.h:31:47: error: right-hand operand of comma expression has no effect [-Werror=unused-value] (*(DST) = atomic_load_explicit(SRC, ORDER), \ ^ ../lib/ovs-atomic.h:401:5: note: in expansion of macro 'atomic_read_explicit' atomic_read_explicit(VAR, DST, memory_order_relaxed) ^~~~~~~~~~~~~~~~~~~~ ../lib/dpif-netdev-perf.c:486:9: note: in expansion of macro 'atomic_read_relaxed' atomic_read_relaxed(&s->drop_counters.n.tx_drops[i], ^~~~~~~~~~~~~~~~~~~ ../ofproto/ofproto-dpif.c:5810:14: error: symbol 'i' shadows an earlier one ../ofproto/ofproto-dpif.c:5805:9: originally declared here "sparse" says: ../ofproto/ofproto-dpif-xlate.c:456:23: error: symbol 'xlate_error_to_drop_reason' redeclared with different type (originally declared at ../ofproto/ofproto-dpif-xlate.h:227) - different signedness Please fix these issues and resubmit. _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev