From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 572735F33 for ; Mon, 3 Sep 2018 16:47:07 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180903144706euoutp01283e73209c9d241317d9312726640118~Q6yc1Kws31820118201euoutp01H for ; Mon, 3 Sep 2018 14:47:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180903144706euoutp01283e73209c9d241317d9312726640118~Q6yc1Kws31820118201euoutp01H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535986026; bh=n3+Q6L7+oTWfwBbsMw+fOyEV0DTZDUTGzzki5XBVPPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=co+WCllgL+7NLIM0VsPkjqHO+ys1m55IOzgTRehHWz+r4KKkmo9fvdJW/Fh8gmp/+ i365iRjq8wGitFBqdmE/POeHDG7JNNyYRgrH7m/ldkGbw74l3p6bFDnxRwmDTHA+Bu ulSSnqsM+dkI7SSCh8uoBthR6be9cOowfzsPH7mo= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180903144705eucas1p120777501299fdc4c64f594c86c454970~Q6ycDvQc50609506095eucas1p1Q; Mon, 3 Sep 2018 14:47:05 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 23.F2.04441.9694D8B5; Mon, 3 Sep 2018 15:47:05 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180903144704eucas1p1d469c23bc22f25af27f00d94aaf8a660~Q6ybQBf930609506095eucas1p1P; Mon, 3 Sep 2018 14:47:04 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20180903144704eusmtrp22e66d1a7a865f493a5972f55b302a659~Q6ya8ySZg0869408694eusmtrp2x; Mon, 3 Sep 2018 14:47:04 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-c8-5b8d496937f9 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id A8.E7.04128.8694D8B5; Mon, 3 Sep 2018 15:47:04 +0100 (BST) Received: from imaximets.rnd.samsung.ru (unknown [106.109.129.180]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180903144703eusmtip196e83f240866752eb084d6135c207e80~Q6yaTiwoE1096510965eusmtip1o; Mon, 3 Sep 2018 14:47:03 +0000 (GMT) From: Ilya Maximets To: dev@dpdk.org Cc: Jingjing Wu , Konstantin Ananyev , Wenzhuo Lu , Beilei Xing , Qi Zhang , Xiao Wang , Bruce Richardson , Ilya Maximets Date: Mon, 3 Sep 2018 17:48:31 +0300 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180903144311eucas1p2b6499c49dbd0d54334e973113cdc5ad6~Q6vBsFYRm1033710337eucas1p2D@eucas1p2.samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLIsWRmVeSWpSXmKPExsWy7djPc7qZnr3RBlMWiFt0f2hhsrixyt7i 3aftTBZX2n+yW8xc8JnR4v2fRSwW0zf0s1lsPfOX0WL/88PsDpwevxYsZfVYvOclk0ffllWM AcxRXDYpqTmZZalF+nYJXBlfL05lLJinXbFx7nfGBsYXKl2MnBwSAiYSezdNYeti5OIQEljB KHHqwjwmCOcLo8S0o+3MEM5nRonHF+6wwrTcfN3LApFYzihx7fVLVgjnB6PExb13mUGq2AR0 JE6tPsIIYosICEh87lwMtoRZ4CiTxLWu6WBFwgIBEsdX3gArYhFQlZjzcRILxAp5idUbDoDV cAqUS1y/fJwRpF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itz DzFKcDArifA2ugOFeFMSK6tSi/Lji0pzUosPMZoCHTWRWUo0OR8YUXkl8YamhuYWlobmxubG ZhZK4rznDSqjhATSE0tSs1NTC1KLYPqYODilGhh5G1cnmrb9SfH+W8W7z+drllLzp97l8258 b/Y7dORE3z811RlaFyffbu1Ke1p/IPftV2bPQrWuv24uvM0X323+cTfgX3Zz9az46NWB71+b rJ8eUCul+ubyj9mPinZUCU63u75EavOuT4kl138dfXJup1f7+w333U7b1H1flqy8uqcpNTVx 07TvSizFGYmGWsxFxYkAqlDEH3ACAAA= Message-Id: <20180903144704eucas1p1d469c23bc22f25af27f00d94aaf8a660~Q6ybQBf930609506095eucas1p1P@eucas1p1.samsung.com> X-CMS-MailID: 20180903144704eucas1p1d469c23bc22f25af27f00d94aaf8a660 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20180903144704eucas1p1d469c23bc22f25af27f00d94aaf8a660 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180903144704eucas1p1d469c23bc22f25af27f00d94aaf8a660 References: <20180903144311eucas1p2b6499c49dbd0d54334e973113cdc5ad6~Q6vBsFYRm1033710337eucas1p2D@eucas1p2.samsung.com> Subject: [dpdk-dev] [PATCH v1 2/2] drivers/net: use sleep delay by default for intel NICs 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: Mon, 03 Sep 2018 14:47:07 -0000 NICs uses different delays up to a second during their configuration. It makes no sense to busy-wait so long wasting CPU cycles and preventing any other threads to execute on the same CPU core. These busy polling are the rudiments that came from the kernel drivers where you can not sleep in interrupt context, but as we're in userspace, we're able and should sleep to allow other threads to run. Delays never called on rx/tx path, so this should not affect performance. Signed-off-by: Ilya Maximets --- drivers/net/avf/Makefile | 1 + drivers/net/avf/base/avf_osdep.h | 4 ++-- drivers/net/e1000/Makefile | 1 + drivers/net/e1000/base/e1000_osdep.h | 2 +- drivers/net/e1000/meson.build | 2 ++ drivers/net/i40e/base/i40e_osdep.h | 6 +++--- drivers/net/ifc/base/ifcvf_osdep.h | 2 +- drivers/net/ixgbe/base/ixgbe_osdep.h | 2 +- drivers/net/ixgbe/meson.build | 3 ++- 9 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/net/avf/Makefile b/drivers/net/avf/Makefile index 3f815bbc4..8ee707529 100644 --- a/drivers/net/avf/Makefile +++ b/drivers/net/avf/Makefile @@ -9,6 +9,7 @@ include $(RTE_SDK)/mk/rte.vars.mk LIB = librte_pmd_avf.a CFLAGS += -O3 +CFLAGS += -DALLOW_EXPERIMENTAL_API LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -lrte_hash LDLIBS += -lrte_bus_pci diff --git a/drivers/net/avf/base/avf_osdep.h b/drivers/net/avf/base/avf_osdep.h index 9ef45968e..442a5acd0 100644 --- a/drivers/net/avf/base/avf_osdep.h +++ b/drivers/net/avf/base/avf_osdep.h @@ -93,8 +93,8 @@ typedef uint64_t u64; #define avf_memset(a, b, c, d) memset((a), (b), (c)) #define avf_memcpy(a, b, c, d) rte_memcpy((a), (b), (c)) -#define avf_usec_delay(x) rte_delay_us(x) -#define avf_msec_delay(x) rte_delay_us(1000*(x)) +#define avf_usec_delay(x) rte_delay_us_sleep(x) +#define avf_msec_delay(x) avf_usec_delay(1000 * (x)) #define AVF_PCI_REG(reg) rte_read32(reg) #define AVF_PCI_REG_ADDR(a, reg) \ diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile index 9c87e883b..0ed627656 100644 --- a/drivers/net/e1000/Makefile +++ b/drivers/net/e1000/Makefile @@ -10,6 +10,7 @@ LIB = librte_pmd_e1000.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs LDLIBS += -lrte_bus_pci diff --git a/drivers/net/e1000/base/e1000_osdep.h b/drivers/net/e1000/base/e1000_osdep.h index b8868049f..5958ea157 100644 --- a/drivers/net/e1000/base/e1000_osdep.h +++ b/drivers/net/e1000/base/e1000_osdep.h @@ -48,7 +48,7 @@ #include "../e1000_logs.h" -#define DELAY(x) rte_delay_us(x) +#define DELAY(x) rte_delay_us_sleep(x) #define usec_delay(x) DELAY(x) #define usec_delay_irq(x) DELAY(x) #define msec_delay(x) DELAY(1000*(x)) diff --git a/drivers/net/e1000/meson.build b/drivers/net/e1000/meson.build index cf456995c..d0901d377 100644 --- a/drivers/net/e1000/meson.build +++ b/drivers/net/e1000/meson.build @@ -1,6 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation +allow_experimental_apis = true + subdir('base') objs = [base_objs] diff --git a/drivers/net/i40e/base/i40e_osdep.h b/drivers/net/i40e/base/i40e_osdep.h index 8e5c593c9..a6072e153 100644 --- a/drivers/net/i40e/base/i40e_osdep.h +++ b/drivers/net/i40e/base/i40e_osdep.h @@ -233,9 +233,9 @@ struct i40e_spinlock { #define i40e_memcpy(a, b, c, d) rte_memcpy((a), (b), (c)) #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) -#define DELAY(x) rte_delay_us(x) -#define i40e_usec_delay(x) rte_delay_us(x) -#define i40e_msec_delay(x) rte_delay_us(1000*(x)) +#define DELAY(x) rte_delay_us_sleep(x) +#define i40e_usec_delay(x) DELAY(x) +#define i40e_msec_delay(x) DELAY(1000 * (x)) #define udelay(x) DELAY(x) #define msleep(x) DELAY(1000*(x)) #define usleep_range(min, max) msleep(DIV_ROUND_UP(min, 1000)) diff --git a/drivers/net/ifc/base/ifcvf_osdep.h b/drivers/net/ifc/base/ifcvf_osdep.h index cf151ef52..6aef25ea4 100644 --- a/drivers/net/ifc/base/ifcvf_osdep.h +++ b/drivers/net/ifc/base/ifcvf_osdep.h @@ -17,7 +17,7 @@ #define DEBUGOUT(S, args...) RTE_LOG(DEBUG, PMD, S, ##args) #define STATIC static -#define msec_delay rte_delay_ms +#define msec_delay(x) rte_delay_us_sleep(1000 * (x)) #define IFCVF_READ_REG8(reg) rte_read8(reg) #define IFCVF_WRITE_REG8(val, reg) rte_write8((val), (reg)) diff --git a/drivers/net/ixgbe/base/ixgbe_osdep.h b/drivers/net/ixgbe/base/ixgbe_osdep.h index bb5dfd2af..94ede9bc2 100644 --- a/drivers/net/ixgbe/base/ixgbe_osdep.h +++ b/drivers/net/ixgbe/base/ixgbe_osdep.h @@ -51,7 +51,7 @@ #define ASSERT(x) if(!(x)) rte_panic("IXGBE: x") -#define DELAY(x) rte_delay_us(x) +#define DELAY(x) rte_delay_us_sleep(x) #define usec_delay(x) DELAY(x) #define msec_delay(x) DELAY(1000*(x)) diff --git a/drivers/net/ixgbe/meson.build b/drivers/net/ixgbe/meson.build index 02d5ef5e4..544a14148 100644 --- a/drivers/net/ixgbe/meson.build +++ b/drivers/net/ixgbe/meson.build @@ -5,10 +5,11 @@ version = 2 cflags += ['-DRTE_LIBRTE_IXGBE_BYPASS'] +allow_experimental_apis = true + subdir('base') objs = [base_objs] -allow_experimental_apis = true sources = files( 'ixgbe_82599_bypass.c', 'ixgbe_bypass.c', -- 2.17.1