From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id 784AD1B857 for ; Fri, 11 Jan 2019 07:03:24 +0100 (CET) Received: by mail-pl1-f193.google.com with SMTP id y1so6279168plp.9 for ; Thu, 10 Jan 2019 22:03:24 -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=U8abJF/2L9XWEZvSPaufp6mJEKuOL25d4u10RbvvyEA=; b=uLMwVvWx3tH9Aa3wDHjFi08oK3lycrS9Si+rdBPjOUFPan8LNwH+0j5NVQepzA+q+A qG2jfEcDw95mNB+8EfTrZyPmr3jFCCmhq3Yl6eTWSqdhc8Mz8BxXl+oXixTnE4LcDi8i GkOsA8TCwte3gBRLjXevyr6QxHkpXocp3a7yxcH+WnUDSw7YQCVhNdgv4R6CBBOU9Y6E lCtNZU85C0UsQAyEqaLh9jMMNdvyrAHYuVVjwvLJj52mopA8fk73w6RhDUv2umwPVkHR 2OxcCQKzv5fVh9f0T9CX/+RXLGpmLaR7U5tQfRLLcS7Hahqy8VXzR+7hIVVVmSeu1V0A JK2Q== 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=U8abJF/2L9XWEZvSPaufp6mJEKuOL25d4u10RbvvyEA=; b=SJt838A5Q4l/5rHx5ogJisuYdj92ebKTQoOubmMsBv1/iJvktmPb+a3nWna5kmPw6I MLRqNapkrmR7YRFQwG379p6CDOGbt5pMEuS8OcguOMlporEctebg92VphPc104PR6woa ohThLkAAlVXtQS0PRjq2QXbfcEk4Y9s2udRKQEouuA1FGreQZoS+OZiOCjf5kqhIIbug gdkpvIQ+JYjFEEyEMSRBPn4meKT5dN7k5ptO6jhB+xxdjQLW+rjNVAh7TshhUpEgTv4L CG9lG4e9FlF2HcPf6IxLmHRRa7cPH+8wiogObwu/hoSaRJ3xmgTzbmMa3eseZ/EE5kF7 hZqQ== X-Gm-Message-State: AJcUukeQedm16ImRCQcTimoYYtI+TyUo9TmuXnoxVHVDJiuHX0QSaOCe 73X/EKXwj9RepBGQoV8IM/IZbw== X-Google-Smtp-Source: ALg8bN6JyhKjH7MhcqltloZiaRXJeLOHkIcOqx7YDuDtEOKSM03vA0XpbFs3q8uY4fTPmHgBk7Mgzg== X-Received: by 2002:a17:902:4624:: with SMTP id o33mr13096482pld.289.1547186603454; Thu, 10 Jan 2019 22:03:23 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id f67sm158490619pff.29.2019.01.10.22.03.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Jan 2019 22:03:23 -0800 (PST) Date: Thu, 10 Jan 2019 22:03:16 -0800 From: Stephen Hemminger To: "Gavin Hu (Arm Technology China)" Cc: "Dumitrescu, Cristian" , "Van Haaren, Harry" , "dev@dpdk.org" , "Pattan, Reshma" , "thomas@monjalon.net" , "olivier.matz@6wind.com" , Honnappa Nagarahalli Message-ID: <20190110220316.3937ad07@hermes.lan> In-Reply-To: References: <20190110165051.4859-1-harry.van.haaren@intel.com> <20190110180658.23302-1-harry.van.haaren@intel.com> <3EB4FA525960D640B5BDFFD6A3D891268E828A86@IRSMSX108.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] mbuf: fix compile by removing struct from function 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, 11 Jan 2019 06:03:24 -0000 On Fri, 11 Jan 2019 03:01:43 +0000 "Gavin Hu (Arm Technology China)" wrote: > > -----Original Message----- > > From: dev On Behalf Of Dumitrescu, Cristian > > Sent: Friday, January 11, 2019 2:40 AM > > To: Van Haaren, Harry ; dev@dpdk.org > > Cc: Pattan, Reshma ; thomas@monjalon.net; > > olivier.matz@6wind.com > > Subject: Re: [dpdk-dev] [PATCH v2] mbuf: fix compile by removing struct > > from function > > > > > > > > > -----Original Message----- > > > From: Van Haaren, Harry > > > Sent: Thursday, January 10, 2019 6:07 PM > > > To: dev@dpdk.org > > > Cc: Van Haaren, Harry ; Pattan, Reshma > > > ; Dumitrescu, Cristian > > > ; thomas@monjalon.net; > > > olivier.matz@6wind.com > > > Subject: [PATCH v2] mbuf: fix compile by removing struct from function > > > > > > Although C compilation works with the struct rte_mbuf_sched > > > declared inside the struct rte_mbuf namespace, C++ fails to > > > compile. > > > > > > This fix removes the temporary struct rte_mbuf_sched, instead > > > reading from the mbuf directly for each struct member. As the > > > struct is now not used directly, the C++ compiler doesn't need > > > to know about the struct, resolving the issue. > > > > > > Fixes: 5d3f72100904 ("mbuf: implement generic format for sched field") > > > > > > Signed-off-by: Harry van Haaren > > > > > > --- > > > > > > Cc: reshma.pattan@intel.com > > > Cc: cristian.dumitrescu@intel.com > > > Cc: thomas@monjalon.net > > > Cc: olivier.matz@6wind.com > > > > > > See mailing list for v1 discussion, perhaps this solution is more > > > readable due to leaving sched struct in-line in the mbuf struct. > > > --- > > > lib/librte_mbuf/rte_mbuf.h | 16 ++++++---------- > > > 1 file changed, 6 insertions(+), 10 deletions(-) > > > > > > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > > > index bc562dc8a..1b260efd5 100644 > > > --- a/lib/librte_mbuf/rte_mbuf.h > > > +++ b/lib/librte_mbuf/rte_mbuf.h > > > @@ -2344,11 +2344,9 @@ rte_mbuf_sched_get(const struct rte_mbuf > > *m, > > > uint32_t *queue_id, > > > uint8_t *traffic_class, > > > uint8_t *color) > > > { > > > -struct rte_mbuf_sched sched = m->hash.sched; > > Did C++ complain *sched? *sched is better with less stack mem footprint. > If the pointer works, the code looks better. Using *sched will cause compiler to generate multiple references which is the real performance issue here.