Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says: ==================== igc: ethtool: Flex filter cleanup Kurt Kanzenbach says: This series contains some cosmetics for the flex filter code. The fixes have been merged separately via -net already. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: igc: Unify filtering rule fields igc: Use netdev printing functions for flex filters igc: Use reverse xmas tree ==================== Link: https://lore.kernel.org/r/20240207191656.1250777-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -3385,7 +3385,7 @@ static int igc_flex_filter_select(struct igc_adapter *adapter,
|
||||
u32 fhftsl;
|
||||
|
||||
if (input->index >= MAX_FLEX_FILTER) {
|
||||
dev_err(&adapter->pdev->dev, "Wrong Flex Filter index selected!\n");
|
||||
netdev_err(adapter->netdev, "Wrong Flex Filter index selected!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3420,7 +3420,6 @@ static int igc_flex_filter_select(struct igc_adapter *adapter,
|
||||
static int igc_write_flex_filter_ll(struct igc_adapter *adapter,
|
||||
struct igc_flex_filter *input)
|
||||
{
|
||||
struct device *dev = &adapter->pdev->dev;
|
||||
struct igc_hw *hw = &adapter->hw;
|
||||
u8 *data = input->data;
|
||||
u8 *mask = input->mask;
|
||||
@@ -3434,7 +3433,7 @@ static int igc_write_flex_filter_ll(struct igc_adapter *adapter,
|
||||
* out early to avoid surprises later.
|
||||
*/
|
||||
if (input->length % 8 != 0) {
|
||||
dev_err(dev, "The length of a flex filter has to be 8 byte aligned!\n");
|
||||
netdev_err(adapter->netdev, "The length of a flex filter has to be 8 byte aligned!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3504,8 +3503,8 @@ static int igc_write_flex_filter_ll(struct igc_adapter *adapter,
|
||||
}
|
||||
wr32(IGC_WUFC, wufc);
|
||||
|
||||
dev_dbg(&adapter->pdev->dev, "Added flex filter %u to HW.\n",
|
||||
input->index);
|
||||
netdev_dbg(adapter->netdev, "Added flex filter %u to HW.\n",
|
||||
input->index);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -3577,9 +3576,9 @@ static bool igc_flex_filter_in_use(struct igc_adapter *adapter)
|
||||
static int igc_add_flex_filter(struct igc_adapter *adapter,
|
||||
struct igc_nfc_rule *rule)
|
||||
{
|
||||
struct igc_flex_filter flex = { };
|
||||
struct igc_nfc_filter *filter = &rule->filter;
|
||||
unsigned int eth_offset, user_offset;
|
||||
struct igc_flex_filter flex = { };
|
||||
int ret, index;
|
||||
bool vlan;
|
||||
|
||||
@@ -3615,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)
|
||||
|
||||
Reference in New Issue
Block a user