[v2,14/33] net/ice/base: fix ethertype filter input set

Message ID 20220413160932.2074781-15-kevinx.liu@intel.com (mailing list archive)
State Superseded, archived
Headers
Series support full function of DCF |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Kevin Liu April 13, 2022, 4:09 p.m. UTC
  From: Alvin Zhang <alvinx.zhang@intel.com>

Add destination and source MAC as the input sets to ethertype filter.

For example:
   flow create 0 ingress pattern eth dst is 00:11:22:33:44:55
   type is 0x802 / end actions queue index 2 / end

This flow will result in all the matched ingress packets be
forwarded to queue 2.

Fixes: 1f70fb3e958a ("net/ice/base: support flow director for non-IP packets")

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
---
 drivers/net/ice/base/ice_fdir.c | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/drivers/net/ice/base/ice_fdir.c b/drivers/net/ice/base/ice_fdir.c
index ae76361102..0a1d45a9d7 100644
--- a/drivers/net/ice/base/ice_fdir.c
+++ b/drivers/net/ice/base/ice_fdir.c
@@ -3935,6 +3935,9 @@  ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
 				   input->ip.v6.dst_port);
 		break;
 	case ICE_FLTR_PTYPE_NON_IP_L2:
+		ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac);
+		ice_pkt_insert_mac_addr(loc + ETH_ALEN,
+					input->ext_data.src_mac);
 		ice_pkt_insert_u16(loc, ICE_MAC_ETHTYPE_OFFSET,
 				   input->ext_data.ether_type);
 		break;