Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Priyanka B
2016-06-17 23:14:09 +0530
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d6b9fed58ce47e1683652bc389ff4e3d997c39f2
d6b9fed5
1 parent
7c90b00b
[ONOS] Bandwidth issue fix
Change-Id: I72007a2e211b807906d58172d3c58b07f6613a55
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
4 deletions
protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepBandwidthObjectVer1.java
providers/bgp/topology/src/main/java/org/onosproject/provider/bgp/topology/impl/BgpTopologyProvider.java
providers/bgp/topology/src/test/java/org/onosproject/provider/bgp/topology/impl/BgpTopologyProviderTest.java
providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java
protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepBandwidthObjectVer1.java
View file @
d6b9fed
...
...
@@ -152,7 +152,16 @@ public class PcepBandwidthObjectVer1 implements PcepBandwidthObject {
throw
new
PcepParseException
(
"Failed to write bandwidth object header. Index "
+
objLenIndex
);
}
cb
.
writeInt
(
Float
.
floatToIntBits
(
iBandwidth
));
//Convert to bytes per second
float
bwBytes
=
iBandwidth
/
8.0f
;
//Bytes/sec to IEEE floating format
int
bandwidth
=
Float
.
floatToIntBits
(
bwBytes
);
cb
.
writeByte
(
bandwidth
>>>
24
);
cb
.
writeByte
(
bandwidth
>>
16
&
0xff
);
cb
.
writeByte
(
bandwidth
>>
8
&
0xff
);
cb
.
writeByte
(
bandwidth
&
0xff
);
short
hLength
=
(
short
)
(
cb
.
writerIndex
()
-
objStartIndex
);
cb
.
setShort
(
objLenIndex
,
hLength
);
//will be helpful during print().
...
...
providers/bgp/topology/src/main/java/org/onosproject/provider/bgp/topology/impl/BgpTopologyProvider.java
View file @
d6b9fed
...
...
@@ -492,6 +492,8 @@ public class BgpTopologyProvider extends AbstractProvider implements DeviceProvi
switch
(
tlv
.
getType
())
{
case
LinkStateAttributes
.
ATTR_LINK_MAX_RES_BANDWIDTH
:
maxReservableBw
=
((
BgpLinkAttrMaxLinkBandwidth
)
tlv
).
linkAttrMaxLinkBandwidth
();
//will get in bytes/second , convert to MBPS to store in network config service
maxReservableBw
=
maxReservableBw
*
8
/
1000000
;
break
;
default
:
// do nothing
}
...
...
providers/bgp/topology/src/test/java/org/onosproject/provider/bgp/topology/impl/BgpTopologyProviderTest.java
View file @
d6b9fed
...
...
@@ -1005,7 +1005,8 @@ public class BgpTopologyProviderTest {
linkStateAttr
.
add
(
tlv
);
tlv
=
BgpLinkAttrTeDefaultMetric
.
of
(
20
);
linkStateAttr
.
add
(
tlv
);
tlv
=
BgpLinkAttrMaxLinkBandwidth
.
of
(
70
,
LinkStateAttributes
.
ATTR_LINK_MAX_RES_BANDWIDTH
);
tlv
=
BgpLinkAttrMaxLinkBandwidth
.
of
((
float
)
8.75
*
1_000_000L
,
LinkStateAttributes
.
ATTR_LINK_MAX_RES_BANDWIDTH
);
linkStateAttr
.
add
(
tlv
);
linkPathAttributes
.
add
(
new
LinkStateAttributes
(
linkStateAttr
));
details
.
setPathAttribute
(
linkPathAttributes
);
...
...
providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java
View file @
d6b9fed
...
...
@@ -1010,9 +1010,9 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
//build ERO object
PcepEroObject
eroobj
=
pc
.
factory
().
buildEroObject
().
setSubObjects
(
llSubObjects
).
build
();
in
t
iBandwidth
=
DEFAULT_BANDWIDTH_VALUE
;
floa
t
iBandwidth
=
DEFAULT_BANDWIDTH_VALUE
;
if
(
tunnel
.
annotations
().
value
(
BANDWIDTH
)
!=
null
)
{
iBandwidth
=
Float
.
floatToIntBits
(
Float
.
parseFloat
(
tunnel
.
annotations
().
value
(
BANDWIDTH
)
));
iBandwidth
=
Float
.
valueOf
(
tunnel
.
annotations
().
value
(
BANDWIDTH
));
}
// build bandwidth object
PcepBandwidthObject
bandwidthObject
=
pc
.
factory
().
buildBandwidthObject
().
setBandwidth
(
iBandwidth
).
build
();
...
...
Please
register
or
login
to post a comment