Commit graph

36 commits

Author SHA1 Message Date
Martin Braun
3da73de4ab mpm: udp: Fix Pylint warnings in UDP-related files
Fixes long lines, missing docstrings, and deprecated Pythonisms from
ethdispatch.py and xportmgr_udp.py.
2022-06-08 13:44:19 -07:00
Martin Braun
05211aa9a1 mpm: xportmgr_udp: Match DNAT arguments to manpage
Change the --to argument to --to-destination. Both seem to work, but the
latter is what is listed in iptables-extensions(8). What's confusing is
that `--to` also exists in another context (in the `string` match
extension).
2022-02-21 13:27:39 -06:00
Samuel O'Brien
6394a7c6ea sim: Lay Groundwork for Simulator
At this point, only about half of the mpm methods work on the simulator
    over the mpm shell, and it hasn't been tested with uhd at all.
    If you want to give it a try, first install all of the python
    dependencies of mpm (The simulator doesn't require libusrp or any of
    the C++ deps). In addition, running mpm on a desktop machine requires
    the python lib netifaces. Next, make an /mpm/build directory and open
    it. Run `cmake .. -DMPM_DEVICE=sim`, then `make`. Finally, run
    `python3 python/usrp_hwd.py`. You should be able to open another
    terminal and run `mpm/tools/mpm_shell.py localhost` to connect to the
    mpm server.

Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
2020-10-07 15:29:19 -05:00
Steven Koo
92b2127909 mpm: exclude internal nic for network hosts
Sometimes the internal nic address is routable in network mode. This
causes mpm find to incorrectly set it as the addr. This commit removes
the internal interfaces from the routable list. This also sets the
forwarding interface as the last resort. mpm will prefer the SFP ports
since they can be higher throughput.

Signed-off-by: Steven Koo <steven.koo@ni.com>
2020-08-19 18:05:10 -05:00
Steven Koo
d81816a225 mpm: Reenable forward interfaces for remote hosts
The forward interfaces are able to forward CHDR packets with MPM
iptables routing. This reenables forward interfaces as a CHDR option.
2020-08-04 15:46:22 -05:00
Steven Koo
25a0e462dd mpm: Default virtual NIC CHDR IP selection
This change adds detection for setting the correct internal
fpga CHDR IP address when using embedded mode.
2020-07-30 11:39:00 -05:00
Aaron Rossetto
5023e66b2d mpm: Don't index empty forwarding interface list
If no internal interfaces are found to which to forward CHDR packets,
return after printing the warning instead of attempting to index the
empty list and generating an exception.
2020-07-24 15:24:14 -05:00
RobertWalstab
1d3866bef4 uhd: remove liberio 2020-07-20 16:01:03 -05:00
RobertWalstab
2dd09111cf mpm: support forwarding CHDR packets 2020-07-16 10:00:12 -05:00
Alex Williams
419d7dafa5 mpm,mpmd: Add iface type and mtu info for UDP links
This changes MTU handling for the "internal" UDP type. Because MPM
echo packets will not be returned for internal NICs, use the iface's
programmed MTU instead.
2020-07-16 10:00:12 -05:00
Andrew Lynch
eadbc21982 mpm: Add support for internal Ethernet interface 2020-07-16 10:00:12 -05:00
Alex Williams
40b563387b mpm: Detect number of liberio channels
Instead of using hard-coded values, detect the number of liberio
channels, and only offer liberio links if they exist.
2020-07-16 10:00:12 -05:00
Martin Braun
a252a2f3d8 mpm: Fix various Pylint issues
No functional changes. Fixes for things that PyLint complains about, but
are safe to change anyway, as well as a minor improvement to a docstring
that referenced non-existant args.

