From patchwork Mon Sep 21 07:34:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingjing Wu X-Patchwork-Id: 7103 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 312BB11A2; Mon, 21 Sep 2015 09:34:22 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 7C99C3B5 for ; Mon, 21 Sep 2015 09:34:19 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 21 Sep 2015 00:34:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,566,1437462000"; d="scan'208";a="773324403" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 21 Sep 2015 00:34:18 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t8L7YEjZ027261; Mon, 21 Sep 2015 15:34:14 +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 t8L7YAlt001439; Mon, 21 Sep 2015 15:34:12 +0800 Received: (from wujingji@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t8L7YAbY001435; Mon, 21 Sep 2015 15:34:10 +0800 From: Jingjing Wu To: dev@dpdk.org Date: Mon, 21 Sep 2015 15:34:09 +0800 Message-Id: <1442820849-1405-1-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] ethdev: remove old flow director APIs 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" Old flow director APIs have been replaced by rte_eth_dev_filter_ctrl since release 2.0. And no drivers in current code support these APIs. All the removed APIs are list below: - rte_eth_dev_fdir_add_perfect_filter; - rte_eth_dev_fdir_add_signature_filter; - rte_eth_dev_fdir_get_infos; - rte_eth_dev_fdir_remove_perfect_filter; - rte_eth_dev_fdir_remove_signature_filter; - rte_eth_dev_fdir_set_masks; - rte_eth_dev_fdir_update_perfect_filter; - rte_eth_dev_fdir_update_signature_filter; Signed-off-by: Jingjing Wu Acked-by: Wenzhuo Lu --- drivers/net/enic/enic_ethdev.c | 1 - lib/librte_ether/rte_ethdev.c | 228 ------------------------- lib/librte_ether/rte_ethdev.h | 380 ----------------------------------------- 3 files changed, 609 deletions(-) diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 8280cea..02d288f 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -576,7 +576,6 @@ static const struct eth_dev_ops enicpmd_eth_dev_ops = { .priority_flow_ctrl_set = NULL, .mac_addr_add = enicpmd_add_mac_addr, .mac_addr_remove = enicpmd_remove_mac_addr, - .fdir_set_masks = NULL, .filter_ctrl = enicpmd_dev_filter_ctrl, }; diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index b309309..f593f6e 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1970,234 +1970,6 @@ rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on) } int -rte_eth_dev_fdir_add_signature_filter(uint8_t port_id, - struct rte_fdir_filter *fdir_filter, - uint8_t queue) -{ - struct rte_eth_dev *dev; - - VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); - dev = &rte_eth_devices[port_id]; - - if (dev->data->dev_conf.fdir_conf.mode != RTE_FDIR_MODE_SIGNATURE) { - PMD_DEBUG_TRACE("port %d: invalid FDIR mode=%u\n", - port_id, dev->data->dev_conf.fdir_conf.mode); - return -ENOSYS; - } - - if ((fdir_filter->l4type == RTE_FDIR_L4TYPE_SCTP - || fdir_filter->l4type == RTE_FDIR_L4TYPE_NONE) - && (fdir_filter->port_src || fdir_filter->port_dst)) { - PMD_DEBUG_TRACE(" Port are meaningless for SCTP and " - "None l4type, source & destinations ports " - "should be null!\n"); - return -EINVAL; - } - - FUNC_PTR_OR_ERR_RET(*dev->dev_ops->fdir_add_signature_filter, -ENOTSUP); - return (*dev->dev_ops->fdir_add_signature_filter)(dev, fdir_filter, - queue); -} - -int -rte_eth_dev_fdir_update_signature_filter(uint8_t port_id, - struct rte_fdir_filter *fdir_filter, - uint8_t queue) -{ - struct rte_eth_dev *dev; - - VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); - dev = &rte_eth_devices[port_id]; - - if (dev->data->dev_conf.fdir_conf.mode != RTE_FDIR_MODE_SIGNATURE) { - PMD_DEBUG_TRACE("port %d: invalid FDIR mode=%u\n", - port_id, dev->data->dev_conf.fdir_conf.mode); - return -ENOSYS; - } - - if ((fdir_filter->l4type == RTE_FDIR_L4TYPE_SCTP - || fdir_filter->l4type == RTE_FDIR_L4TYPE_NONE) - && (fdir_filter->port_src || fdir_filter->port_dst)) { - PMD_DEBUG_TRACE(" Port are meaningless for SCTP and " - "None l4type, source & destinations ports " - "should be null!\n"); - return -EINVAL; - } - - FUNC_PTR_OR_ERR_RET(*dev->dev_ops->fdir_update_signature_filter, -ENOTSUP); - return (*dev->dev_ops->fdir_update_signature_filter)(dev, fdir_filter, - queue); - -} - -int -rte_eth_dev_fdir_remove_signature_filter(uint8_t port_id, - struct rte_fdir_filter *fdir_filter) -{ - struct rte_eth_dev *dev; - - VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); - dev = &rte_eth_devices[port_id]; - - if (dev->data->dev_conf.fdir_conf.mode != RTE_FDIR_MODE_SIGNATURE) { - PMD_DEBUG_TRACE("port %d: invalid FDIR mode=%u\n", - port_id, dev->data->dev_conf.fdir_conf.mode); - return -ENOSYS; - } - - if ((fdir_filter->l4type == RTE_FDIR_L4TYPE_SCTP - || fdir_filter->l4type == RTE_FDIR_L4TYPE_NONE) - && (fdir_filter->port_src || fdir_filter->port_dst)) { - PMD_DEBUG_TRACE(" Port are meaningless for SCTP and " - "None l4type source & destinations ports " - "should be null!\n"); - return -EINVAL; - } - - FUNC_PTR_OR_ERR_RET(*dev->dev_ops->fdir_remove_signature_filter, -ENOTSUP); - return (*dev->dev_ops->fdir_remove_signature_filter)(dev, fdir_filter); -} - -int -rte_eth_dev_fdir_get_infos(uint8_t port_id, struct rte_eth_fdir *fdir) -{ - struct rte_eth_dev *dev; - - VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); - dev = &rte_eth_devices[port_id]; - if (!(dev->data->dev_conf.fdir_conf.mode)) { - PMD_DEBUG_TRACE("port %d: pkt-filter disabled\n", port_id); - return -ENOSYS; - } - - FUNC_PTR_OR_ERR_RET(*dev->dev_ops->fdir_infos_get, -ENOTSUP); - - (*dev->dev_ops->fdir_infos_get)(dev, fdir); - return 0; -} - -int -rte_eth_dev_fdir_add_perfect_filter(uint8_t port_id, - struct rte_fdir_filter *fdir_filter, - uint16_t soft_id, uint8_t queue, - uint8_t drop) -{ - struct rte_eth_dev *dev; - - VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); - dev = &rte_eth_devices[port_id]; - - if (dev->data->dev_conf.fdir_conf.mode != RTE_FDIR_MODE_PERFECT) { - PMD_DEBUG_TRACE("port %d: invalid FDIR mode=%u\n", - port_id, dev->data->dev_conf.fdir_conf.mode); - return -ENOSYS; - } - - if ((fdir_filter->l4type == RTE_FDIR_L4TYPE_SCTP - || fdir_filter->l4type == RTE_FDIR_L4TYPE_NONE) - && (fdir_filter->port_src || fdir_filter->port_dst)) { - PMD_DEBUG_TRACE(" Port are meaningless for SCTP and " - "None l4type, source & destinations ports " - "should be null!\n"); - return -EINVAL; - } - - /* For now IPv6 is not supported with perfect filter */ - if (fdir_filter->iptype == RTE_FDIR_IPTYPE_IPV6) - return -ENOTSUP; - - FUNC_PTR_OR_ERR_RET(*dev->dev_ops->fdir_add_perfect_filter, -ENOTSUP); - return (*dev->dev_ops->fdir_add_perfect_filter)(dev, fdir_filter, - soft_id, queue, - drop); -} - -int -rte_eth_dev_fdir_update_perfect_filter(uint8_t port_id, - struct rte_fdir_filter *fdir_filter, - uint16_t soft_id, uint8_t queue, - uint8_t drop) -{ - struct rte_eth_dev *dev; - - VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); - dev = &rte_eth_devices[port_id]; - - if (dev->data->dev_conf.fdir_conf.mode != RTE_FDIR_MODE_PERFECT) { - PMD_DEBUG_TRACE("port %d: invalid FDIR mode=%u\n", - port_id, dev->data->dev_conf.fdir_conf.mode); - return -ENOSYS; - } - - if ((fdir_filter->l4type == RTE_FDIR_L4TYPE_SCTP - || fdir_filter->l4type == RTE_FDIR_L4TYPE_NONE) - && (fdir_filter->port_src || fdir_filter->port_dst)) { - PMD_DEBUG_TRACE(" Port are meaningless for SCTP and " - "None l4type, source & destinations ports " - "should be null!\n"); - return -EINVAL; - } - - /* For now IPv6 is not supported with perfect filter */ - if (fdir_filter->iptype == RTE_FDIR_IPTYPE_IPV6) - return -ENOTSUP; - - FUNC_PTR_OR_ERR_RET(*dev->dev_ops->fdir_update_perfect_filter, -ENOTSUP); - return (*dev->dev_ops->fdir_update_perfect_filter)(dev, fdir_filter, - soft_id, queue, drop); -} - -int -rte_eth_dev_fdir_remove_perfect_filter(uint8_t port_id, - struct rte_fdir_filter *fdir_filter, - uint16_t soft_id) -{ - struct rte_eth_dev *dev; - - VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); - dev = &rte_eth_devices[port_id]; - - if (dev->data->dev_conf.fdir_conf.mode != RTE_FDIR_MODE_PERFECT) { - PMD_DEBUG_TRACE("port %d: invalid FDIR mode=%u\n", - port_id, dev->data->dev_conf.fdir_conf.mode); - return -ENOSYS; - } - - if ((fdir_filter->l4type == RTE_FDIR_L4TYPE_SCTP - || fdir_filter->l4type == RTE_FDIR_L4TYPE_NONE) - && (fdir_filter->port_src || fdir_filter->port_dst)) { - PMD_DEBUG_TRACE(" Port are meaningless for SCTP and " - "None l4type, source & destinations ports " - "should be null!\n"); - return -EINVAL; - } - - /* For now IPv6 is not supported with perfect filter */ - if (fdir_filter->iptype == RTE_FDIR_IPTYPE_IPV6) - return -ENOTSUP; - - FUNC_PTR_OR_ERR_RET(*dev->dev_ops->fdir_remove_perfect_filter, -ENOTSUP); - return (*dev->dev_ops->fdir_remove_perfect_filter)(dev, fdir_filter, - soft_id); -} - -int -rte_eth_dev_fdir_set_masks(uint8_t port_id, struct rte_fdir_masks *fdir_mask) -{ - struct rte_eth_dev *dev; - - VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); - dev = &rte_eth_devices[port_id]; - if (!(dev->data->dev_conf.fdir_conf.mode)) { - PMD_DEBUG_TRACE("port %d: pkt-filter disabled\n", port_id); - return -ENOSYS; - } - - FUNC_PTR_OR_ERR_RET(*dev->dev_ops->fdir_set_masks, -ENOTSUP); - return (*dev->dev_ops->fdir_set_masks)(dev, fdir_mask); -} - -int rte_eth_dev_flow_ctrl_get(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index fa06554..8a8c82b 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -732,114 +732,6 @@ struct rte_eth_udp_tunnel { }; /** - * Possible l4type of FDIR filters. - */ -enum rte_l4type { - RTE_FDIR_L4TYPE_NONE = 0, /**< None. */ - RTE_FDIR_L4TYPE_UDP, /**< UDP. */ - RTE_FDIR_L4TYPE_TCP, /**< TCP. */ - RTE_FDIR_L4TYPE_SCTP, /**< SCTP. */ -}; - -/** - * Select IPv4 or IPv6 FDIR filters. - */ -enum rte_iptype { - RTE_FDIR_IPTYPE_IPV4 = 0, /**< IPv4. */ - RTE_FDIR_IPTYPE_IPV6 , /**< IPv6. */ -}; - -/** - * A structure used to define a FDIR packet filter. - */ -struct rte_fdir_filter { - uint16_t flex_bytes; /**< Flex bytes value to match. */ - uint16_t vlan_id; /**< VLAN ID value to match, 0 otherwise. */ - uint16_t port_src; /**< Source port to match, 0 otherwise. */ - uint16_t port_dst; /**< Destination port to match, 0 otherwise. */ - union { - uint32_t ipv4_addr; /**< IPv4 source address to match. */ - uint32_t ipv6_addr[4]; /**< IPv6 source address to match. */ - } ip_src; /**< IPv4/IPv6 source address to match (union of above). */ - union { - uint32_t ipv4_addr; /**< IPv4 destination address to match. */ - uint32_t ipv6_addr[4]; /**< IPv6 destination address to match */ - } ip_dst; /**< IPv4/IPv6 destination address to match (union of above). */ - enum rte_l4type l4type; /**< l4type to match: NONE/UDP/TCP/SCTP. */ - enum rte_iptype iptype; /**< IP packet type to match: IPv4 or IPv6. */ -}; - -/** - * A structure used to configure FDIR masks that are used by the device - * to match the various fields of RX packet headers. - * @note The only_ip_flow field has the opposite meaning compared to other - * masks! - */ -struct rte_fdir_masks { - /** When set to 1, packet l4type is \b NOT relevant in filters, and - source and destination port masks must be set to zero. */ - uint8_t only_ip_flow; - /** If set to 1, vlan_id is relevant in filters. */ - uint8_t vlan_id; - /** If set to 1, vlan_prio is relevant in filters. */ - uint8_t vlan_prio; - /** If set to 1, flexbytes is relevant in filters. */ - uint8_t flexbytes; - /** If set to 1, set the IPv6 masks. Otherwise set the IPv4 masks. */ - uint8_t set_ipv6_mask; - /** When set to 1, comparison of destination IPv6 address with IP6AT - registers is meaningful. */ - uint8_t comp_ipv6_dst; - /** Mask of Destination IPv4 Address. All bits set to 1 define the - relevant bits to use in the destination address of an IPv4 packet - when matching it against FDIR filters. */ - uint32_t dst_ipv4_mask; - /** Mask of Source IPv4 Address. All bits set to 1 define - the relevant bits to use in the source address of an IPv4 packet - when matching it against FDIR filters. */ - uint32_t src_ipv4_mask; - /** Mask of Source IPv6 Address. All bits set to 1 define the - relevant BYTES to use in the source address of an IPv6 packet - when matching it against FDIR filters. */ - uint16_t dst_ipv6_mask; - /** Mask of Destination IPv6 Address. All bits set to 1 define the - relevant BYTES to use in the destination address of an IPv6 packet - when matching it against FDIR filters. */ - uint16_t src_ipv6_mask; - /** Mask of Source Port. All bits set to 1 define the relevant - bits to use in the source port of an IP packets when matching it - against FDIR filters. */ - uint16_t src_port_mask; - /** Mask of Destination Port. All bits set to 1 define the relevant - bits to use in the destination port of an IP packet when matching it - against FDIR filters. */ - uint16_t dst_port_mask; -}; - -/** - * A structure used to report the status of the flow director filters in use. - */ -struct rte_eth_fdir { - /** Number of filters with collision indication. */ - uint16_t collision; - /** Number of free (non programmed) filters. */ - uint16_t free; - /** The Lookup hash value of the added filter that updated the value - of the MAXLEN field */ - uint16_t maxhash; - /** Longest linked list of filters in the table. */ - uint8_t maxlen; - /** Number of added filters. */ - uint64_t add; - /** Number of removed filters. */ - uint64_t remove; - /** Number of failed added filters (no more space in device). */ - uint64_t f_add; - /** Number of failed removed filters. */ - uint64_t f_remove; -}; - -/** * A structure used to enable/disable specific device interrupts. */ struct rte_intr_conf { @@ -1108,45 +1000,6 @@ typedef uint16_t (*eth_tx_burst_t)(void *txq, uint16_t nb_pkts); /**< @internal Send output packets on a transmit queue of an Ethernet device. */ -typedef int (*fdir_add_signature_filter_t)(struct rte_eth_dev *dev, - struct rte_fdir_filter *fdir_ftr, - uint8_t rx_queue); -/**< @internal Setup a new signature filter rule on an Ethernet device */ - -typedef int (*fdir_update_signature_filter_t)(struct rte_eth_dev *dev, - struct rte_fdir_filter *fdir_ftr, - uint8_t rx_queue); -/**< @internal Update a signature filter rule on an Ethernet device */ - -typedef int (*fdir_remove_signature_filter_t)(struct rte_eth_dev *dev, - struct rte_fdir_filter *fdir_ftr); -/**< @internal Remove a signature filter rule on an Ethernet device */ - -typedef void (*fdir_infos_get_t)(struct rte_eth_dev *dev, - struct rte_eth_fdir *fdir); -/**< @internal Get information about fdir status */ - -typedef int (*fdir_add_perfect_filter_t)(struct rte_eth_dev *dev, - struct rte_fdir_filter *fdir_ftr, - uint16_t soft_id, uint8_t rx_queue, - uint8_t drop); -/**< @internal Setup a new perfect filter rule on an Ethernet device */ - -typedef int (*fdir_update_perfect_filter_t)(struct rte_eth_dev *dev, - struct rte_fdir_filter *fdir_ftr, - uint16_t soft_id, uint8_t rx_queue, - uint8_t drop); -/**< @internal Update a perfect filter rule on an Ethernet device */ - -typedef int (*fdir_remove_perfect_filter_t)(struct rte_eth_dev *dev, - struct rte_fdir_filter *fdir_ftr, - uint16_t soft_id); -/**< @internal Remove a perfect filter rule on an Ethernet device */ - -typedef int (*fdir_set_masks_t)(struct rte_eth_dev *dev, - struct rte_fdir_masks *fdir_masks); -/**< @internal Setup flow director masks on an Ethernet device */ - typedef int (*flow_ctrl_get_t)(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf); /**< @internal Get current flow control parameter on an Ethernet device */ @@ -1416,23 +1269,6 @@ struct eth_dev_ops { eth_udp_tunnel_del_t udp_tunnel_del; eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit */ eth_set_vf_rate_limit_t set_vf_rate_limit; /**< Set VF rate limit */ - - /** Add a signature filter. */ - fdir_add_signature_filter_t fdir_add_signature_filter; - /** Update a signature filter. */ - fdir_update_signature_filter_t fdir_update_signature_filter; - /** Remove a signature filter. */ - fdir_remove_signature_filter_t fdir_remove_signature_filter; - /** Get information about FDIR status. */ - fdir_infos_get_t fdir_infos_get; - /** Add a perfect filter. */ - fdir_add_perfect_filter_t fdir_add_perfect_filter; - /** Update a perfect filter. */ - fdir_update_perfect_filter_t fdir_update_perfect_filter; - /** Remove a perfect filter. */ - fdir_remove_perfect_filter_t fdir_remove_perfect_filter; - /** Setup masks for FDIR filtering. */ - fdir_set_masks_t fdir_set_masks; /** Update redirection table. */ reta_update_t reta_update; /** Query redirection table. */ @@ -2683,222 +2519,6 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, #endif /** - * Setup a new signature filter rule on an Ethernet device - * - * @param port_id - * The port identifier of the Ethernet device. - * @param fdir_filter - * The pointer to the fdir filter structure describing the signature filter - * rule. - * The *rte_fdir_filter* structure includes the values of the different fields - * to match: source and destination IP addresses, vlan id, flexbytes, source - * and destination ports, and so on. - * @param rx_queue - * The index of the RX queue where to store RX packets matching the added - * signature filter defined in fdir_filter. - * @return - * - (0) if successful. - * - (-ENOTSUP) if hardware doesn't support flow director mode. - * - (-ENODEV) if *port_id* invalid. - * - (-ENOSYS) if the FDIR mode is not configured in signature mode - * on *port_id*. - * - (-EINVAL) if the fdir_filter information is not correct. - */ -int rte_eth_dev_fdir_add_signature_filter(uint8_t port_id, - struct rte_fdir_filter *fdir_filter, - uint8_t rx_queue); - -/** - * Update a signature filter rule on an Ethernet device. - * If the rule doesn't exits, it is created. - * - * @param port_id - * The port identifier of the Ethernet device. - * @param fdir_ftr - * The pointer to the structure describing the signature filter rule. - * The *rte_fdir_filter* structure includes the values of the different fields - * to match: source and destination IP addresses, vlan id, flexbytes, source - * and destination ports, and so on. - * @param rx_queue - * The index of the RX queue where to store RX packets matching the added - * signature filter defined in fdir_ftr. - * @return - * - (0) if successful. - * - (-ENOTSUP) if hardware doesn't support flow director mode. - * - (-ENODEV) if *port_id* invalid. - * - (-ENOSYS) if the flow director mode is not configured in signature mode - * on *port_id*. - * - (-EINVAL) if the fdir_filter information is not correct. - */ -int rte_eth_dev_fdir_update_signature_filter(uint8_t port_id, - struct rte_fdir_filter *fdir_ftr, - uint8_t rx_queue); - -/** - * Remove a signature filter rule on an Ethernet device. - * - * @param port_id - * The port identifier of the Ethernet device. - * @param fdir_ftr - * The pointer to the structure describing the signature filter rule. - * The *rte_fdir_filter* structure includes the values of the different fields - * to match: source and destination IP addresses, vlan id, flexbytes, source - * and destination ports, and so on. - * @return - * - (0) if successful. - * - (-ENOTSUP) if hardware doesn't support flow director mode. - * - (-ENODEV) if *port_id* invalid. - * - (-ENOSYS) if the flow director mode is not configured in signature mode - * on *port_id*. - * - (-EINVAL) if the fdir_filter information is not correct. - */ -int rte_eth_dev_fdir_remove_signature_filter(uint8_t port_id, - struct rte_fdir_filter *fdir_ftr); - -/** - * Retrieve the flow director information of an Ethernet device. - * - * @param port_id - * The port identifier of the Ethernet device. - * @param fdir - * A pointer to a structure of type *rte_eth_dev_fdir* to be filled with - * the flow director information of the Ethernet device. - * @return - * - (0) if successful. - * - (-ENOTSUP) if hardware doesn't support flow director mode. - * - (-ENODEV) if *port_id* invalid. - * - (-ENOSYS) if the flow director mode is not configured on *port_id*. - */ -int rte_eth_dev_fdir_get_infos(uint8_t port_id, struct rte_eth_fdir *fdir); - -/** - * Add a new perfect filter rule on an Ethernet device. - * - * @param port_id - * The port identifier of the Ethernet device. - * @param fdir_filter - * The pointer to the structure describing the perfect filter rule. - * The *rte_fdir_filter* structure includes the values of the different fields - * to match: source and destination IP addresses, vlan id, flexbytes, source - * and destination ports, and so on. - * IPv6 are not supported. - * @param soft_id - * The 16-bit value supplied in the field hash.fdir.id of mbuf for RX - * packets matching the perfect filter. - * @param rx_queue - * The index of the RX queue where to store RX packets matching the added - * perfect filter defined in fdir_filter. - * @param drop - * If drop is set to 1, matching RX packets are stored into the RX drop - * queue defined in the rte_fdir_conf. - * @return - * - (0) if successful. - * - (-ENOTSUP) if hardware doesn't support flow director mode. - * - (-ENODEV) if *port_id* invalid. - * - (-ENOSYS) if the flow director mode is not configured in perfect mode - * on *port_id*. - * - (-EINVAL) if the fdir_filter information is not correct. - */ -int rte_eth_dev_fdir_add_perfect_filter(uint8_t port_id, - struct rte_fdir_filter *fdir_filter, - uint16_t soft_id, uint8_t rx_queue, - uint8_t drop); - -/** - * Update a perfect filter rule on an Ethernet device. - * If the rule doesn't exits, it is created. - * - * @param port_id - * The port identifier of the Ethernet device. - * @param fdir_filter - * The pointer to the structure describing the perfect filter rule. - * The *rte_fdir_filter* structure includes the values of the different fields - * to match: source and destination IP addresses, vlan id, flexbytes, source - * and destination ports, and so on. - * IPv6 are not supported. - * @param soft_id - * The 16-bit value supplied in the field hash.fdir.id of mbuf for RX - * packets matching the perfect filter. - * @param rx_queue - * The index of the RX queue where to store RX packets matching the added - * perfect filter defined in fdir_filter. - * @param drop - * If drop is set to 1, matching RX packets are stored into the RX drop - * queue defined in the rte_fdir_conf. - * @return - * - (0) if successful. - * - (-ENOTSUP) if hardware doesn't support flow director mode. - * - (-ENODEV) if *port_id* invalid. - * - (-ENOSYS) if the flow director mode is not configured in perfect mode - * on *port_id*. - * - (-EINVAL) if the fdir_filter information is not correct. - */ -int rte_eth_dev_fdir_update_perfect_filter(uint8_t port_id, - struct rte_fdir_filter *fdir_filter, - uint16_t soft_id, uint8_t rx_queue, - uint8_t drop); - -/** - * Remove a perfect filter rule on an Ethernet device. - * - * @param port_id - * The port identifier of the Ethernet device. - * @param fdir_filter - * The pointer to the structure describing the perfect filter rule. - * The *rte_fdir_filter* structure includes the values of the different fields - * to match: source and destination IP addresses, vlan id, flexbytes, source - * and destination ports, and so on. - * IPv6 are not supported. - * @param soft_id - * The soft_id value provided when adding/updating the removed filter. - * @return - * - (0) if successful. - * - (-ENOTSUP) if hardware doesn't support flow director mode. - * - (-ENODEV) if *port_id* invalid. - * - (-ENOSYS) if the flow director mode is not configured in perfect mode - * on *port_id*. - * - (-EINVAL) if the fdir_filter information is not correct. - */ -int rte_eth_dev_fdir_remove_perfect_filter(uint8_t port_id, - struct rte_fdir_filter *fdir_filter, - uint16_t soft_id); -/** - * Configure globally the masks for flow director mode for an Ethernet device. - * For example, the device can match packets with only the first 24 bits of - * the IPv4 source address. - * - * The following fields can be masked: IPv4 addresses and L4 port numbers. - * The following fields can be either enabled or disabled completely for the - * matching functionality: VLAN ID tag; VLAN Priority + CFI bit; Flexible 2-byte - * tuple. - * IPv6 masks are not supported. - * - * All filters must comply with the masks previously configured. - * For example, with a mask equal to 255.255.255.0 for the source IPv4 address, - * all IPv4 filters must be created with a source IPv4 address that fits the - * "X.X.X.0" format. - * - * This function flushes all filters that have been previously added in - * the device. - * - * @param port_id - * The port identifier of the Ethernet device. - * @param fdir_mask - * The pointer to the fdir mask structure describing relevant headers fields - * and relevant bits to use when matching packets addresses and ports. - * IPv6 masks are not supported. - * @return - * - (0) if successful. - * - (-ENOTSUP) if hardware doesn't support flow director mode. - * - (-ENODEV) if *port_id* invalid. - * - (-ENOSYS) if the flow director mode is not configured in perfect - * mode on *port_id*. - * - (-EINVAL) if the fdir_filter information is not correct - */ -int rte_eth_dev_fdir_set_masks(uint8_t port_id, - struct rte_fdir_masks *fdir_mask); - -/** * The eth device event type for interrupt, and maybe others in the future. */ enum rte_eth_event_type {