Commit d0466c7f authored by Jakub Kicinski's avatar Jakub Kicinski

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.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents d45f5fa8 b7471025
...@@ -585,7 +585,7 @@ enum igc_filter_match_flags { ...@@ -585,7 +585,7 @@ enum igc_filter_match_flags {
struct igc_nfc_filter { struct igc_nfc_filter {
u8 match_flags; u8 match_flags;
u16 etype; u16 etype;
__be16 vlan_etype; u16 vlan_etype;
u16 vlan_tci; u16 vlan_tci;
u16 vlan_tci_mask; u16 vlan_tci_mask;
u8 src_addr[ETH_ALEN]; u8 src_addr[ETH_ALEN];
......
...@@ -981,7 +981,7 @@ static int igc_ethtool_get_nfc_rule(struct igc_adapter *adapter, ...@@ -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) { if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_ETYPE) {
fsp->flow_type |= FLOW_EXT; 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; 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, ...@@ -1249,7 +1249,7 @@ static void igc_ethtool_init_nfc_rule(struct igc_nfc_rule *rule,
/* VLAN etype matching */ /* VLAN etype matching */
if ((fsp->flow_type & FLOW_EXT) && fsp->h_ext.vlan_etype) { 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; rule->filter.match_flags |= IGC_FILTER_FLAG_VLAN_ETYPE;
} }
......
...@@ -3385,7 +3385,7 @@ static int igc_flex_filter_select(struct igc_adapter *adapter, ...@@ -3385,7 +3385,7 @@ static int igc_flex_filter_select(struct igc_adapter *adapter,
u32 fhftsl; u32 fhftsl;
if (input->index >= MAX_FLEX_FILTER) { 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; return -EINVAL;
} }
...@@ -3420,7 +3420,6 @@ static int igc_flex_filter_select(struct igc_adapter *adapter, ...@@ -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, static int igc_write_flex_filter_ll(struct igc_adapter *adapter,
struct igc_flex_filter *input) struct igc_flex_filter *input)
{ {
struct device *dev = &adapter->pdev->dev;
struct igc_hw *hw = &adapter->hw; struct igc_hw *hw = &adapter->hw;
u8 *data = input->data; u8 *data = input->data;
u8 *mask = input->mask; u8 *mask = input->mask;
...@@ -3434,7 +3433,7 @@ static int igc_write_flex_filter_ll(struct igc_adapter *adapter, ...@@ -3434,7 +3433,7 @@ static int igc_write_flex_filter_ll(struct igc_adapter *adapter,
* out early to avoid surprises later. * out early to avoid surprises later.
*/ */
if (input->length % 8 != 0) { 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; return -EINVAL;
} }
...@@ -3504,7 +3503,7 @@ static int igc_write_flex_filter_ll(struct igc_adapter *adapter, ...@@ -3504,7 +3503,7 @@ static int igc_write_flex_filter_ll(struct igc_adapter *adapter,
} }
wr32(IGC_WUFC, wufc); wr32(IGC_WUFC, wufc);
dev_dbg(&adapter->pdev->dev, "Added flex filter %u to HW.\n", netdev_dbg(adapter->netdev, "Added flex filter %u to HW.\n",
input->index); input->index);
return 0; return 0;
...@@ -3577,9 +3576,9 @@ static bool igc_flex_filter_in_use(struct igc_adapter *adapter) ...@@ -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, static int igc_add_flex_filter(struct igc_adapter *adapter,
struct igc_nfc_rule *rule) struct igc_nfc_rule *rule)
{ {
struct igc_flex_filter flex = { };
struct igc_nfc_filter *filter = &rule->filter; struct igc_nfc_filter *filter = &rule->filter;
unsigned int eth_offset, user_offset; unsigned int eth_offset, user_offset;
struct igc_flex_filter flex = { };
int ret, index; int ret, index;
bool vlan; bool vlan;
...@@ -3615,10 +3614,12 @@ static int igc_add_flex_filter(struct igc_adapter *adapter, ...@@ -3615,10 +3614,12 @@ static int igc_add_flex_filter(struct igc_adapter *adapter,
ETH_ALEN, NULL); ETH_ALEN, NULL);
/* Add VLAN etype */ /* Add VLAN etype */
if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_ETYPE) if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_ETYPE) {
igc_flex_filter_add_field(&flex, &filter->vlan_etype, 12, __be16 vlan_etype = cpu_to_be16(filter->vlan_etype);
sizeof(filter->vlan_etype),
NULL); igc_flex_filter_add_field(&flex, &vlan_etype, 12,
sizeof(vlan_etype), NULL);
}
/* Add VLAN TCI */ /* Add VLAN TCI */
if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI) if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment