]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/ixgbe/ixgbe.h
ixgbe: combine some stats into a union to allow for Tx/Rx stats overlap
[net-next-2.6.git] / drivers / net / ixgbe / ixgbe.h
index ed8703cfffb7ec06ede55d5dce2ff02324d47bd6..3c63ee6be2eecf518951d904f10c96f0044084f6 100644 (file)
 #define IXGBE_MIN_RXD                       64
 
 /* flow control */
-#define IXGBE_DEFAULT_FCRTL            0x10000
 #define IXGBE_MIN_FCRTL                           0x40
 #define IXGBE_MAX_FCRTL                        0x7FF80
-#define IXGBE_DEFAULT_FCRTH            0x20000
 #define IXGBE_MIN_FCRTH                          0x600
 #define IXGBE_MAX_FCRTH                        0x7FFF0
 #define IXGBE_DEFAULT_FCPAUSE           0xFFFF
@@ -130,7 +128,9 @@ struct ixgbe_tx_buffer {
        unsigned long time_stamp;
        u16 length;
        u16 next_to_watch;
-       u16 mapped_as_page;
+       unsigned int bytecount;
+       u16 gso_segs;
+       u8 mapped_as_page;
 };
 
 struct ixgbe_rx_buffer {
@@ -146,8 +146,22 @@ struct ixgbe_queue_stats {
        u64 bytes;
 };
 
+struct ixgbe_tx_queue_stats {
+       u64 restart_queue;
+       u64 tx_busy;
+};
+
+struct ixgbe_rx_queue_stats {
+       u64 rsc_count;
+       u64 rsc_flush;
+       u64 non_eop_descs;
+       u64 alloc_rx_page_failed;
+       u64 alloc_rx_buff_failed;
+};
+
 struct ixgbe_ring {
        void *desc;                     /* descriptor ring memory */
+       struct device *dev;             /* device for DMA mapping */
        union {
                struct ixgbe_tx_buffer *tx_buffer_info;
                struct ixgbe_rx_buffer *rx_buffer_info;
@@ -163,8 +177,7 @@ struct ixgbe_ring {
 
 #define IXGBE_RING_RX_PS_ENABLED                (u8)(1)
        u8 flags;                       /* per ring feature flags */
-       u16 head;
-       u16 tail;
+       u8 __iomem *tail;
 
        unsigned int total_bytes;
        unsigned int total_packets;
@@ -183,15 +196,15 @@ struct ixgbe_ring {
 
        struct ixgbe_queue_stats stats;
        struct u64_stats_sync syncp;
-       int numa_node;
+       union {
+               struct ixgbe_tx_queue_stats tx_stats;
+               struct ixgbe_rx_queue_stats rx_stats;
+       };
        unsigned long reinit_state;
-       u64 rsc_count;                  /* stat for coalesced packets */
-       u64 rsc_flush;                  /* stats for flushed packets */
-       u32 restart_queue;              /* track tx queue restarts */
-       u32 non_eop_descs;              /* track hardware descriptor chaining */
-
+       int numa_node;
        unsigned int size;              /* length in bytes */
        dma_addr_t dma;                 /* phys. address of descriptor ring */
+       struct rcu_head rcu;
 } ____cacheline_internodealigned_in_smp;
 
 enum ixgbe_ring_f_enum {
@@ -454,10 +467,10 @@ extern void ixgbe_down(struct ixgbe_adapter *adapter);
 extern void ixgbe_reinit_locked(struct ixgbe_adapter *adapter);
 extern void ixgbe_reset(struct ixgbe_adapter *adapter);
 extern void ixgbe_set_ethtool_ops(struct net_device *netdev);
-extern int ixgbe_setup_rx_resources(struct ixgbe_adapter *, struct ixgbe_ring *);
-extern int ixgbe_setup_tx_resources(struct ixgbe_adapter *, struct ixgbe_ring *);
-extern void ixgbe_free_rx_resources(struct ixgbe_adapter *, struct ixgbe_ring *);
-extern void ixgbe_free_tx_resources(struct ixgbe_adapter *, struct ixgbe_ring *);
+extern int ixgbe_setup_rx_resources(struct ixgbe_ring *);
+extern int ixgbe_setup_tx_resources(struct ixgbe_ring *);
+extern void ixgbe_free_rx_resources(struct ixgbe_ring *);
+extern void ixgbe_free_tx_resources(struct ixgbe_ring *);
 extern void ixgbe_configure_rx_ring(struct ixgbe_adapter *,struct ixgbe_ring *);
 extern void ixgbe_configure_tx_ring(struct ixgbe_adapter *,struct ixgbe_ring *);
 extern void ixgbe_update_stats(struct ixgbe_adapter *adapter);
@@ -467,11 +480,11 @@ extern netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *,
                                         struct net_device *,
                                         struct ixgbe_adapter *,
                                         struct ixgbe_ring *);
-extern void ixgbe_unmap_and_free_tx_resource(struct ixgbe_adapter *,
+extern void ixgbe_unmap_and_free_tx_resource(struct ixgbe_ring *,
                                              struct ixgbe_tx_buffer *);
 extern void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter,
                                    struct ixgbe_ring *rx_ring,
-                                   int cleaned_count);
+                                  u16 cleaned_count);
 extern void ixgbe_write_eitr(struct ixgbe_q_vector *);
 extern int ethtool_ioctl(struct ifreq *ifr);
 extern s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw);