X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Ftap%2Ftap_flow.h;h=9e332b0314a22dd179d4ec331e0721893d98bef3;hb=056eaf2e6d55;hp=377a9f7b758a0d2f5f56b2e6f0331a0026b354e4;hpb=268483dc208686373698423e764b77bf53e181a1;p=dpdk.git diff --git a/drivers/net/tap/tap_flow.h b/drivers/net/tap/tap_flow.h index 377a9f7b75..9e332b0314 100644 --- a/drivers/net/tap/tap_flow.h +++ b/drivers/net/tap/tap_flow.h @@ -36,6 +36,36 @@ #include #include +#include + +/** + * In TC, priority 0 means we require the kernel to allocate one for us. + * In rte_flow, however, we want the priority 0 to be the most important one. + * Use an offset to have the most important priority being 1 in TC. + */ +#define PRIORITY_OFFSET 1 +#define PRIORITY_MASK (0xfff) +#define MAX_PRIORITY (PRIORITY_MASK - PRIORITY_OFFSET) +#define GROUP_MASK (0xf) +#define GROUP_SHIFT 12 +#define MAX_GROUP GROUP_MASK + +/** + * These index are actually in reversed order: their priority is processed + * by subtracting their value to the lowest priority (PRIORITY_MASK). + * Thus the first one will have the lowest priority in the end + * (but biggest value). + */ +enum implicit_rule_index { + TAP_REMOTE_TX, + TAP_ISOLATE, + TAP_REMOTE_BROADCASTV6, + TAP_REMOTE_BROADCAST, + TAP_REMOTE_ALLMULTI, + TAP_REMOTE_PROMISC, + TAP_REMOTE_LOCAL_MAC, + TAP_REMOTE_MAX_IDX, +}; int tap_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type, @@ -43,4 +73,11 @@ int tap_dev_filter_ctrl(struct rte_eth_dev *dev, void *arg); int tap_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error); +int tap_flow_implicit_create(struct pmd_internals *pmd, + enum implicit_rule_index idx); +int tap_flow_implicit_destroy(struct pmd_internals *pmd, + enum implicit_rule_index idx); +int tap_flow_implicit_flush(struct pmd_internals *pmd, + struct rte_flow_error *error); + #endif /* _TAP_FLOW_H_ */