From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by dpdk.org (Postfix) with ESMTP id 75B9AA492 for ; Mon, 21 May 2018 08:52:40 +0200 (CEST) Received: by mail-pf0-f196.google.com with SMTP id p12-v6so6594954pff.13 for ; Sun, 20 May 2018 23:52:40 -0700 (PDT) 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=YFCGAH6uZNxtyioO1cXjzSWkH8pebfDdIRKRg8Vo+5E=; b=pHU4k+crTIk1p/tVW0huXzjT2uvgvMBM4rkSDP1FcIy2lDTCHKZdu1Uw7UhWYIJVmW D03Ndu9obwUE8V33ATyCJZNs+X1xcNXOtMlkGEqk6dEdoSIeTxQSrCWOlSd3EwrHThRA 0GHMyBiBguqRazE5POSYlohnJgYqfYSO1fIB9SoMIaR+shVlxGthrQKCDckuAPdRr0Ni WaC1+sh+gnZY7L+8yHyy2F6frj9OmJgUFAVUt050c3PkywHEllYxbqwap+zEyW22dWbh Qg7BQXyLc5c+Kif/OjSV9iYhAn4tcDWgwKGR86jrpEQ0RBS1u+0c+xsQ0ZX6iTOk4lEU 2LFg== 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=YFCGAH6uZNxtyioO1cXjzSWkH8pebfDdIRKRg8Vo+5E=; b=l8xuPhGLCPBOC+oz+TvGTNZh6X+0UUyS4AaiWuNHGpkCfPO7AWmNZtAsx3NVIwsAtD qHzdrj7N2Kokzq7s0/8SBJg6NVKYL7JI10gkMye+buKnNsSo3pttNioKBRFIWyq0gj4T IF/85uJiZTylUy2qkuW6Mwbj76bGz0ZvN8pQ2DfUbMAKtcB5WeS00XrpRkZkSNCF7ayo kVAmWXfVIueOl0y5mo5W8mJIubO/CotBNnPaUUZqwBRxjdJUxDtAu1odlu34acT4ChYa I1GpZeMC5gJHEF1/yZzIGr/6p/mRBY0LQ8GP/fPNMpIrwTwb4C47Bh/gM0rz8x7Bt/t3 EqBA== X-Gm-Message-State: ALKqPweXvysyBpS4xDDt5frcCRI1qaGCR8i15M+E5mLt9VE40i2dAFr4 ulI0AWw0MrIwEua1It8eBJu63w== X-Google-Smtp-Source: AB8JxZp6SwDAGbjCldr1kTZaBsd9KB4+hAQkLJmrnNqcLtkWN/+dpEoRH9cEhk0CG644SujkEoE5lQ== X-Received: by 2002:a62:4708:: with SMTP id u8-v6mr18960535pfa.89.1526885559589; Sun, 20 May 2018 23:52:39 -0700 (PDT) Received: from xeon-e3 (204-195-35-107.wavecable.com. [204.195.35.107]) by smtp.gmail.com with ESMTPSA id d19-v6sm33350109pfk.59.2018.05.20.23.52.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 May 2018 23:52:39 -0700 (PDT) Date: Sun, 20 May 2018 23:52:37 -0700 From: Stephen Hemminger To: Shreyansh Jain Cc: Andy Green , "dev@dpdk.org" Message-ID: <20180520235237.276dc37b@xeon-e3> In-Reply-To: References: <152656480225.46638.3271983577765861155.stgit@localhost.localdomain> <152656493702.46638.10712692446180001555.stgit@localhost.localdomain> <70fc4570-7447-a9fa-dda6-a41f220c35ca@warmcat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v5 01/21] lib/librte_ethdev: change eth-dev-ops API to return int 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: Mon, 21 May 2018 06:52:40 -0000 On Sun, 20 May 2018 02:43:58 +0000 Shreyansh Jain wrote: > > > This doesn't feel correct. A counter, especially the number of > > descriptors in a queue, doesn't have a negative value. So, 1) this is > > an unnatural return and 2) we litter the code with unnecessary > > typecast. > > > > > > In fact, even in the above change, the debug messages continue to > > print unsigned values. So, another typecast would be required there. > > > > > > I don't agree with this change - at least not until some strong gcc 8 > > warning reason is triggering this. Can you please point me to some > > conversation on mailing list which enforces this? > > > > > > > hmmmmm.... no, it's not my idea. > > > > If you don't like it, don't do it, I don't mind either way. I sent a > > patch that just solved the compiler error only already, and was told on > > the list it would be cooler if these things returned an int instead. > > > > There's no point challenging me about the wisdom of it, although it > > seems reasonable to me. I sent a patch, list guy $1 says do X instead, > > I do X and then list guy $2 says EXPLAIN YOURSELF. > > That is what a community is. Consensus has to be built, not expected automagically. If you touch a line, you are responsible for it (also, because in future git blame would point *you* out for a change). My comment was a suggestion, not a "you must do it this way". The reason was it was cleaner change for Gcc fix and it allowed for possibility that some driver might not detect an error (for example if device was removed by hot plug).