BUG 6541: Switch the Epoll mode in PCEP and PCC-mock to level-triggered 80/44780/1
authorOmair <of8826@att.com>
Sun, 28 Aug 2016 00:48:21 +0000 (17:48 -0700)
committerMilos Fabian <milfabia@cisco.com>
Mon, 29 Aug 2016 09:11:02 +0000 (09:11 +0000)
PCEP and PCC-mock are depending on round-robin processing of incoming messages.
Therefore when using epoll native transport, switch the mode to "level-triggered".

Change-Id: I51537b7b0ecf9465f21186e78ca8c37e1433bf19
Signed-off-by: Omair <of8826@att.com>
(cherry picked from commit 1cc38735ca380f75153f291a695b0d28916553fb)

pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPDispatcherImpl.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/protocol/PCCDispatcherImpl.java

index fc6c6e2765147c507667b76db44b5b7c885ede31..06105f8239771de3097d0879216c18f62bbab765 100644 (file)
@@ -18,6 +18,7 @@ import io.netty.channel.EventLoopGroup;
 import io.netty.channel.epoll.Epoll;
 import io.netty.channel.epoll.EpollChannelOption;
 import io.netty.channel.epoll.EpollEventLoopGroup;
+import io.netty.channel.epoll.EpollMode;
 import io.netty.channel.epoll.EpollServerSocketChannel;
 import io.netty.channel.socket.SocketChannel;
 import io.netty.channel.socket.nio.NioServerSocketChannel;
@@ -113,6 +114,7 @@ public class PCEPDispatcherImpl implements PCEPDispatcher, Closeable {
 
         if (Epoll.isAvailable()) {
             b.channel(EpollServerSocketChannel.class);
+            b.childOption(EpollChannelOption.EPOLL_MODE, EpollMode.LEVEL_TRIGGERED);
         } else {
             b.channel(NioServerSocketChannel.class);
         }
index 8a228fcb2a3fee55b045b8eb98e6fc0d553992dc..0571a59328dff2bad2be1b4c4d57c5edc78eb38b 100755 (executable)
@@ -18,6 +18,7 @@ import io.netty.channel.EventLoopGroup;
 import io.netty.channel.epoll.Epoll;
 import io.netty.channel.epoll.EpollChannelOption;
 import io.netty.channel.epoll.EpollEventLoopGroup;
+import io.netty.channel.epoll.EpollMode;
 import io.netty.channel.epoll.EpollSocketChannel;
 import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.channel.socket.SocketChannel;
@@ -109,6 +110,7 @@ public final class PCCDispatcherImpl implements PCCDispatcher, AutoCloseable {
     private void setChannelFactory(final Bootstrap bootstrap, final Optional<KeyMapping> keys) {
         if(Epoll.isAvailable()) {
             bootstrap.channel(EpollSocketChannel.class);
+            bootstrap.option(EpollChannelOption.EPOLL_MODE, EpollMode.LEVEL_TRIGGERED);
         } else {
             bootstrap.channel(NioSocketChannel.class);
         }