From patchwork Fri Mar 24 02:36:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John Daley (johndale)" X-Patchwork-Id: 22201 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 946C6CF66; Fri, 24 Mar 2017 03:37:22 +0100 (CET) Received: from alln-iport-4.cisco.com (alln-iport-4.cisco.com [173.37.142.91]) by dpdk.org (Postfix) with ESMTP id 8F19F69A5 for ; Fri, 24 Mar 2017 03:37:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2320; q=dns/txt; s=iport; t=1490323023; x=1491532623; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=B9qXis3y+lFYJNHQBCdQfMLb/3KLgGNuZl4JQEfureY=; b=VZg7IWNj3WL3AjsamFRiXdv7AAjsU8FYJ7yodn+1ywmq8q9KIOk/16nV YsyJIH9rHF9YbDdgtXM5PcKLMtYj+s1LU0nbbmpWZiBkrc2EV9+Fdx13k fGJ1ObjEXjabn5SDR05i9haW+T0Mdseaga3532jyft9iMxtkwKabdKyrB Q=; X-IronPort-AV: E=Sophos;i="5.36,213,1486425600"; d="scan'208";a="401298639" Received: from alln-core-12.cisco.com ([173.36.13.134]) by alln-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Mar 2017 02:37:02 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-12.cisco.com (8.14.5/8.14.5) with ESMTP id v2O2b2nu003134; Fri, 24 Mar 2017 02:37:02 GMT Received: by cisco.com (Postfix, from userid 392789) id 4DE683FAAF12; Thu, 23 Mar 2017 19:37:02 -0700 (PDT) From: John Daley To: adrien.mazarguil@6wind.com Cc: dev@dpdk.org, John Daley Date: Thu, 23 Mar 2017 19:36:59 -0700 Message-Id: <20170324023659.28099-2-johndale@cisco.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170324023659.28099-1-johndale@cisco.com> References: <20170324023659.28099-1-johndale@cisco.com> Subject: [dpdk-dev] [PATCH 1/1] ethdev: don't consider device state when validating flows 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" PMDs only consider if a flow would be accepted or not the assuming the device had all it's resources available to it. Since state is not considered, -EEXIST and -EBUSY return codes no longer make sense and are removed. Also clarify the -ENOMEM has nothig to do with device resouces, only host resources needed rte_flow_validate(). Signed-off-by: John Daley --- lib/librte_ether/rte_flow.h | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h index 171a5698e..16846449d 100644 --- a/lib/librte_ether/rte_flow.h +++ b/lib/librte_ether/rte_flow.h @@ -932,15 +932,10 @@ struct rte_flow_error { /** * Check whether a flow rule can be created on a given port. * - * While this function has no effect on the target device, the flow rule is - * validated against its current configuration state and the returned value - * should be considered valid by the caller for that state only. - * - * The returned value is guaranteed to remain valid only as long as no - * successful calls to rte_flow_create() or rte_flow_destroy() are made in - * the meantime and no device parameter affecting flow rules in any way are - * modified, due to possible collisions or resource limitations (although in - * such cases EINVAL should not be returned). + * The flow rule is validated against the target device. There is no check + * against the current state of the device- creating the flow could still + * fail due to a lack of resources on the device. This function has no effect + * on the target device. * * @param port_id * Port identifier of Ethernet device. @@ -965,13 +960,7 @@ struct rte_flow_error { * -ENOTSUP: valid but unsupported rule specification (e.g. partial * bit-masks are unsupported). * - * -EEXIST: collision with an existing rule. - * - * -ENOMEM: not enough resources. - * - * -EBUSY: action cannot be performed due to busy device resources, may - * succeed if the affected queues or even the entire port are in a stopped - * state (see rte_eth_dev_rx_queue_stop() and rte_eth_dev_stop()). + * -ENOMEM: not enough host resources to execute this funtion. */ int rte_flow_validate(uint8_t port_id,