lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] LWIP/WIN32 UDP performance (throughtput)


From: Stephane Lesage
Subject: Re: [lwip-users] LWIP/WIN32 UDP performance (throughtput)
Date: Thu, 16 Feb 2012 17:35:22 +0100

> But then struct pbuf is still only 16 bytes long, so payload might
> start in the middle of a 32-byte border, which leads to faults when
> flushing cache (since the struct pbuf members are still used cached) or
> am I wrong there?

I don't have the problem, because:
1. I don't need to align my payload. I just need to ensure that a cache line 
cannot contain payload of pbuf N and struct of pbuf N+1.
I do this by setting (PBUF_POOL_BUFSIZE + sizeof(struct pbuf)) = multiple of 
cache line size

2. on RX, the pbuf is owned by the driver so I can safely flush the cache to 
get the payload, because I know the stack will not modify a value in the struct.

> > But I agree it could be easier with something like:
> > #define PBUF_ALIGNMENT      32
> 
> That's what I imagined (only with another name maybe).

Ok, maybe we need 2 settings:
1. alignement of pbuf struct
2. alignement of pbuf payload (may lead to wasted memory)

-- 
Stéphane Lesage





reply via email to

[Prev in Thread] Current Thread [Next in Thread]