1 /* SPDX-License-Identifier: BSD-3-Clause 2 * 3 * Copyright (c) 2017-2018 Solarflare Communications Inc. 4 * All rights reserved. 5 * 6 * This software was jointly developed between OKTET Labs (under contract 7 * for Solarflare) and Solarflare Communications, Inc. 8 */ 9 10 #ifndef _SFC_FLOW_H 11 #define _SFC_FLOW_H 12 13 #include <rte_tailq.h> 14 #include <rte_flow_driver.h> 15 16 #include "efx.h" 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 #if EFSYS_OPT_RX_SCALE 23 /* RSS configuration storage */ 24 struct sfc_flow_rss { 25 unsigned int rxq_hw_index_min; 26 unsigned int rxq_hw_index_max; 27 unsigned int rss_hash_types; 28 uint8_t rss_key[EFX_RSS_KEY_SIZE]; 29 unsigned int rss_tbl[EFX_RSS_TBL_SIZE]; 30 }; 31 #endif /* EFSYS_OPT_RX_SCALE */ 32 33 /* PMD-specific definition of the opaque type from rte_flow.h */ 34 struct rte_flow { 35 efx_filter_spec_t spec; /* filter specification */ 36 #if EFSYS_OPT_RX_SCALE 37 boolean_t rss; /* RSS toggle */ 38 struct sfc_flow_rss rss_conf; /* RSS configuration */ 39 #endif /* EFSYS_OPT_RX_SCALE */ 40 TAILQ_ENTRY(rte_flow) entries; /* flow list entries */ 41 }; 42 43 TAILQ_HEAD(sfc_flow_list, rte_flow); 44 45 extern const struct rte_flow_ops sfc_flow_ops; 46 47 struct sfc_adapter; 48 49 void sfc_flow_init(struct sfc_adapter *sa); 50 void sfc_flow_fini(struct sfc_adapter *sa); 51 int sfc_flow_start(struct sfc_adapter *sa); 52 void sfc_flow_stop(struct sfc_adapter *sa); 53 54 #ifdef __cplusplus 55 } 56 #endif 57 #endif /* _SFC_FLOW_H */ 58