Instead of EtherType filter RTE flow API should be used.
Move corresponding definitions to ethdev internal driver API
since it is used by drivers internally.
Preserve RTE_ETH_FILTER_ETHERTYPE because of it as well.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
"filters:\n"
"--------\n\n"
- "ethertype_filter (port_id) (add|del)"
- " (mac_addr|mac_ignr) (mac_address) ethertype"
- " (ether_type) (drop|fwd) queue (queue_id)\n"
- " Add/Del an ethertype filter.\n\n"
-
"2tuple_filter (port_id) (add|del)"
" dst_port (dst_port_value) protocol (protocol_value)"
" mask (mask_value) tcp_flags (tcp_flags_value)"
/* *** Filters Control *** */
-/* *** deal with ethertype filter *** */
-struct cmd_ethertype_filter_result {
- cmdline_fixed_string_t filter;
- portid_t port_id;
- cmdline_fixed_string_t ops;
- cmdline_fixed_string_t mac;
- struct rte_ether_addr mac_addr;
- cmdline_fixed_string_t ethertype;
- uint16_t ethertype_value;
- cmdline_fixed_string_t drop;
- cmdline_fixed_string_t queue;
- uint16_t queue_id;
-};
-
-cmdline_parse_token_string_t cmd_ethertype_filter_filter =
- TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result,
- filter, "ethertype_filter");
-cmdline_parse_token_num_t cmd_ethertype_filter_port_id =
- TOKEN_NUM_INITIALIZER(struct cmd_ethertype_filter_result,
- port_id, UINT16);
-cmdline_parse_token_string_t cmd_ethertype_filter_ops =
- TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result,
- ops, "add#del");
-cmdline_parse_token_string_t cmd_ethertype_filter_mac =
- TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result,
- mac, "mac_addr#mac_ignr");
-cmdline_parse_token_etheraddr_t cmd_ethertype_filter_mac_addr =
- TOKEN_ETHERADDR_INITIALIZER(struct cmd_ethertype_filter_result,
- mac_addr);
-cmdline_parse_token_string_t cmd_ethertype_filter_ethertype =
- TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result,
- ethertype, "ethertype");
-cmdline_parse_token_num_t cmd_ethertype_filter_ethertype_value =
- TOKEN_NUM_INITIALIZER(struct cmd_ethertype_filter_result,
- ethertype_value, UINT16);
-cmdline_parse_token_string_t cmd_ethertype_filter_drop =
- TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result,
- drop, "drop#fwd");
-cmdline_parse_token_string_t cmd_ethertype_filter_queue =
- TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result,
- queue, "queue");
-cmdline_parse_token_num_t cmd_ethertype_filter_queue_id =
- TOKEN_NUM_INITIALIZER(struct cmd_ethertype_filter_result,
- queue_id, UINT16);
-
-static void
-cmd_ethertype_filter_parsed(void *parsed_result,
- __rte_unused struct cmdline *cl,
- __rte_unused void *data)
-{
- struct cmd_ethertype_filter_result *res = parsed_result;
- struct rte_eth_ethertype_filter filter;
- int ret = 0;
-
- ret = rte_eth_dev_filter_supported(res->port_id,
- RTE_ETH_FILTER_ETHERTYPE);
- if (ret < 0) {
- printf("ethertype filter is not supported on port %u.\n",
- res->port_id);
- return;
- }
-
- memset(&filter, 0, sizeof(filter));
- if (!strcmp(res->mac, "mac_addr")) {
- filter.flags |= RTE_ETHTYPE_FLAGS_MAC;
- rte_memcpy(&filter.mac_addr, &res->mac_addr,
- sizeof(struct rte_ether_addr));
- }
- if (!strcmp(res->drop, "drop"))
- filter.flags |= RTE_ETHTYPE_FLAGS_DROP;
- filter.ether_type = res->ethertype_value;
- filter.queue = res->queue_id;
-
- if (!strcmp(res->ops, "add"))
- ret = rte_eth_dev_filter_ctrl(res->port_id,
- RTE_ETH_FILTER_ETHERTYPE,
- RTE_ETH_FILTER_ADD,
- &filter);
- else
- ret = rte_eth_dev_filter_ctrl(res->port_id,
- RTE_ETH_FILTER_ETHERTYPE,
- RTE_ETH_FILTER_DELETE,
- &filter);
- if (ret < 0)
- printf("ethertype filter programming error: (%s)\n",
- strerror(-ret));
-}
-
-cmdline_parse_inst_t cmd_ethertype_filter = {
- .f = cmd_ethertype_filter_parsed,
- .data = NULL,
- .help_str = "ethertype_filter <port_id> add|del mac_addr|mac_ignr "
- "<mac_addr> ethertype <value> drop|fw queue <queue_id>: "
- "Add or delete an ethertype filter entry",
- .tokens = {
- (void *)&cmd_ethertype_filter_filter,
- (void *)&cmd_ethertype_filter_port_id,
- (void *)&cmd_ethertype_filter_ops,
- (void *)&cmd_ethertype_filter_mac,
- (void *)&cmd_ethertype_filter_mac_addr,
- (void *)&cmd_ethertype_filter_ethertype,
- (void *)&cmd_ethertype_filter_ethertype_value,
- (void *)&cmd_ethertype_filter_drop,
- (void *)&cmd_ethertype_filter_queue,
- (void *)&cmd_ethertype_filter_queue_id,
- NULL,
- },
-};
-
/* *** deal with flow director filter *** */
struct cmd_flow_director_result {
cmdline_fixed_string_t flow_director_filter;
(cmdline_parse_inst_t *)&cmd_config_rss_hash_key,
(cmdline_parse_inst_t *)&cmd_dump,
(cmdline_parse_inst_t *)&cmd_dump_one,
- (cmdline_parse_inst_t *)&cmd_ethertype_filter,
(cmdline_parse_inst_t *)&cmd_syn_filter,
(cmdline_parse_inst_t *)&cmd_2tuple_filter,
(cmdline_parse_inst_t *)&cmd_5tuple_filter,
as with previous firmware versions. Meanwhile, the Ethertype filter can be
used to classify MPLS packet by using a command in testpmd like:
- testpmd> ethertype_filter 0 add mac_ignr 00:00:00:00:00:00 ethertype \
- 0x8847 fwd queue <M>
+ testpmd> flow create 0 ingress pattern eth type is 0x8847 / end \
+ actions queue index <M> / end
16 Byte RX Descriptor setting on DPDK VF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ethdev: the legacy filter API, including
``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well
- as filter types ETHERTYPE, FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR,
+ as filter types FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR,
HASH and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in
PMDs that implement the latter.
The legacy API will be removed in DPDK 20.11.
Note these functions interface the deprecated legacy filtering framework,
superseded by *rte_flow*. See `Flow rules management`_.
-ethertype_filter
-~~~~~~~~~~~~~~~~~~~~
-
-Add or delete a L2 Ethertype filter, which identify packets by their L2 Ethertype mainly assign them to a receive queue::
-
- ethertype_filter (port_id) (add|del) (mac_addr|mac_ignr) (mac_address) \
- ethertype (ether_type) (drop|fwd) queue (queue_id)
-
-The available information parameters are:
-
-* ``port_id``: The port which the Ethertype filter assigned on.
-
-* ``mac_addr``: Compare destination mac address.
-
-* ``mac_ignr``: Ignore destination mac address match.
-
-* ``mac_address``: Destination mac address to match.
-
-* ``ether_type``: The EtherType value want to match,
- for example 0x0806 for ARP packet. 0x0800 (IPv4) and 0x86DD (IPv6) are invalid.
-
-* ``queue_id``: The receive queue associated with this EtherType filter.
- It is meaningless when deleting or dropping.
-
-Example, to add/remove an ethertype filter rule::
-
- testpmd> ethertype_filter 0 add mac_ignr 00:11:22:33:44:55 \
- ethertype 0x0806 fwd queue 3
-
- testpmd> ethertype_filter 0 del mac_ignr 00:11:22:33:44:55 \
- ethertype 0x0806 fwd queue 3
-
2tuple_filter
~~~~~~~~~~~~~~~~~
return RTE_ETH_TX_DESC_FULL;
}
-static struct bnxt_filter_info *
-bnxt_match_and_validate_ether_filter(struct bnxt *bp,
- struct rte_eth_ethertype_filter *efilter,
- struct bnxt_vnic_info *vnic0,
- struct bnxt_vnic_info *vnic,
- int *ret)
-{
- struct bnxt_filter_info *mfilter = NULL;
- int match = 0;
- *ret = 0;
-
- if (efilter->ether_type == RTE_ETHER_TYPE_IPV4 ||
- efilter->ether_type == RTE_ETHER_TYPE_IPV6) {
- PMD_DRV_LOG(ERR, "invalid ether_type(0x%04x) in"
- " ethertype filter.", efilter->ether_type);
- *ret = -EINVAL;
- goto exit;
- }
- if (efilter->queue >= bp->rx_nr_rings) {
- PMD_DRV_LOG(ERR, "Invalid queue %d\n", efilter->queue);
- *ret = -EINVAL;
- goto exit;
- }
-
- vnic0 = BNXT_GET_DEFAULT_VNIC(bp);
- vnic = &bp->vnic_info[efilter->queue];
- if (vnic == NULL) {
- PMD_DRV_LOG(ERR, "Invalid queue %d\n", efilter->queue);
- *ret = -EINVAL;
- goto exit;
- }
-
- if (efilter->flags & RTE_ETHTYPE_FLAGS_DROP) {
- STAILQ_FOREACH(mfilter, &vnic0->filter, next) {
- if ((!memcmp(efilter->mac_addr.addr_bytes,
- mfilter->l2_addr, RTE_ETHER_ADDR_LEN) &&
- mfilter->flags ==
- HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP &&
- mfilter->ethertype == efilter->ether_type)) {
- match = 1;
- break;
- }
- }
- } else {
- STAILQ_FOREACH(mfilter, &vnic->filter, next)
- if ((!memcmp(efilter->mac_addr.addr_bytes,
- mfilter->l2_addr, RTE_ETHER_ADDR_LEN) &&
- mfilter->ethertype == efilter->ether_type &&
- mfilter->flags ==
- HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX)) {
- match = 1;
- break;
- }
- }
-
- if (match)
- *ret = -EEXIST;
-
-exit:
- return mfilter;
-}
-
-static int
-bnxt_ethertype_filter(struct rte_eth_dev *dev,
- enum rte_filter_op filter_op,
- void *arg)
-{
- struct bnxt *bp = dev->data->dev_private;
- struct rte_eth_ethertype_filter *efilter =
- (struct rte_eth_ethertype_filter *)arg;
- struct bnxt_filter_info *bfilter, *filter1;
- struct bnxt_vnic_info *vnic, *vnic0;
- int ret;
-
- if (filter_op == RTE_ETH_FILTER_NOP)
- return 0;
-
- if (arg == NULL) {
- PMD_DRV_LOG(ERR, "arg shouldn't be NULL for operation %u.",
- filter_op);
- return -EINVAL;
- }
-
- vnic0 = BNXT_GET_DEFAULT_VNIC(bp);
- vnic = &bp->vnic_info[efilter->queue];
-
- switch (filter_op) {
- case RTE_ETH_FILTER_ADD:
- bnxt_match_and_validate_ether_filter(bp, efilter,
- vnic0, vnic, &ret);
- if (ret < 0)
- return ret;
-
- bfilter = bnxt_get_unused_filter(bp);
- if (bfilter == NULL) {
- PMD_DRV_LOG(ERR,
- "Not enough resources for a new filter.\n");
- return -ENOMEM;
- }
- bfilter->filter_type = HWRM_CFA_NTUPLE_FILTER;
- memcpy(bfilter->l2_addr, efilter->mac_addr.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- memcpy(bfilter->dst_macaddr, efilter->mac_addr.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- bfilter->enables |= NTUPLE_FLTR_ALLOC_INPUT_EN_DST_MACADDR;
- bfilter->ethertype = efilter->ether_type;
- bfilter->enables |= NTUPLE_FLTR_ALLOC_INPUT_EN_ETHERTYPE;
-
- filter1 = bnxt_get_l2_filter(bp, bfilter, vnic0);
- if (filter1 == NULL) {
- ret = -EINVAL;
- goto cleanup;
- }
- bfilter->enables |=
- HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID;
- bfilter->fw_l2_filter_id = filter1->fw_l2_filter_id;
-
- bfilter->dst_id = vnic->fw_vnic_id;
-
- if (efilter->flags & RTE_ETHTYPE_FLAGS_DROP) {
- bfilter->flags =
- HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP;
- }
-
- ret = bnxt_hwrm_set_ntuple_filter(bp, bfilter->dst_id, bfilter);
- if (ret)
- goto cleanup;
- STAILQ_INSERT_TAIL(&vnic->filter, bfilter, next);
- break;
- case RTE_ETH_FILTER_DELETE:
- filter1 = bnxt_match_and_validate_ether_filter(bp, efilter,
- vnic0, vnic, &ret);
- if (ret == -EEXIST) {
- ret = bnxt_hwrm_clear_ntuple_filter(bp, filter1);
-
- STAILQ_REMOVE(&vnic->filter, filter1, bnxt_filter_info,
- next);
- bnxt_free_filter(bp, filter1);
- } else if (ret == 0) {
- PMD_DRV_LOG(ERR, "No matching filter found\n");
- }
- break;
- default:
- PMD_DRV_LOG(ERR, "unsupported operation %u.", filter_op);
- ret = -EINVAL;
- goto error;
- }
- return ret;
-cleanup:
- bnxt_free_filter(bp, bfilter);
-error:
- return ret;
-}
-
static inline int
parse_ntuple_filter(struct bnxt *bp,
struct rte_eth_ntuple_filter *nfilter,
case RTE_ETH_FILTER_NTUPLE:
ret = bnxt_ntuple_filter(dev, filter_op, arg);
break;
- case RTE_ETH_FILTER_ETHERTYPE:
- ret = bnxt_ethertype_filter(dev, filter_op, arg);
- break;
case RTE_ETH_FILTER_GENERIC:
if (filter_op != RTE_ETH_FILTER_GET)
return -EINVAL;
static int igb_ntuple_filter_handle(struct rte_eth_dev *dev,
enum rte_filter_op filter_op,
void *arg);
-static int igb_ethertype_filter_handle(struct rte_eth_dev *dev,
- enum rte_filter_op filter_op,
- void *arg);
-static int igb_get_ethertype_filter(struct rte_eth_dev *dev,
- struct rte_eth_ethertype_filter *filter);
static int eth_igb_filter_ctrl(struct rte_eth_dev *dev,
enum rte_filter_type filter_type,
enum rte_filter_op filter_op,
return 0;
}
-static int
-igb_get_ethertype_filter(struct rte_eth_dev *dev,
- struct rte_eth_ethertype_filter *filter)
-{
- struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct e1000_filter_info *filter_info =
- E1000_DEV_PRIVATE_TO_FILTER_INFO(dev->data->dev_private);
- uint32_t etqf;
- int ret;
-
- ret = igb_ethertype_filter_lookup(filter_info, filter->ether_type);
- if (ret < 0) {
- PMD_DRV_LOG(ERR, "ethertype (0x%04x) filter doesn't exist.",
- filter->ether_type);
- return -ENOENT;
- }
-
- etqf = E1000_READ_REG(hw, E1000_ETQF(ret));
- if (etqf & E1000_ETQF_FILTER_ENABLE) {
- filter->ether_type = etqf & E1000_ETQF_ETHERTYPE;
- filter->flags = 0;
- filter->queue = (etqf & E1000_ETQF_QUEUE) >>
- E1000_ETQF_QUEUE_SHIFT;
- return 0;
- }
-
- return -ENOENT;
-}
-
-/*
- * igb_ethertype_filter_handle - Handle operations for ethertype filter.
- * @dev: pointer to rte_eth_dev structure
- * @filter_op:operation will be taken.
- * @arg: a pointer to specific structure corresponding to the filter_op
- */
-static int
-igb_ethertype_filter_handle(struct rte_eth_dev *dev,
- enum rte_filter_op filter_op,
- void *arg)
-{
- struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- int ret;
-
- MAC_TYPE_FILTER_SUP(hw->mac.type);
-
- if (filter_op == RTE_ETH_FILTER_NOP)
- return 0;
-
- if (arg == NULL) {
- PMD_DRV_LOG(ERR, "arg shouldn't be NULL for operation %u.",
- filter_op);
- return -EINVAL;
- }
-
- switch (filter_op) {
- case RTE_ETH_FILTER_ADD:
- ret = igb_add_del_ethertype_filter(dev,
- (struct rte_eth_ethertype_filter *)arg,
- TRUE);
- break;
- case RTE_ETH_FILTER_DELETE:
- ret = igb_add_del_ethertype_filter(dev,
- (struct rte_eth_ethertype_filter *)arg,
- FALSE);
- break;
- case RTE_ETH_FILTER_GET:
- ret = igb_get_ethertype_filter(dev,
- (struct rte_eth_ethertype_filter *)arg);
- break;
- default:
- PMD_DRV_LOG(ERR, "unsupported operation %u.", filter_op);
- ret = -EINVAL;
- break;
- }
- return ret;
-}
-
static int
eth_igb_filter_ctrl(struct rte_eth_dev *dev,
enum rte_filter_type filter_type,
case RTE_ETH_FILTER_NTUPLE:
ret = igb_ntuple_filter_handle(dev, filter_op, arg);
break;
- case RTE_ETH_FILTER_ETHERTYPE:
- ret = igb_ethertype_filter_handle(dev, filter_op, arg);
- break;
case RTE_ETH_FILTER_SYN:
ret = eth_igb_syn_filter_handle(dev, filter_op, arg);
break;
#include <rte_ethdev.h>
#include <rte_ethdev_core.h>
+#include <rte_ethdev_driver.h>
#include "base/hinic_compat.h"
#include "base/hinic_pmd_cfg.h"
static int i40e_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
struct rte_eth_udp_tunnel *udp_tunnel);
static void i40e_filter_input_set_init(struct i40e_pf *pf);
-static int i40e_ethertype_filter_handle(struct rte_eth_dev *dev,
- enum rte_filter_op filter_op,
- void *arg);
static int i40e_dev_filter_ctrl(struct rte_eth_dev *dev,
enum rte_filter_type filter_type,
enum rte_filter_op filter_op,
return ret;
}
-/*
- * Handle operations for ethertype filter.
- */
-static int
-i40e_ethertype_filter_handle(struct rte_eth_dev *dev,
- enum rte_filter_op filter_op,
- void *arg)
-{
- struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
- int ret = 0;
-
- if (filter_op == RTE_ETH_FILTER_NOP)
- return ret;
-
- if (arg == NULL) {
- PMD_DRV_LOG(ERR, "arg shouldn't be NULL for operation %u",
- filter_op);
- return -EINVAL;
- }
-
- switch (filter_op) {
- case RTE_ETH_FILTER_ADD:
- ret = i40e_ethertype_filter_set(pf,
- (struct rte_eth_ethertype_filter *)arg,
- TRUE);
- break;
- case RTE_ETH_FILTER_DELETE:
- ret = i40e_ethertype_filter_set(pf,
- (struct rte_eth_ethertype_filter *)arg,
- FALSE);
- break;
- default:
- PMD_DRV_LOG(ERR, "unsupported operation %u", filter_op);
- ret = -ENOSYS;
- break;
- }
- return ret;
-}
-
static int
i40e_dev_filter_ctrl(struct rte_eth_dev *dev,
enum rte_filter_type filter_type,
case RTE_ETH_FILTER_HASH:
ret = i40e_hash_filter_ctrl(dev, filter_op, arg);
break;
- case RTE_ETH_FILTER_ETHERTYPE:
- ret = i40e_ethertype_filter_handle(dev, filter_op, arg);
- break;
case RTE_ETH_FILTER_TUNNEL:
ret = i40e_tunnel_filter_handle(dev, filter_op, arg);
break;
void *arg);
static int ixgbe_get_ntuple_filter(struct rte_eth_dev *dev,
struct rte_eth_ntuple_filter *filter);
-static int ixgbe_ethertype_filter_handle(struct rte_eth_dev *dev,
- enum rte_filter_op filter_op,
- void *arg);
-static int ixgbe_get_ethertype_filter(struct rte_eth_dev *dev,
- struct rte_eth_ethertype_filter *filter);
static int ixgbe_dev_filter_ctrl(struct rte_eth_dev *dev,
enum rte_filter_type filter_type,
enum rte_filter_op filter_op,
return 0;
}
-static int
-ixgbe_get_ethertype_filter(struct rte_eth_dev *dev,
- struct rte_eth_ethertype_filter *filter)
-{
- struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct ixgbe_filter_info *filter_info =
- IXGBE_DEV_PRIVATE_TO_FILTER_INFO(dev->data->dev_private);
- uint32_t etqf, etqs;
- int ret;
-
- ret = ixgbe_ethertype_filter_lookup(filter_info, filter->ether_type);
- if (ret < 0) {
- PMD_DRV_LOG(ERR, "ethertype (0x%04x) filter doesn't exist.",
- filter->ether_type);
- return -ENOENT;
- }
-
- etqf = IXGBE_READ_REG(hw, IXGBE_ETQF(ret));
- if (etqf & IXGBE_ETQF_FILTER_EN) {
- etqs = IXGBE_READ_REG(hw, IXGBE_ETQS(ret));
- filter->ether_type = etqf & IXGBE_ETQF_ETHERTYPE;
- filter->flags = 0;
- filter->queue = (etqs & IXGBE_ETQS_RX_QUEUE) >>
- IXGBE_ETQS_RX_QUEUE_SHIFT;
- return 0;
- }
- return -ENOENT;
-}
-
-/*
- * ixgbe_ethertype_filter_handle - Handle operations for ethertype filter.
- * @dev: pointer to rte_eth_dev structure
- * @filter_op:operation will be taken.
- * @arg: a pointer to specific structure corresponding to the filter_op
- */
-static int
-ixgbe_ethertype_filter_handle(struct rte_eth_dev *dev,
- enum rte_filter_op filter_op,
- void *arg)
-{
- struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- int ret;
-
- MAC_TYPE_FILTER_SUP(hw->mac.type);
-
- if (filter_op == RTE_ETH_FILTER_NOP)
- return 0;
-
- if (arg == NULL) {
- PMD_DRV_LOG(ERR, "arg shouldn't be NULL for operation %u.",
- filter_op);
- return -EINVAL;
- }
-
- switch (filter_op) {
- case RTE_ETH_FILTER_ADD:
- ret = ixgbe_add_del_ethertype_filter(dev,
- (struct rte_eth_ethertype_filter *)arg,
- TRUE);
- break;
- case RTE_ETH_FILTER_DELETE:
- ret = ixgbe_add_del_ethertype_filter(dev,
- (struct rte_eth_ethertype_filter *)arg,
- FALSE);
- break;
- case RTE_ETH_FILTER_GET:
- ret = ixgbe_get_ethertype_filter(dev,
- (struct rte_eth_ethertype_filter *)arg);
- break;
- default:
- PMD_DRV_LOG(ERR, "unsupported operation %u.", filter_op);
- ret = -EINVAL;
- break;
- }
- return ret;
-}
-
static int
ixgbe_dev_filter_ctrl(struct rte_eth_dev *dev,
enum rte_filter_type filter_type,
case RTE_ETH_FILTER_NTUPLE:
ret = ixgbe_ntuple_filter_handle(dev, filter_op, arg);
break;
- case RTE_ETH_FILTER_ETHERTYPE:
- ret = ixgbe_ethertype_filter_handle(dev, filter_op, arg);
- break;
case RTE_ETH_FILTER_SYN:
ret = ixgbe_syn_filter_handle(dev, filter_op, arg);
break;
*(const void **)arg = &qede_flow_ops;
return 0;
- case RTE_ETH_FILTER_ETHERTYPE:
case RTE_ETH_FILTER_FLEXIBLE:
case RTE_ETH_FILTER_SYN:
case RTE_ETH_FILTER_HASH:
case RTE_ETH_FILTER_NONE:
sfc_err(sa, "Global filters configuration not supported");
break;
- case RTE_ETH_FILTER_ETHERTYPE:
- sfc_err(sa, "EtherType filters not supported");
- break;
case RTE_ETH_FILTER_FLEXIBLE:
sfc_err(sa, "Flexible filters not supported");
break;
RTE_ETH_FILTER_OP_MAX
};
-/**
- * Define all structures for Ethertype Filter type.
- */
-
-#define RTE_ETHTYPE_FLAGS_MAC 0x0001 /**< If set, compare mac */
-#define RTE_ETHTYPE_FLAGS_DROP 0x0002 /**< If set, drop packet when match */
-
-/**
- * A structure used to define the ethertype filter entry
- * to support RTE_ETH_FILTER_ETHERTYPE with RTE_ETH_FILTER_ADD,
- * RTE_ETH_FILTER_DELETE and RTE_ETH_FILTER_GET operations.
- */
-struct rte_eth_ethertype_filter {
- struct rte_ether_addr mac_addr; /**< Mac address to match. */
- uint16_t ether_type; /**< Ether type to match */
- uint16_t flags; /**< Flags from RTE_ETHTYPE_FLAGS_* */
- uint16_t queue; /**< Queue assigned to when match*/
-};
-
#define RTE_FLEX_FILTER_MAXLEN 128 /**< bytes to use in flex filter. */
#define RTE_FLEX_FILTER_MASK_SIZE \
(RTE_ALIGN(RTE_FLEX_FILTER_MAXLEN, CHAR_BIT) / CHAR_BIT)
rte_eth_hairpin_queue_peer_unbind(uint16_t cur_port, uint16_t cur_queue,
uint32_t direction);
+
+/*
+ * Legacy ethdev API used internally by drivers.
+ */
+
+/**
+ * Define all structures for Ethertype Filter type.
+ */
+
+#define RTE_ETHTYPE_FLAGS_MAC 0x0001 /**< If set, compare mac */
+#define RTE_ETHTYPE_FLAGS_DROP 0x0002 /**< If set, drop packet when match */
+
+/**
+ * A structure used to define the ethertype filter entry
+ * to support RTE_ETH_FILTER_ETHERTYPE data representation.
+ */
+struct rte_eth_ethertype_filter {
+ struct rte_ether_addr mac_addr; /**< Mac address to match. */
+ uint16_t ether_type; /**< Ether type to match */
+ uint16_t flags; /**< Flags from RTE_ETHTYPE_FLAGS_* */
+ uint16_t queue; /**< Queue assigned to when match*/
+};
+
#ifdef __cplusplus
}
#endif