Skip to contentSkip to conversation

tx path circular buffer

DISCUSSION Tobin C. Harding 2 participants 3 messages Jun 7, 2017 – Jun 8, 2017

lore
Share & tools
lore
#0 lore raw

Hi,

I am attempting to implement a circular buffer for the tx path of a networking driver. From my understanding this is something that is very common, yet I am struggling to find a clear way to do it.

I have tried to read the source for ath6kl, brcmfmac without success.

I have read Documentation/circular-buffers.txt and this seems like the solution however grep'ing drivers/net hints that this is not that common a way to solve this problem. Also I'm getting in knots with atomic_t types when copying the text document.

Before I bore you with all my non-working code, does any one please know, off the top of their heads, a driver with simple-ish / nice clean implementation that I can learn from?

thanks,
Tobin.

#1 lore raw
Quoted 5 lines · Tobin C. Harding

Hi,

I am attempting to implement a circular buffer for the tx path of a networking driver. From my understanding this is something that is very common, yet I am struggling to find a clear way to do it.

Have you looked at include/linux/kfifo.h?

#2 lore raw
Quoted 8 lines · Greg KH
Quoted 5 lines · Tobin C. Harding

Hi,

I am attempting to implement a circular buffer for the tx path of a networking driver. From my understanding this is something that is very common, yet I am struggling to find a clear way to do it.

Have you looked at include/linux/kfifo.h?

thanks Greg, I ended up using kfifo for the tx path and circ_buf for the rx path.

Tobin.