From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E9315A04DB; Fri, 16 Oct 2020 00:43:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 99B0F1DE6A; Fri, 16 Oct 2020 00:43:26 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id F18331DE5C for ; Fri, 16 Oct 2020 00:43:23 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id BEB3F5C0182; Thu, 15 Oct 2020 18:43:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 15 Oct 2020 18:43:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= X9CX3FnMtWtSO3nvdfzuimnZnDLUgOq8rB7+AUciLfw=; b=s7ShclYx29soC/03 e5KBJTHKOUp/sIF8DaKpir7Qi3UTxZ0Bux14ELdhS7JNeUN1yew7lP5UXj1CBMCs DaDS9buPeXur0b02Y7hFYre5Mw68aXtnDOCGNxyM1Ov7g+QwxiEc/hMASwFB2ue7 Q5n5fhgYRFejmOVno0TNfN0y8G5gnWw20yKcQj9INQlr3xrHcn3Tn3hgBgV9xaty Q1tdfdEkInx8pj0/aCj6PSXZd5GYVvwnYj3TwzrJTd3YWnLhBI+PHGvTiQucBVSk oaR+p72XId6Fy7tGM62rmreV/9nKXVXJrdI5L+k0m2q36oGF4Pzsay41p2lEkrPL +40xCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=X9CX3FnMtWtSO3nvdfzuimnZnDLUgOq8rB7+AUciL fw=; b=WhEvdXsAL+8WSnQoxyIPJv6uDp3kveteYFQGk2YX42Ak5PM8eBpcrruUk DRd49tbRoh8u9FFgenDHKM26/KIuLkBprlwAySHuyScqTifpDY/fs145f82gan5N k2BINMIDiDlLBHvyULcddPRUnL6RF508AZXVT5a/F7lv5kZlqjhB38P24iW378CH VdbqTXJ1enz1+jYAUrWk0JvPu7nx2NgRH8hNW7cjZHThCk2MD5FtprqS7aoik7v5 94MWKn0l1nvtiQ1MgWjUkVVttPu3LRnlPULhsNYZIcAro9xr4ODIlA7XtymUnC5n vkSlbzfYOzWMjvhost6VFrzKt4xkg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrieeggddugecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 3B18C3280064; Thu, 15 Oct 2020 18:43:19 -0400 (EDT) From: Thomas Monjalon To: Suanming Mou Cc: dev@dpdk.org, ferruh.yigit@intel.com, andrew.rybchenko@oktetlabs.ru, asafp@nvidia.com Date: Fri, 16 Oct 2020 00:43:16 +0200 Message-ID: <8055466.jLWnYVvNTZ@thomas> In-Reply-To: <1602724067-390536-1-git-send-email-suanmingm@nvidia.com> References: <1601194817-208834-1-git-send-email-suanmingm@nvidia.com> <1602724067-390536-1-git-send-email-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v5 0/2] ethdev: make rte_flow API thread safe 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 15/10/2020 03:07, Suanming Mou: > Currently, the rte_flow functions are not defined as thread safe. > DPDK applications either call the functions in single thread or add > locks around the functions for the critical section. > > For PMDs support the flow operations thread safe natively, the > redundant protection in application hurts the performance of the > rte_flow operation functions. > > And the restriction of thread safe not guaranteed for the rte_flow > functions also limits the applications' expectation. > > This feature is going to change the rte_flow functions to be thread > safe. As different PMDs have different flow operations, some may > support thread safe already and others may not. For PMDs don't > support flow thread safe operation, a new lock is defined in ethdev > in order to protects thread unsafe PMDs from rte_flow level. > > A new RTE_ETH_DEV_FLOW_OPS_THREAD_SAFE device flag is added to > determine whether the PMD supports thread safe flow operation or not. > For PMDs support thread safe flow operations, set the > RTE_ETH_DEV_FLOW_OPS_THREAD_SAFE flag, rte_flow level functions will > skip the thread safe helper lock for these PMDs. Again the rte_flow > level thread safe lock only works when PMD operation functions are > not thread safe. > > For the PMDs which don't want the default mutex lock, just set the > flag in the PMD, and add the prefer type of lock in the PMD. Then > the default mutex lock is easily replaced by the PMD level lock. > > The change has no effect on the current DPDK applications. No change > is required for the current DPDK applications. For the standard posix > pthread_mutex, if no lock contention with the added rte_flow level > mutex, the mutex only does the atomic increasing in > pthread_mutex_lock() and decreasing in > pthread_mutex_unlock(). No futex() syscall will be involved. > > > Suanming Mou (2): > eal/windows: add pthread mutex lock > ethdev: make rte_flow API thread safe Applied, thanks