From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D523B2B88 for ; Wed, 1 Mar 2017 10:58:51 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2017 01:58:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,224,1484035200"; d="scan'208";a="829667456" Received: from dhunt5-mobl.ger.corp.intel.com (HELO [10.237.221.69]) ([10.237.221.69]) by FMSMGA003.fm.intel.com with ESMTP; 01 Mar 2017 01:58:50 -0800 To: Bruce Richardson References: <1485163480-156507-2-git-send-email-david.hunt@intel.com> <1487647073-129064-1-git-send-email-david.hunt@intel.com> <1487647073-129064-5-git-send-email-david.hunt@intel.com> <20170224140941.GF106392@bricha3-MOBL3.ger.corp.intel.com> Cc: dev@dpdk.org From: "Hunt, David" Message-ID: <1f537556-3493-f3f2-57bf-5af0a5167d97@intel.com> Date: Wed, 1 Mar 2017 09:58:49 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20170224140941.GF106392@bricha3-MOBL3.ger.corp.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v7 04/17] lib: add new burst oriented distributor structs 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: Wed, 01 Mar 2017 09:58:52 -0000 On 24/2/2017 2:09 PM, Bruce Richardson wrote: > On Tue, Feb 21, 2017 at 03:17:40AM +0000, David Hunt wrote: >> Signed-off-by: David Hunt >> --- >> lib/librte_distributor/rte_distributor_private.h | 61 ++++++++++++++++++++++++ >> 1 file changed, 61 insertions(+) >> >> diff --git a/lib/librte_distributor/rte_distributor_private.h b/lib/librte_distributor/rte_distributor_private.h >> index 2d85b9b..c8e0f98 100644 >> --- a/lib/librte_distributor/rte_distributor_private.h >> +++ b/lib/librte_distributor/rte_distributor_private.h >> @@ -129,6 +129,67 @@ struct rte_distributor_v20 { >> struct rte_distributor_returned_pkts returns; >> }; >> >> +/* All different signature compare functions */ >> +enum rte_distributor_match_function { >> + RTE_DIST_MATCH_SCALAR = 0, >> + RTE_DIST_MATCH_VECTOR, >> + RTE_DIST_NUM_MATCH_FNS >> +}; >> + >> +/** >> + * Buffer structure used to pass the pointer data between cores. This is cache >> + * line aligned, but to improve performance and prevent adjacent cache-line >> + * prefetches of buffers for other workers, e.g. when worker 1's buffer is on >> + * the next cache line to worker 0, we pad this out to two cache lines. >> + * We can pass up to 8 mbufs at a time in one cacheline. >> + * There is a separate cacheline for returns in the burst API. >> + */ >> +struct rte_distributor_buffer { >> + volatile int64_t bufptr64[RTE_DIST_BURST_SIZE] >> + __rte_cache_aligned; /* <= outgoing to worker */ >> + >> + int64_t pad1 __rte_cache_aligned; /* <= one cache line */ >> + >> + volatile int64_t retptr64[RTE_DIST_BURST_SIZE] >> + __rte_cache_aligned; /* <= incoming from worker */ >> + >> + int64_t pad2 __rte_cache_aligned; /* <= one cache line */ >> + >> + int count __rte_cache_aligned; /* <= number of current mbufs */ >> +}; > Rather than adding padding elements here, would it be better and clearer > just to align the values to 128B (or more strictly CACHE_LINE_SZ * 2)? > > /Bruce I tried various combinations of __rte_align(128) and taking out the pads, but the performance regressed 10-15%. For the moment, I suggest leaving as is. Dave.