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 EFA72A04BF; Thu, 3 Sep 2020 19:37:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 37D361C0B7; Thu, 3 Sep 2020 19:37:51 +0200 (CEST) Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by dpdk.org (Postfix) with ESMTP id 9D7BF1C0B6 for ; Thu, 3 Sep 2020 19:37:49 +0200 (CEST) Received: by mail-pg1-f169.google.com with SMTP id 67so2678229pgd.12 for ; Thu, 03 Sep 2020 10:37:49 -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=0vgvxDJ2CGh0ldAgmwA6KT5ogEqrZM+B135TVekG9p8=; b=KQOTUr4h0EdepkHHPEySTG74F/4oBiiIJbCGqtDigv3aDESaPyOmd34rShpIEiYARI xfqhaIfhgHa8bF1zemJYkB9AW9pE8fRGFu5rPO4PHsRBeB9exN1j1AD0oYzm5HP0r+3s MUBIdZ6j5dhfIZRvHer6HrLJFOwLwZYx5iMjtybmrCzznlXL88WaFhJiLa6KWX9K+8FN XhVIVSIBC+8rkjfxnGeuO0W5KpY2rV7l354NCtE8bWWKT+eK8R1WSSJFgUfoYDcvcUmG /c5BDsltzRLUETe2xC6bMIcFKxKdeQzFLRxDXXg+6rUdIRIFtjgZ7U5nharS2MMmAMpK 91mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0vgvxDJ2CGh0ldAgmwA6KT5ogEqrZM+B135TVekG9p8=; b=i2m/y+IlqRDeMDzSYxxRFB61rqHkNJyqUX0zJrZCVOfZQqYG2Ai8yzOzkvVYUez5dK pkU0UNl8Bf15C3Ea8jAOhcxlWp2135kheFdoFVNHb4egbbjHuoUXXF7QVdHE54uOg/V1 yUMvaUn7LyIaD3oe7/wGM/84W+Ge8dF98dnzghQKt/DkOOI3E3u35PYgeaPZpcJxwJHp Tosu0pNjrUxIZ8eYqSryF4t4Wk41ImGs9dVIrFfzt1/Z3eoDOkwz/jpo+6QRwPIefrD0 TWxkfqhj5VaP+xNnobGirLa1y1tS5X9f4bhDCWNW2xqx5T1mC7y66mS9mtUN/V//3ivR A/EQ== X-Gm-Message-State: AOAM5310lve4p6OOMru0irppqDtafEfm21zvwQIUyiV3P+HVrL97Djqg J+k6r26nR3o4DA2315GQHbIBnA== X-Google-Smtp-Source: ABdhPJw849YrZQqvyi959zegqJjEZ8ayARbKtdbvjuez+Cr9ybiedWDuCIJ99h0Ug3jbvjYMFLHLRw== X-Received: by 2002:aa7:9517:: with SMTP id b23mr1275580pfp.21.1599154668489; Thu, 03 Sep 2020 10:37:48 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id hg16sm3068901pjb.37.2020.09.03.10.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 10:37:48 -0700 (PDT) Date: Thu, 3 Sep 2020 10:37:39 -0700 From: Stephen Hemminger To: Suanming Mou Cc: Ori Kam , John McNamara , Marko Kovacevic , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , dev@dpdk.org Message-ID: <20200903103739.1d1b4b0e@hermes.lan> In-Reply-To: <1599108782-230624-1-git-send-email-suanmingm@nvidia.com> References: <1599108782-230624-1-git-send-email-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC] 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" On Thu, 3 Sep 2020 12:53:02 +0800 Suanming Mou wrote: > Currently, the rte flow functions are not defined as thread safety. > 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 safety 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 > safety. As different PMDs have different flow operations, some may > support thread safety 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 safety. > > The change has no effect on the current DPDK applications. No change > is required for the current DPDK applications. > > Signed-off-by: Suanming Mou What is the performance impact of this for currently working applications that use a single thread to program flow rules. You are adding a couple of system calls to what was formerly a totally usermode operation.