Skip to contentSkip to conversation

net/ice/base: add SRC MAC field support for FD

PATCH In review Zhirun Yan 2 participants 2 messages Jul 8, 2020 Network drivers

lore
Share & tools
lore

Zhirun Yan

author
#0 lore raw

PATCH 1/1 net/ice/base: add SRC MAC field support for FD

Add src MAC address field support, so that SRC MAC field in L2 can be matched when set Flow Director filter with SRC MAC address.

---
 drivers/net/ice/base/ice_fdir.c | 1 +
 drivers/net/ice/base/ice_fdir.h | 1 +
 2 files changed, 2 insertions(+)
drivers/net/ice/base/ice_fdir.c +1 -0
index b1dc2afb7..2c47fb57b 100644
@@ -1023,6 +1023,7 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
 		ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos);
 		ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl);
 		ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac);
+		ice_pkt_insert_mac_addr(loc + ETH_ALEN, input->ext_data.src_mac);
 		break;
 	case ICE_FLTR_PTYPE_NONF_IPV4_SCTP:
 		ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET,
drivers/net/ice/base/ice_fdir.h +1 -0
index ad3e11a5b..7e00bb273 100644
@@ -165,6 +165,7 @@ struct ice_fdir_l2tpv3 {
 
 struct ice_fdir_extra {
 	u8 dst_mac[ETH_ALEN];	/* dest MAC address */
+	u8 src_mac[ETH_ALEN];	/* src MAC address */
 	__be16 ether_type;      /* for NON_IP_L2 */
 	u32 usr_def[2];		/* user data */
 	__be16 vlan_type;	/* VLAN ethertype */
Signature · 1 line
2.17.1
#1 lore raw
Quoted 4 lines · Zhirun Yan

Add src MAC address field support, so that SRC MAC field in L2 can be matched when set Flow Director filter with SRC MAC address.

Squashed into relevant commit [1] in next-net, thanks.

[1]
net/ice: add support for src MAC filter on FDIR

They both implement same feature, base code and driver changes are related and can be merged into single patch.