From 4f73fac78aa8773477d0ff570be9340a492736d0 Mon Sep 17 00:00:00 2001 From: Carmelo Cascone Date: Tue, 19 Mar 2019 15:57:59 -0700 Subject: [PATCH] Use max_group_size 1 for INDIRECT groups Change-Id: I8db03a88af06b373d615e05c4b01e47579df2398 --- .../net/pi/impl/PiGroupTranslatorImpl.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/net/src/main/java/org/onosproject/net/pi/impl/PiGroupTranslatorImpl.java b/core/net/src/main/java/org/onosproject/net/pi/impl/PiGroupTranslatorImpl.java index 53028565f8..6e7e2d7669 100644 --- a/core/net/src/main/java/org/onosproject/net/pi/impl/PiGroupTranslatorImpl.java +++ b/core/net/src/main/java/org/onosproject/net/pi/impl/PiGroupTranslatorImpl.java @@ -102,13 +102,16 @@ final class PiGroupTranslatorImpl { actionProfileId, actionProfileModel.maxGroupSize())); } + // If not INDIRECT, we set the maximum group size as specified in the + // model, however this might be highly inefficient for some HW targets + // which pre-allocate resources for the whole group. + final int maxGroupSize = group.type() == GroupDescription.Type.INDIRECT + ? 1 : group.buckets().buckets().size(); + final PiActionProfileGroup.Builder piActionGroupBuilder = PiActionProfileGroup.builder() .withId(PiActionProfileGroupId.of(group.id().id())) .withActionProfileId(groupKey.actionProfileId()) - // We set the maximum group size as specified in the model, - // however this might be highly inefficient for some HW targets - // which pre-allocate resources for the whole group. - .withMaxSize(actionProfileModel.maxGroupSize()); + .withMaxSize(maxGroupSize); // Translate group buckets to PI group members final PiPipelineInterpreter interpreter = getInterpreterOrNull(device, pipeconf);