OSDN Git Service

ionic: change the descriptor ring length without full reset
authorShannon Nelson <snelson@pensando.io>
Thu, 27 Aug 2020 23:00:28 +0000 (16:00 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Aug 2020 15:01:30 +0000 (08:01 -0700)
commita34e25ab977ced1c3366fc69c0595bb3fde63fad
tree791eff1b9f42b1645ed3ddabed931aed76a4daa8
parentf053e1f8709819fdc3cdc03803ad137bade9a7d6
ionic: change the descriptor ring length without full reset

The original way of changing ring length was to completely
tear down the lif's queue structure and then rebuild it, while
running the risk of allocations that might fail in the middle
and leave us with a broken driver.

Instead, we can set up all the new queue and descriptor
allocations first, then swap them out and delete the old
allocations.  If the new allocations fail, we report the error,
stay with the old setup and continue running.  This gives us
a safer path, and a smaller window of time where we're not
processing traffic.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
drivers/net/ethernet/pensando/ionic/ionic_lif.c
drivers/net/ethernet/pensando/ionic/ionic_lif.h