diff options
Diffstat (limited to 'v3po/v3po2vpp')
-rw-r--r-- | v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VhostUserCustomizer.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VhostUserCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VhostUserCustomizer.java index dc8fade2b..152e6d1c0 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VhostUserCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VhostUserCustomizer.java @@ -85,9 +85,13 @@ public class VhostUserCustomizer extends AbstractInterfaceTypeCustomizer<VhostUs CreateVhostUserIf request = new CreateVhostUserIf(); request.isServer = booleanToByte(VhostUserRole.Server.equals(vhostUser.getRole())); request.sockFilename = vhostUser.getSocket().getBytes(); - // TODO HONEYCOMB-177 expose device instance attribute just like for TAP - request.renumber = 0; - request.customDevInstance = 0; + final Long deviceInstance = vhostUser.getDeviceInstance(); + if (deviceInstance == null) { + request.renumber = 0; + } else { + request.renumber = 1; + request.customDevInstance = Math.toIntExact(deviceInstance); + } request.useCustomMac = 0; request.macAddress = new byte[]{}; return request; @@ -120,9 +124,13 @@ public class VhostUserCustomizer extends AbstractInterfaceTypeCustomizer<VhostUs ModifyVhostUserIf request = new ModifyVhostUserIf(); request.isServer = booleanToByte(VhostUserRole.Server.equals(vhostUser.getRole())); request.sockFilename = vhostUser.getSocket().getBytes(); - // TODO HONEYCOMB-177 - request.renumber = 0; - request.customDevInstance = 0; + final Long deviceInstance = vhostUser.getDeviceInstance(); + if (deviceInstance == null) { + request.renumber = 0; + } else { + request.renumber = 1; + request.customDevInstance = Math.toIntExact(deviceInstance); + } request.swIfIndex = swIfIndex; return request; } |