Skip to content

Commit

Permalink
net/ixgbe: parse flow director filter
Browse files Browse the repository at this point in the history
check if the rule is a flow director rule, and get the flow director info.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wei Dai <wei.dai@intel.com>
  • Loading branch information
zhaowei413 authored and Ferruh Yigit committed Jan 17, 2017
1 parent 99e7003 commit 1177743
Show file tree
Hide file tree
Showing 4 changed files with 1,414 additions and 109 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ixgbe/ixgbe_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,8 @@ static int ixgbe_fdir_filter_init(struct rte_eth_dev *eth_dev)
"Failed to allocate memory for fdir hash map!");
return -ENOMEM;
}
fdir_info->mask_added = FALSE;

return 0;
}

Expand Down
16 changes: 16 additions & 0 deletions drivers/net/ixgbe/ixgbe_ethdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,17 @@ struct ixgbe_fdir_filter {
/* list of fdir filters */
TAILQ_HEAD(ixgbe_fdir_filter_list, ixgbe_fdir_filter);

struct ixgbe_fdir_rule {
struct ixgbe_hw_fdir_mask mask;
union ixgbe_atr_input ixgbe_fdir; /* key of fdir filter*/
bool b_spec; /* If TRUE, ixgbe_fdir, fdirflags, queue have meaning. */
bool b_mask; /* If TRUE, mask has meaning. */
enum rte_fdir_mode mode; /* IP, MAC VLAN, Tunnel */
uint32_t fdirflags; /* drop or forward */
uint32_t soft_id; /* an unique value for this rule */
uint8_t queue; /* assigned rx queue */
};

struct ixgbe_hw_fdir_info {
struct ixgbe_hw_fdir_mask mask;
uint8_t flex_bytes_offset;
Expand All @@ -182,6 +193,7 @@ struct ixgbe_hw_fdir_info {
/* store the pointers of the filters, index is the hash value. */
struct ixgbe_fdir_filter **hash_map;
struct rte_hash *hash_handle; /* cuckoo hash handler */
bool mask_added; /* If already got mask from consistent filter */
};

/* structure for interrupt relative data */
Expand Down Expand Up @@ -520,6 +532,10 @@ bool ixgbe_rss_update_sp(enum ixgbe_mac_type mac_type);
* Flow director function prototypes
*/
int ixgbe_fdir_configure(struct rte_eth_dev *dev);
int ixgbe_fdir_set_input_mask(struct rte_eth_dev *dev);
int ixgbe_fdir_filter_program(struct rte_eth_dev *dev,
struct ixgbe_fdir_rule *rule,
bool del, bool update);

void ixgbe_configure_dcb(struct rte_eth_dev *dev);

Expand Down
Loading

0 comments on commit 1177743

Please sign in to comment.