[dpdk-dev] [PATCH] igb/ixgbe: fix index overflow when resetting 4096 queue rings

Ivan Boule ivan.boule at 6wind.com
Fri Nov 15 14:26:56 CET 2013


On 11/15/2013 02:19 PM, Thomas Monjalon wrote:
> Rings are resetted with a loop because memset cannot be used without
> issuing a warning about volatile casting.
> The index of the loop was a 16-bit variable which is is sufficient for
> ring entries number but not for the byte size of the whole ring.
> The overflow happens when rings are configured for 4096 entries
> (descriptor size is 16 bytes). The result is an endless loop.
>
> It is fixed by indexing ring entries and resetting all bytes of the entry
> with a simple assignment.
> The descriptor initializer is zeroed thanks to its static declaration.
>
> Signed-off-by: Thomas Monjalon <thomas.monjalon at 6wind.com>
> ---
>   lib/librte_pmd_e1000/igb_rxtx.c   |   14 ++++++--------
>   lib/librte_pmd_ixgbe/ixgbe_rxtx.c |   10 ++++++----
>   2 files changed, 12 insertions(+), 12 deletions(-)
>
>
Acked-by: Ivan Boule <ivan.boule at 6wind.com>

-- 
Ivan Boule
6WIND Development Engineer



More information about the dev mailing list