This touches files that are mpm.conf-related.
2020-07-09 00:39:11 -07:00
Aaron Rossetto
2da39536bb mpm: Fix calculation of link_rate for UDP xports 2019-11-26 12:21:32 -08:00
Martin Braun
c256b9df65 x300/mpmd: Port all RFNoC devices to the new RFNoC framework
Co-Authored-By: Alex Williams <alex.williams@ni.com>
Co-Authored-By: Sugandha Gupta <sugandha.gupta@ettus.com>
Co-Authored-By: Brent Stapleton <brent.stapleton@ettus.com>
Co-Authored-By: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
2019-11-26 12:16:25 -08:00
Sugandha Gupta
8a400f6a30 mpm: Add option for muxed data stream for liberio transport
If the number of channels for embedded mode streaming is 4
(1 for ctrl, 1 for async messages and 2 for data ), we need to
mux the data transport. This is needed for E310
2019-05-01 15:17:23 -07:00
Martin Braun
164d76dcfd mpm: python: Move from Boost.Python to PyBind11 2019-04-02 10:39:57 -07:00
Brent Stapleton
431deb855b uhd: mpm: update all license header w/ "-or-later"
Updating all SPDX license identifiers to include "-or-later"
2019-03-08 00:43:07 +01:00
Brent Stapleton
6bc92ce1e2 mpm: xport: add commit_xport docstring 2019-02-11 17:12:52 -08:00
Alex Williams
6e8b0ec413 mpm: Parameterize max UDP link allocation
Add an argument to the UDP xport_mgr to adjust the xport sorting. This
enables Rhodium to use a different limit from Magnesium. Previously, the
sorting method would overload a link with both of Rhodium's higher-rate
streams.
2019-01-25 15:01:03 -08:00
Sugandha Gupta
a4289bca10 mpm: xportmgr_udp: Add bridge mode support 2019-01-17 15:38:23 -08:00
Martin Braun
a69ab0c23a cmake: Update coding style to use lowercase commands
Also updates our coding style file.

Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code (with GNU compliant sed):

cmake --help-command-list | grep -v "cmake version" | while read c; do
  echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done > convert.sed \
&& git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \
'*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed

(Make sure the backslashes don't get mangled!)
2018-11-14 14:10:09 -08:00
Trung Tran
b357278c1b mpm: add link_speed xport_info 2018-09-13 14:47:54 -07:00
Martin Braun
444857598f mpm: xportmgr_udp: Catch inconsistent Ethernet device detections
This manager first detects all valid Ethernet devices. The checks for
validity happen across multiple calls in a non-atomic fashion, so it's
possible to end up with inconsistent results. To avoid such issues, we
filter results without talking to the network stack as a final pass.
2018-06-08 14:58:20 -07:00
Martin Braun
2970aa27ce mpm: xportmgr_udp: Assign xports to previously used SFPs
This changes the sorting algorithm for the xport<->SFP mapping. When
multiple SFPs are used, this sorting will avoid a criss-cross mapping
(e.g., mapping ports 0 and 1 of 0/Radio_0 to different SFPs).
2018-04-30 16:57:45 -07:00
Martin Braun
ed2d1ac3e4 mpm: Demote some log messages
The log output at level 'INFO' was pretty cluttered. This cleans up the
log messages at the higher levels. In some cases, log message typos or
capitalizations were also fixed.
2018-03-06 15:28:33 -08:00
Martin Braun
e9288a439c mpm: Update all license headers
- Fix typo in company name (missing 'a')
- Updated SPDX license identifier to version 3.0
2018-02-19 16:55:08 -08:00
Martin Braun
852bf3aa10 mpm: n310: Return CHDR addresses as part of device_info
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-02-07 14:04:30 -08:00
Martin Braun
f45e3c3df0 mpm: xports: Sort requested transport options by QoS
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:59 -08:00
Martin Braun
77dd58640c mpm: udp xport: Bind SID addr 0 and 1 to respective SFP ports
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:59 -08:00
Martin Braun
8b700c7e08 mpm: udp xport: Increment TX/RX allocations for streamers
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:59 -08:00
Martin Braun
a3cbdf481b mpm: xports: Amend protocol for request/commit xport, add allocation
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:59 -08:00
Martin Braun
87dbcd9f1a mpmd: Refactor MPM transport architecture, use managers
This splits up the transport code in mpmd_impl across multiple classes
to properly leverage the request_xport/commit_xport API in MPM.
Different types of transport (UDP, liberio) use their own distinct
classes, which are generated dynamically on request.

This is a true refactoring despite the large amount of changes; there
are no functional differences.

Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
Reviewed-By: Trung Tran <trung.tran@ettus.com>
Reviewed-By: Ashish Chaudhari <ashish.chaudhari@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
8210fc9b17 mpm: xport: Let UDP manager re-enumerate available CHDR ifaces on init()
This will enumerate CHDR interfaces as late as possible, so that the
user changing the IP address will not affect operations. Note that IP
is considered static during a UHD session.
2017-12-22 15:05:58 -08:00
Martin Braun
d3e6dd1140 mpm: Harmonize imports, tidy + sort modules
- Moved nijesdcore to cores/
- Moved udev, net, dtoverlay, uio to sys_utils/
- Made all imports non-relative (except in __init__.py files)
- Removed some unnecessary imports
- Reordered some imports for Python conventions
2017-12-22 15:05:58 -08:00
Martin Braun
58e7022062 mpm: Factor out xport managers as own objects
- Move XportMgr classes out of n310.py
- Subclass them there and apply N310-specific settings
- Remove chdr_interfaces option from PeriphManagerBase
2017-12-22 15:05:57 -08:00