From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 1/2] ethdev: add capability control API Date: Mon, 06 Mar 2017 11:32:16 +0100 Message-ID: <2480022.hlQWxlV5d8@xps13> References: <1488589820-206947-1-git-send-email-cristian.dumitrescu@intel.com> <1488589820-206947-2-git-send-email-cristian.dumitrescu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, jerin.jacob@caviumnetworks.com, balasubramanian.manoharan@cavium.com, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com To: Cristian Dumitrescu Return-path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id 451FC952 for ; Mon, 6 Mar 2017 11:32:18 +0100 (CET) Received: by mail-wm0-f48.google.com with SMTP id v186so60037397wmd.0 for ; Mon, 06 Mar 2017 02:32:18 -0800 (PST) In-Reply-To: <1488589820-206947-2-git-send-email-cristian.dumitrescu@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Cristian, 2017-03-04 01:10, Cristian Dumitrescu: > struct rte_flow_ops *eth_flow_ops; > int rte = rte_eth_dev_filter_ctrl(eth_port_id, > RTE_ETH_FILTER_GENERIC, RTE_ETH_FILTER_GET, ð_flow_ops); > > Unfortunately, the rte_flow opportunistically uses the rte_eth_dev_filter_ctrl() > API function, which is applicable just to RX-side filters as opposed to > introducing a mechanism that could be used by any capability in a generic way. > > This is the gap that addressed by the current patch. This mechanism is intended > to be used to introduce new capabilities into ethdev in a modular plugin-like > approach, such as hierarchical scheduler. Over time, if agreed, it can also be > used for exposing the existing Ethernet device capabilities in a modular way, > such as: xstats, filters, multicast, mirroring, tunnels, time stamping, eeprom, > bypass, etc. > > Changes in v3: > -Followed up on suggestion from Jerin: renamed capability from Hierarchical > Scheduler (sched) to Traffic Manager (tm) > > Changes in v2: > -Followed up on suggestion from Jerin and Hemant: renamed capability_control() > to capability_ops_get() > -Added ACK from Keith, Jerin and Hemant It is difficult to follow previous discussions as you do not keep threading with --in-reply-to. > Signed-off-by: Cristian Dumitrescu > Acked-by: Keith Wiles > Acked-by: Jerin Jacob > Acked-by: Hemant Agrawal [...] > +enum rte_eth_capability { > + RTE_ETH_CAPABILITY_FLOW = 0, /**< Flow */ > + RTE_ETH_CAPABILITY_TM, /**< Traffic Manager */ > + RTE_ETH_CAPABILITY_MAX > +}; [...] > /** > + * Take capability operations on an Ethernet device. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param cap > + * The capability of the Ethernet device > + * @param arg > + * A pointer to arguments defined specifically for the operation. > + * @return > + * - (0) if successful. > + * - (-ENOTSUP) if hardware doesn't support. > + * - (-ENODEV) if *port_id* invalid. > + */ > +int rte_eth_dev_capability_ops_get(uint8_t port_id, > + enum rte_eth_capability cap, void *arg); What is the benefit of getting different kind of capabilities with the same function? enum + void* = ioctl A self-explanatory API should have a dedicated function for each kind of features with different argument types.