1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2017 Intel Corporation 3 */ 4 5 #ifndef __INCLUDE_RTE_ETH_SOFTNIC_H__ 6 #define __INCLUDE_RTE_ETH_SOFTNIC_H__ 7 8 #include <stdint.h> 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 /** Firmware. */ 15 #ifndef SOFTNIC_FIRMWARE 16 #define SOFTNIC_FIRMWARE "firmware.cli" 17 #endif 18 19 /** TCP connection port (0 = no connectivity). */ 20 #ifndef SOFTNIC_CONN_PORT 21 #define SOFTNIC_CONN_PORT 0 22 #endif 23 24 /** NUMA node ID. */ 25 #ifndef SOFTNIC_CPU_ID 26 #define SOFTNIC_CPU_ID 0 27 #endif 28 29 /** 30 * Service cores: 31 * 32 * 0 = The current device is run explicitly by the application. The firmware 33 * creates one or several pipelines for the current device and maps them to 34 * CPU cores that should not be service cores. The application is required 35 * to call rte_pmd_softnic_run() for the current device on each of these CPU 36 * cores in order to make the current device work. 37 * 38 * 1 = The current device is run on the service cores transparently to the 39 * application. The firmware creates one or several pipelines for the 40 * current device and maps them to CPU cores that should be service cores. 41 * Each of these service cores is calling rte_pmd_softnic_run() for the 42 * current device in order to make the current device work. The application 43 * is not allowed to call rte_pmd_softnic_run() for the current device. 44 */ 45 #ifndef SOFTNIC_SC 46 #define SOFTNIC_SC 1 47 #endif 48 49 /** Traffic Manager: Number of scheduler queues. */ 50 #ifndef SOFTNIC_TM_N_QUEUES 51 #define SOFTNIC_TM_N_QUEUES (64 * 1024) 52 #endif 53 54 /** Traffic Manager: Scheduler queue size (per traffic class). */ 55 #ifndef SOFTNIC_TM_QUEUE_SIZE 56 #define SOFTNIC_TM_QUEUE_SIZE 64 57 #endif 58 59 /** 60 * Soft NIC run. 61 * 62 * @param port_id 63 * Port ID of the Soft NIC device. 64 * @return 65 * Zero on success, error code otherwise. 66 */ 67 int 68 rte_pmd_softnic_run(uint16_t port_id); 69 70 /** 71 * Soft NIC manage. 72 * 73 * @param port_id 74 * Port ID of the Soft NIC device. 75 * @return 76 * Zero on success, error code otherwise. 77 */ 78 __rte_experimental 79 int 80 rte_pmd_softnic_manage(uint16_t port_id); 81 82 #ifdef __cplusplus 83 } 84 #endif 85 86 #endif /* __INCLUDE_RTE_ETH_SOFTNIC_H__ */ 87