Skip to content

Commit

Permalink
Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/…
Browse files Browse the repository at this point in the history
…jkirsher/next-queue

Jeff Kirsher says:

====================
1GbE Intel Wired LAN Driver Updates 2016-08-18

This series contains updates to igb only.

Gangfeng Huang provides all the changes in the series to update the
igb driver to support advanced receive side filters that direct receive
packets by flows to different hardware queues. This enables a tight
control on routing a flow in the platform.  First patch allows for
receive network flow classification to insert and remove receive filters
by ethtool.  Second and third patches add the ability to insert and
remove ethertype and VLAN priority filters by ethtool.

Last patch just fixes an error message to return "Not supported" versus
"Unknown error 524".
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Aug 19, 2016
2 parents 3e7d2d4 + 54be813 commit a5c8818
Show file tree
Hide file tree
Showing 7 changed files with 452 additions and 2 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/intel/igb/e1000_82575.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ struct e1000_adv_tx_context_desc {
/* ETQF register bit definitions */
#define E1000_ETQF_FILTER_ENABLE BIT(26)
#define E1000_ETQF_1588 BIT(30)
#define E1000_ETQF_IMM_INT BIT(29)
#define E1000_ETQF_QUEUE_ENABLE BIT(31)
#define E1000_ETQF_QUEUE_SHIFT 16
#define E1000_ETQF_QUEUE_MASK 0x00070000
#define E1000_ETQF_ETYPE_MASK 0x0000FFFF

/* FTQF register bit definitions */
#define E1000_FTQF_VF_BP 0x00008000
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/ethernet/intel/igb/e1000_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -1024,4 +1024,8 @@
#define E1000_RTTBCNRC_RF_INT_MASK \
(E1000_RTTBCNRC_RF_DEC_MASK << E1000_RTTBCNRC_RF_INT_SHIFT)

#define E1000_VLAPQF_QUEUE_SEL(_n, q_idx) (q_idx << ((_n) * 4))
#define E1000_VLAPQF_P_VALID(_n) (0x1 << (3 + (_n) * 4))
#define E1000_VLAPQF_QUEUE_MASK 0x03

#endif
1 change: 1 addition & 0 deletions drivers/net/ethernet/intel/igb/e1000_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
(0x054E0 + ((_i - 16) * 8)))
#define E1000_RAH(_i) (((_i) <= 15) ? (0x05404 + ((_i) * 8)) : \
(0x054E4 + ((_i - 16) * 8)))
#define E1000_VLAPQF 0x055B0 /* VLAN Priority Queue Filter VLAPQF */
#define E1000_IP4AT_REG(_i) (0x05840 + ((_i) * 8))
#define E1000_IP6AT_REG(_i) (0x05880 + ((_i) * 4))
#define E1000_WUPM_REG(_i) (0x05A00 + ((_i) * 4))
Expand Down
50 changes: 50 additions & 0 deletions drivers/net/ethernet/intel/igb/igb.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,49 @@ struct hwmon_buff {
};
#endif

/* The number of L2 ether-type filter registers, Index 3 is reserved
* for PTP 1588 timestamp
*/
#define MAX_ETYPE_FILTER (4 - 1)
/* ETQF filter list: one static filter per filter consumer. This is
* to avoid filter collisions later. Add new filters here!!
*
* Current filters: Filter 3
*/
#define IGB_ETQF_FILTER_1588 3

#define IGB_N_EXTTS 2
#define IGB_N_PEROUT 2
#define IGB_N_SDP 4
#define IGB_RETA_SIZE 128

enum igb_filter_match_flags {
IGB_FILTER_FLAG_ETHER_TYPE = 0x1,
IGB_FILTER_FLAG_VLAN_TCI = 0x2,
};

#define IGB_MAX_RXNFC_FILTERS 16

/* RX network flow classification data structure */
struct igb_nfc_input {
/* Byte layout in order, all values with MSB first:
* match_flags - 1 byte
* etype - 2 bytes
* vlan_tci - 2 bytes
*/
u8 match_flags;
__be16 etype;
__be16 vlan_tci;
};

struct igb_nfc_filter {
struct hlist_node nfc_node;
struct igb_nfc_input filter;
u16 etype_reg_index;
u16 sw_idx;
u16 action;
};

/* board specific private data structure */
struct igb_adapter {
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
Expand Down Expand Up @@ -473,6 +511,13 @@ struct igb_adapter {
int copper_tries;
struct e1000_info ei;
u16 eee_advert;

/* RX network flow classification support */
struct hlist_head nfc_filter_list;
unsigned int nfc_filter_count;
/* lock for RX network flow classification filter */
spinlock_t nfc_lock;
bool etype_bitmap[MAX_ETYPE_FILTER];
};

/* flags controlling PTP/1588 function */
Expand Down Expand Up @@ -599,4 +644,9 @@ static inline struct netdev_queue *txring_txq(const struct igb_ring *tx_ring)
return netdev_get_tx_queue(tx_ring->netdev, tx_ring->queue_index);
}

int igb_add_filter(struct igb_adapter *adapter,
struct igb_nfc_filter *input);
int igb_erase_filter(struct igb_adapter *adapter,
struct igb_nfc_filter *input);

#endif /* _IGB_H_ */
Loading

0 comments on commit a5c8818

Please sign in to comment.