From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v4] mbuf: fix mbuf free performance with non atomic refcnt Date: Fri, 8 Dec 2017 08:37:02 -0800 Message-ID: <20171208083702.556655e0@xeon-e3> References: <20171115091413.27119-1-hhaim@cisco.com> <20171208154651.16546-1-olivier.matz@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, hhaim@cisco.com, matvejchikov@gmail.com, konstantin.ananyev@intel.com To: Olivier Matz Return-path: Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by dpdk.org (Postfix) with ESMTP id 2A18A1B03E for ; Fri, 8 Dec 2017 17:37:04 +0100 (CET) Received: by mail-pf0-f195.google.com with SMTP id m26so7625515pfj.11 for ; Fri, 08 Dec 2017 08:37:04 -0800 (PST) In-Reply-To: <20171208154651.16546-1-olivier.matz@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, 8 Dec 2017 16:46:51 +0100 Olivier Matz wrote: > +/* internal */ > +static inline uint16_t > +__rte_mbuf_refcnt_update(struct rte_mbuf *m, int16_t value) > +{ > + return (uint16_t)(rte_atomic16_add_return(&m->refcnt_atomic, value)); > +} You don't need the cast (or paren's around rte_atomic16_addr_return) because C has implicit cast to return value.