The kernel rejects fanout configurations in which both the rollover
mode and the rollover flag are set. Because the PMD always set the
flag, the mode never worked.

Fixes: d3bc77ab05a4 ("net/af_packet: allow changing fanout mode")
Cc: [email protected]
Cc: [email protected]

Signed-off-by: Frank Dressler <[email protected]>
---
 drivers/net/af_packet/rte_eth_af_packet.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/af_packet/rte_eth_af_packet.c 
b/drivers/net/af_packet/rte_eth_af_packet.c
index ef57719803..870536a8b2 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -844,6 +844,8 @@ get_fanout_mode(const char *fanout_mode)
        } else if (!strcmp(fanout_mode, "cpu")) {
                load_balance |= PACKET_FANOUT_CPU;
        } else if (!strcmp(fanout_mode, "rollover")) {
+               /* setting both is rejected by kernel */
+               load_balance &= ~PACKET_FANOUT_FLAG_ROLLOVER;
                load_balance |= PACKET_FANOUT_ROLLOVER;
        } else if (!strcmp(fanout_mode, "rnd")) {
                load_balance |= PACKET_FANOUT_RND;
-- 
2.56.0

Reply via email to