nfp: flower: split and limit cmsg skb lists
authorPieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Wed, 11 Apr 2018 23:47:38 +0000 (16:47 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Apr 2018 01:57:28 +0000 (21:57 -0400)
commitcf2cbadc20f5651c3dde9f5ac2ee52fb43aa4ddd
tree8f69b5a96ae8d2dfeb2dcbcb02d2a95df516053d
parent0b1a989ef5a751b5992842d1934e22de861a848e
nfp: flower: split and limit cmsg skb lists

Introduce a second skb list for handling control messages and limit the
number of allowed messages. Some control messages are considered more
crucial than others, resulting in the need for a second skb list. By
splitting the list into a separate high and low priority list we can
ensure that messages on the high list get added to the head of the list
that gets processed, this however has no functional impact. Previously
there was no limit on the number of messages allowed on the queue, this
could result in the queue growing boundlessly and eventually the host
running out of memory.

Fixes: b985f870a5f0 ("nfp: process control messages in workqueue in flower app")
Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/flower/cmsg.c
drivers/net/ethernet/netronome/nfp/flower/cmsg.h
drivers/net/ethernet/netronome/nfp/flower/main.c
drivers/net/ethernet/netronome/nfp/flower/main.h