Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(RFC) Improve network bandwidth by using shared memory between tender and bindings for hvt #290

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unwanted usage of xon
nikhilap1 committed Apr 4, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit d28667205287752a8ab7cb02accd01fa52f59517
18 changes: 8 additions & 10 deletions ukvm/ukvm_module_net.c
Original file line number Diff line number Diff line change
@@ -290,7 +290,7 @@ void* io_event_loop()
void* io_thread()
{
struct net_msg pkt;
int ret, er, tap_no_data = 0, shm_no_data = 0;
int ret, tap_no_data = 0, shm_no_data = 0;
uint64_t packets_read = 0;

while (1) {
@@ -319,15 +319,13 @@ void* io_thread()
}

/* Read from shmstream and write to tap interface */
do {
ret = shm_net_read(rx_channel, &net_rdr,
pkt.data, PACKET_SIZE, (size_t *)&pkt.length);
if (ret == SHM_NET_OK || ret == SHM_NET_XON) {
er = write(netfd, pkt.data, pkt.length);
assert(er == pkt.length);
}
} while(++packets_read < MAX_PACKETS_READ &&
(ret == SHM_NET_OK || ret == SHM_NET_XON));
while (packets_read < MAX_PACKETS_READ &&
(ret = shm_net_read(rx_channel, &net_rdr,
pkt.data, PACKET_SIZE, (size_t *)&pkt.length) == SHM_NET_OK)) {
ret = write(netfd, pkt.data, pkt.length);
packets_read++;
assert(ret == pkt.length);
}

if (ret == SHM_NET_AGAIN) {
shm_no_data = 1;