From patchwork Mon Jan 12 07:16:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingjing Wu X-Patchwork-Id: 2234 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 CF6985AA4; Mon, 12 Jan 2015 08:16:49 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 2BDFA5A9B for ; Mon, 12 Jan 2015 08:16:32 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 11 Jan 2015 23:16:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,742,1413270000"; d="scan'208";a="668289527" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 11 Jan 2015 23:16:31 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t0C7GTQD007247; Mon, 12 Jan 2015 15:16:29 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t0C7GQWJ023346; Mon, 12 Jan 2015 15:16:28 +0800 Received: (from wujingji@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t0C7GQr0023342; Mon, 12 Jan 2015 15:16:26 +0800 From: Jingjing Wu To: dev@dpdk.org Date: Mon, 12 Jan 2015 15:16:13 +0800 Message-Id: <1421046973-23283-5-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1421046973-23283-1-git-send-email-jingjing.wu@intel.com> References: <1419477270-14611-1-git-send-email-jingjing.wu@intel.com> <1421046973-23283-1-git-send-email-jingjing.wu@intel.com> Subject: [dpdk-dev] [PATCH v2 4/4] ethdev: remove old APIs and structures of ethertype filter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Structure rte_ethertype_filter is removed. Following APIs are removed: - rte_eth_dev_add_ethertype_filter - rte_eth_dev_remove_ethertype_filter - rte_eth_dev_get_ethertype_filter Signed-off-by: Jingjing Wu --- lib/librte_ether/rte_ethdev.c | 57 ---------------------------- lib/librte_ether/rte_ethdev.h | 88 ------------------------------------------- 2 files changed, 145 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 95f2ceb..b55fab2 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -3015,63 +3015,6 @@ rte_eth_dev_get_syn_filter(uint8_t port_id, } int -rte_eth_dev_add_ethertype_filter(uint8_t port_id, uint16_t index, - struct rte_ethertype_filter *filter, uint16_t rx_queue) -{ - struct rte_eth_dev *dev; - - if (port_id >= nb_ports) { - PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); - return -ENODEV; - } - if (filter->ethertype == ETHER_TYPE_IPv4 || - filter->ethertype == ETHER_TYPE_IPv6){ - PMD_DEBUG_TRACE("IP and IPv6 are not supported" - " in ethertype filter\n"); - return -EINVAL; - } - dev = &rte_eth_devices[port_id]; - FUNC_PTR_OR_ERR_RET(*dev->dev_ops->add_ethertype_filter, -ENOTSUP); - return (*dev->dev_ops->add_ethertype_filter)(dev, index, - filter, rx_queue); -} - -int -rte_eth_dev_remove_ethertype_filter(uint8_t port_id, uint16_t index) -{ - struct rte_eth_dev *dev; - - if (port_id >= nb_ports) { - PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); - return -ENODEV; - } - - dev = &rte_eth_devices[port_id]; - FUNC_PTR_OR_ERR_RET(*dev->dev_ops->remove_ethertype_filter, -ENOTSUP); - return (*dev->dev_ops->remove_ethertype_filter)(dev, index); -} - -int -rte_eth_dev_get_ethertype_filter(uint8_t port_id, uint16_t index, - struct rte_ethertype_filter *filter, uint16_t *rx_queue) -{ - struct rte_eth_dev *dev; - - if (filter == NULL || rx_queue == NULL) - return -EINVAL; - - if (port_id >= nb_ports) { - PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); - return -ENODEV; - } - - dev = &rte_eth_devices[port_id]; - FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_ethertype_filter, -ENOTSUP); - return (*dev->dev_ops->get_ethertype_filter)(dev, index, - filter, rx_queue); -} - -int rte_eth_dev_add_2tuple_filter(uint8_t port_id, uint16_t index, struct rte_2tuple_filter *filter, uint16_t rx_queue) { diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index ce0528f..1200c1c 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -972,15 +972,6 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback); #define TCP_FLAG_ALL 0x3F /** - * A structure used to define an ethertype filter. - */ -struct rte_ethertype_filter { - uint16_t ethertype; /**< little endian. */ - uint8_t priority_en; /**< compare priority enable. */ - uint8_t priority; -}; - -/** * A structure used to define an syn filter. */ struct rte_syn_filter { @@ -1372,20 +1363,6 @@ typedef int (*eth_get_syn_filter_t)(struct rte_eth_dev *dev, struct rte_syn_filter *filter, uint16_t *rx_queue); /**< @internal Get syn filter rule on an Ethernet device */ -typedef int (*eth_add_ethertype_filter_t)(struct rte_eth_dev *dev, - uint16_t index, struct rte_ethertype_filter *filter, - uint16_t rx_queue); -/**< @internal Setup a new ethertype filter rule on an Ethernet device */ - -typedef int (*eth_remove_ethertype_filter_t)(struct rte_eth_dev *dev, - uint16_t index); -/**< @internal Remove an ethertype filter rule on an Ethernet device */ - -typedef int (*eth_get_ethertype_filter_t)(struct rte_eth_dev *dev, - uint16_t index, struct rte_ethertype_filter *filter, - uint16_t *rx_queue); -/**< @internal Get an ethertype filter rule on an Ethernet device */ - typedef int (*eth_add_2tuple_filter_t)(struct rte_eth_dev *dev, uint16_t index, struct rte_2tuple_filter *filter, uint16_t rx_queue); @@ -1532,9 +1509,6 @@ struct eth_dev_ops { eth_add_syn_filter_t add_syn_filter; /**< add syn filter. */ eth_remove_syn_filter_t remove_syn_filter; /**< remove syn filter. */ eth_get_syn_filter_t get_syn_filter; /**< get syn filter. */ - eth_add_ethertype_filter_t add_ethertype_filter; /**< add ethertype filter. */ - eth_remove_ethertype_filter_t remove_ethertype_filter; /**< remove ethertype filter. */ - eth_get_ethertype_filter_t get_ethertype_filter; /**< get ethertype filter. */ eth_add_2tuple_filter_t add_2tuple_filter; /**< add 2tuple filter. */ eth_remove_2tuple_filter_t remove_2tuple_filter; /**< remove 2tuple filter. */ eth_get_2tuple_filter_t get_2tuple_filter; /**< get 2tuple filter. */ @@ -3474,68 +3448,6 @@ int rte_eth_dev_get_syn_filter(uint8_t port_id, struct rte_syn_filter *filter, uint16_t *rx_queue); /** - * Add a new ethertype filter rule on an Ethernet device. - * - * @param port_id - * The port identifier of the Ethernet device. - * @param index - * The identifier of ethertype filter. - * @param filter - * The pointer to the structure describing the ethertype filter rule. - * The *rte_ethertype_filter* structure includes the values of the different - * fields to match: ethertype and priority in vlan tag. - * priority in vlan tag is not supported for E1000 dev. - * @param rx_queue - * The index of the RX queue where to store RX packets matching the added - * ethertype filter. - * @return - * - (0) if successful. - * - (-ENOTSUP) if hardware doesn't support ethertype filter. - * - (-ENODEV) if *port_id* invalid. - * - (-EINVAL) if the filter information is not correct. - */ -int rte_eth_dev_add_ethertype_filter(uint8_t port_id, uint16_t index, - struct rte_ethertype_filter *filter, uint16_t rx_queue); - -/** - * remove an ethertype filter rule on an Ethernet device. - * - * @param port_id - * The port identifier of the Ethernet device. - * @param index - * The identifier of ethertype filter. - * @return - * - (0) if successful. - * - (-ENOTSUP) if hardware doesn't support ethertype filter. - * - (-ENODEV) if *port_id* invalid. - * - (-EINVAL) if the filter information is not correct. - */ -int rte_eth_dev_remove_ethertype_filter(uint8_t port_id, - uint16_t index); - -/** - * Get an ethertype filter rule on an Ethernet device. - * - * @param port_id - * The port identifier of the Ethernet device. - * @param index - * The identifier of ethertype filter. - * @param filter - * A pointer to a structure of type *rte_ethertype_filter* to be filled with - * the information of the Ethertype filter. - * @param rx_queue - * A pointer to get the queue index. - * @return - * - (0) if successful. - * - (-ENOTSUP) if hardware doesn't support ethertype filter. - * - (-ENODEV) if *port_id* invalid. - * - (-EINVAL) if the filter information is not correct. - * - (-ENOENT) if no enabled filter in this index. - */ -int rte_eth_dev_get_ethertype_filter(uint8_t port_id, uint16_t index, - struct rte_ethertype_filter *filter, uint16_t *rx_queue); - -/** * Add a new 2tuple filter rule on an Ethernet device. * * @param port_id