From 334d72bb5649b7e2ead55f4fb7744d7fbcc2992f Mon Sep 17 00:00:00 2001 From: seladb Date: Fri, 19 Jan 2024 03:08:26 -0800 Subject: [PATCH] Auto precommit update (#1278) * Auto pre-commit update * Fix spelling mistakes --------- Co-authored-by: GitHub --- .pre-commit-config.yaml | 4 +- Pcap++/src/DpdkDevice.cpp | 116 +++++++++++++++++++------------------- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0d9efe1161..8da6142c65 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: mixed-line-ending args: ['--fix=lf'] - repo: https://github.com/psf/black - rev: 23.12.0 + rev: 23.12.1 hooks: - id: black - repo: https://github.com/pocc/pre-commit-hooks @@ -25,7 +25,7 @@ repos: - id: codespell pass_filenames: false - repo: https://github.com/crate-ci/typos - rev: v1.16.25 + rev: v1.17.1 hooks: - id: typos args: ['--config=typos-config.toml'] diff --git a/Pcap++/src/DpdkDevice.cpp b/Pcap++/src/DpdkDevice.cpp index c732abbe0b..00aa3d5b90 100644 --- a/Pcap++/src/DpdkDevice.cpp +++ b/Pcap++/src/DpdkDevice.cpp @@ -43,64 +43,64 @@ namespace pcpp * ================ */ -#define DPDK_COFIG_HEADER_SPLIT 0 /**< Header Split disabled */ -#define DPDK_COFIG_SPLIT_HEADER_SIZE 0 -#define DPDK_COFIG_HW_IP_CHECKSUM 0 /**< IP checksum offload disabled */ -#define DPDK_COFIG_HW_VLAN_FILTER 0 /**< VLAN filtering disabled */ -#define DPDK_COFIG_JUMBO_FRAME 0 /**< Jumbo Frame Support disabled */ -#define DPDK_COFIG_HW_STRIP_CRC 0 /**< CRC stripped by hardware disabled */ +#define DPDK_CONFIG_HEADER_SPLIT 0 /**< Header Split disabled */ +#define DPDK_CONFIG_SPLIT_HEADER_SIZE 0 +#define DPDK_CONFIG_HW_IP_CHECKSUM 0 /**< IP checksum offload disabled */ +#define DPDK_CONFIG_HW_VLAN_FILTER 0 /**< VLAN filtering disabled */ +#define DPDK_CONFIG_JUMBO_FRAME 0 /**< Jumbo Frame Support disabled */ +#define DPDK_CONFIG_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 +#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 +#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 #if (RTE_VER_YEAR < 22) || (RTE_VER_YEAR == 22 && RTE_VER_MONTH < 11) -#define DPDK_CONFIG_ETH_RSS_IPV4 ETH_RSS_IPV4 -#define DPDK_CONFIG_ETH_RSS_FRAG_IPV4 ETH_RSS_FRAG_IPV4 -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_TCP ETH_RSS_NONFRAG_IPV4_TCP -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_UDP ETH_RSS_NONFRAG_IPV4_UDP -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_SCTP ETH_RSS_NONFRAG_IPV4_SCTP -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_OTHER ETH_RSS_NONFRAG_IPV4_OTHER -#define DPDK_CONFIG_ETH_RSS_IPV6 ETH_RSS_IPV6 -#define DPDK_CONFIG_ETH_RSS_FRAG_IPV6 ETH_RSS_FRAG_IPV6 -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_TCP ETH_RSS_NONFRAG_IPV6_TCP -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_UDP ETH_RSS_NONFRAG_IPV6_UDP -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_SCTP ETH_RSS_NONFRAG_IPV6_SCTP -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_OTHER ETH_RSS_NONFRAG_IPV6_OTHER -#define DPDK_CONFIG_ETH_RSS_L2_PAYLOAD ETH_RSS_L2_PAYLOAD -#define DPDK_CONFIG_ETH_RSS_IPV6_EX ETH_RSS_IPV6_EX -#define DPDK_CONFIG_ETH_RSS_IPV6_TCP_EX ETH_RSS_IPV6_TCP_EX -#define DPDK_CONFIG_ETH_RSS_IPV6_UDP_EX ETH_RSS_IPV6_UDP_EX -#define DPDK_CONFIG_ETH_RSS_PORT ETH_RSS_PORT -#define DPDK_CONFIG_ETH_RSS_VXLAN ETH_RSS_VXLAN -#define DPDK_CONFIG_ETH_RSS_GENEVE ETH_RSS_GENEVE -#define DPDK_CONFIG_ETH_RSS_NVGRE ETH_RSS_NVGRE +#define DPDK_CONFIG_ETH_RSS_IPV4 ETH_RSS_IPV4 +#define DPDK_CONFIG_ETH_RSS_FRAG_IPV4 ETH_RSS_FRAG_IPV4 +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_TCP ETH_RSS_NONFRAG_IPV4_TCP +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_UDP ETH_RSS_NONFRAG_IPV4_UDP +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_SCTP ETH_RSS_NONFRAG_IPV4_SCTP +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_OTHER ETH_RSS_NONFRAG_IPV4_OTHER +#define DPDK_CONFIG_ETH_RSS_IPV6 ETH_RSS_IPV6 +#define DPDK_CONFIG_ETH_RSS_FRAG_IPV6 ETH_RSS_FRAG_IPV6 +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_TCP ETH_RSS_NONFRAG_IPV6_TCP +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_UDP ETH_RSS_NONFRAG_IPV6_UDP +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_SCTP ETH_RSS_NONFRAG_IPV6_SCTP +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_OTHER ETH_RSS_NONFRAG_IPV6_OTHER +#define DPDK_CONFIG_ETH_RSS_L2_PAYLOAD ETH_RSS_L2_PAYLOAD +#define DPDK_CONFIG_ETH_RSS_IPV6_EX ETH_RSS_IPV6_EX +#define DPDK_CONFIG_ETH_RSS_IPV6_TCP_EX ETH_RSS_IPV6_TCP_EX +#define DPDK_CONFIG_ETH_RSS_IPV6_UDP_EX ETH_RSS_IPV6_UDP_EX +#define DPDK_CONFIG_ETH_RSS_PORT ETH_RSS_PORT +#define DPDK_CONFIG_ETH_RSS_VXLAN ETH_RSS_VXLAN +#define DPDK_CONFIG_ETH_RSS_GENEVE ETH_RSS_GENEVE +#define DPDK_CONFIG_ETH_RSS_NVGRE ETH_RSS_NVGRE #else -#define DPDK_CONFIG_ETH_RSS_IPV4 RTE_ETH_RSS_IPV4 -#define DPDK_CONFIG_ETH_RSS_FRAG_IPV4 RTE_ETH_RSS_FRAG_IPV4 -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_TCP RTE_ETH_RSS_NONFRAG_IPV4_TCP -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_UDP RTE_ETH_RSS_NONFRAG_IPV4_UDP -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_SCTP RTE_ETH_RSS_NONFRAG_IPV4_SCTP -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_OTHER RTE_ETH_RSS_NONFRAG_IPV4_OTHER -#define DPDK_CONFIG_ETH_RSS_IPV6 RTE_ETH_RSS_IPV6 -#define DPDK_CONFIG_ETH_RSS_FRAG_IPV6 RTE_ETH_RSS_FRAG_IPV6 -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_TCP RTE_ETH_RSS_NONFRAG_IPV6_TCP -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_UDP RTE_ETH_RSS_NONFRAG_IPV6_UDP -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_SCTP RTE_ETH_RSS_NONFRAG_IPV6_SCTP -#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_OTHER RTE_ETH_RSS_NONFRAG_IPV6_OTHER -#define DPDK_CONFIG_ETH_RSS_L2_PAYLOAD RTE_ETH_RSS_L2_PAYLOAD -#define DPDK_CONFIG_ETH_RSS_IPV6_EX RTE_ETH_RSS_IPV6_EX -#define DPDK_CONFIG_ETH_RSS_IPV6_TCP_EX RTE_ETH_RSS_IPV6_TCP_EX -#define DPDK_CONFIG_ETH_RSS_IPV6_UDP_EX RTE_ETH_RSS_IPV6_UDP_EX -#define DPDK_CONFIG_ETH_RSS_PORT RTE_ETH_RSS_PORT -#define DPDK_CONFIG_ETH_RSS_VXLAN RTE_ETH_RSS_VXLAN -#define DPDK_CONFIG_ETH_RSS_GENEVE RTE_ETH_RSS_GENEVE -#define DPDK_CONFIG_ETH_RSS_NVGRE RTE_ETH_RSS_NVGRE +#define DPDK_CONFIG_ETH_RSS_IPV4 RTE_ETH_RSS_IPV4 +#define DPDK_CONFIG_ETH_RSS_FRAG_IPV4 RTE_ETH_RSS_FRAG_IPV4 +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_TCP RTE_ETH_RSS_NONFRAG_IPV4_TCP +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_UDP RTE_ETH_RSS_NONFRAG_IPV4_UDP +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_SCTP RTE_ETH_RSS_NONFRAG_IPV4_SCTP +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV4_OTHER RTE_ETH_RSS_NONFRAG_IPV4_OTHER +#define DPDK_CONFIG_ETH_RSS_IPV6 RTE_ETH_RSS_IPV6 +#define DPDK_CONFIG_ETH_RSS_FRAG_IPV6 RTE_ETH_RSS_FRAG_IPV6 +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_TCP RTE_ETH_RSS_NONFRAG_IPV6_TCP +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_UDP RTE_ETH_RSS_NONFRAG_IPV6_UDP +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_SCTP RTE_ETH_RSS_NONFRAG_IPV6_SCTP +#define DPDK_CONFIG_ETH_RSS_NONFRAG_IPV6_OTHER RTE_ETH_RSS_NONFRAG_IPV6_OTHER +#define DPDK_CONFIG_ETH_RSS_L2_PAYLOAD RTE_ETH_RSS_L2_PAYLOAD +#define DPDK_CONFIG_ETH_RSS_IPV6_EX RTE_ETH_RSS_IPV6_EX +#define DPDK_CONFIG_ETH_RSS_IPV6_TCP_EX RTE_ETH_RSS_IPV6_TCP_EX +#define DPDK_CONFIG_ETH_RSS_IPV6_UDP_EX RTE_ETH_RSS_IPV6_UDP_EX +#define DPDK_CONFIG_ETH_RSS_PORT RTE_ETH_RSS_PORT +#define DPDK_CONFIG_ETH_RSS_VXLAN RTE_ETH_RSS_VXLAN +#define DPDK_CONFIG_ETH_RSS_GENEVE RTE_ETH_RSS_GENEVE +#define DPDK_CONFIG_ETH_RSS_NVGRE RTE_ETH_RSS_NVGRE #endif @@ -300,14 +300,14 @@ bool DpdkDevice::configurePort(uint8_t numOfRxQueues, uint8_t numOfTxQueues) struct rte_eth_conf portConf; memset(&portConf,0,sizeof(rte_eth_conf)); #if (RTE_VER_YEAR < 22) || (RTE_VER_YEAR == 22 && RTE_VER_MONTH < 11) - portConf.rxmode.split_hdr_size = DPDK_COFIG_SPLIT_HEADER_SIZE; + portConf.rxmode.split_hdr_size = DPDK_CONFIG_SPLIT_HEADER_SIZE; #endif #if (RTE_VER_YEAR < 18) || (RTE_VER_YEAR == 18 && RTE_VER_MONTH < 8) - portConf.rxmode.header_split = DPDK_COFIG_HEADER_SPLIT; - portConf.rxmode.hw_ip_checksum = DPDK_COFIG_HW_IP_CHECKSUM; - portConf.rxmode.hw_vlan_filter = DPDK_COFIG_HW_VLAN_FILTER; - portConf.rxmode.jumbo_frame = DPDK_COFIG_JUMBO_FRAME; - portConf.rxmode.hw_strip_crc = DPDK_COFIG_HW_STRIP_CRC; + portConf.rxmode.header_split = DPDK_CONFIG_HEADER_SPLIT; + portConf.rxmode.hw_ip_checksum = DPDK_CONFIG_HW_IP_CHECKSUM; + portConf.rxmode.hw_vlan_filter = DPDK_CONFIG_HW_VLAN_FILTER; + portConf.rxmode.jumbo_frame = DPDK_CONFIG_JUMBO_FRAME; + portConf.rxmode.hw_strip_crc = DPDK_CONFIG_HW_STRIP_CRC; #endif // Enable RSS only if hardware supports it and the user wants to use it if (m_Config.rssHashFunction == RSS_NONE)