diff options
| author | Henry Tieman <[email protected]> | 2020-05-12 01:01:42 +0000 |
|---|---|---|
| committer | Jeff Kirsher <[email protected]> | 2020-05-23 04:36:27 +0000 |
| commit | cac2a27cd9ab1638e21df11ec583d2bc919a3ae3 (patch) | |
| tree | b00d9f857c87276edf008f8ddf9a4fcd860ded4b /drivers/net/ethernet/intel/ice/ice_flex_pipe.c | |
| parent | ice: Support displaying ntuple rules (diff) | |
| download | kernel-cac2a27cd9ab1638e21df11ec583d2bc919a3ae3.tar.gz kernel-cac2a27cd9ab1638e21df11ec583d2bc919a3ae3.zip | |
ice: Support IPv4 Flow Director filters
Support the addition and deletion of IPv4 filters.
Supported fields are: src-ip, dst-ip, src-port, and dst-port
Supported flow-types are: tcp4, udp4, sctp4, ip4
Example usage:
ethtool -N eth0 flow-type tcp4 src-ip 192.168.0.55 dst-ip 172.16.0.55 \
src-port 16 dst-port 12 action 32
Signed-off-by: Henry Tieman <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_flex_pipe.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c index fe2f04f706e7..16d2f599bd70 100644 --- a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c +++ b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c @@ -1633,6 +1633,34 @@ ice_find_free_tunnel_entry(struct ice_hw *hw, enum ice_tunnel_type type, } /** + * ice_get_open_tunnel_port - retrieve an open tunnel port + * @hw: pointer to the HW structure + * @type: tunnel type (TNL_ALL will return any open port) + * @port: returns open port + */ +bool +ice_get_open_tunnel_port(struct ice_hw *hw, enum ice_tunnel_type type, + u16 *port) +{ + bool res = false; + u16 i; + + mutex_lock(&hw->tnl_lock); + + for (i = 0; i < hw->tnl.count && i < ICE_TUNNEL_MAX_ENTRIES; i++) + if (hw->tnl.tbl[i].valid && hw->tnl.tbl[i].in_use && + (type == TNL_ALL || hw->tnl.tbl[i].type == type)) { + *port = hw->tnl.tbl[i].port; + res = true; + break; + } + + mutex_unlock(&hw->tnl_lock); + + return res; +} + +/** * ice_create_tunnel * @hw: pointer to the HW structure * @type: type of tunnel @@ -2332,6 +2360,12 @@ ice_find_prof_id(struct ice_hw *hw, enum ice_block blk, u16 off; u8 i; + /* For FD, we don't want to re-use a existed profile with the same + * field vector and mask. This will cause rule interference. + */ + if (blk == ICE_BLK_FD) + return ICE_ERR_DOES_NOT_EXIST; + for (i = 0; i < (u8)es->count; i++) { off = i * es->fvw; |
