nfp: flower: refine the use of circular buffer
authorYinjun Zhang <yinjun.zhang@corigine.com>
Thu, 16 Dec 2021 01:37:01 +0000 (20:37 -0500)
committerJakub Kicinski <kuba@kernel.org>
Fri, 17 Dec 2021 04:25:56 +0000 (20:25 -0800)
commit7ffd9041de76756665df060c266891325426836f
tree68d29ace60b637f8c27fc8a04388cc3d3c180037
parent7cd2802d7496c1fc76f42dc045b48cc16d11df39
nfp: flower: refine the use of circular buffer

The current use of circular buffer to manage stats_context_id is
very obscure, and it will cause problem if its element size is
not power of two. So change the use more straightforward and
scalable, and also change that for mask_id to keep consistency.

Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/1639618621-5857-1-git-send-email-yinjun.zhang@corigine.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/netronome/nfp/flower/metadata.c