]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ionic: struct reorder for faster access
authorShannon Nelson <snelson@pensando.io>
Tue, 1 Sep 2020 18:20:20 +0000 (11:20 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Sep 2020 22:47:01 +0000 (15:47 -0700)
Move a few active struct fields to the front of the struct
for a little better cache use and performance.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_dev.h
drivers/net/ethernet/pensando/ionic/ionic_lif.h

index 9e2ac2b8a0821d2d349b33e440be2e0fadd21574..0641ca2e1780fa7c86c5a057d051879bb60785f7 100644 (file)
@@ -199,16 +199,17 @@ struct ionic_desc_info {
 
 struct ionic_queue {
        struct device *dev;
-       u64 dbell_count;
-       u64 drop;
-       u64 stop;
-       u64 wake;
        struct ionic_lif *lif;
        struct ionic_desc_info *info;
-       struct ionic_dev *idev;
        u16 head_idx;
        u16 tail_idx;
        unsigned int index;
+       unsigned int num_descs;
+       u64 dbell_count;
+       u64 stop;
+       u64 wake;
+       u64 drop;
+       struct ionic_dev *idev;
        unsigned int type;
        unsigned int hw_index;
        unsigned int hw_type;
@@ -226,7 +227,6 @@ struct ionic_queue {
        };
        dma_addr_t base_pa;
        dma_addr_t sg_base_pa;
-       unsigned int num_descs;
        unsigned int desc_size;
        unsigned int sg_desc_size;
        unsigned int pid;
@@ -246,8 +246,6 @@ struct ionic_intr_info {
 };
 
 struct ionic_cq {
-       void *base;
-       dma_addr_t base_pa;
        struct ionic_lif *lif;
        struct ionic_cq_info *info;
        struct ionic_queue *bound_q;
@@ -255,8 +253,10 @@ struct ionic_cq {
        u16 tail_idx;
        bool done_color;
        unsigned int num_descs;
-       u64 compl_count;
        unsigned int desc_size;
+       u64 compl_count;
+       void *base;
+       dma_addr_t base_pa;
 };
 
 struct ionic;
index e1e6ff1a09187c41ec9655ae6482740b6ea70f48..11ea9e0c6a4a55d17a20c91bea027042dcfb941e 100644 (file)
 #define IONIC_TX_BUDGET_DEFAULT                256
 
 struct ionic_tx_stats {
-       u64 dma_map_err;
        u64 pkts;
        u64 bytes;
-       u64 clean;
-       u64 linearize;
        u64 csum_none;
        u64 csum;
-       u64 crc32_csum;
        u64 tso;
        u64 tso_bytes;
        u64 frags;
        u64 vlan_inserted;
+       u64 clean;
+       u64 linearize;
+       u64 crc32_csum;
        u64 sg_cntr[IONIC_MAX_NUM_SG_CNTR];
+       u64 dma_map_err;
 };
 
 struct ionic_rx_stats {
-       u64 dma_map_err;
-       u64 alloc_err;
        u64 pkts;
        u64 bytes;
        u64 csum_none;
        u64 csum_complete;
-       u64 csum_error;
        u64 buffers_posted;
        u64 dropped;
        u64 vlan_stripped;
+       u64 csum_error;
+       u64 dma_map_err;
+       u64 alloc_err;
 };
 
 #define IONIC_QCQ_F_INITED             BIT(0)