netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/6] gve: Alloc before freeing when changing config
@ 2024-01-22 18:26 Shailend Chand
  2024-01-22 18:26 ` [PATCH net-next 1/6] gve: Define config structs for queue allocation Shailend Chand
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Shailend Chand @ 2024-01-22 18:26 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, Shailend Chand

Functions allocating resources did so directly into priv thus far. The
assumption doing that was that priv was not already holding references
to live resources.

When ring configuration is changed in any way from userspace, thus far
we relied on calling the ndo_stop and ndo_open callbacks in succession.
This meant that we teardown existing resources and rob the OS of
networking before we have successfully allocated resources for the new
config.

Correcting this requires us to perform allocations without editing priv.
That is what the "gve: Switch to config-aware..." patch does: it modifies
all the allocation paths so that they take a new configuration as input
and return references to newly allocated resources without modifying
priv or interfering with live resources in any way.

Having corrected the allocation paths so, the ndo open and close
callbacks are refactored to make available distinct functions for
allocating queue resources and starting or stopping them. This is then
put to use in the set_channels and set_features hooks in the last two
patches.

These changes have been tested by verifying the integrity of a stream of
integers while the driver is continuously reconfigured with ethtool.

Shailend Chand (6):
  gve: Define config structs for queue allocation
  gve: Refactor napi add and remove functions
  gve: Switch to config-aware queue allocation
  gve: Refactor gve_open and gve_close
  gve: Alloc before freeing when adjusting queues
  gve: Alloc before freeing when changing features

 drivers/net/ethernet/google/gve/gve.h        | 144 +++-
 drivers/net/ethernet/google/gve/gve_dqo.h    |  18 +-
 drivers/net/ethernet/google/gve/gve_main.c   | 854 ++++++++++++-------
 drivers/net/ethernet/google/gve/gve_rx.c     | 116 ++-
 drivers/net/ethernet/google/gve/gve_rx_dqo.c |  91 +-
 drivers/net/ethernet/google/gve/gve_tx.c     | 128 ++-
 drivers/net/ethernet/google/gve/gve_tx_dqo.c | 108 ++-
 drivers/net/ethernet/google/gve/gve_utils.c  |  31 +
 drivers/net/ethernet/google/gve/gve_utils.h  |   5 +
 9 files changed, 999 insertions(+), 496 deletions(-)

-- 
2.43.0.429.g432eaa2c6b-goog


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-01-24  1:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-22 18:26 [PATCH net-next 0/6] gve: Alloc before freeing when changing config Shailend Chand
2024-01-22 18:26 ` [PATCH net-next 1/6] gve: Define config structs for queue allocation Shailend Chand
2024-01-23 16:26   ` Simon Horman
2024-01-22 18:26 ` [PATCH net-next 2/6] gve: Refactor napi add and remove functions Shailend Chand
2024-01-23 16:26   ` Simon Horman
2024-01-22 18:26 ` [PATCH net-next 3/6] gve: Switch to config-aware queue allocation Shailend Chand
2024-01-23 16:27   ` Simon Horman
2024-01-22 18:26 ` [PATCH net-next 4/6] gve: Refactor gve_open and gve_close Shailend Chand
2024-01-22 18:26 ` [PATCH net-next 5/6] gve: Alloc before freeing when adjusting queues Shailend Chand
2024-01-22 18:26 ` [PATCH net-next 6/6] gve: Alloc before freeing when changing features Shailend Chand
2024-01-24  1:50 ` [PATCH net-next 0/6] gve: Alloc before freeing when changing config patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).