[PATCH 1/1] net/mana: add 32 bit short doorbell

Wei Hu weh at microsoft.com
Wed Sep 20 10:10:46 CEST 2023



> -----Original Message-----
> From: Long Li <longli at microsoft.com>
> Sent: Wednesday, September 20, 2023 3:24 AM
> To: Wei Hu <weh at microsoft.com>; dev at dpdk.org
> Cc: stable at dpdk.org; Ferruh Yigit <ferruh.yigit at amd.com>; Luca Boccassi
> <bluca at debian.org>; Kevin Traynor <ktraynor at redhat.com>
> Subject: RE: [PATCH 1/1] net/mana: add 32 bit short doorbell
> 
> > > > +#ifdef RTE_ARCH_32
> > > > +	uint16_t cqe_incr =
> > > > +(uint16_t)rxq->gdma_cq.head_incr_to_short_db;
> > >
> > > How do you make sure head_incr_to_short_db doesn't overflow?
> > >
> >
> > I have checked this with hardware team. In my opinion it would be
> > easily overflown.
> > The hw team seems suggesting the hw will take care of this.
> >
> > Thanks,
> > Wei
> 
> I'm not sure how HW can take care of this when it overflows. When it
> happens, the HW will miss a doorbell and CQ queue will get full. And
> eventually you'll lose completions for TX/RX.
> 
> In mana_alloc_and_post_rx_wqes() and mana_rx_burst(), the code has check
> for RX/TX_WQE_SHORT_DB_THRESHOLD to make sure tail_incr doesn't
> overflow when ringing the doorbell.
> 
> In gdma_poll_completion_queue(), you need to have a similar mechanism to
> not overflow tail_incr  when ringing the doorbell.
> 
I am not sure what can be done here. Applications could run in poll mode without
need to ring cq doorbell, or it could take very long time before it change the interrupt
state. What we can do when cq->head_incr_to_short_db reaches 0xffff in 
gdma_poll_completion_queue()?

If it breaks out the loop and return, the next time it enters it may still  at0xffff
because it has not rung doorbell the have it reset yet.

If  just resetting the value to 0 and let it keep going in the loop, it is no difference than
casting it to 16 bit unsigned int, which would be done in 
mana_arm_cq() if it is eventually called.

Anyway, ringing cq doorbell has not been tested as the driver doesn't support interrupts.

Wei


More information about the stable mailing list