Commit b7471025 authored by Kurt Kanzenbach's avatar Kurt Kanzenbach Committed by Tony Nguyen
Browse files

igc: Unify filtering rule fields



All filtering parameters such as EtherType and VLAN TCI are stored in host
byte order except for the VLAN EtherType. Unify it.

Signed-off-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Tested-by: default avatarNaama Meir <naamax.meir@linux.intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 5edcf51d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -585,7 +585,7 @@ enum igc_filter_match_flags {
struct igc_nfc_filter {
	u8 match_flags;
	u16 etype;
	__be16 vlan_etype;
	u16 vlan_etype;
	u16 vlan_tci;
	u16 vlan_tci_mask;
	u8 src_addr[ETH_ALEN];
+2 −2
Original line number Diff line number Diff line
@@ -981,7 +981,7 @@ static int igc_ethtool_get_nfc_rule(struct igc_adapter *adapter,

	if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_ETYPE) {
		fsp->flow_type |= FLOW_EXT;
		fsp->h_ext.vlan_etype = rule->filter.vlan_etype;
		fsp->h_ext.vlan_etype = htons(rule->filter.vlan_etype);
		fsp->m_ext.vlan_etype = ETHER_TYPE_FULL_MASK;
	}

@@ -1249,7 +1249,7 @@ static void igc_ethtool_init_nfc_rule(struct igc_nfc_rule *rule,

	/* VLAN etype matching */
	if ((fsp->flow_type & FLOW_EXT) && fsp->h_ext.vlan_etype) {
		rule->filter.vlan_etype = fsp->h_ext.vlan_etype;
		rule->filter.vlan_etype = ntohs(fsp->h_ext.vlan_etype);
		rule->filter.match_flags |= IGC_FILTER_FLAG_VLAN_ETYPE;
	}

+6 −4
Original line number Diff line number Diff line
@@ -3614,10 +3614,12 @@ static int igc_add_flex_filter(struct igc_adapter *adapter,
					  ETH_ALEN, NULL);

	/* Add VLAN etype */
	if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_ETYPE)
		igc_flex_filter_add_field(&flex, &filter->vlan_etype, 12,
					  sizeof(filter->vlan_etype),
					  NULL);
	if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_ETYPE) {
		__be16 vlan_etype = cpu_to_be16(filter->vlan_etype);

		igc_flex_filter_add_field(&flex, &vlan_etype, 12,
					  sizeof(vlan_etype), NULL);
	}

	/* Add VLAN TCI */
	if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI)