summaryrefslogtreecommitdiffstats
path: root/vpp-classifier/impl/src/main/java
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-10-16 07:38:22 +0200
committerMarek Gradzki <mgradzki@cisco.com>2017-10-16 07:46:57 +0200
commit29b385dfc94a27ac31918b66411568036c4a6ddb (patch)
tree45920e3038c0e40320a69235f0d2c725f51f1c66 /vpp-classifier/impl/src/main/java
parentde2390b07e0ba53a21a7d25f9f6455a8b6b33eac (diff)
HC2VPP-246: adapt Policer Writer to policer_add_del byte order changes
Endianness of policer_add_del parameters was changed to network order: https://gerrit.fd.io/r/#/c/8548 JVPP flips ordering, so there is no need for additional convertion anymore. Change-Id: Ib7c5fafe240e0607819800c4cf4d37f4c4a8e1c6 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'vpp-classifier/impl/src/main/java')
-rw-r--r--vpp-classifier/impl/src/main/java/io/fd/hc2vpp/policer/write/PolicerCustomizer.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/policer/write/PolicerCustomizer.java b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/policer/write/PolicerCustomizer.java
index 69eff100a..17718a418 100644
--- a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/policer/write/PolicerCustomizer.java
+++ b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/policer/write/PolicerCustomizer.java
@@ -89,19 +89,17 @@ public class PolicerCustomizer extends FutureJVppCustomizer implements ListWrite
request.isAdd = booleanToByte(isAdd);
request.name = policer.getName().getBytes(StandardCharsets.US_ASCII);
- // policer_add_del expects host order unlike most of the other VPP APIs
- // jvpp by default converts ordering to network order, so we need additional reverse
if (policer.getCir() != null) {
- request.cir = Integer.reverseBytes(policer.getCir().intValue());
+ request.cir = policer.getCir().intValue();
}
if (policer.getEir() != null) {
- request.eir = Integer.reverseBytes(policer.getEir().intValue());
+ request.eir = policer.getEir().intValue();
}
if (policer.getCb() != null) {
- request.cb = Long.reverseBytes(policer.getCb().longValue());
+ request.cb = policer.getCb().longValue();
}
if (policer.getEb() != null) {
- request.eb = Long.reverseBytes(policer.getEb().longValue());
+ request.eb = policer.getEb().longValue();
}
if (policer.getRateType() != null) {
request.rateType = (byte) policer.getRateType().getIntValue();