mirror of
https://github.com/OISF/suricata.git
synced 2026-10-12 02:07:10 +00:00
ixgbe driver requires different configuration of RSS rte_flow rule than i40e, with just one generic rule matching all traffic. The generic rule configured by DeviceCreateRSSFlowGeneric() has pattern equivalent to "pattern eth / end" in dpdk-testpmd syntax. The rule must have rx queues configured. The rule hashes traffic to different queues based on ipv4 and ipv6 hash types (ipv4 src dst / ipv6 src dst). The hash key is 40 bytes long symmetric hash key. ixgbe does not support any other hash function than RTE_ETH_HASH_FUNCTION_DEFAULT. The syntax in dpdk-testpmd for this rule with attributes: port index == 0 used rx queue indices == 0 1 2 3 <hash_key> == 6d5a symmetric hash key is as follows: "flow create 0 ingress pattern eth / end actions rss types ipv4 ipv6 end queues 0 1 2 3 end key <hash_key> key_len 40 func default / end" Ticket: 7337
48 lines
1.5 KiB
C
48 lines
1.5 KiB
C
/* Copyright (C) 2025 Open Information Security Foundation
|
|
*
|
|
* You can copy, redistribute or modify this Program under the terms of
|
|
* the GNU General Public License version 2 as published by the Free
|
|
* Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* version 2 along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
* 02110-1301, USA.
|
|
*/
|
|
|
|
/**
|
|
* \file
|
|
*
|
|
* \author Adam Kiripolsky <[email protected]>
|
|
*/
|
|
|
|
#ifndef UTIL_DPDK_RSS
|
|
#define UTIL_DPDK_RSS
|
|
|
|
#include "suricata-common.h"
|
|
|
|
#ifdef HAVE_DPDK
|
|
|
|
#include "util-dpdk.h"
|
|
|
|
#define RSS_HKEY_LEN 40
|
|
|
|
extern uint8_t RSS_HKEY[];
|
|
|
|
struct rte_flow_action_rss DPDKInitRSSAction(struct rte_eth_rss_conf rss_conf, int nb_rx_queues,
|
|
uint16_t *queues, enum rte_eth_hash_function func, bool set_key);
|
|
int DPDKCreateRSSFlowGeneric(
|
|
int port_id, const char *port_name, struct rte_flow_action_rss rss_conf);
|
|
int DPDKSetRSSFlowQueues(int port_id, const char *port_name, struct rte_flow_action_rss rss_conf);
|
|
int DPDKCreateRSSFlow(int port_id, const char *port_name, struct rte_flow_action_rss rss_conf,
|
|
uint64_t rss_type, struct rte_flow_item *pattern);
|
|
|
|
#endif /* HAVE_DPDK */
|
|
|
|
#endif /* UTIL_DPDK_RSS */
|