From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f46.google.com (mail-oi0-f46.google.com [209.85.218.46]) by dpdk.org (Postfix) with ESMTP id DB034556D for ; Mon, 3 Nov 2014 13:21:57 +0100 (CET) Received: by mail-oi0-f46.google.com with SMTP id g201so8465591oib.5 for ; Mon, 03 Nov 2014 04:31:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=+brG9cZngRFpMVWhoXEkVPx9h7784MbZkQTblvfo6C0=; b=GUge2Zwfmxv8OZ4Zwsv993kI9Yx1jRBBX8bJE348AyD44y0hrsf38ruMqPL1A0kLRn 0jCMXSSrHr1kxZVv7Cw1RZZ+iq5jI2keX1VuH+oTDIogEi1fNpfXs6SVREjXMmkxlolw YbFzY1Lak0FA6vsqJwI0vL+ZSySQU07116i46GH3SiOcODn2+gySdRWgY95nU4rPd0ni Y9+pdz3H/vB96A/xUeosPKo6pPupdvo1IsxTzwP9EFR+wHOa6hqRpGXf7vULZvD491p6 BqUAPfJgpbM+tnDYsUCsBOBGXLTzqNejBrVdeJxoO03Tp0rgQ3mscgZzN6tAKdojhZ17 +JMA== X-Gm-Message-State: ALoCoQl/98xfC9LdXBPODZJ9IcRmspUz/8qJQt6CCpC0YgOmmKwNof4UmPazjIrvuBN1DkrNukrs MIME-Version: 1.0 X-Received: by 10.202.132.70 with SMTP id g67mr117350oid.85.1415017870900; Mon, 03 Nov 2014 04:31:10 -0800 (PST) Received: by 10.202.55.214 with HTTP; Mon, 3 Nov 2014 04:31:10 -0800 (PST) In-Reply-To: <1415013076-30314-1-git-send-email-bruce.richardson@intel.com> References: <1415013076-30314-1-git-send-email-bruce.richardson@intel.com> Date: Mon, 3 Nov 2014 13:31:10 +0100 Message-ID: From: David Marchand To: Bruce Richardson Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] ixgbe: fix icc issue with mbuf initializer X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 12:21:58 -0000 Hello Bruce, On Mon, Nov 3, 2014 at 12:11 PM, Bruce Richardson < bruce.richardson@intel.com> wrote: > diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c > b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c > index e813e43..b57c588 100644 > --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c > +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c > @@ -730,16 +730,15 @@ static struct ixgbe_txq_ops vec_txq_ops = { > int > ixgbe_rxq_vec_setup(struct igb_rx_queue *rxq) > { > - struct rte_mbuf mb_def = { > - .nb_segs = 1, > - .data_off = RTE_PKTMBUF_HEADROOM, > -#ifdef RTE_MBUF_REFCNT > - { .refcnt = 1, } > -#endif > - }; > + struct rte_mbuf mb_def = { .buf_addr = 0 }; /* zeroed mbuf */ > > + mb_def.nb_segs = 1; > + mb_def.data_off = RTE_PKTMBUF_HEADROOM; > mb_def.buf_len = rxq->mb_pool->elt_size - sizeof(struct rte_mbuf); > mb_def.port = rxq->port_id; > +#ifdef RTE_MBUF_REFCNT > + mb_def.refcnt = 1; > +#endif > rxq->mbuf_initializer = *((uint64_t *)&mb_def.rearm_data); > return 0; > } > I would expect we use rte_mbuf_refcnt_set / rte_mbuf_refcnt_read to access this "refcnt" field. This api handles both RTE_MBUF_REFCNT_ATOMIC and ! RTE_MBUF_REFCNT_ATOMIC configs. But I suppose this is fine at init time (since the union will initialize properly the field). By the way, why do we have this RTE_MBUF_REFCNT_ATOMIC option ? >>From my point of view, there is not much use of a refcnt that is not atomic :-). -- David Marchand