diff options
Diffstat (limited to 'drivers/net/ethernet/pensando/ionic/ionic_main.c')
| -rw-r--r-- | drivers/net/ethernet/pensando/ionic/ionic_main.c | 29 | 
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index a13530ec4dd8..08c42b039d92 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -289,6 +289,35 @@ static void ionic_adminq_cb(struct ionic_queue *q,  	complete_all(&ctx->work);  } +bool ionic_adminq_poke_doorbell(struct ionic_queue *q) +{ +	struct ionic_lif *lif = q->lif; +	unsigned long now, then, dif; +	unsigned long irqflags; + +	spin_lock_irqsave(&lif->adminq_lock, irqflags); + +	if (q->tail_idx == q->head_idx) { +		spin_unlock_irqrestore(&lif->adminq_lock, irqflags); +		return false; +	} + +	now = READ_ONCE(jiffies); +	then = q->dbell_jiffies; +	dif = now - then; + +	if (dif > q->dbell_deadline) { +		ionic_dbell_ring(q->lif->kern_dbpage, q->hw_type, +				 q->dbval | q->head_idx); + +		q->dbell_jiffies = now; +	} + +	spin_unlock_irqrestore(&lif->adminq_lock, irqflags); + +	return true; +} +  int ionic_adminq_post(struct ionic_lif *lif, struct ionic_admin_ctx *ctx)  {  	struct ionic_desc_info *desc_info;  |