Commit graph

14 commits

Author SHA1 Message Date
Lars Amsel
d09b8c358a MPM: Better error message for multiple assigned MACs
Each MAC address should be only assigned to one link at a time.
If the motherboard EEPROM is messed up, it might happen that
there are more links connected to a single MAC.

So in that case a

  [link_index] = ip2.link_lookup(address=mac_addr)

results in a ValueError (too many values to unpack) which gives
no clue on what actually went wrong. Instead we check the len
of he link_lookup result and give a more meaningful error message.
2022-10-11 15:29:50 -05: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
mattprost
3d5d136534 mpm: Return 10 Gbs link speed on failure
The sysfs call used to determine link speed occasionally will fail and
return -1. In order to mitigate side effects from this behavior, return
10 Gbs link speed instead of 1 Gbs. This mitigates problems that occur
when this issue is seen on 10GbE ports. This approach was elected over
returning -1 to be handled on the host side in order to avoid breaking
mpm compatibility.

Signed-off-by: ettus <matt.prost@ni.com>
2020-09-01 15:19:30 -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
Martin Braun
e8b3319531 mpm: net: Fix typo in docstring 2019-07-20 14:41:00 -07:00
Sugandha Gupta
c81b4ac99f mpm: net: Add bridge utilities 2019-01-17 15:38:23 -08:00
Trung Tran
b357278c1b mpm: add link_speed xport_info 2018-09-13 14:47:54 -07:00
Martin Braun
8762a4d444 mpm: net: Fix rare failures for IP addr detection
Because the detection of valid Ethernet devices happens across multiple
calls in a non-atomic fashion, we cannot assume that a device passed to
net.get_iface_info() actually has a valid IP address, so we don't make
that assumption.
2018-06-08 14:58:20 -07:00
Martin Braun
725debb964 mpm: Rename n310 to n3xx
This module (and class) are, in fact, used for all N3xx-derivates so
renaming it is the more correct thing to do.
2018-03-05 15:56:41 -08:00
Martin Braun
0cb30c8412 mpm: net: Add get_hostname() 2018-03-02 13:48:14 -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
0e285428df mpm: net: Add get_local_ip_addrs() method 2018-02-07 13:44:54 -08:00
Martin Braun
8815098747 mpm: Harmonize all license header
Now uses SPDX headers everywhere.
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
Renamed from mpm/python/usrp_mpm/net.py (Browse further)