From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 07BF010FAB for ; Thu, 30 Mar 2017 13:13:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490872381; x=1522408381; h=subject:to:references:cc:from:message-id:date: mime-version:in-reply-to; bh=mSW7sUKD7Gkz0DFO6MKif/Tz3m8T1Pczt4VWrVjwMro=; b=xK/infjnFfyXYD+kJ0CnJ0Vk65j3xjB6OKSyGsriX6DWVbVMVXbYoUh/ lb6fzszR3v9MtEspz/R63b2zz+vIXg==; Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Mar 2017 04:12:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,246,1486454400"; d="scan'208,217";a="241996364" Received: from dhunt5-mobl.ger.corp.intel.com (HELO [10.237.221.69]) ([10.237.221.69]) by fmsmga004.fm.intel.com with ESMTP; 30 Mar 2017 04:12:58 -0700 To: Harry van Haaren , dev@dpdk.org References: <1490374395-149320-1-git-send-email-harry.van.haaren@intel.com> <1490829963-106807-1-git-send-email-harry.van.haaren@intel.com> <1490829963-106807-15-git-send-email-harry.van.haaren@intel.com> Cc: jerin.jacob@caviumnetworks.com, Bruce Richardson From: "Hunt, David" Message-ID: <65840fd1-9833-232b-bebc-645efc3fc9ce@intel.com> Date: Thu, 30 Mar 2017 12:12:57 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1490829963-106807-15-git-send-email-harry.van.haaren@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v6 14/21] event/sw: add xstats support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 11:13:01 -0000 On 30/3/2017 12:25 AM, Harry van Haaren wrote: > From: Bruce Richardson > > 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