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

Message ID 20200708124307.99093-1-zhirun.yan@intel.com
State Accepted, archived
Delegated to: Qi Zhang
Headers show
Series
  • net/ice/base: add SRC MAC field support for FD
Related show

Checks

Context Check Description
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Zhirun Yan July 8, 2020, 12:43 p.m. UTC
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.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
---
 drivers/net/ice/base/ice_fdir.c | 1 +
 drivers/net/ice/base/ice_fdir.h | 1 +
 2 files changed, 2 insertions(+)

Comments

Ferruh Yigit July 8, 2020, 5:40 p.m. UTC | #1
On 7/8/2020 1:43 PM, Zhirun Yan wrote:
> 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.
> 
> Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>

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.

Patch
diff mbox series

diff --git a/drivers/net/ice/base/ice_fdir.c b/drivers/net/ice/base/ice_fdir.c
index b1dc2afb7..2c47fb57b 100644
--- a/drivers/net/ice/base/ice_fdir.c
+++ b/drivers/net/ice/base/ice_fdir.c
@@ -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,
diff --git a/drivers/net/ice/base/ice_fdir.h b/drivers/net/ice/base/ice_fdir.h
index ad3e11a5b..7e00bb273 100644
--- a/drivers/net/ice/base/ice_fdir.h
+++ b/drivers/net/ice/base/ice_fdir.h
@@ -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 */