Intel Wired LAN Driver Updates
Subsystems (3)
cover Intel Wired LAN Driver Updates
This series contains updates from Emil to ixgbevf.
He cleans up the code by removing the adapter structure as a parameter from multiple functions in favor of using the ixgbevf_ring structure and moves hot-path specific statistic int the ring structure for anticipated performance gains.
He also removes the Tx/Rx counters for checksum offload and adds counters for tx_restart_queue and tx_timeout_count.
Next he makes it so that the first tx_buffer structure acts as a central storage location for most the skb info we are about to transmit, then takes advantage of the dma buffer always being present in the first descriptor and mapped as single allowing a call to dma_unmap_single which alleviates the need to check for DMA mapping in ixgbevf_clean_tx_irq().
Finally he merges the ixgbevf_tx_map call and the ixgbevf_tx_queue call into a single function.
Emil Tantilov (7):
ixgbevf: make use of the dev pointer in the ixgbevf_ring struct
ixgbevf: move ring specific stats into ring specific structure
ixgbevf: remove counters for Tx/Rx checksum offload
ixgbevf: add tx counters
ixgbevf: make the first tx_buffer a repository for most of the skb
info
ixgbevf: redo dma mapping using the tx buffer info
ixgbevf: merge ixgbevf_tx_map and ixgbevf_tx_queue into a single
function
drivers/net/ethernet/intel/ixgbevf/defines.h | 1 + drivers/net/ethernet/intel/ixgbevf/ethtool.c | 62 +-- drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 90 ++-- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 620 +++++++++++----------- 4 files changed, 403 insertions(+), 370 deletions(-)
Signature · 1 line
1.8.5.GIT
PATCH 1/7 ixgbevf: make use of the dev pointer in the ixgbevf_ring struct
From: Emil Tantilov <[email protected]>
This patch cleans up the code by removing the adapter structure as parameter from multiple functions. The adapter structure was previously being used to access the dev pointer, but this can also be done via the ixgbevf_ring structure. This way we can drop the adapter as parameter from these functions.
This patch also includes small cleanups in some error code paths.
--- drivers/net/ethernet/intel/ixgbevf/ethtool.c | 46 ++++++------ drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 8 +- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 91 +++++++++-------------- 3 files changed, 61 insertions(+), 84 deletions(-)
drivers/net/ethernet/intel/ixgbevf/ethtool.c +23 -23
@@ -305,18 +305,18 @@ static int ixgbevf_set_ringparam(struct net_device *netdev,/* clone ring and setup updated count */ tx_ring[i] = *adapter->tx_ring[i]; tx_ring[i].count = new_tx_count; - err =ixgbevf_setup_tx_resources (adapter, &tx_ring[i]); -if (!err) -continue ; -while (i) { - i--; -ixgbevf_free_tx_resources (adapter, &tx_ring[i]); - } + err =ixgbevf_setup_tx_resources (&tx_ring[i]); +if (err) { +while (i) { + i--; +ixgbevf_free_tx_resources (&tx_ring[i]); + } -vfree (tx_ring); - tx_ring =NULL ; +vfree (tx_ring); + tx_ring =NULL ; - goto clear_reset; + goto clear_reset; + } } }
@@ -331,18 +331,18 @@ static int ixgbevf_set_ringparam(struct net_device *netdev,/* clone ring and setup updated count */ rx_ring[i] = *adapter->rx_ring[i]; rx_ring[i].count = new_rx_count; - err =ixgbevf_setup_rx_resources (adapter, &rx_ring[i]); -if (!err) -continue ; -while (i) { - i--; -ixgbevf_free_rx_resources (adapter, &rx_ring[i]); - } + err =ixgbevf_setup_rx_resources (&rx_ring[i]); +if (err) { +while (i) { + i--; +ixgbevf_free_rx_resources (&rx_ring[i]); + } -vfree (rx_ring); - rx_ring =NULL ; +vfree (rx_ring); + rx_ring =NULL ; - goto clear_reset; + goto clear_reset; + } } }
@@ -352,7 +352,7 @@ static int ixgbevf_set_ringparam(struct net_device *netdev,/* Tx */ if (tx_ring) {for (i =0 ; i < adapter->num_tx_queues; i++) { -ixgbevf_free_tx_resources (adapter, adapter->tx_ring[i]); +ixgbevf_free_tx_resources (adapter->tx_ring[i]); *adapter->tx_ring[i] = tx_ring[i]; } adapter->tx_ring_count = new_tx_count;
@@ -364,7 +364,7 @@ static int ixgbevf_set_ringparam(struct net_device *netdev,/* Rx */ if (rx_ring) {for (i =0 ; i < adapter->num_rx_queues; i++) { -ixgbevf_free_rx_resources (adapter, adapter->rx_ring[i]); +ixgbevf_free_rx_resources (adapter->rx_ring[i]); *adapter->rx_ring[i] = rx_ring[i]; } adapter->rx_ring_count = new_rx_count;
@@ -380,7 +380,7 @@ clear_reset:/* free Tx resources if Rx error is encountered */ if (tx_ring) {for (i =0 ; i < adapter->num_tx_queues; i++) -ixgbevf_free_tx_resources (adapter, &tx_ring[i]); +ixgbevf_free_tx_resources (&tx_ring[i]);vfree (tx_ring); }
drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +4 -4
@@ -420,10 +420,10 @@ void ixgbevf_down(struct ixgbevf_adapter *adapter);void ixgbevf_reinit_locked (struct ixgbevf_adapter *adapter);void ixgbevf_reset (struct ixgbevf_adapter *adapter);void ixgbevf_set_ethtool_ops (struct net_device *netdev); -int ixgbevf_setup_rx_resources (struct ixgbevf_adapter *,struct ixgbevf_ring *); -int ixgbevf_setup_tx_resources (struct ixgbevf_adapter *,struct ixgbevf_ring *); -void ixgbevf_free_rx_resources (struct ixgbevf_adapter *,struct ixgbevf_ring *); -void ixgbevf_free_tx_resources (struct ixgbevf_adapter *,struct ixgbevf_ring *); +int ixgbevf_setup_rx_resources (struct ixgbevf_ring *); +int ixgbevf_setup_tx_resources (struct ixgbevf_ring *); +void ixgbevf_free_rx_resources (struct ixgbevf_ring *); +void ixgbevf_free_tx_resources (struct ixgbevf_ring *);void ixgbevf_update_stats (struct ixgbevf_adapter *adapter);int ethtool_ioctl (struct ifreq *ifr);
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +34 -57
268 lines not on this page · raw message
Signature · 1 line
1.8.5.GIT
PATCH 2/7 ixgbevf: move ring specific stats into ring specific structure
In reply to Aaron BrownFrom: Emil Tantilov <[email protected]>
This patch moves hot-path specific statistics into the ring structure. This allows us to drop the adapter structure in some functions and should help with performance.
--- drivers/net/ethernet/intel/ixgbevf/ethtool.c | 12 +++--- drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 44 +++++++++++++++----- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 50 +++++++++++------------ 3 files changed, 62 insertions(+), 44 deletions(-)
drivers/net/ethernet/intel/ixgbevf/ethtool.c +6 -6
@@ -411,15 +411,15 @@ static void ixgbevf_get_ethtool_stats(struct net_device *netdev, tx_yields =0 , tx_cleaned =0 , tx_missed =0 ;for (i =0 ; i < adapter->num_rx_queues; i++) { - rx_yields += adapter->rx_ring[i]->bp_yields; - rx_cleaned += adapter->rx_ring[i]->bp_cleaned; - rx_yields += adapter->rx_ring[i]->bp_yields; + rx_yields += adapter->rx_ring[i]->stats.yields; + rx_cleaned += adapter->rx_ring[i]->stats.cleaned; + rx_yields += adapter->rx_ring[i]->stats.yields; }for (i =0 ; i < adapter->num_tx_queues; i++) { - tx_yields += adapter->tx_ring[i]->bp_yields; - tx_cleaned += adapter->tx_ring[i]->bp_cleaned; - tx_yields += adapter->tx_ring[i]->bp_yields; + tx_yields += adapter->tx_ring[i]->stats.yields; + tx_cleaned += adapter->tx_ring[i]->stats.cleaned; + tx_yields += adapter->tx_ring[i]->stats.yields; } adapter->bp_rx_yields = rx_yields;
drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +33 -11
81 lines not on this page · raw message
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +23 -27
156 lines not on this page · raw message
Signature · 1 line
1.8.5.GIT
PATCH 3/7 ixgbevf: remove counters for Tx/Rx checksum offload
In reply to Aaron BrownFrom: Emil Tantilov <[email protected]>
This patch removes the Tx/Rx counters for checksum offload.
The Tx counter was never updated and the Rx counter is of limited use. This is in effort to clean up the counters and make them consistent with the counters shown by ixgbe.
Also this patch removes some members of the adapter structure that were never used and shuffles others to reduce number of holes.
before:
/* size: 1568, cachelines: 25, members: 48 */ /* sum members: 1519, holes: 10, sum holes: 43 */ /* padding: 6 */ /* last cacheline: 32 bytes */
after:
/* size: 1480, cachelines: 24, members: 43 */ /* sum members: 1479, holes: 1, sum holes: 1 */ /* last cacheline: 8 bytes */
--- drivers/net/ethernet/intel/ixgbevf/ethtool.c | 2 -- drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 23 +++++++++-------------- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 ---- 3 files changed, 9 insertions(+), 20 deletions(-)
drivers/net/ethernet/intel/ixgbevf/ethtool.c +0 -2
@@ -79,9 +79,7 @@ static const struct ixgbe_stats ixgbe_gstrings_stats[] = { {"tx_busy", IXGBEVF_ZSTAT(tx_busy)}, {"multicast", IXGBEVF_STAT(stats.vfmprc, stats.base_vfmprc, stats.saved_reset_vfmprc)}, - {"rx_csum_offload_good", IXGBEVF_ZSTAT(hw_csum_rx_good)}, {"rx_csum_offload_errors", IXGBEVF_ZSTAT(hw_csum_rx_error)}, - {"tx_csum_offload_ctxt", IXGBEVF_ZSTAT(hw_csum_tx_good)}, #ifdef BP_EXTENDED_STATS {"rx_bp_poll_yield", IXGBEVF_ZSTAT(bp_rx_yields)}, {"rx_bp_cleaned", IXGBEVF_ZSTAT(bp_rx_cleaned)},
drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +9 -14
@@ -106,7 +106,6 @@ struct ixgbevf_ring { };u64 hw_csum_rx_error; -u64 hw_csum_rx_good;u8 __iomem *tail;u16 reg_idx;/* holds the special value that gets the hardware register
@@ -336,7 +335,6 @@ static inline u16 ixgbevf_desc_unused(struct ixgbevf_ring *ring)struct ixgbevf_adapter {struct timer_list watchdog_timer;unsigned long active_vlans[BITS_TO_LONGS (VLAN_N_VID )]; -u16 bd_number;struct work_struct reset_task;struct ixgbevf_q_vector *q_vector[MAX_MSIX_Q_VECTORS ];
@@ -349,25 +347,18 @@ struct ixgbevf_adapter {u32 eims_other;/* TX */ -struct ixgbevf_ring *tx_ring[MAX_TX_QUEUES ];/* One per active queue */ int num_tx_queues; +struct ixgbevf_ring *tx_ring[MAX_TX_QUEUES ];/* One per active queue */ u64 restart_queue; -u64 hw_csum_tx_good; -u64 lsc_int; -u64 hw_tso_ctxt; -u64 hw_tso6_ctxt;u32 tx_timeout_count;/* RX */ -struct ixgbevf_ring *rx_ring[MAX_TX_QUEUES ];/* One per active queue */ int num_rx_queues; +struct ixgbevf_ring *rx_ring[MAX_TX_QUEUES ];/* One per active queue */ u64 hw_csum_rx_error;u64 hw_rx_no_dma_resources; -u64 hw_csum_rx_good;u64 non_eop_descs;int num_msix_vectors; -struct msix_entry *msix_entries; -u32 alloc_rx_page_failed;u32 alloc_rx_buff_failed;
@@ -379,6 +370,8 @@ struct ixgbevf_adapter {#define IXGBE_FLAG_IN_NETPOLL (u32)(1 << 1)#define IXGBEVF_FLAG_QUEUE_RESET_REQUESTED (u32)(1 << 2) +struct msix_entry *msix_entries; +/* OS defined structs */ struct net_device *netdev;struct pci_dev *pdev;
@@ -386,10 +379,12 @@ struct ixgbevf_adapter {/* structs defined in ixgbe_vf.h */ struct ixgbe_hw hw;u16 msg_enable; -struct ixgbevf_hw_stats stats; +u16 bd_number;/* Interrupt Throttle Rate */ u32 eitr_param; +struct ixgbevf_hw_stats stats; +unsigned long state;u64 tx_busy;unsigned int tx_ring_count;
@@ -408,9 +403,9 @@ struct ixgbevf_adapter {u32 link_speed;bool link_up; -struct work_struct watchdog_task; -spinlock_t mbx_lock; + +struct work_struct watchdog_task; };enum ixbgevf_state_t {
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +0 -4
@@ -357,7 +357,6 @@ static inline void ixgbevf_rx_checksum(struct ixgbevf_ring *ring,/* It must be a TCP or UDP packet with a valid checksum */ skb->ip_summed =CHECKSUM_UNNECESSARY ; - ring->hw_csum_rx_good++; }/**
@@ -2263,10 +2262,7 @@ void ixgbevf_update_stats(struct ixgbevf_adapter *adapter)for (i =0 ; i < adapter->num_rx_queues; i++) { adapter->hw_csum_rx_error += adapter->rx_ring[i]->hw_csum_rx_error; - adapter->hw_csum_rx_good += - adapter->rx_ring[i]->hw_csum_rx_good; adapter->rx_ring[i]->hw_csum_rx_error =0 ; - adapter->rx_ring[i]->hw_csum_rx_good =0 ; } }
Signature · 1 line
1.8.5.GIT
PATCH 4/7 ixgbevf: add tx counters
In reply to Aaron BrownFrom: Emil Tantilov <[email protected]>
This patch adds counters for tx_restart_queue and tx_timeout_count.
--- drivers/net/ethernet/intel/ixgbevf/ethtool.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/ixgbevf/ethtool.c +2 -0
@@ -77,6 +77,8 @@ static const struct ixgbe_stats ixgbe_gstrings_stats[] = { {"tx_bytes" ,IXGBEVF_STAT (stats.vfgotc, stats.base_vfgotc, stats.saved_reset_vfgotc)}, {"tx_busy", IXGBEVF_ZSTAT(tx_busy)}, + {"tx_restart_queue", IXGBEVF_ZSTAT(restart_queue)}, + {"tx_timeout_count", IXGBEVF_ZSTAT(tx_timeout_count)}, {"multicast", IXGBEVF_STAT(stats.vfmprc, stats.base_vfmprc, stats.saved_reset_vfmprc)}, {"rx_csum_offload_errors", IXGBEVF_ZSTAT(hw_csum_rx_error)},
Signature · 1 line
1.8.5.GIT
PATCH 5/7 ixgbevf: make the first tx_buffer a repository for most of the skb info
In reply to Aaron BrownFrom: Emil Tantilov <[email protected]>
This change makes it so that the first tx_buffer structure acts as a central storage location for most of the info about the skb we are about to transmit.
In addition this patch makes tx_flags part of the ixgbevf_tx_buffer struct. This allows us to use the flags directly from the stucture and as result removes the tx_flags parameter from some functions. Also as a cleanup mapped_as_page is folded into tx_flags and some unused flags were removed.
--- drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 12 +- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 213 +++++++++++++--------- 2 files changed, 130 insertions(+), 95 deletions(-)
drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +7 -5
@@ -46,12 +46,15 @@/* wrapper around a pointer to a socket buffer, * so a DMA handle can be stored along with the buffer */ struct ixgbevf_tx_buffer { +union ixgbe_adv_tx_desc *next_to_watch; +unsigned long time_stamp;struct sk_buff *skb; +unsigned int bytecount; +unsigned short gso_segs; +__be16 protocol;dma_addr_t dma; -unsigned long time_stamp; -union ixgbe_adv_tx_desc *next_to_watch; +u32 tx_flags;u16 length; -u16 mapped_as_page; };struct ixgbevf_rx_buffer {
@@ -144,8 +147,7 @@ struct ixgbevf_ring {#define IXGBE_TX_FLAGS_VLAN (u32)(1 << 1)#define IXGBE_TX_FLAGS_TSO (u32)(1 << 2)#define IXGBE_TX_FLAGS_IPV4 (u32)(1 << 3) -#define IXGBE_TX_FLAGS_FCOE (u32)(1 << 4) -#define IXGBE_TX_FLAGS_FSO (u32)(1 << 5) +#define IXGBE_TX_FLAGS_MAPPED_AS_PAGE (u32)(1 << 4)#define IXGBE_TX_FLAGS_VLAN_MASK 0xffff0000#define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0x0000e000#define IXGBE_TX_FLAGS_VLAN_SHIFT 16
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +123 -90
405 lines not on this page · raw message
Signature · 1 line
1.8.5.GIT
PATCH 6/7 ixgbevf: redo dma mapping using the tx buffer info
In reply to Aaron BrownFrom: Emil Tantilov <[email protected]>
This patch takes advantage of the dma buffer always being present in the first descriptor and mapped as single. As such we can call dma_unmap_single and don't need to check for DMA mapping in ixgbevf_clean_tx_irq().
In addition this patch makes use of the DMA API.
--- drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 5 +- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 94 ++++++++++++++--------- 2 files changed, 59 insertions(+), 40 deletions(-)
drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +2 -3
@@ -52,9 +52,9 @@ struct ixgbevf_tx_buffer {unsigned int bytecount;unsigned short gso_segs;__be16 protocol; -dma_addr_t dma; +DEFINE_DMA_UNMAP_ADDR (dma); +DEFINE_DMA_UNMAP_LEN (len);u32 tx_flags; -u16 length; };struct ixgbevf_rx_buffer {
@@ -147,7 +147,6 @@ struct ixgbevf_ring {#define IXGBE_TX_FLAGS_VLAN (u32)(1 << 1)#define IXGBE_TX_FLAGS_TSO (u32)(1 << 2)#define IXGBE_TX_FLAGS_IPV4 (u32)(1 << 3) -#define IXGBE_TX_FLAGS_MAPPED_AS_PAGE (u32)(1 << 4)#define IXGBE_TX_FLAGS_VLAN_MASK 0xffff0000#define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0x0000e000#define IXGBE_TX_FLAGS_VLAN_SHIFT 16
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +57 -37
147 lines not on this page · raw message
Signature · 1 line
1.8.5.GIT
PATCH 7/7 ixgbevf: merge ixgbevf_tx_map and ixgbevf_tx_queue into a single function
In reply to Aaron BrownFrom: Emil Tantilov <[email protected]>
This change merges the ixgbevf_tx_map call and the ixgbevf_tx_queue call into a single function. In order to make room for this setting of cmd_type and olinfo flags is done in separate functions.
--- drivers/net/ethernet/intel/ixgbevf/defines.h | 1 + drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 272 +++++++++++----------- 2 files changed, 133 insertions(+), 140 deletions(-)
drivers/net/ethernet/intel/ixgbevf/defines.h +1 -0
@@ -183,6 +183,7 @@ typedef u32 ixgbe_link_speed;#define IXGBE_TXD_CMD_DEXT 0x20000000/* Descriptor extension (0 = legacy) */ #define IXGBE_TXD_CMD_VLE 0x40000000/* Add VLAN tag */ #define IXGBE_TXD_STAT_DD 0x00000001/* Descriptor Done */ +#define IXGBE_TXD_CMD (IXGBE_TXD_CMD_EOP | IXGBE_TXD_CMD_RS)/* Transmit Descriptor - Advanced */ union ixgbe_adv_tx_desc {
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +132 -140
331 lines not on this page · raw message
Signature · 1 line
1.8.5.GIT
David Miller
maintainerFrom: Aaron Brown <[email protected]>
Date: Fri, 17 Jan 2014 18:29:58 -0800
Quoted 17 lines
This series contains updates from Emil to ixgbevf.
He cleans up the code by removing the adapter structure as a parameter from multiple functions in favor of using the
ixgbevf_ringstructure and moves hot-path specific statistic int the ring structure for anticipated performance gains.He also removes the Tx/Rx counters for checksum offload and adds counters for
tx_restart_queueandtx_timeout_count.Next he makes it so that the first
tx_bufferstructure acts as a central storage location for most the skb info we are about to transmit, then takes advantage of the dma buffer always being present in the first descriptor and mapped as single allowing a call todma_unmap_singlewhich alleviates the need to check for DMA mapping inixgbevf_clean_tx_irq().
Quoted 2 lines
Finally he merges the
ixgbevf_tx_mapcall and theixgbevf_tx_queuecall into a single function.
Series applied, thanks.