diff options
| author | Shannon Nelson <shannon.nelson@amd.com> | 2024-03-06 15:29:49 -0800 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2024-03-08 11:54:34 +0000 |
| commit | ae24a8f88b3fc8ef463e8dffd41ebba48c81cfd4 (patch) | |
| tree | 052f9c57022af950f10d4d5283c72535385105cb /drivers/net/ethernet/pensando/ionic/ionic_dev.h | |
| parent | 05c9447395e52ba87a66e25031025ef0a5095317 (diff) | |
| download | lwn-ae24a8f88b3fc8ef463e8dffd41ebba48c81cfd4.tar.gz lwn-ae24a8f88b3fc8ef463e8dffd41ebba48c81cfd4.zip | |
ionic: remove callback pointer from desc_info
By reworking the queue service routines to have their own
servicing loops we can remove the cb pointer from desc_info
to save another 8 bytes per descriptor,
This simplifies some of the queue handling indirection and makes
the code a little easier to follow, and keeps service code in
one place rather than jumping between code files.
struct ionic_desc_info
Before: /* size: 472, cachelines: 8, members: 7 */
After: /* size: 464, cachelines: 8, members: 6 */
Suggested-by: Neel Patel <npatel2@amd.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/pensando/ionic/ionic_dev.h')
| -rw-r--r-- | drivers/net/ethernet/pensando/ionic/ionic_dev.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h index c70576be3714..2096aae1ef71 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h @@ -189,10 +189,6 @@ struct ionic_queue; struct ionic_qcq; struct ionic_desc_info; -typedef void (*ionic_desc_cb)(struct ionic_queue *q, - struct ionic_desc_info *desc_info, - struct ionic_cq_info *cq_info, void *cb_arg); - #define IONIC_MAX_BUF_LEN ((u16)-1) #define IONIC_PAGE_SIZE PAGE_SIZE #define IONIC_PAGE_SPLIT_SZ (PAGE_SIZE / 2) @@ -216,8 +212,7 @@ struct ionic_buf_info { struct ionic_desc_info { unsigned int bytes; unsigned int nbufs; - ionic_desc_cb cb; - void *cb_arg; + void *arg; struct xdp_frame *xdpf; enum xdp_action act; struct ionic_buf_info bufs[MAX_SKB_FRAGS + 1]; @@ -381,10 +376,9 @@ int ionic_q_init(struct ionic_lif *lif, struct ionic_dev *idev, struct ionic_queue *q, unsigned int index, const char *name, unsigned int num_descs, size_t desc_size, size_t sg_desc_size, unsigned int pid); -void ionic_q_post(struct ionic_queue *q, bool ring_doorbell, ionic_desc_cb cb, - void *cb_arg); -void ionic_q_service(struct ionic_queue *q, struct ionic_cq_info *cq_info, - unsigned int stop_index); +void ionic_q_post(struct ionic_queue *q, bool ring_doorbell, void *arg); +bool ionic_q_is_posted(struct ionic_queue *q, unsigned int pos); + int ionic_heartbeat_check(struct ionic *ionic); bool ionic_is_fw_running(struct ionic_dev *idev); |
