[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <66894e1a6b087_12869e294de@willemb.c.googlers.com.notmuch>
Date: Sat, 06 Jul 2024 10:00:58 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Jakub Kicinski <kuba@...nel.org>,
davem@...emloft.net
Cc: netdev@...r.kernel.org,
edumazet@...gle.com,
pabeni@...hat.com,
petrm@...dia.com,
przemyslaw.kitszel@...el.com,
willemdebruijn.kernel@...il.com,
ecree.xilinx@...il.com,
Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH net-next 3/5] selftests: drv-net: rss_ctx: test queue
changes vs user RSS config
Jakub Kicinski wrote:
> By default main RSS table should change to include all queues.
> When user sets a specific RSS config the driver should preserve it,
> even when queue count changes. Driver should refuse to deactivate
> queues used in the user-set RSS config.
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> +def test_rss_queue_reconfigure(cfg, main_ctx=True):
> + """Make sure queue changes can't override requested RSS config.
> +
> + By default main RSS table should change to include all queues.
> + When user sets a specific RSS config the driver should preserve it,
> + even when queue count changes. Driver should refuse to deactivate
> + queues used in the user-set RSS config.
> + """
> +
> + if not main_ctx:
> + require_ntuple(cfg)
> +
> + # Start with 4 queues, an arbitrary known number.
> + try:
> + qcnt = len(_get_rx_cnts(cfg))
> + ethtool(f"-L {cfg.ifname} combined 4")
> + defer(ethtool, f"-L {cfg.ifname} combined {qcnt}")
> + except:
> + raise KsftSkipEx("Not enough queues for the test or qstat not supported")
> +
> + if main_ctx:
> + ctx_id = 0
> + ctx_ref = ""
> + else:
> + ctx_id = ethtool_create(cfg, "-X", "context new")
> + ctx_ref = f"context {ctx_id}"
> + defer(ethtool, f"-X {cfg.ifname} {ctx_ref} delete")
> +
> + # Indirection table should be distributing to all queues.
> + data = get_rss(cfg, context=ctx_id)
> + ksft_eq(0, min(data['rss-indirection-table']))
> + ksft_eq(3, max(data['rss-indirection-table']))
> +
> + # Increase queues, indirection table should be distributing to all queues.
> + # It's unclear whether tables of additional contexts should be reset, too.
> + if main_ctx:
> + ethtool(f"-L {cfg.ifname} combined 5")
> + data = get_rss(cfg)
> + ksft_eq(0, min(data['rss-indirection-table']))
> + ksft_eq(4, max(data['rss-indirection-table']))
> + ethtool(f"-L {cfg.ifname} combined 4")
> +
> + # Configure the table explicitly
> + port = rand_port()
> + ethtool(f"-X {cfg.ifname} {ctx_ref} weight 1 0 0 1")
> + if main_ctx:
> + other_key = 'empty'
> + defer(ethtool, f"-X {cfg.ifname} default")
> + else:
> + other_key = 'noise'
> + flow = f"flow-type tcp{cfg.addr_ipver} dst-port {port} context {ctx_id}"
> + ntuple = ethtool_create(cfg, "-N", flow)
> + defer(ethtool, f"-N {cfg.ifname} delete {ntuple}")
> +
> + _send_traffic_check(cfg, port, ctx_ref, { 'target': (0, 3),
> + other_key: (1, 2) })
How come queues missing from the indir set in non-main context are not
empty (but noise)?
> +
> + # We should be able to increase queues, but table should be left untouched
> + ethtool(f"-L {cfg.ifname} combined 5")
> + data = get_rss(cfg, context=ctx_id)
> + ksft_eq({0, 3}, set(data['rss-indirection-table']))
> +
> + _send_traffic_check(cfg, port, ctx_ref, { 'target': (0, 3),
> + other_key: (1, 2, 4) })
> +
> + # Setting queue count to 3 should fail, queue 3 is used
> + try:
> + ethtool(f"-L {cfg.ifname} combined 3")
> + except CmdExitFailure:
> + pass
> + else:
> + raise Exception(f"Driver didn't prevent us from deactivating a used queue (context {ctx_id})")
> +
> +
Powered by blists - more mailing lists