Skip to content

Commit cac2a27

Browse files
Henry TiemanJeff Kirsher
authored andcommitted
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]>
1 parent 4ab9564 commit cac2a27

File tree

12 files changed

+1493
-0
lines changed

12 files changed

+1493
-0
lines changed

drivers/net/ethernet/intel/ice/ice.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ extern const char ice_drv_ver[];
9696
#define ICE_TX_DESC(R, i) (&(((struct ice_tx_desc *)((R)->desc))[i]))
9797
#define ICE_RX_DESC(R, i) (&(((union ice_32b_rx_flex_desc *)((R)->desc))[i]))
9898
#define ICE_TX_CTX_DESC(R, i) (&(((struct ice_tx_ctx_desc *)((R)->desc))[i]))
99+
#define ICE_TX_FDIRDESC(R, i) (&(((struct ice_fltr_desc *)((R)->desc))[i]))
99100

100101
/* Macro for each VSI in a PF */
101102
#define ice_for_each_vsi(pf, i) \
@@ -216,6 +217,7 @@ enum ice_state {
216217
__ICE_CFG_BUSY,
217218
__ICE_SERVICE_SCHED,
218219
__ICE_SERVICE_DIS,
220+
__ICE_FD_FLUSH_REQ,
219221
__ICE_OICR_INTR_DIS, /* Global OICR interrupt disabled */
220222
__ICE_MDD_VF_PRINT_PENDING, /* set when MDD event handle */
221223
__ICE_VF_RESETS_DISABLED, /* disable resets during ice_remove */
@@ -557,6 +559,8 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup);
557559
const char *ice_stat_str(enum ice_status stat_err);
558560
const char *ice_aq_str(enum ice_aq_err aq_err);
559561
void ice_vsi_manage_fdir(struct ice_vsi *vsi, bool ena);
562+
int ice_add_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd);
563+
int ice_del_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd);
560564
int ice_get_ethtool_fdir_entry(struct ice_hw *hw, struct ethtool_rxnfc *cmd);
561565
int
562566
ice_get_fdir_fltr_ids(struct ice_hw *hw, struct ethtool_rxnfc *cmd,

drivers/net/ethernet/intel/ice/ice_ethtool.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,6 +2537,10 @@ static int ice_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)
25372537
struct ice_vsi *vsi = np->vsi;
25382538

25392539
switch (cmd->cmd) {
2540+
case ETHTOOL_SRXCLSRLINS:
2541+
return ice_add_fdir_ethtool(vsi, cmd);
2542+
case ETHTOOL_SRXCLSRLDEL:
2543+
return ice_del_fdir_ethtool(vsi, cmd);
25402544
case ETHTOOL_SRXFH:
25412545
return ice_set_rss_hash_opt(vsi, cmd);
25422546
default:

0 commit comments

Comments
 (0)