mirror of
https://github.com/EttusResearch/uhd.git
synced 2026-10-25 17:36:10 +00:00
uhd: dpdk: Fix compiler warnings for gcc15
- Some DPDK methods were not checking their return values; now they do and trigger exceptions upon failure. - cstdbool was included, despite us using C++17 which makes that obsolete.
This commit is contained in:
parent
b767b4e628
commit
c7255dacc6
@ -13,6 +13,7 @@
|
||||
#include <uhdlib/utils/prefs.hpp>
|
||||
#include <arpa/inet.h>
|
||||
#include <rte_arp.h>
|
||||
#include <rte_errno.h>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
namespace uhd { namespace transport { namespace dpdk {
|
||||
@ -92,7 +93,12 @@ dpdk_port::dpdk_port(port_id_t port,
|
||||
|
||||
/* Set hardware offloads */
|
||||
struct rte_eth_dev_info dev_info;
|
||||
rte_eth_dev_info_get(_port, &dev_info);
|
||||
if (rte_eth_dev_info_get(_port, &dev_info)) {
|
||||
UHD_LOG_THROW(uhd::runtime_error,
|
||||
"DPDK",
|
||||
"Could not get device info for port " << _port << ": "
|
||||
<< rte_strerror(rte_errno));
|
||||
}
|
||||
#ifdef RTE_ETH_RX_OFFLOAD_IPV4_CKSUM
|
||||
uint64_t rx_offloads = RTE_ETH_RX_OFFLOAD_IPV4_CKSUM;
|
||||
uint64_t tx_offloads = RTE_ETH_TX_OFFLOAD_IPV4_CKSUM;
|
||||
@ -588,7 +594,12 @@ void dpdk_ctx::init(const device_addr_t& user_args)
|
||||
for (auto& port : _ports) {
|
||||
struct rte_eth_link link;
|
||||
auto portid = port.second->get_port_id();
|
||||
rte_eth_link_get(portid, &link);
|
||||
if (rte_eth_link_get(portid, &link)) {
|
||||
UHD_LOG_THROW(uhd::runtime_error,
|
||||
"DPDK",
|
||||
"Could not get link status for port "
|
||||
<< portid << ". Error: " << rte_strerror(rte_errno));
|
||||
}
|
||||
unsigned int link_status = link.link_status;
|
||||
unsigned int link_speed = link.link_speed;
|
||||
UHD_LOGGER_TRACE("DPDK") << boost::format("Port %u UP: %d, %u Mbps")
|
||||
@ -673,7 +684,12 @@ int dpdk_ctx::get_port_queue_count(port_id_t portid)
|
||||
int dpdk_ctx::get_port_link_status(port_id_t portid) const
|
||||
{
|
||||
struct rte_eth_link link;
|
||||
rte_eth_link_get_nowait(portid, &link);
|
||||
if (rte_eth_link_get_nowait(portid, &link)) {
|
||||
UHD_LOG_THROW(uhd::runtime_error,
|
||||
"DPDK",
|
||||
"Could not get link status for port "
|
||||
<< portid << ". Error: " << rte_strerror(rte_errno));
|
||||
}
|
||||
return link.link_status;
|
||||
}
|
||||
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include <boost/program_options.hpp>
|
||||
#include <cstdbool>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user