gve: Refactor gve_open and gve_close
authorShailend Chand <shailend@google.com>
Mon, 22 Jan 2024 18:26:30 +0000 (18:26 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 24 Jan 2024 01:41:31 +0000 (17:41 -0800)
commit92a6d7a4010c3e84894f4fb7f481e648f0b12e53
treedb9ebfaaddd3e09db4ca4154610fb56564ba3046
parentf13697cc7a19225307d85b0a77ef1c15abe95a7d
gve: Refactor gve_open and gve_close

gve_open is rewritten to be composed of two funcs: gve_queues_mem_alloc
and gve_queues_start. The former only allocates queue resources without
doing anything to install the queues, which is taken up by the latter.
Similarly gve_close is split into gve_queues_stop and
gve_queues_mem_free.

Separating the acts of queue resource allocation and making the queue
become live help with subsequent changes that aim to not take down the
datapath when applying new configurations.

Signed-off-by: Shailend Chand <shailend@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Jeroen de Borst <jeroendb@google.com>
Link: https://lore.kernel.org/r/20240122182632.1102721-5-shailend@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/google/gve/gve_main.c