Skip to content

Commit

Permalink
Integrate io_uring transport into 4.2 (#14045)
Browse files Browse the repository at this point in the history
Motivation:

We should include our io_uring transport as part of 4.2

Modifications:

Add io_uring transport based on our incubator version and main version

Result:

Fixes #14010

---------

Co-authored-by: Chris Vest <christianvest_hansen@apple.com>
  • Loading branch information
normanmaurer and chrisvest committed May 15, 2024
1 parent 09b4ea6 commit 028394a
Show file tree
Hide file tree
Showing 90 changed files with 12,018 additions and 9 deletions.
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,8 @@
<module>transport-native-unix-common</module>
<module>transport-classes-epoll</module>
<module>transport-native-epoll</module>
<module>transport-classes-io_uring</module>
<module>transport-native-io_uring</module>
<module>transport-classes-kqueue</module>
<module>transport-native-kqueue</module>
<module>transport-rxtx</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,14 @@ private final class DefaultEpollIoRegistration extends AtomicBoolean implements
}

@Override
public void submit(IoOps ops) throws Exception {
public long submit(IoOps ops) throws Exception {
EpollIoOps epollIoOps = cast(ops);
try {
if (!isValid()) {
return;
return -1;
}
Native.epollCtlMod(epollFd.intValue(), handle.fd().intValue(), epollIoOps.value);
return epollIoOps.value;
} catch (IOException e) {
throw e;
} catch (Exception e) {
Expand Down
63 changes: 63 additions & 0 deletions transport-classes-io_uring/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2024 The Netty Project
~
~ The Netty Project licenses this file to you under the Apache License,
~ version 2.0 (the "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at:
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
~ License for the specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.netty</groupId>
<artifactId>netty-parent</artifactId>
<version>4.2.0.Final-SNAPSHOT</version>
</parent>
<artifactId>netty-transport-classes-io_uring</artifactId>

<name>Netty/Transport/Classes/io_uring</name>
<packaging>jar</packaging>

<properties>
<javaModuleName>io.netty.transport.classes.io_uring</javaModuleName>
</properties>

<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-unix-common</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 028394a

Please sign in to comment.