From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by dpdk.org (Postfix) with ESMTP id 46A64567C for ; Sat, 7 May 2016 06:56:22 +0200 (CEST) Received: by mail-pa0-f43.google.com with SMTP id bt5so53550296pac.3 for ; Fri, 06 May 2016 21:56:22 -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=CQnpWjSlENV22f+l9ErXtp+sNTsSWmiWvC8ghIWV3bU=; b=nRcZw0TyRVCOeGvB7rmQmfVW/hW/K3tZbIQJ6DsKUF1G9pzev2Dko+Ni2eiVs1XsSh PJ5S3RZ9JB/+eNVOWAmpBAF2tdACq44qGtbUyMgMJpz/PnQA+MBcrfIWLzO+raqIDTTo 4tLjGIsX+wjTmhnIrmBFHsm1APvokfVO2sNaVSfi4g1qDSdgR9dm8rwSXfsxoTOJauwA Eo+2pOprzo42oxVfoZFO7bl4aNlS2KZYGbD7Ia5Kxk7UN25Id3AgquOdrk+5MqZ6EHv9 H18DhfFGho90+GFCA4kF05ecC7G7RvpPQQ+2W961StfMpOcvJ1dTMbNrx7HBsNHUEQ5L 7zXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CQnpWjSlENV22f+l9ErXtp+sNTsSWmiWvC8ghIWV3bU=; b=AdloBagbaHO33ULWIS0gixwLF/CdLDovEkWH0MC++YVErCZP1tKAVHaCoj4EQCzMvX rJskldTkmjCYwj+bKusMTTN/wMcjYgrwVGCubaM0uRe0ciBKnkXsYlNuw3tklGDCOOnC 4LRoHIhwaJAM4RJKbL7cfe4NWGrS+L7Xs9J7HodUbZEGsrJblK5/mZKF1HFioZBGMu9v mzl0I03y7ltoi3Cdp30XrEqntQVR49dLeksP1vEk9vQ8yn/6p9DYRbTFWutWUTKkvewn qp9NyyHsgkPmURNMDcp2VuGrVpAQkMVTRU4dNzARAucj2D+RbIBEUL3tTrMlNjPtjtu9 0xzw== X-Gm-Message-State: AOPr4FVpFEn+y3B5Iugyre+bV/skDup2rfyTW10FnsnlPRfrq/KWRN7fAT6aQi2C//Qq0A== X-Received: by 10.66.81.136 with SMTP id a8mr33922288pay.113.1462596981533; Fri, 06 May 2016 21:56:21 -0700 (PDT) Received: from xeon-e3 (static-50-53-72-186.bvtn.or.frontiernet.net. [50.53.72.186]) by smtp.gmail.com with ESMTPSA id 5sm24570812pfn.46.2016.05.06.21.56.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 May 2016 21:56:21 -0700 (PDT) Date: Fri, 6 May 2016 21:56:32 -0700 From: Stephen Hemminger To: Shen Wei Cc: dev@dpdk.org, pablo.de.lara.guarch@intel.com, christian.maciocco@intel.com, Sameh Gobriel Message-ID: <20160506215632.2bacfcdf@xeon-e3> In-Reply-To: <1462565102-15312-1-git-send-email-wei1.shen@intel.com> References: <1462565102-15312-1-git-send-email-wei1.shen@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v1] hash: add tsx support for cuckoo hash 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: Sat, 07 May 2016 04:56:22 -0000 On Fri, 6 May 2016 21:05:02 +0100 Shen Wei wrote: > --- a/lib/librte_hash/rte_cuckoo_hash.c > +++ b/lib/librte_hash/rte_cuckoo_hash.c > @@ -1,7 +1,7 @@ > /*- > * BSD LICENSE > * > - * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. > + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -100,7 +100,9 @@ EAL_REGISTER_TAILQ(rte_hash_tailq) > > #define KEY_ALIGNMENT 16 > > -#define LCORE_CACHE_SIZE 8 > +#define LCORE_CACHE_SIZE 64 > + > +#define RTE_HASH_BFS_QUEUE_MAX_LEN 5000 > > #if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) > /* > @@ -190,6 +192,7 @@ struct rte_hash { > memory support */ > struct lcore_cache *local_free_slots; > /**< Local cache per lcore, storing some indexes of the free slots */ > + uint8_t multiwrite_add; /**< Multi-write safe hash add behavior */ > } __rte_cache_aligned; > I like the idea of using TSX to allow multi-writer safety, but there are several problems with this patch. 1) It changes ABI, so it breaks old programs 2) What about older processors, need to detect and handle them at runtime. 3) Why can't this just be the default behavior with correct fallback to locking on older processors. Actually lock ellision in DPDK is an interesting topic in general that needs to be addressed.