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 123F3A051A; Thu, 16 Jan 2020 23:56:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE7461D52E; Thu, 16 Jan 2020 23:56:28 +0100 (CET) Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by dpdk.org (Postfix) with ESMTP id B4C3A1D52D for ; Thu, 16 Jan 2020 23:56:26 +0100 (CET) Received: by mail-pj1-f66.google.com with SMTP id n59so2373435pjb.1 for ; Thu, 16 Jan 2020 14:56:26 -0800 (PST) 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=nFK2Td3L3fvGG9y7A4fGmKeLw4ooHR6ABlTtUb+JjrE=; b=QcG3uUHk276RlXQNmL2/FCcfIHQja+wPcrAqbdu9JwS7NZ4RTeHohZsQuS6N89CI7A XUV+fsUkKFgvzNFm/FiRoIIgjQwnKZ8NWpXk5soO6ZrmwgJqUA+BueNrt7HFGAoafvSR T+GnfMW6UpCWzigNYr+4FsgumqMRpMApieKqWtMRMq2YLbAw8chc0zsv8kzl9rWuF9DP JrbZojLi6rVaxewXgDHxZaC9Gn4E/mlFAB34npAXLrLqs1ydbliYg1co3CpQxqqMA0rp tbO4PLSwbYYwGWi1vWYLrYasOb4uQfYzIj/LZ6kwUi/KN/WBymGHRIpmCf2rrJXkL8Hh 1JLg== 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=nFK2Td3L3fvGG9y7A4fGmKeLw4ooHR6ABlTtUb+JjrE=; b=spy9RL9QYflY5BA42wfTREC69WshGIHtAgUyyysJjxBbi60EAr7+bKPzOu21EJpBhH X989SmCwrCKaQVrjeAsPARuHTGDyF2ZzLsbJiihd7Uvn/I7Gh2Du0EJkH22Z4uPbRLGn mEm2Ay0AJcWDU6MaLiwIzqc+klf1qBaSq7ouEKSMwYNmzBVhocnI4am6GXc/UVmK04bj JtDSRXBN9etvEuOsrlGBYmaA3Ih+JEJloAKFaG54/wkimb1Hj169lWnU1Lw99MtHUF6s 8oaJpBq1+DY7U1uB7eWlmwu8Ds8ROe8GwxIEd1IT5iKgq7GnVRoafF/KzgclPyjr7934 J48A== X-Gm-Message-State: APjAAAVqdElKERkYcEzZyTOxmvebnT1bOWMQns1LS61OZoUZGWYxdmzB M1/MvVTz0jN3RFbL5Q3ljVjjWA== X-Google-Smtp-Source: APXvYqwy6fTw0JMCzfNS8tEAaYnh8ga/PU5rtdx+8ZkKZj6yYSQXOnbYYq8SgwyeoK+wbonWo+3KFA== X-Received: by 2002:a17:90a:7781:: with SMTP id v1mr2003032pjk.108.1579215385903; Thu, 16 Jan 2020 14:56:25 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id l66sm25835334pga.30.2020.01.16.14.56.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2020 14:56:25 -0800 (PST) Date: Thu, 16 Jan 2020 14:56:17 -0800 From: Stephen Hemminger To: Ferruh Yigit Cc: Xiaoyu Min , jerinjacobk@gmail.com, orika@mellanox.com, viacheslavo@mellanox.com, matan@mellanox.com, rasland@mellanox.com, Thomas Monjalon , Andrew Rybchenko , Adrien Mazarguil , dev@dpdk.org Message-ID: <20200116145617.7907ba46@hermes.lan> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/5] ethdev: add API to dump device internal flow info 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, 16 Jan 2020 20:37:36 +0000 Ferruh Yigit wrote: > On 1/16/2020 10:14 AM, Xiaoyu Min wrote: > > Introduce an API which dump the device's internal representation > > information of rte flows in hardware. > > > > Signed-off-by: Xiaoyu Min > > <...> > > > @@ -1212,3 +1212,19 @@ rte_flow_expand_rss(struct rte_flow_expand_rss *buf, size_t size, > > } > > return lsize; > > } > > + > > +int > > +rte_flow_dev_dump(uint16_t port_id, FILE *file, struct rte_flow_error *error) > > +{ > > + struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > > + const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); > > + > > + if (unlikely(!ops)) > > + return -rte_errno; > > + if (likely(!!ops->dev_dump)) > > + return flow_err(port_id, ops->dev_dump(dev, file, error), > > + error); > > + return rte_flow_error_set(error, ENOSYS, > > + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > > + NULL, rte_strerror(ENOSYS)); > > +} > > Should API validate user provided input "FILE *file" ? None of the other DPDK dump routines do.