From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 853485B32 for ; Fri, 23 Nov 2018 18:22:19 +0100 (CET) Received: by mail-pf1-f194.google.com with SMTP id u3-v6so3626825pfm.4 for ; Fri, 23 Nov 2018 09:22:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bli5Frn4Rf9iK4OAb5fGU+KRMpb9O+/R0pTvXIWcQ2M=; b=dNRW7OPYey11GfgPI9xA1znQYY/ZDI8ucEH6r3B8oezhK3hEFl7XY+WtLf1BG+D/OT GNHuCpXQ63cnT1IaFBw5JChMGzf23JdMfMKXNTm2PPEy+pTJkTVXSrt+/HRt4kh5p7H8 rvjJ23TWX3p+oJeYx3yh5EKdPneEZQWo6sxzHVQLGuotlIkOC4QMr/u0xqK5rJVa9A5p U97dcGB23tBGdfxL+LMZzm1/tW3JBvG3kVbAW3Ecxi/jXBdiXrvyX/HHneeqH2zBPEY5 /fWDmhIiMVyyVwY88t3lLsxfCQYrQeiHo1CJFcWAzT0sJrNoGaP9slSuzvHMkNCEMfsp 43wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bli5Frn4Rf9iK4OAb5fGU+KRMpb9O+/R0pTvXIWcQ2M=; b=Pq+0AD6FiPz2NbyDFeeJ4XWCO3fOJRA/YQEk/PALpxDHg2UkySf7nVPhZuGkl+azWw dbBCuxvqlo4gCMcMrZtATX25jVgRpgoF9093lDbeOCJI6JToaie7JEUPrtmA4HuoNqU9 Ktc3HwJrP75cxqXaP+AsYNeaq9XveKQKZV1NBHh6KP4lUAgVK4k1XStjJKaVl110HzBM /eE3dK2jxI5QH9/2A7/YI0kCqbY4N4cWNbEq+MKFFGdh/IVaiFA8ylMgXPZ8VH6/zxsF LU6aXAcq/9GxHIoHqsX79JC5lXkcVZVAAHBUDiJMklXW65mrgVG2Kgu1gSInmCubCPKa 3zPg== X-Gm-Message-State: AA+aEWY0YhS/DVfglczoWuio5DeDlvdgrMfxIApMUXBIZriPuD7zsrZR d97ri7fweaBUGg/uiwj+ni+i2w== X-Google-Smtp-Source: AFSGD/W8NR0ne6a3LRh+0b6QtwvP401zUSH3QljQwp2RhEJ9BYMkbdClie9joWnUd/ePDC1ZWjm3Dw== X-Received: by 2002:a63:1444:: with SMTP id 4mr14971269pgu.430.1542993738535; Fri, 23 Nov 2018 09:22:18 -0800 (PST) Received: from xeon-e3 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id u70sm14343531pfa.176.2018.11.23.09.22.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Nov 2018 09:22:18 -0800 (PST) Date: Fri, 23 Nov 2018 09:22:15 -0800 From: Stephen Hemminger To: "Varghese, Vipin" Cc: "Pattan, Reshma" , "dev@dpdk.org" , "thomas@monjalon.net" , "Mcnamara, John" , "Byrne, Stephen1" , "Glynn, Michael J" , "Patel, Amol" Message-ID: <20181123092215.50d299ae@xeon-e3> In-Reply-To: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2C1B26@BGSMSX101.gar.corp.intel.com> References: <20181106124912.40700-1-vipin.varghese@intel.com> <20181106124912.40700-5-vipin.varghese@intel.com> <3AEA2BF9852C6F48A459DA490692831F2A3D58A3@irsmsx110.ger.corp.intel.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2C1435@BGSMSX101.gar.corp.intel.com> <3AEA2BF9852C6F48A459DA490692831F2A3D61A6@irsmsx110.ger.corp.intel.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2C1A45@BGSMSX101.gar.corp.intel.com> <3AEA2BF9852C6F48A459DA490692831F2A3D6264@irsmsx110.ger.corp.intel.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2C1A79@BGSMSX101.gar.corp.intel.com> <3AEA2BF9852C6F48A459DA490692831F2A3D62FB@irsmsx110.ger.corp.intel.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2C1B26@BGSMSX101.gar.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 5/9] app/procinfo: add support for show tm 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: Fri, 23 Nov 2018 17:22:19 -0000 On Fri, 23 Nov 2018 15:05:07 +0000 "Varghese, Vipin" wrote: > > > > > > > > > > > > > > > > > > > > > > > > + if ((ret) | (!is_leaf)) > > > > > > > > > + > > > > > > > > > > > > > > > > Is the operator here should be || ? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Check is done for 'if either ret is not 0 or if it ret is 0 > > > > > > > but not leaf' we skip leaf details print. If 'ret is 0 and is leaf' > > > > > > > we skip continue to print > > > > > > leaf details. > > > > > > > > > > > > IMO, using logical operator over bitwise operator is good here > > > > > > in if statement > > > > > . > > > > > > Like below.? > > > > > > > > > > > > If (ret || (is_leaf == 0 )) > > > > > > > > > > Thanks for the information, if the logic is correct do I need to > > > > > change for v6 > > > > > > > > > > > > > OK in v6, but you can wait to hear more comments from others if any > > > > before sending v6 . > > > > > > Ok thanks Reshma, but can you tell me how the earlier logic fails and > > > runs slow compared to logical or? > > > > Not about faster or slower. > > Now I see, I was wondering the suggestion was for improvement for performance. > > > > > Logical operators are commonly used in decision making in C programming. > > Bitwise operators are used in C programming to perform bit-level operations. > > > > Agreed > > > Since , above if condition is for decision making here logical || operator will fit > > , so I am suggesting to use that. > > > > But bitwise OR is not wrong right? > > > We don't need to do any bitwise manipulation in if condition to make the > > decision, so bitwise | operator is not needed > > We can correct this in next patch set not v6 if this is only change for 'show tm' It could be that compiler might optimize logical into bitwise operation to avoid cost of conditional branch (if there are no side effects).