igb: offloading of receive filters
Subsystems (3)
v7 cover igb: offloading of receive filters
Hi,
Known issue:
- It seems that the the QSEL bits in the RAH registers do not have any effect for source address (i.e. steering doesn't work for source address filters), everything is pointing to a hardware (or documentation) issue;
Changes from v6:
- Because the i210 doesn't support steering traffic per source address (only filtering works), an error is emitted when only an source address is specified in a classification rule;
Changes from v5:
- Filters can now be added for local MAC addresses, when removed, they return to their initial configuration (thanks for the testing Aaron);
Changes from v4:
- Added a new bit to the MAC address filters internal representation to mean that some filters are steering filters (i.e. they direct traffic to queues);
- And, this is only supported in i210;
Changes from v3:
- Addressed review comments from Aaron F. Brown and Jakub Kicinski;
Changes from v2:
- Addressed review comments from Jakub Kicinski, mostly about coding style adjustments and more consistent error reporting;
Changes from v1:
- Addressed review comments from Alexander Duyck and Florian Fainelli;
- Adding and removing cls_flower filters are now proposed in the same patch;
- cls_flower filters are kept in a separated list from "ethtool" filters (so that section of the original cover letter is no longer valid);
- The patch adding support for ethtool filters is now independent from the rest of the series;
Original cover letter:
This series enables some ethtool and tc-flower filters to be offloaded to igb-based network controllers. This is useful when the system configurator want to steer kinds of traffic to a specific hardware queue.
The first two commits are bug fixes.
The basis of this series is to export the internal API used to configure address filters, so they can be used by ethtool, and extending the functionality so an source address can be handled.
Then, we enable the tc-flower offloading implementation to re-use the same infrastructure as ethtool, and storing them in the per-adapter "nfc" (Network Filter Config?) list. But for consistency, for destructive access they are separated, i.e. an filter added by tc-flower can only be removed by tc-flower, but ethtool can read them all.
Only support for VLAN Prio, Source and Destination MAC Address, and Ethertype is enabled for now.
Open question:
- igb is initialized with the number of traffic classes as 1, if we want to use multiple traffic classes we need to increase this value, the only way I could find is to use mqprio (for example). Should igb be initialized with, say, the number of queues as its "num_tc"?
--
Vinicius Costa Gomes (10):
igb: Fix not adding filter elements to the list
igb: Fix queue selection on MAC filters on i210
igb: Enable the hardware traffic class feature bit for igb models
igb: Add support for MAC address filters specifying source addresses
igb: Add support for enabling queue steering in filters
igb: Allow filters to be added for the local MAC address
igb: Enable nfc filters to specify MAC addresses
igb: Add MAC address support for ethtool nftuple filters
igb: Add the skeletons for tc-flower offloading
igb: Add support for adding offloaded clsflower filters
.../net/ethernet/intel/igb/e1000_defines.h | 2 + drivers/net/ethernet/intel/igb/igb.h | 13 + drivers/net/ethernet/intel/igb/igb_ethtool.c | 73 +++- drivers/net/ethernet/intel/igb/igb_main.c | 370 +++++++++++++++++- 4 files changed, 441 insertions(+), 17 deletions(-)
--
2.17.0
PATCH v7 1/10 igb: Fix not adding filter elements to the list
Because the order of the parameters passes to 'hlist_add_behind()' was inverted, the 'parent' node was added "behind" the 'input', as input is not in the list, this causes the 'input' node to be lost.
--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igb/igb_ethtool.c +1 -1
@@ -2865,7 +2865,7 @@ static int igb_update_ethtool_nfc_entry(struct igb_adapter *adapter,/* add filter to the list */ if (parent) -hlist_add_behind (&parent->nfc_node, &input->nfc_node); +hlist_add_behind (&input->nfc_node, &parent->nfc_node);else hlist_add_head (&input->nfc_node, &adapter->nfc_filter_list);
Signature · 1 line
2.17.0
PATCH v7 2/10 igb: Fix queue selection on MAC filters on i210
In reply to Vinicius Costa GomesOn the RAH registers there are semantic differences on the meaning of the "queue" parameter for traffic steering depending on the controller
model: there is the 82575 meaning, which "queue" means a RX Hardware Queue, and the i350 meaning, where it is a reception pool.
The previous behaviour was having no effect for i210 based controllers because the QSEL bit of the RAH register wasn't being set.
This patch separates the condition in discrete cases, so the different handling is clearer.
--- drivers/net/ethernet/intel/igb/igb_main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/igb/igb_main.c +9 -4
@@ -8748,12 +8748,17 @@ static void igb_rar_set_index(struct igb_adapter *adapter, u32 index)if (is_valid_ether_addr (addr)) rar_high |=E1000_RAH_AV ; -if (hw->mac.type == e1000_82575) +switch (hw->mac.type) { +case e1000_82575: +case e1000_i210: rar_high |=E1000_RAH_POOL_1 * - adapter->mac_table[index].queue; -else + adapter->mac_table[index].queue; +break ; +default : rar_high |=E1000_RAH_POOL_1 << - adapter->mac_table[index].queue; + adapter->mac_table[index].queue; +break ; + } }wr32 (E1000_RAL (index), rar_low);
Signature · 1 line
2.17.0
PATCH v7 3/10 igb: Enable the hardware traffic class feature bit for igb models
In reply to Vinicius Costa GomesThis will allow functionality depending on the hardware being traffic class aware to work. In particular the tc-flower offloading checks verifies that this bit is set.
--- drivers/net/ethernet/intel/igb/igb_main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/intel/igb/igb_main.c +3 -0
@@ -2807,6 +2807,9 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (hw->mac.type >= e1000_82576) netdev->features |=NETIF_F_SCTP_CRC ; +if (hw->mac.type >= e1000_i350) + netdev->features |=NETIF_F_HW_TC ; +#define IGB_GSO_PARTIAL_FEATURES (NETIF_F_GSO_GRE | \ NETIF_F_GSO_GRE_CSUM | \ NETIF_F_GSO_IPXIP4 | \
Signature · 1 line
2.17.0
PATCH v7 4/10 igb: Add support for MAC address filters specifying source addresses
In reply to Vinicius Costa GomesMakes it possible to direct packets to queues based on their source address. Documents the expected usage of the 'flags' parameter.
--- .../net/ethernet/intel/igb/e1000_defines.h | 1 + drivers/net/ethernet/intel/igb/igb.h | 1 + drivers/net/ethernet/intel/igb/igb_main.c | 40 ++++++++++++++++--- 3 files changed, 37 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/igb/e1000_defines.h +1 -0
@@ -491,6 +491,7 @@* manageability enabled, allowing us room for 15 multicast addresses. */ #define E1000_RAH_AV 0x80000000/* Receive descriptor valid */ +#define E1000_RAH_ASEL_SRC_ADDR 0x00010000#define E1000_RAL_MAC_ADDR_LEN 4#define E1000_RAH_MAC_ADDR_LEN 2#define E1000_RAH_POOL_MASK 0x03FC0000
drivers/net/ethernet/intel/igb/igb.h +1 -0
@@ -474,6 +474,7 @@ struct igb_mac_addr {#define IGB_MAC_STATE_DEFAULT 0x1#define IGB_MAC_STATE_IN_USE 0x2 +#define IGB_MAC_STATE_SRC_ADDR 0x4/* board specific private data structure */ struct igb_adapter {
drivers/net/ethernet/intel/igb/igb_main.c +35 -5
@@ -6844,8 +6844,14 @@ static void igb_set_default_mac_filter(struct igb_adapter *adapter)igb_rar_set_index (adapter,0 ); } -static int igb_add_mac_filter (struct igb_adapter *adapter,const u8 *addr, -const u8 queue) +/* Add a MAC filter for 'addr' directing matching traffic to 'queue', +* 'flags' is used to indicate what kind of match is made, match is by +* default for the destination address, if matching by source address +* is desired the flag IGB_MAC_STATE_SRC_ADDR can be used. +*/ +static int igb_add_mac_filter_flags (struct igb_adapter *adapter, +const u8 *addr,const u8 queue, +const u8 flags) {struct e1000_hw *hw = &adapter->hw; int rar_entries = hw->mac.rar_entry_count -
@@ -6865,7 +6871,7 @@ static int igb_add_mac_filter(struct igb_adapter *adapter, const u8 *addr,ether_addr_copy (adapter->mac_table[i].addr, addr); adapter->mac_table[i].queue = queue; - adapter->mac_table[i].state |=IGB_MAC_STATE_IN_USE ; + adapter->mac_table[i].state |=IGB_MAC_STATE_IN_USE | flags;igb_rar_set_index (adapter, i);return i;
@@ -6874,8 +6880,21 @@ static int igb_add_mac_filter(struct igb_adapter *adapter, const u8 *addr,return -ENOSPC ; } -static int igb_del_mac_filter (struct igb_adapter *adapter,const u8 *addr, +static int igb_add_mac_filter (struct igb_adapter *adapter,const u8 *addr,const u8 queue) +{ +return igb_add_mac_filter_flags (adapter, addr, queue,0 ); +} + +/* Remove a MAC filter for 'addr' directing matching traffic to +* 'queue', 'flags' is used to indicate what kind of match need to be +* removed, match is by default for the destination address, if +* matching by source address is to be removed the flag +* IGB_MAC_STATE_SRC_ADDR can be used. +*/ +static int igb_del_mac_filter_flags (struct igb_adapter *adapter, +const u8 *addr,const u8 queue, +const u8 flags) {struct e1000_hw *hw = &adapter->hw; int rar_entries = hw->mac.rar_entry_count -
@@ -6892,12 +6911,14 @@ static int igb_del_mac_filter(struct igb_adapter *adapter, const u8 *addr,for (i =0 ; i < rar_entries; i++) {if (!(adapter->mac_table[i].state &IGB_MAC_STATE_IN_USE ))continue ; +if ((adapter->mac_table[i].state & flags) != flags) +continue ;if (adapter->mac_table[i].queue != queue)continue ;if (!ether_addr_equal (adapter->mac_table[i].addr, addr))continue ; - adapter->mac_table[i].state &= ~IGB_MAC_STATE_IN_USE ; + adapter->mac_table[i].state =0 ;memset (adapter->mac_table[i].addr,0 ,ETH_ALEN ); adapter->mac_table[i].queue =0 ;
@@ -6908,6 +6929,12 @@ static int igb_del_mac_filter(struct igb_adapter *adapter, const u8 *addr,return -ENOENT ; } +static int igb_del_mac_filter (struct igb_adapter *adapter,const u8 *addr, +const u8 queue) +{ +return igb_del_mac_filter_flags (adapter, addr, queue,0 ); +} +static int igb_uc_sync (struct net_device *netdev,const unsigned char *addr) {struct igb_adapter *adapter =netdev_priv (netdev);
@@ -8751,6 +8778,9 @@ static void igb_rar_set_index(struct igb_adapter *adapter, u32 index)if (is_valid_ether_addr (addr)) rar_high |=E1000_RAH_AV ; +if (adapter->mac_table[index].state &IGB_MAC_STATE_SRC_ADDR ) + rar_high |=E1000_RAH_ASEL_SRC_ADDR ; +switch (hw->mac.type) {case e1000_82575:case e1000_i210:
Signature · 1 line
2.17.0
PATCH v7 5/10 igb: Add support for enabling queue steering in filters
In reply to Vinicius Costa GomesOn some igb models (82575 and i210) the MAC address filters can control to which queue the packet will be assigned.
This extends the 'state' with one more state to signify that queue selection should be enabled for that filter.
As 82575 parts are no longer easily obtained (and this was developed against i210), only support for the i210 model is enabled.
These functions are exported and will be used in the next patch.
--- .../net/ethernet/intel/igb/e1000_defines.h | 1 + drivers/net/ethernet/intel/igb/igb.h | 6 +++++ drivers/net/ethernet/intel/igb/igb_main.c | 26 +++++++++++++++++++ 3 files changed, 33 insertions(+)
drivers/net/ethernet/intel/igb/e1000_defines.h +1 -0
@@ -492,6 +492,7 @@*/ #define E1000_RAH_AV 0x80000000/* Receive descriptor valid */ #define E1000_RAH_ASEL_SRC_ADDR 0x00010000 +#define E1000_RAH_QSEL_ENABLE 0x10000000#define E1000_RAL_MAC_ADDR_LEN 4#define E1000_RAH_MAC_ADDR_LEN 2#define E1000_RAH_POOL_MASK 0x03FC0000
drivers/net/ethernet/intel/igb/igb.h +6 -0
@@ -475,6 +475,7 @@ struct igb_mac_addr {#define IGB_MAC_STATE_DEFAULT 0x1#define IGB_MAC_STATE_IN_USE 0x2#define IGB_MAC_STATE_SRC_ADDR 0x4 +#define IGB_MAC_STATE_QUEUE_STEERING 0x8/* board specific private data structure */ struct igb_adapter {
@@ -740,4 +741,9 @@ int igb_add_filter(struct igb_adapter *adapter,int igb_erase_filter (struct igb_adapter *adapter,struct igb_nfc_filter *input); +int igb_add_mac_steering_filter (struct igb_adapter *adapter, +const u8 *addr,u8 queue,u8 flags); +int igb_del_mac_steering_filter (struct igb_adapter *adapter, +const u8 *addr,u8 queue,u8 flags); +#endif /* _IGB_H_ */
drivers/net/ethernet/intel/igb/igb_main.c +26 -0
@@ -6935,6 +6935,28 @@ static int igb_del_mac_filter(struct igb_adapter *adapter, const u8 *addr,return igb_del_mac_filter_flags (adapter, addr, queue,0 ); } +int igb_add_mac_steering_filter (struct igb_adapter *adapter, +const u8 *addr,u8 queue,u8 flags) +{ +struct e1000_hw *hw = &adapter->hw; + +/* In theory, this should be supported on 82575 as well, but +* that part wasn't easily accessible during development. +*/ +if (hw->mac.type != e1000_i210) +return -EOPNOTSUPP ; + +return igb_add_mac_filter_flags (adapter, addr, queue, +IGB_MAC_STATE_QUEUE_STEERING | flags); +} + +int igb_del_mac_steering_filter (struct igb_adapter *adapter, +const u8 *addr,u8 queue,u8 flags) +{ +return igb_del_mac_filter_flags (adapter, addr, queue, +IGB_MAC_STATE_QUEUE_STEERING | flags); +} +static int igb_uc_sync (struct net_device *netdev,const unsigned char *addr) {struct igb_adapter *adapter =netdev_priv (netdev);
@@ -8784,6 +8806,10 @@ static void igb_rar_set_index(struct igb_adapter *adapter, u32 index)switch (hw->mac.type) {case e1000_82575:case e1000_i210: +if (adapter->mac_table[index].state & +IGB_MAC_STATE_QUEUE_STEERING ) + rar_high |=E1000_RAH_QSEL_ENABLE ; + rar_high |=E1000_RAH_POOL_1 * adapter->mac_table[index].queue;break ;
Signature · 1 line
2.17.0
PATCH v7 6/10 igb: Allow filters to be added for the local MAC address
In reply to Vinicius Costa GomesUsers expect that when adding a steering filter for the local MAC address, that all the traffic directed to that address will go to some queue.
Currently, it's not possible to configure entries in the "in use" state, which is the normal state of the local MAC address entry (it is the default), this patch allows to override the steering configuration of "in use" entries, if the filter to be added match the address and address type (source or destination) of an existing entry.
There is a bit of a special handling for entries referring to the local MAC address, when they are removed, only the steering configuration is reset.
--- drivers/net/ethernet/intel/igb/igb_main.c | 40 ++++++++++++++++++++--- 1 file changed, 36 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/igb/igb_main.c +36 -4
@@ -6844,6 +6844,27 @@ static void igb_set_default_mac_filter(struct igb_adapter *adapter)igb_rar_set_index (adapter,0 ); } +/* If the filter to be added and an already existing filter express +* the same address and address type, it should be possible to only +* override the other configurations, for example the queue to steer +* traffic. +*/ +static bool igb_mac_entry_can_be_used (const struct igb_mac_addr *entry, +const u8 *addr,const u8 flags) +{ +if (!(entry->state &IGB_MAC_STATE_IN_USE )) +return true; + +if ((entry->state &IGB_MAC_STATE_SRC_ADDR ) != + (flags &IGB_MAC_STATE_SRC_ADDR )) +return false; + +if (!ether_addr_equal (addr, entry->addr)) +return false; + +return true; +} +/* Add a MAC filter for 'addr' directing matching traffic to 'queue', * 'flags' is used to indicate what kind of match is made, match is by * default for the destination address, if matching by source address
@@ -6866,7 +6887,8 @@ static int igb_add_mac_filter_flags(struct igb_adapter *adapter,* addresses. */ for (i =0 ; i < rar_entries; i++) { -if (adapter->mac_table[i].state &IGB_MAC_STATE_IN_USE ) +if (!igb_mac_entry_can_be_used (&adapter->mac_table[i], + addr, flags))continue ;ether_addr_copy (adapter->mac_table[i].addr, addr);
@@ -6918,9 +6940,19 @@ static int igb_del_mac_filter_flags(struct igb_adapter *adapter,if (!ether_addr_equal (adapter->mac_table[i].addr, addr))continue ; - adapter->mac_table[i].state =0 ; -memset (adapter->mac_table[i].addr,0 ,ETH_ALEN ); - adapter->mac_table[i].queue =0 ; +/* When a filter for the default address is "deleted", +* we return it to its initial configuration +*/ +if (adapter->mac_table[i].state &IGB_MAC_STATE_DEFAULT ) { + adapter->mac_table[i].state = +IGB_MAC_STATE_DEFAULT |IGB_MAC_STATE_IN_USE ; + adapter->mac_table[i].queue = + adapter->vfs_allocated_count; + }else { + adapter->mac_table[i].state =0 ; + adapter->mac_table[i].queue =0 ; +memset (adapter->mac_table[i].addr,0 ,ETH_ALEN ); + }igb_rar_set_index (adapter, i);return 0 ;
Signature · 1 line
2.17.0
PATCH v7 7/10 igb: Enable nfc filters to specify MAC addresses
In reply to Vinicius Costa GomesThis allows igb_add_filter()/igb_erase_filter() to work on filters that include MAC addresses (both source and destination).
For now, this only exposes the functionality, the next commit glues ethtool into this. Later in this series, these APIs are used to allow offloading of cls_flower filters.
--- drivers/net/ethernet/intel/igb/igb.h | 4 +++ drivers/net/ethernet/intel/igb/igb_ethtool.c | 28 ++++++++++++++++++++ 2 files changed, 32 insertions(+)
drivers/net/ethernet/intel/igb/igb.h +4 -0
@@ -442,6 +442,8 @@ struct hwmon_buff {enum igb_filter_match_flags {IGB_FILTER_FLAG_ETHER_TYPE =0x1 ,IGB_FILTER_FLAG_VLAN_TCI =0x2 , +IGB_FILTER_FLAG_SRC_MAC_ADDR =0x4 , +IGB_FILTER_FLAG_DST_MAC_ADDR =0x8 , };#define IGB_MAX_RXNFC_FILTERS 16
@@ -456,6 +458,8 @@ struct igb_nfc_input {u8 match_flags;__be16 etype;__be16 vlan_tci; +u8 src_addr[ETH_ALEN ]; +u8 dst_addr[ETH_ALEN ]; };struct igb_nfc_filter {
drivers/net/ethernet/intel/igb/igb_ethtool.c +28 -0
@@ -2776,6 +2776,25 @@ int igb_add_filter(struct igb_adapter *adapter, struct igb_nfc_filter *input)return err; } +if (input->filter.match_flags &IGB_FILTER_FLAG_DST_MAC_ADDR ) { + err =igb_add_mac_steering_filter (adapter, + input->filter.dst_addr, + input->action,0 ); + err =min_t (int, err,0 ); +if (err) +return err; + } + +if (input->filter.match_flags &IGB_FILTER_FLAG_SRC_MAC_ADDR ) { + err =igb_add_mac_steering_filter (adapter, + input->filter.src_addr, + input->action, +IGB_MAC_STATE_SRC_ADDR ); + err =min_t (int, err,0 ); +if (err) +return err; + } +if (input->filter.match_flags &IGB_FILTER_FLAG_VLAN_TCI ) err =igb_rxnfc_write_vlan_prio_filter (adapter, input);
@@ -2824,6 +2843,15 @@ int igb_erase_filter(struct igb_adapter *adapter, struct igb_nfc_filter *input)igb_clear_vlan_prio_filter (adapter,ntohs (input->filter.vlan_tci)); +if (input->filter.match_flags &IGB_FILTER_FLAG_SRC_MAC_ADDR ) +igb_del_mac_steering_filter (adapter, input->filter.src_addr, + input->action, +IGB_MAC_STATE_SRC_ADDR ); + +if (input->filter.match_flags &IGB_FILTER_FLAG_DST_MAC_ADDR ) +igb_del_mac_steering_filter (adapter, input->filter.dst_addr, + input->action,0 ); +return 0 ; }
Signature · 1 line
2.17.0
PATCH v7 8/10 igb: Add MAC address support for ethtool nftuple filters
In reply to Vinicius Costa GomesThis adds the capability of configuring the queue steering of arriving packets based on their source and destination MAC addresses.
Source address steering (i.e. driving traffic to a specific queue), for the i210, does not work, but filtering does (i.e. accepting traffic based on the source address). So, trying to add a filter specifying only a source address will be an error.
In practical terms this adds support for the following use cases, characterized by these examples:
$ ethtool -N eth0 flow-type ether dst aa:aa:aa:aa:aa:aa action 0 (this will direct packets with destination address "aa:aa:aa:aa:aa:aa" to the RX queue 0)
$ ethtool -N eth0 flow-type ether src 44:44:44:44:44:44 \ proto 0x22f0 action 3 (this will direct packets with source address "44:44:44:44:44:44" and ethertype 0x22f0 to the RX queue 3)
--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 43 ++++++++++++++++++-- 1 file changed, 39 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/igb/igb_ethtool.c +39 -4
@@ -2495,6 +2495,23 @@ static int igb_get_ethtool_nfc_entry(struct igb_adapter *adapter, fsp->h_ext.vlan_tci = rule->filter.vlan_tci; fsp->m_ext.vlan_tci =htons (VLAN_PRIO_MASK ); } +if (rule->filter.match_flags &IGB_FILTER_FLAG_DST_MAC_ADDR ) { +ether_addr_copy (fsp->h_u.ether_spec.h_dest, + rule->filter.dst_addr); +/* As we only support matching by the full +* mask, return the mask to userspace +*/ +eth_broadcast_addr (fsp->m_u.ether_spec.h_dest); + } +if (rule->filter.match_flags &IGB_FILTER_FLAG_SRC_MAC_ADDR ) { +ether_addr_copy (fsp->h_u.ether_spec.h_source, + rule->filter.src_addr); +/* As we only support matching by the full +* mask, return the mask to userspace +*/ +eth_broadcast_addr (fsp->m_u.ether_spec.h_source); + } +return 0 ; }return -EINVAL ;
@@ -2768,8 +2785,16 @@ static int igb_rxnfc_write_vlan_prio_filter(struct igb_adapter *adapter,int igb_add_filter (struct igb_adapter *adapter,struct igb_nfc_filter *input) { +struct e1000_hw *hw = &adapter->hw;int err = -EINVAL ; +if (hw->mac.type == e1000_i210 && + !(input->filter.match_flags & ~IGB_FILTER_FLAG_SRC_MAC_ADDR )) { +dev_err (&adapter->pdev->dev, +"i210 doesn't support flow classification rules specifying only source addresses.\n" ); +return -EOPNOTSUPP ; + } +if (input->filter.match_flags &IGB_FILTER_FLAG_ETHER_TYPE ) { err =igb_rxnfc_write_etype_filter (adapter, input);if (err)
@@ -2933,10 +2958,6 @@ static int igb_add_ethtool_nfc_entry(struct igb_adapter *adapter,if ((fsp->flow_type & ~FLOW_EXT ) !=ETHER_FLOW )return -EINVAL ; -if (fsp->m_u.ether_spec.h_proto !=ETHER_TYPE_FULL_MASK && - fsp->m_ext.vlan_tci !=htons (VLAN_PRIO_MASK )) -return -EINVAL ; - input =kzalloc (sizeof (*input),GFP_KERNEL );if (!input)return -ENOMEM ;
@@ -2946,6 +2967,20 @@ static int igb_add_ethtool_nfc_entry(struct igb_adapter *adapter, input->filter.match_flags =IGB_FILTER_FLAG_ETHER_TYPE ; } +/* Only support matching addresses by the full mask */ +if (is_broadcast_ether_addr (fsp->m_u.ether_spec.h_source)) { + input->filter.match_flags |=IGB_FILTER_FLAG_SRC_MAC_ADDR ; +ether_addr_copy (input->filter.src_addr, + fsp->h_u.ether_spec.h_source); + } + +/* Only support matching addresses by the full mask */ +if (is_broadcast_ether_addr (fsp->m_u.ether_spec.h_dest)) { + input->filter.match_flags |=IGB_FILTER_FLAG_DST_MAC_ADDR ; +ether_addr_copy (input->filter.dst_addr, + fsp->h_u.ether_spec.h_dest); + } +if ((fsp->flow_type &FLOW_EXT ) && fsp->m_ext.vlan_tci) {if (fsp->m_ext.vlan_tci !=htons (VLAN_PRIO_MASK )) { err = -EINVAL ;
Signature · 1 line
2.17.0
PATCH v7 9/10 igb: Add the skeletons for tc-flower offloading
In reply to Vinicius Costa GomesThis adds basic functions needed to implement offloading for filters created by tc-flower.
--- drivers/net/ethernet/intel/igb/igb_main.c | 66 +++++++++++++++++++++++ 1 file changed, 66 insertions(+)
drivers/net/ethernet/intel/igb/igb_main.c +66 -0
@@ -36,6 +36,7 @@#include <net/checksum.h> #include <net/ip6_checksum.h> #include <net/pkt_sched.h> +#include <net/pkt_cls.h> #include <linux/net_tstamp.h> #include <linux/mii.h> #include <linux/ethtool.h>
@@ -2498,6 +2499,69 @@ static int igb_offload_cbs(struct igb_adapter *adapter,return 0 ; } +static int igb_configure_clsflower (struct igb_adapter *adapter, +struct tc_cls_flower_offload *cls_flower) +{ +return -EOPNOTSUPP ; +} + +static int igb_delete_clsflower (struct igb_adapter *adapter, +struct tc_cls_flower_offload *cls_flower) +{ +return -EOPNOTSUPP ; +} + +static int igb_setup_tc_cls_flower (struct igb_adapter *adapter, +struct tc_cls_flower_offload *cls_flower) +{ +switch (cls_flower->command) { +case TC_CLSFLOWER_REPLACE : +return igb_configure_clsflower (adapter, cls_flower); +case TC_CLSFLOWER_DESTROY : +return igb_delete_clsflower (adapter, cls_flower); +case TC_CLSFLOWER_STATS : +return -EOPNOTSUPP ; +default : +return -EINVAL ; + } +} + +static int igb_setup_tc_block_cb (enum tc_setup_type type,void *type_data, +void *cb_priv) +{ +struct igb_adapter *adapter = cb_priv; + +if (!tc_cls_can_offload_and_chain0 (adapter->netdev, type_data)) +return -EOPNOTSUPP ; + +switch (type) { +case TC_SETUP_CLSFLOWER : +return igb_setup_tc_cls_flower (adapter, type_data); + +default : +return -EOPNOTSUPP ; + } +} + +static int igb_setup_tc_block (struct igb_adapter *adapter, +struct tc_block_offload *f) +{ +if (f->binder_type !=TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS ) +return -EOPNOTSUPP ; + +switch (f->command) { +case TC_BLOCK_BIND : +return tcf_block_cb_register (f->block, igb_setup_tc_block_cb, + adapter, adapter); +case TC_BLOCK_UNBIND : +tcf_block_cb_unregister (f->block, igb_setup_tc_block_cb, + adapter); +return 0 ; +default : +return -EOPNOTSUPP ; + } +} +static int igb_setup_tc (struct net_device *dev,enum tc_setup_type type,void *type_data) {
@@ -2506,6 +2570,8 @@ static int igb_setup_tc(struct net_device *dev, enum tc_setup_type type,switch (type) {case TC_SETUP_QDISC_CBS :return igb_offload_cbs (adapter, type_data); +case TC_SETUP_BLOCK : +return igb_setup_tc_block (adapter, type_data);default :return -EOPNOTSUPP ;
Signature · 1 line
2.17.0
PATCH v7 10/10 igb: Add support for adding offloaded clsflower filters
In reply to Vinicius Costa GomesThis allows filters added by tc-flower and specifying MAC addresses, Ethernet types, and the VLAN priority field, to be offloaded to the controller.
This reuses most of the infrastructure used by ethtool, but clsflower filters are kept in a separated list, so they are invisible to ethtool.
To setup clsflower offloading:
$ tc qdisc replace dev eth0 handle 100: parent root mqprio \
num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
queues 1 at 0 1 at 1 2 at 2 hw 0
(clsflower offloading depends on the netword driver to be configured
with multiple traffic classes, we use mqprio's 'num_tc' parameter to
set it to 3)$ tc qdisc add dev eth0 ingress
Examples of filters:
$ tc filter add dev eth0 parent ffff: flower \
dst_mac aa:aa:aa:aa:aa:aa \
hw_tc 2 skip_sw
(just a simple filter filtering for the destination MAC address and
steering that traffic to queue 2)$ tc filter add dev enp2s0 parent ffff: proto 0x22f0 flower \
src_mac cc:cc:cc:cc:cc:cc \
hw_tc 1 skip_sw
(as the i210 doesn't support steering traffic based on the source
address alone, we need to use another steering traffic, in this case
we are using the ethernet type (0x22f0) to steer traffic to queue 1)--- drivers/net/ethernet/intel/igb/igb.h | 2 + drivers/net/ethernet/intel/igb/igb_main.c | 188 +++++++++++++++++++++- 2 files changed, 188 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/igb/igb.h +2 -0
@@ -465,6 +465,7 @@ struct igb_nfc_input {struct igb_nfc_filter {struct hlist_node nfc_node;struct igb_nfc_input filter; +unsigned long cookie;u16 etype_reg_index;u16 sw_idx;u16 action;
@@ -604,6 +605,7 @@ struct igb_adapter {/* RX network flow classification support */ struct hlist_head nfc_filter_list; +struct hlist_head cls_flower_list;unsigned int nfc_filter_count;/* lock for RX network flow classification filter */ spinlock_t nfc_lock;
drivers/net/ethernet/intel/igb/igb_main.c +186 -2
208 lines not on this page · raw message
Signature · 1 line
2.17.0
RE: [next-queue PATCH v7 01/10] igb: Fix not adding filter elements to the list
In reply to Vinicius Costa GomesQuoted 14 lines
From: netdev-owner at vger.kernel.org [mailto:netdev-
owner at vger.kernel.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: [next-queue PATCH v7 01/10] igb: Fix not adding filter elements to the listBecause the order of the parameters passes to '
hlist_add_behind()' was inverted, the 'parent' node was added "behind" the 'input', as input is not in the list, this causes the 'input' node to be lost.
Quoted 5 lines
Fixes 0e71def25281 ("igb: add support of RX network flow classification")Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Tested by: Aaron Brown <[email protected]>
RE: [Intel-wired-lan] [next-queue PATCH v7 02/10] igb: Fix queue selection on MAC filters on i210
In reply to Vinicius Costa GomesQuoted 17 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: [Intel-wired-lan] [next-queue PATCH v7 02/10] igb: Fix queue selection on MAC filters on i210On the RAH registers there are semantic differences on the meaning of the "queue" parameter for traffic steering depending on the controller
model: there is the 82575 meaning, which "queue" means a RX Hardware Queue, and the i350 meaning, where it is a reception pool.The previous behaviour was having no effect for i210 based controllers because the QSEL bit of the RAH register wasn't being set.
Quoted 9 lines
This patch separates the condition in discrete cases, so the different handling is clearer.
Fixes 83c21335c876 ("igb: improve MAC filter handling")Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb_main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
Tested by: Aaron Brown <[email protected]>
RE: [Intel-wired-lan] [next-queue PATCH v7 03/10] igb: Enable the hardware traffic class feature bit for igb models
In reply to Vinicius Costa GomesQuoted 9 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: [Intel-wired-lan] [next-queue PATCH v7 03/10] igb: Enable the hardware traffic class feature bit for igb models
Quoted 8 lines
This will allow functionality depending on the hardware being traffic class aware to work. In particular the tc-flower offloading checks verifies that this bit is set.
Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb_main.c | 3 +++ 1 file changed, 3 insertions(+)
Tested by: Aaron Brown <[email protected]>
RE: [next-queue PATCH v7 04/10] igb: Add support for MAC address filters specifying source addresses
In reply to Vinicius Costa GomesQuoted 13 lines
From: netdev-owner at vger.kernel.org [mailto:netdev-
owner at vger.kernel.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: [next-queue PATCH v7 04/10] igb: Add support for MAC address filters specifying source addressesMakes it possible to direct packets to queues based on their source address. Documents the expected usage of the 'flags' parameter.
Quoted 6 lines
Signed-off-by Vinicius Costa Gomes <[email protected]>--- .../net/ethernet/intel/igb/e1000_defines.h | 1 + drivers/net/ethernet/intel/igb/igb.h | 1 + drivers/net/ethernet/intel/igb/igb_main.c | 40 ++++++++++++++++--- 3 files changed, 37 insertions(+), 5 deletions(-)
Tested by: Aaron Brown <[email protected]>
RE: [Intel-wired-lan] [next-queue PATCH v7 05/10] igb: Add support for enabling queue steering in filters
In reply to Vinicius Costa GomesQuoted 18 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: [Intel-wired-lan] [next-queue PATCH v7 05/10] igb: Add support for enabling queue steering in filtersOn some igb models (82575 and i210) the MAC address filters can control to which queue the packet will be assigned.
This extends the 'state' with one more state to signify that queue selection should be enabled for that filter.
As 82575 parts are no longer easily obtained (and this was developed against i210), only support for the i210 model is enabled.
Quoted 8 lines
These functions are exported and will be used in the next patch.
Signed-off-by Vinicius Costa Gomes <[email protected]>--- .../net/ethernet/intel/igb/e1000_defines.h | 1 + drivers/net/ethernet/intel/igb/igb.h | 6 +++++ drivers/net/ethernet/intel/igb/igb_main.c | 26 +++++++++++++++++++ 3 files changed, 33 insertions(+)
Tested by: Aaron Brown <[email protected]>
RE: [Intel-wired-lan] [next-queue PATCH v7 06/10] igb: Allow filters to be added for the local MAC address
In reply to Vinicius Costa GomesQuoted 19 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: [Intel-wired-lan] [next-queue PATCH v7 06/10] igb: Allow filters to be added for the local MAC addressUsers expect that when adding a steering filter for the local MAC address, that all the traffic directed to that address will go to some queue.
Currently, it's not possible to configure entries in the "in use" state, which is the normal state of the local MAC address entry (it is the default), this patch allows to override the steering configuration of "in use" entries, if the filter to be added match the address and address type (source or destination) of an existing entry.
Quoted 8 lines
There is a bit of a special handling for entries referring to the local MAC address, when they are removed, only the steering configuration is reset.
Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb_main.c | 40 ++++++++++++++++++++--- 1 file changed, 36 insertions(+), 4 deletions(-)
Tested by: Aaron Brown <[email protected]>
RE: [next-queue PATCH v7 07/10] igb: Enable nfc filters to specify MAC addresses
In reply to Vinicius Costa GomesQuoted 17 lines
From: netdev-owner at vger.kernel.org [mailto:netdev-
owner at vger.kernel.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: [next-queue PATCH v7 07/10] igb: Enable nfc filters to specify MAC addressesThis allows igb_add_filter()/igb_erase_filter() to work on filters that include MAC addresses (both source and destination).
For now, this only exposes the functionality, the next commit glues ethtool into this. Later in this series, these APIs are used to allow offloading of
cls_flowerfilters.
Quoted 5 lines
Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb.h | 4 +++ drivers/net/ethernet/intel/igb/igb_ethtool.c | 28 ++++++++++++++++++++ 2 files changed, 32 insertions(+)
Tested by: Aaron Brown <[email protected]>
RE: [next-queue PATCH v7 08/10] igb: Add MAC address support for ethtool nftuple filters
In reply to Vinicius Costa GomesQuoted 30 lines
From: netdev-owner at vger.kernel.org [mailto:netdev-
owner at vger.kernel.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: [next-queue PATCH v7 08/10] igb: Add MAC address support for ethtool nftuple filtersThis adds the capability of configuring the queue steering of arriving packets based on their source and destination MAC addresses.
Source address steering (i.e. driving traffic to a specific queue), for the i210, does not work, but filtering does (i.e. accepting traffic based on the source address). So, trying to add a filter specifying only a source address will be an error.
In practical terms this adds support for the following use cases, characterized by these examples:
$ ethtool -N eth0 flow-type ether dst aa:aa:aa:aa:aa:aa action 0 (this will direct packets with destination address "aa:aa:aa:aa:aa:aa" to the RX queue 0)$ ethtool -N eth0 flow-type ether src 44:44:44:44:44:44 \ proto 0x22f0 action 3 (this will direct packets with source address "44:44:44:44:44:44" and ethertype 0x22f0 to the RX queue 3)
Quoted 5 lines
Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 43 ++++++++++++++++++-- 1 file changed, 39 insertions(+), 4 deletions(-)
Tested by: Aaron Brown <[email protected]>
RE: [Intel-wired-lan] [next-queue PATCH v7 09/10] igb: Add the skeletons for tc-flower offloading
In reply to Vinicius Costa GomesQuoted 9 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: [Intel-wired-lan] [next-queue PATCH v7 09/10] igb: Add the skeletons for tc-flower offloading
Quoted 9 lines
This adds basic functions needed to implement offloading for filters created by tc-flower.
Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb_main.c | 66 +++++++++++++++++++++++ 1 file changed, 66 insertions(+)
Tested by: Aaron Brown <[email protected]>
RE: [next-queue PATCH v7 10/10] igb: Add support for adding offloaded clsflower filters
In reply to Vinicius Costa GomesQuoted 44 lines
From: netdev-owner at vger.kernel.org [mailto:netdev-
owner at vger.kernel.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: [next-queue PATCH v7 10/10] igb: Add support for adding offloaded clsflower filtersThis allows filters added by tc-flower and specifying MAC addresses, Ethernet types, and the VLAN priority field, to be offloaded to the controller.
This reuses most of the infrastructure used by ethtool, but clsflower filters are kept in a separated list, so they are invisible to ethtool.
To setup clsflower offloading:
$ tc qdisc replace dev eth0 handle 100: parent root mqprio \ num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \ queues 1 at 0 1 at 1 2 at 2 hw 0 (clsflower offloading depends on the netword driver to be configured with multiple traffic classes, we use mqprio's 'num_tc' parameter to set it to 3)$ tc qdisc add dev eth0 ingressExamples of filters:
$ tc filter add dev eth0 parent ffff: flower \ dst_mac aa:aa:aa:aa:aa:aa \ hw_tc 2 skip_sw (just a simple filter filtering for the destination MAC address and steering that traffic to queue 2)$ tc filter add dev enp2s0 parent ffff: proto 0x22f0 flower \ src_mac cc:cc:cc:cc:cc:cc \ hw_tc 1 skip_sw (as the i210 doesn't support steering traffic based on the source address alone, we need to use another steering traffic, in this case we are using the ethernet type (0x22f0) to steer traffic to queue 1)
Quoted 6 lines
Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb.h | 2 + drivers/net/ethernet/intel/igb/igb_main.c | 188 +++++++++++++++++++++- 2 files changed, 188 insertions(+), 2 deletions(-)
Tested by: Aaron Brown <[email protected]>
RE: [next-queue PATCH v7 01/10] igb: Fix not adding filter elements to the list
In reply to Vinicius Costa GomesQuoted 24 lines
From: Brown, Aaron F
Sent: Friday, April 13, 2018 7:17 PM
To: 'Vinicius Costa Gomes' <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: RE: [next-queue PATCH v7 01/10] igb: Fix not adding filter elements to the listQuoted 14 lines
From: netdev-owner at vger.kernel.org [mailto:netdev-
owner at vger.kernel.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: [next-queue PATCH v7 01/10] igb: Fix not adding filter elements to the listBecause the order of the parameters passes to '
hlist_add_behind()' was inverted, the 'parent' node was added "behind" the 'input', as input is not in the list, this causes the 'input' node to be lost.
Quoted 7 lines
Quoted 5 lines
Fixes 0e71def25281 ("igb: add support of RX network flow classification")Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Tested by: Aaron Brown <[email protected]>
Resending with "Tested-by..." rather then "Tested by..." so that patchwork actually picks it up. What I get for signing off on the mails late Friday.
RE: [Intel-wired-lan] [next-queue PATCH v7 02/10] igb: Fix queue selection on MAC filters on i210
In reply to Vinicius Costa GomesQuoted 29 lines
From: Brown, Aaron F
Sent: Friday, April 13, 2018 7:18 PM
To: 'Vinicius Costa Gomes' <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: RE: [Intel-wired-lan] [next-queue PATCH v7 02/10] igb: Fix queue selection on MAC filters on i210Quoted 20 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: [Intel-wired-lan] [next-queue PATCH v7 02/10] igb: Fix queue selection on MAC filters on i210On the RAH registers there are semantic differences on the meaning of the "queue" parameter for traffic steering depending on the controller
model: there is the 82575 meaning, which "queue" means a RX Hardware Queue, and the i350 meaning, where it is a reception pool.The previous behaviour was having no effect for i210 based controllers because the QSEL bit of the RAH register wasn't being set.
This patch separates the condition in discrete cases, so the different handling is clearer.
Quoted 8 lines
Quoted 6 lines
Fixes 83c21335c876 ("igb: improve MAC filter handling")Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb_main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)Tested by: Aaron Brown <[email protected]>
RE: [Intel-wired-lan] [next-queue PATCH v7 03/10] igb: Enable the hardware traffic class feature bit for igb models
In reply to Vinicius Costa GomesQuoted 22 lines
From: Brown, Aaron F
Sent: Friday, April 13, 2018 7:18 PM
To: 'Vinicius Costa Gomes' <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: RE: [Intel-wired-lan] [next-queue PATCH v7 03/10] igb: Enable the hardware traffic class feature bit for igb modelsQuoted 13 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: [Intel-wired-lan] [next-queue PATCH v7 03/10] igb: Enable the hardware traffic class feature bit for igb modelsThis will allow functionality depending on the hardware being traffic class aware to work. In particular the tc-flower offloading checks verifies that this bit is set.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb_main.c | 3 +++ 1 file changed, 3 insertions(+)Tested by: Aaron Brown <[email protected]>
RE: [next-queue PATCH v7 04/10] igb: Add support for MAC address filters specifying source addresses
In reply to Vinicius Costa GomesQuoted 23 lines
From: Brown, Aaron F
Sent: Friday, April 13, 2018 7:19 PM
To: 'Vinicius Costa Gomes' <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: RE: [next-queue PATCH v7 04/10] igb: Add support for MAC address filters specifying source addressesQuoted 13 lines
From: netdev-owner at vger.kernel.org [mailto:netdev-
owner at vger.kernel.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: [next-queue PATCH v7 04/10] igb: Add support for MAC address filters specifying source addressesMakes it possible to direct packets to queues based on their source address. Documents the expected usage of the 'flags' parameter.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Vinicius Costa Gomes <[email protected]>--- .../net/ethernet/intel/igb/e1000_defines.h | 1 + drivers/net/ethernet/intel/igb/igb.h | 1 + drivers/net/ethernet/intel/igb/igb_main.c | 40 ++++++++++++++++--- 3 files changed, 37 insertions(+), 5 deletions(-)Tested by: Aaron Brown <[email protected]>
RE: [Intel-wired-lan] [next-queue PATCH v7 05/10] igb: Add support for enabling queue steering in filters
In reply to Vinicius Costa GomesQuoted 30 lines
From: Brown, Aaron F
Sent: Friday, April 13, 2018 7:20 PM
To: 'Vinicius Costa Gomes' <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: RE: [Intel-wired-lan] [next-queue PATCH v7 05/10] igb: Add support for enabling queue steering in filtersQuoted 7 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: [Intel-wired-lan] [next-queue PATCH v7 05/10] igb: Add supportfor
Quoted 13 lines
enabling queue steering in filters
On some igb models (82575 and i210) the MAC address filters can control to which queue the packet will be assigned.
This extends the 'state' with one more state to signify that queue selection should be enabled for that filter.
As 82575 parts are no longer easily obtained (and this was developed against i210), only support for the i210 model is enabled.
These functions are exported and will be used in the next patch.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Vinicius Costa Gomes <[email protected]>--- .../net/ethernet/intel/igb/e1000_defines.h | 1 + drivers/net/ethernet/intel/igb/igb.h | 6 +++++ drivers/net/ethernet/intel/igb/igb_main.c | 26 +++++++++++++++++++ 3 files changed, 33 insertions(+)Tested by: Aaron Brown <[email protected]>
RE: [Intel-wired-lan] [next-queue PATCH v7 06/10] igb: Allow filters to be added for the local MAC address
In reply to Vinicius Costa GomesQuoted 32 lines
From: Brown, Aaron F
Sent: Friday, April 13, 2018 7:20 PM
To: 'Vinicius Costa Gomes' <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: RE: [Intel-wired-lan] [next-queue PATCH v7 06/10] igb: Allow filters to be added for the local MAC addressQuoted 23 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: [Intel-wired-lan] [next-queue PATCH v7 06/10] igb: Allow filters to be added for the local MAC addressUsers expect that when adding a steering filter for the local MAC address, that all the traffic directed to that address will go to some queue.
Currently, it's not possible to configure entries in the "in use" state, which is the normal state of the local MAC address entry (it is the default), this patch allows to override the steering configuration of "in use" entries, if the filter to be added match the address and address type (source or destination) of an existing entry.
There is a bit of a special handling for entries referring to the local MAC address, when they are removed, only the steering configuration is reset.
Quoted 7 lines
Quoted 3 lines
Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb_main.c | 40 ++++++++++++++++++++---
Quoted 1 line
1 file changed, 36 insertions(+), 4 deletions(-)Tested by: Aaron Brown <[email protected]>
RE: [next-queue PATCH v7 07/10] igb: Enable nfc filters to specify MAC addresses
In reply to Vinicius Costa GomesQuoted 27 lines
From: Brown, Aaron F
Sent: Friday, April 13, 2018 7:22 PM
To: 'Vinicius Costa Gomes' <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: RE: [next-queue PATCH v7 07/10] igb: Enable nfc filters to specify MAC addressesQuoted 17 lines
From: netdev-owner at vger.kernel.org [mailto:netdev-
owner at vger.kernel.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: [next-queue PATCH v7 07/10] igb: Enable nfc filters to specify MAC addressesThis allows igb_add_filter()/igb_erase_filter() to work on filters that include MAC addresses (both source and destination).
For now, this only exposes the functionality, the next commit glues ethtool into this. Later in this series, these APIs are used to allow offloading of
cls_flowerfilters.
Quoted 8 lines
Quoted 4 lines
Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb.h | 4 +++ drivers/net/ethernet/intel/igb/igb_ethtool.c | 28++++++++++++++++++++
Quoted 1 line
2 files changed, 32 insertions(+)Tested by: Aaron Brown <[email protected]>
RE: [next-queue PATCH v7 08/10] igb: Add MAC address support for ethtool nftuple filters
In reply to Vinicius Costa GomesQuoted 40 lines
From: Brown, Aaron F
Sent: Friday, April 13, 2018 7:23 PM
To: 'Vinicius Costa Gomes' <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: RE: [next-queue PATCH v7 08/10] igb: Add MAC address support for ethtool nftuple filtersQuoted 30 lines
From: netdev-owner at vger.kernel.org [mailto:netdev-
owner at vger.kernel.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: [next-queue PATCH v7 08/10] igb: Add MAC address support for ethtool nftuple filtersThis adds the capability of configuring the queue steering of arriving packets based on their source and destination MAC addresses.
Source address steering (i.e. driving traffic to a specific queue), for the i210, does not work, but filtering does (i.e. accepting traffic based on the source address). So, trying to add a filter specifying only a source address will be an error.
In practical terms this adds support for the following use cases, characterized by these examples:
$ ethtool -N eth0 flow-type ether dst aa:aa:aa:aa:aa:aa action 0 (this will direct packets with destination address "aa:aa:aa:aa:aa:aa" to the RX queue 0)$ ethtool -N eth0 flow-type ether src 44:44:44:44:44:44 \ proto 0x22f0 action 3 (this will direct packets with source address "44:44:44:44:44:44" and ethertype 0x22f0 to the RX queue 3)
Quoted 8 lines
Quoted 3 lines
Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 43 ++++++++++++++++++--
Quoted 2 lines
1 file changed, 39 insertions(+), 4 deletions(-)Tested by: Aaron Brown <[email protected]>
RE: [Intel-wired-lan] [next-queue PATCH v7 09/10] igb: Add the skeletons for tc-flower offloading
In reply to Vinicius Costa GomesQuoted 21 lines
From: Brown, Aaron F
Sent: Friday, April 13, 2018 7:23 PM
To: 'Vinicius Costa Gomes' <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: RE: [Intel-wired-lan] [next-queue PATCH v7 09/10] igb: Add the skeletons for tc-flower offloadingQuoted 12 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; Sanchez-Palencia, Jesus <jesus.sanchez- palencia at intel.com>
Subject: [Intel-wired-lan] [next-queue PATCH v7 09/10] igb: Add the skeletons for tc-flower offloadingThis adds basic functions needed to implement offloading for filters created by tc-flower.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb_main.c | 66 +++++++++++++++++++++++ 1 file changed, 66 insertions(+)Tested by: Aaron Brown <[email protected]>
RE: [next-queue PATCH v7 10/10] igb: Add support for adding offloaded clsflower filters
In reply to Vinicius Costa GomesQuoted 55 lines
From: Brown, Aaron F
Sent: Friday, April 13, 2018 7:25 PM
To: 'Vinicius Costa Gomes' <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: RE: [next-queue PATCH v7 10/10] igb: Add support for adding offloaded clsflower filtersQuoted 8 lines
From: netdev-owner at vger.kernel.org [mailto:netdev-
owner at vger.kernel.org] On Behalf Of Vinicius Costa Gomes
Sent: Tuesday, April 10, 2018 10:50 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Gomes, Vinicius <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; Sanchez-Palencia, Jesus <[email protected]>
Subject: [next-queue PATCH v7 10/10] igb: Add support for addingoffloaded
Quoted 36 lines
clsflower filters
This allows filters added by tc-flower and specifying MAC addresses, Ethernet types, and the VLAN priority field, to be offloaded to the controller.
This reuses most of the infrastructure used by ethtool, but clsflower filters are kept in a separated list, so they are invisible to ethtool.
To setup clsflower offloading:
$ tc qdisc replace dev eth0 handle 100: parent root mqprio \ num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \ queues 1 at 0 1 at 1 2 at 2 hw 0 (clsflower offloading depends on the netword driver to be configured with multiple traffic classes, we use mqprio's 'num_tc' parameter to set it to 3)$ tc qdisc add dev eth0 ingressExamples of filters:
$ tc filter add dev eth0 parent ffff: flower \ dst_mac aa:aa:aa:aa:aa:aa \ hw_tc 2 skip_sw (just a simple filter filtering for the destination MAC address and steering that traffic to queue 2)$ tc filter add dev enp2s0 parent ffff: proto 0x22f0 flower \ src_mac cc:cc:cc:cc:cc:cc \ hw_tc 1 skip_sw (as the i210 doesn't support steering traffic based on the source address alone, we need to use another steering traffic, in this case we are using the ethernet type (0x22f0) to steer traffic to queue 1)
Quoted 8 lines
Quoted 6 lines
Signed-off-by Vinicius Costa Gomes <[email protected]>--- drivers/net/ethernet/intel/igb/igb.h | 2 + drivers/net/ethernet/intel/igb/igb_main.c | 188 +++++++++++++++++++++- 2 files changed, 188 insertions(+), 2 deletions(-)Tested by: Aaron Brown <[email protected]>