On 16/6/26 00:18, Josh Hilke wrote:
Add VMState representation for the Transmit Rate Limiter (TRL) state to
support migration. This includes the TRL timers and target rates per
queue.

Signed-off-by: Josh Hilke <[email protected]>
---
  hw/net/igb.c | 43 +++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 43 insertions(+)

diff --git a/hw/net/igb.c b/hw/net/igb.c
index c076807..04c48f1 100644
--- a/hw/net/igb.c
+++ b/hw/net/igb.c
@@ -563,6 +563,45 @@ static const VMStateDescription igb_vmstate_intr_timer = {
      VMSTATE_STRUCT_ARRAY(_f, _s, _num, 0,                           \
                           igb_vmstate_intr_timer, IGBIntrDelayTimer)
+static bool igb_trl_needed(void *opaque)
+{
+    IGBState *s = opaque;
+
+    for (int i = 0; i < IGB_NUM_QUEUES; i++) {
+        if (igb_trl_enabled(s->core.trl[i].trlrc)) {

Using 'bool igb_trl_enabled(const IGBTrlQueue *q)' in previous patch:

           if (igb_trl_enabled(&s->core.trl[i])) {

+            return true;
+        }
+    }
+
+    return false;
+}

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>


Reply via email to