diff options
| author | Paul David <paul.david@ettus.com> | 2016-05-11 16:22:38 -0700 | 
|---|---|---|
| committer | Paul David <paul.david@ettus.com> | 2016-05-18 13:34:02 -0700 | 
| commit | 4e8aaaeb8c767ad444a7afa67993e74d3fef0d90 (patch) | |
| tree | 8a196184e79492f1566653368e1d24aca982d192 | |
| parent | 36075f38e6c8b4f641ba3d1fd97cfd72dcc05e7b (diff) | |
| download | uhd-4e8aaaeb8c767ad444a7afa67993e74d3fef0d90.tar.gz uhd-4e8aaaeb8c767ad444a7afa67993e74d3fef0d90.tar.bz2 uhd-4e8aaaeb8c767ad444a7afa67993e74d3fef0d90.zip  | |
x300: Check the maximum frame size for both links
- This change ensures that the smallest frame size is chosen with dual ethernet
- It helps avoid any issues with using frame sizes larger than what the smaller link supports
| -rw-r--r-- | host/lib/usrp/x300/x300_impl.cpp | 23 | 
1 files changed, 22 insertions, 1 deletions
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index c3ebcd5eb..5930d873c 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -571,7 +571,28 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)          // Detect the frame size on the path to the USRP          try { -            _max_frame_sizes = determine_max_frame_size(mb.get_pri_eth().addr, req_max_frame_size); +            frame_size_t pri_frame_sizes = determine_max_frame_size( +                eth_addrs.at(0), req_max_frame_size +            ); + +            _max_frame_sizes = pri_frame_sizes; +            if (eth_addrs.size() > 1) { +                frame_size_t sec_frame_sizes = determine_max_frame_size( +                    eth_addrs.at(1), req_max_frame_size +                ); + +                // Choose the minimum of the max frame sizes +                // to ensure we don't exceed any one of the links' MTU +                _max_frame_sizes.recv_frame_size = std::min( +                    pri_frame_sizes.recv_frame_size, +                    sec_frame_sizes.recv_frame_size +                ); + +                _max_frame_sizes.send_frame_size = std::min( +                    pri_frame_sizes.send_frame_size, +                    sec_frame_sizes.send_frame_size +                ); +            }          } catch(std::exception &e) {              UHD_MSG(error) << e.what() << std::endl;          }  | 
