On 30/3/2017 12:25 AM, Harry van Haaren wrote:
From: Bruce Richardson <bruce.richard...@intel.com>

Add support for xstats to report out on the state of the eventdev.
Useful for debugging and for unit tests, as well as observability
at runtime and performance tuning of apps to work well with the
scheduler.


--snip--

+static int
+sw_xstats_reset_port(struct sw_evdev *sw, uint8_t port_id,
+               const uint32_t ids[], uint32_t nb_ids)
+{
+       const uint32_t reset = 1;
+       const uint32_t ret_n_lt_stats = 0;
+       int offset = sw->xstats_offset_for_port[port_id];
+       int nb_stat = sw->xstats_count_per_port[port_id];
+
+       if (ids) {
+               uint32_t nb_reset = sw_xstats_update(sw,
+                                       RTE_EVENT_DEV_XSTATS_PORT, port_id,
+                                       ids, NULL, nb_ids,
+                                       reset, ret_n_lt_stats);
+               return nb_reset == nb_ids ? 0 : -EINVAL;
+       } else
+               sw_xstats_reset_range(sw, offset, nb_stat);
+
+       return 0;
+}

Checkpatch warning here:
WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return
#747: FILE: drivers/event/sw/sw_evdev_xstats.c:611:
+               return nb_reset == nb_ids ? 0 : -EINVAL;
+       } else

So can be changed to

+               return nb_reset == nb_ids ? 0 : -EINVAL;
+       }
+
+       sw_xstats_reset_range(sw, offset, nb_stat);
+
+       return 0;


Apart from that:

Acked-by: David Hunt <david.h...@intel.com>


Reply via email to