Skip to content

Commit

Permalink
NF-side TX: Moving TX thread logic to nflib (#215)
Browse files Browse the repository at this point in the history
This change adds the ability for NFs to directly pass packets to other NFs, bypassing the TX threads which used to do this. **This is now the new default means of transmitting packets between NFs.** By moving TX thread logic to the NF side onvm can run with fewer cores, improving efficiency. TX threads still send packets out the NIC, but NFs primarily do packet passing.

In our tests this improves throughput in the speed tester NF from 20 Mpps to 41 Mpps by eliminating the enqueue/dequeue to the TX thread.

To make this change, functions related to moving packets and mapping service IDs to instance IDs are moved to nflib and placed in a common file. Because both manager and NF use these functions and because they need some of the same info, a new struct was created called `queue_mgr`. Most common packet functions accept a `queue_mgr` and check the `mgr_type_t` field to distinguish manager threads from NFs, which is useful for handling packets headed out the NIC. 

If a user would like to run onvm with TX threads handling packet passing, they must set NF_HANDLE_TX to 0 in onvm_common.h

Commit Log:
* Merge onvm NF (client) stats

  - Remove stats from onvm_mgr client struct
  - Move all stats to onvm_nflib client_stats
  - Change all occurrences of old stats usage to new structure

* Move NF(client) details to nflib side

  - Group together NF details and stats
  - NF details are stored in memzone
  - Advanced NFs can now get all the NF(client) details by calling onvm_get_client(int id)

* Added in-progress changes to remove TX threads.

* Implement Nick's changes for testing purposes

* Empty message

* Reset pkt_buf count to zero upon successful bulk equeue

* Implemented stats functionality

* Implement changes with client details

* Put in a new function the logic for NFs to give packets to TX threads.
Also fixed a bug where the NFs wouldn't check for a valid receiving NF.

* Changed dequeue function to return number of pckts

* Attempted fix for real packets

* Small fixes, improvments

* Fix wrong method call

* Bug fixes, small changes

  - Works with real traffic now

* Small fixes, improvments

  - Renamed client_details to clients
  - Moved extern clients to mgr side
  - Updated speed tester to reference new structure

* Exposing nf_enq functions to nflib side

* Added flush_all_nfs to shared

* Start writing the code for common packet functions. Ideally we could use onvm_pkt_common_process_tx_batch for both NFs and TX threads.

* Place pkt functions in common file to be shared between manager and nfs. Also change the structure of pkt functions to deal with `onvm_tx_info rather than `thread_info` or `nf_tx_info`.

* Fix compilation issues. To do: fix linker issues.

* Fixed linker error. NFs do not work.

* Fixed spots where variables were local instead of pointing to global data. Still need to flush the NFs regularly.

* Fixed bug where to_tx_buf wouldn't reset if pkts were dropped.

* Change name from onvm_tx_info to queue_mgr. Moved nf_tx_mgr out of shared memory.

* More name changes. Comment cleanup, spacing fixes.

* spacing, typo fix

* Fixed spacing issues.

* Use tabs instead of spaces

* Remove unnecessary commented code.

* Fix names for queue manager's enum
and make buffering in nflib_run more clear.

* Refactor code for `queue_mgr` name changes.

* Update license year

* Change Hewlett Packard reference in license to include 2016
  • Loading branch information
rskennedy authored and twood02 committed Nov 16, 2017
1 parent 6d828a9 commit 740a5f1
Show file tree
Hide file tree
Showing 75 changed files with 842 additions and 622 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
OpenNetVM is distributed under the following BSD LICENSE:

Copyright(c)
2015-2016 George Washington University
2015-2016 University of California Riverside
2015-2017 George Washington University
2015-2017 University of California Riverside
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# BSD LICENSE
#
# Copyright(c)
# 2015-2016 George Washington University
# 2015-2016 University of California Riverside
# 2016 Hewlett Packard Enterprise Development LP
# 2015-2017 George Washington University
# 2015-2017 University of California Riverside
# 2016-2017 Hewlett Packard Enterprise Development LP
# 2010-2014 Intel Corporation.
# All rights reserved.
#
Expand Down
6 changes: 3 additions & 3 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# BSD LICENSE
#
# Copyright(c)
# 2015-2016 George Washington University
# 2015-2016 University of California Riverside
# 2016 Hewlett Packard Enterprise Development LP
# 2015-2017 George Washington University
# 2015-2017 University of California Riverside
# 2016-2017 Hewlett Packard Enterprise Development LP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 3 additions & 3 deletions examples/aes_decrypt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# BSD LICENSE
#
# Copyright(c)
# 2015-2016 George Washington University
# 2015-2016 University of California Riverside
# 2016 Hewlett Packard Enterprise Development LP
# 2015-2017 George Washington University
# 2015-2017 University of California Riverside
# 2016-2017 Hewlett Packard Enterprise Development LP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 3 additions & 3 deletions examples/aes_decrypt/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2016 Hewlett Packard Enterprise Development LP
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* 2016-2017 Hewlett Packard Enterprise Development LP
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 3 additions & 3 deletions examples/aes_decrypt/aes.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2016 Hewlett Packard Enterprise Development LP
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* 2016-2017 Hewlett Packard Enterprise Development LP
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 3 additions & 3 deletions examples/aes_decrypt/aesdecrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2016 Hewlett Packard Enterprise Development LP
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* 2016-2017 Hewlett Packard Enterprise Development LP
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 3 additions & 3 deletions examples/aes_encrypt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# BSD LICENSE
#
# Copyright(c)
# 2015-2016 George Washington University
# 2015-2016 University of California Riverside
# 2016 Hewlett Packard Enterprise Development LP
# 2015-2017 George Washington University
# 2015-2017 University of California Riverside
# 2016-2017 Hewlett Packard Enterprise Development LP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 3 additions & 3 deletions examples/aes_encrypt/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2016 Hewlett Packard Enterprise Development LP
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* 2016-2017 Hewlett Packard Enterprise Development LP
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 3 additions & 3 deletions examples/aes_encrypt/aes.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2016 Hewlett Packard Enterprise Development LP
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* 2016-2017 Hewlett Packard Enterprise Development LP
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 3 additions & 3 deletions examples/aes_encrypt/aesencrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2016 Hewlett Packard Enterprise Development LP
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* 2016-2017 Hewlett Packard Enterprise Development LP
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/basic_monitor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# BSD LICENSE
#
# Copyright(c)
# 2015-2016 George Washington University
# 2015-2016 University of California Riverside
# 2015-2017 George Washington University
# 2015-2017 University of California Riverside
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/basic_monitor/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/bridge/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# BSD LICENSE
#
# Copyright(c)
# 2015-2016 George Washington University
# 2015-2016 University of California Riverside
# 2015-2017 George Washington University
# 2015-2017 University of California Riverside
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/bridge/bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/flow_table/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# BSD LICENSE
#
# Copyright(c)
# 2015-2016 George Washington University
# 2015-2016 University of California Riverside
# 2015-2017 George Washington University
# 2015-2017 University of California Riverside
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/flow_table/flow_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/flow_table/flow_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/flow_table/msgbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/flow_table/msgbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/flow_table/sdn.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/flow_table/sdn.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/flow_table/sdn_pkt_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/flow_table/setupconn.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/flow_table/setupconn.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/ndpi_stats/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# BSD LICENSE
#
# Copyright(c)
# 2015-2016 George Washington University
# 2015-2016 University of California Riverside
# 2015-2017 George Washington University
# 2015-2017 University of California Riverside
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/ndpi_stats/ndpi_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/simple_forward/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# BSD LICENSE
#
# Copyright(c)
# 2015-2016 George Washington University
# 2015-2016 University of California Riverside
# 2015-2017 George Washington University
# 2015-2017 University of California Riverside
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/simple_forward/forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/speed_tester/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# BSD LICENSE
#
# Copyright(c)
# 2015-2016 George Washington University
# 2015-2016 University of California Riverside
# 2015-2017 George Washington University
# 2015-2017 University of California Riverside
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/speed_tester/speed_tester.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/test_flow_dir/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# BSD LICENSE
#
# Copyright(c)
# 2015-2016 George Washington University
# 2015-2016 University of California Riverside
# 2015-2017 George Washington University
# 2015-2017 University of California Riverside
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions examples/test_flow_dir/test_flow_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* BSD LICENSE
*
* Copyright(c)
* 2015-2016 George Washington University
* 2015-2016 University of California Riverside
* 2015-2017 George Washington University
* 2015-2017 University of California Riverside
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions onvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# BSD LICENSE
#
# Copyright(c)
# 2015-2016 George Washington University
# 2015-2016 University of California Riverside
# 2015-2017 George Washington University
# 2015-2017 University of California Riverside
# 2010-2014 Intel Corporation.
# All rights reserved.
#
Expand Down
Loading

0 comments on commit 740a5f1

Please sign in to comment.