1 /* SPDX-License-Identifier: BSD-3-Clause
3 * Copyright(c) 2019-2021 Xilinx, Inc.
4 * Copyright(c) 2016-2019 Solarflare Communications Inc.
6 * This software was jointly developed between OKTET Labs (under contract
7 * for Solarflare) and Solarflare Communications, Inc.
13 #include <rte_kvargs.h>
19 #define SFC_KVARG_VALUES_BOOL "[1|y|yes|on|0|n|no|off]"
21 #define SFC_KVARG_SWITCH_MODE_LEGACY "legacy"
22 #define SFC_KVARG_SWITCH_MODE_SWITCHDEV "switchdev"
24 #define SFC_KVARG_SWITCH_MODE "switch_mode"
25 #define SFC_KVARG_VALUES_SWITCH_MODE \
26 "[" SFC_KVARG_SWITCH_MODE_LEGACY "|" \
27 SFC_KVARG_SWITCH_MODE_SWITCHDEV "]"
29 #define SFC_KVARG_REPRESENTOR "representor"
31 #define SFC_KVARG_PERF_PROFILE "perf_profile"
33 #define SFC_KVARG_PERF_PROFILE_AUTO "auto"
34 #define SFC_KVARG_PERF_PROFILE_THROUGHPUT "throughput"
35 #define SFC_KVARG_PERF_PROFILE_LOW_LATENCY "low-latency"
36 #define SFC_KVARG_VALUES_PERF_PROFILE \
37 "[" SFC_KVARG_PERF_PROFILE_AUTO "|" \
38 SFC_KVARG_PERF_PROFILE_THROUGHPUT "|" \
39 SFC_KVARG_PERF_PROFILE_LOW_LATENCY "]"
41 #define SFC_KVARG_STATS_UPDATE_PERIOD_MS "stats_update_period_ms"
43 #define SFC_KVARG_DATAPATH_EFX "efx"
44 #define SFC_KVARG_DATAPATH_EF10 "ef10"
45 #define SFC_KVARG_DATAPATH_EF10_SIMPLE "ef10_simple"
46 #define SFC_KVARG_DATAPATH_EF10_ESSB "ef10_essb"
47 #define SFC_KVARG_DATAPATH_EF100 "ef100"
49 #define SFC_KVARG_RX_DATAPATH "rx_datapath"
50 #define SFC_KVARG_VALUES_RX_DATAPATH \
51 "[" SFC_KVARG_DATAPATH_EFX "|" \
52 SFC_KVARG_DATAPATH_EF10 "|" \
53 SFC_KVARG_DATAPATH_EF10_ESSB "|" \
54 SFC_KVARG_DATAPATH_EF100 "]"
56 #define SFC_KVARG_TX_DATAPATH "tx_datapath"
57 #define SFC_KVARG_VALUES_TX_DATAPATH \
58 "[" SFC_KVARG_DATAPATH_EFX "|" \
59 SFC_KVARG_DATAPATH_EF10 "|" \
60 SFC_KVARG_DATAPATH_EF10_SIMPLE "|" \
61 SFC_KVARG_DATAPATH_EF100 "]"
63 #define SFC_KVARG_FW_VARIANT "fw_variant"
65 #define SFC_KVARG_FW_VARIANT_DONT_CARE "dont-care"
66 #define SFC_KVARG_FW_VARIANT_FULL_FEATURED "full-feature"
67 #define SFC_KVARG_FW_VARIANT_LOW_LATENCY "ultra-low-latency"
68 #define SFC_KVARG_FW_VARIANT_PACKED_STREAM "capture-packed-stream"
69 #define SFC_KVARG_FW_VARIANT_DPDK "dpdk"
70 #define SFC_KVARG_VALUES_FW_VARIANT \
71 "[" SFC_KVARG_FW_VARIANT_DONT_CARE "|" \
72 SFC_KVARG_FW_VARIANT_FULL_FEATURED "|" \
73 SFC_KVARG_FW_VARIANT_LOW_LATENCY "|" \
74 SFC_KVARG_FW_VARIANT_PACKED_STREAM "|" \
75 SFC_KVARG_FW_VARIANT_DPDK "]"
77 #define SFC_KVARG_RXD_WAIT_TIMEOUT_NS "rxd_wait_timeout_ns"
81 int sfc_kvargs_parse(struct sfc_adapter *sa);
82 void sfc_kvargs_cleanup(struct sfc_adapter *sa);
84 int sfc_kvargs_process(struct sfc_adapter *sa, const char *key_match,
85 arg_handler_t handler, void *opaque_arg);
87 int sfc_kvarg_bool_handler(const char *key, const char *value_str,
89 int sfc_kvarg_long_handler(const char *key, const char *value_str,
91 int sfc_kvarg_string_handler(const char *key, const char *value_str,
98 #endif /* _SFC_KVARGS_H */