Skip to content

Commit

Permalink
Auto precommit update (#1278)
Browse files Browse the repository at this point in the history
* Auto pre-commit update

* Fix spelling mistakes

---------

Co-authored-by: GitHub <noreply@github.com>
  • Loading branch information
seladb and web-flow authored Jan 19, 2024
1 parent 30f8d5d commit 334d72b
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 60 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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']
Expand Down
116 changes: 58 additions & 58 deletions Pcap++/src/DpdkDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 334d72b

Please sign in to comment.