aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e.h1
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_ethtool.c23
2 files changed, 16 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 2af28fd37bff..fc1bd1094397 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -159,6 +159,7 @@ struct i40e_fdir_filter {
159 /* filter ipnut set */ 159 /* filter ipnut set */
160 u8 flow_type; 160 u8 flow_type;
161 u8 ip4_proto; 161 u8 ip4_proto;
162 /* TX packet view of src and dst */
162 __be32 dst_ip[4]; 163 __be32 dst_ip[4];
163 __be32 src_ip[4]; 164 __be32 src_ip[4];
164 __be16 src_port; 165 __be16 src_port;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index b16c25111552..c7718631ed02 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -1249,10 +1249,13 @@ static int i40e_get_ethtool_fdir_entry(struct i40e_pf *pf,
1249 fsp->m_u.usr_ip4_spec.proto = 0; 1249 fsp->m_u.usr_ip4_spec.proto = 0;
1250 } 1250 }
1251 1251
1252 fsp->h_u.tcp_ip4_spec.psrc = rule->src_port; 1252 /* Reverse the src and dest notion, since the HW views them from
1253 fsp->h_u.tcp_ip4_spec.pdst = rule->dst_port; 1253 * Tx perspective where as the user expects it from Rx filter view.
1254 fsp->h_u.tcp_ip4_spec.ip4src = rule->src_ip[0]; 1254 */
1255 fsp->h_u.tcp_ip4_spec.ip4dst = rule->dst_ip[0]; 1255 fsp->h_u.tcp_ip4_spec.psrc = rule->dst_port;
1256 fsp->h_u.tcp_ip4_spec.pdst = rule->src_port;
1257 fsp->h_u.tcp_ip4_spec.ip4src = rule->dst_ip[0];
1258 fsp->h_u.tcp_ip4_spec.ip4dst = rule->src_ip[0];
1256 fsp->ring_cookie = rule->q_index; 1259 fsp->ring_cookie = rule->q_index;
1257 1260
1258 return 0; 1261 return 0;
@@ -1581,10 +1584,14 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,
1581 input->cnt_index = 0; 1584 input->cnt_index = 0;
1582 input->flow_type = fsp->flow_type; 1585 input->flow_type = fsp->flow_type;
1583 input->ip4_proto = fsp->h_u.usr_ip4_spec.proto; 1586 input->ip4_proto = fsp->h_u.usr_ip4_spec.proto;
1584 input->src_port = fsp->h_u.tcp_ip4_spec.psrc; 1587
1585 input->dst_port = fsp->h_u.tcp_ip4_spec.pdst; 1588 /* Reverse the src and dest notion, since the HW expects them to be from
1586 input->src_ip[0] = fsp->h_u.tcp_ip4_spec.ip4src; 1589 * Tx perspective where as the input from user is from Rx filter view.
1587 input->dst_ip[0] = fsp->h_u.tcp_ip4_spec.ip4dst; 1590 */
1591 input->dst_port = fsp->h_u.tcp_ip4_spec.psrc;
1592 input->src_port = fsp->h_u.tcp_ip4_spec.pdst;
1593 input->dst_ip[0] = fsp->h_u.tcp_ip4_spec.ip4src;
1594 input->src_ip[0] = fsp->h_u.tcp_ip4_spec.ip4dst;
1588 1595
1589 ret = i40e_add_del_fdir(vsi, input, true); 1596 ret = i40e_add_del_fdir(vsi, input, true);
1590 if (ret) 1597 if (ret)