[PATCH] Re allocate the RX DMA buffer to avoid skb conflict Handle all RX packets in the DMA ring buffer

YanBo dreamfly281 at gmail.com
Tue May 28 01:24:03 EDT 2013


On Tue, May 28, 2013 at 2:15 AM, Eugene Krasnikov <k.eugene.e at gmail.com> wrote:
> Could you please resend this patch in proper format using git send-email?

This patch is already sent via git send-email, please point out what
error it include then I can correct it  :)

>
>>> +       skb = alloc_skb(WCN36XX_PKT_SIZE, GFP_ATOMIC);
>>> +        if (skb == NULL) {
>>> +               return -ENOMEM;
>
> DXE is rather complicated thing. Could you please add more comments
> why do we need to allocate RX buffer after each received packet? Is
> not that a bit excessive to allocated new buffer on data path? Can we
> just preallocate buffers? Do we need to use GFP_ATOMIC?

The RX skb buffer will be handler by upper layer, but it should be
unmap from the DMA chain,
orelse, there may be some race between CPU and lower hardware
especially when there is heavy RX load in the hardware.


The GFP_ATOMIC is need cause normally the rx skb reallocation is be
done on interrupt context, although currently it is
implemented on the work queue but is not very correctly, both the
interrupt register and skb unmap/refill should be implemented
in the interrupt  context as quickly as possible to avoid the hardware
DMA engine reuse the skb or stuck due to some register no be cleared.
I'll submit another patch to move them to interrupt context instead of
in bottom half.

>
>>> +H2H_TEST_RX_TX = DMA2
>
> Do we need this? it is not used anywhere.
>

It is a DMA channel used for loop test, which will loop the tx data to
the rx channel, not used currently, should be OK if we has no plan
to use this feature to do some test.

>>> +#define WCN36XX_DXE_CTRL_VALID_MASK (0x00000001)
>
> what is the purpose to have just number in brackets?
>
>>> +#define WCN36XX_DXE_REG_CSR_RESET              WCN36XX_DXE_MEM_REG + 0x00
>
> suggest to have something like this: (WCN36XX_DXE_MEM_REG + 0x00)
>
Agree with your point, The brackets issue will be fix in the pull
request patch

BR /Yanbo



More information about the wcn36xx mailing list