Skip to content

Commit

Permalink
dpdk: fix eth link
Browse files Browse the repository at this point in the history
  • Loading branch information
clementperon committed Oct 29, 2023
1 parent d719e22 commit bef8593
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Pcap++/src/DpdkDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ namespace pcpp
#define DPDK_COFIG_JUMBO_FRAME 0 /**< Jumbo Frame Support disabled */
#define DPDK_COFIG_HW_STRIP_CRC 0 /**< CRC stripped by hardware disabled */
#if (RTE_VER_YEAR < 21) || (RTE_VER_YEAR == 21 && RTE_VER_MONTH < 11)
#define DPDK_CONFIG_ETH_LINK_FULL_DUPLEX ETH_LINK_FULL_DUPLEX
#define DPDK_CONFIG_MQ_RSS ETH_RSS
#define DPDK_CONFIG_MQ_NO_RSS ETH_MQ_RX_NONE
#else
#define DPDK_CONFIG_ETH_LINK_FULL_DUPLEX RTE_ETH_LINK_FULL_DUPLEX
#define DPDK_CONFIG_MQ_RSS RTE_ETH_MQ_RX_RSS
#define DPDK_CONFIG_MQ_NO_RSS RTE_ETH_MQ_RX_NONE
#endif
Expand Down Expand Up @@ -562,7 +564,7 @@ void DpdkDevice::getLinkStatus(LinkStatus& linkStatus) const
rte_eth_link_get((uint8_t) m_Id, &link);
linkStatus.linkUp = link.link_status;
linkStatus.linkSpeedMbps = (unsigned) link.link_speed;
linkStatus.linkDuplex = (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? LinkStatus::FULL_DUPLEX : LinkStatus::HALF_DUPLEX;
linkStatus.linkDuplex = (link.link_duplex == DPDK_CONFIG_ETH_LINK_FULL_DUPLEX) ? LinkStatus::FULL_DUPLEX : LinkStatus::HALF_DUPLEX;
}


Expand Down

0 comments on commit bef8593

Please sign in to comment.