15566a3e3SBruce Richardson /* SPDX-License-Identifier: BSD-3-Clause 25566a3e3SBruce Richardson * Copyright(c) 2017 Intel Corporation 3cc6d4215SJasvinder Singh */ 4cc6d4215SJasvinder Singh 5cc6d4215SJasvinder Singh #ifndef __INCLUDE_RTE_ETH_SOFTNIC_H__ 6cc6d4215SJasvinder Singh #define __INCLUDE_RTE_ETH_SOFTNIC_H__ 7cc6d4215SJasvinder Singh 8cc6d4215SJasvinder Singh #include <stdint.h> 9cc6d4215SJasvinder Singh 10cc6d4215SJasvinder Singh #ifdef __cplusplus 11cc6d4215SJasvinder Singh extern "C" { 12cc6d4215SJasvinder Singh #endif 13cc6d4215SJasvinder Singh 147e68bc20SJasvinder Singh /** Firmware. */ 157e68bc20SJasvinder Singh #ifndef SOFTNIC_FIRMWARE 167e68bc20SJasvinder Singh #define SOFTNIC_FIRMWARE "firmware.cli" 178316b981SJasvinder Singh #endif 188316b981SJasvinder Singh 197709a63bSJasvinder Singh /** TCP connection port (0 = no connectivity). */ 207709a63bSJasvinder Singh #ifndef SOFTNIC_CONN_PORT 217709a63bSJasvinder Singh #define SOFTNIC_CONN_PORT 0 227709a63bSJasvinder Singh #endif 237709a63bSJasvinder Singh 247e68bc20SJasvinder Singh /** NUMA node ID. */ 257e68bc20SJasvinder Singh #ifndef SOFTNIC_CPU_ID 267e68bc20SJasvinder Singh #define SOFTNIC_CPU_ID 0 27cc6d4215SJasvinder Singh #endif 28cc6d4215SJasvinder Singh 29a958a5c0SCristian Dumitrescu /** 30a958a5c0SCristian Dumitrescu * Service cores: 31a958a5c0SCristian Dumitrescu * 32a958a5c0SCristian Dumitrescu * 0 = The current device is run explicitly by the application. The firmware 33a958a5c0SCristian Dumitrescu * creates one or several pipelines for the current device and maps them to 34a958a5c0SCristian Dumitrescu * CPU cores that should not be service cores. The application is required 35a958a5c0SCristian Dumitrescu * to call rte_pmd_softnic_run() for the current device on each of these CPU 36a958a5c0SCristian Dumitrescu * cores in order to make the current device work. 37a958a5c0SCristian Dumitrescu * 38a958a5c0SCristian Dumitrescu * 1 = The current device is run on the service cores transparently to the 39a958a5c0SCristian Dumitrescu * application. The firmware creates one or several pipelines for the 40a958a5c0SCristian Dumitrescu * current device and maps them to CPU cores that should be service cores. 41a958a5c0SCristian Dumitrescu * Each of these service cores is calling rte_pmd_softnic_run() for the 42a958a5c0SCristian Dumitrescu * current device in order to make the current device work. The application 43a958a5c0SCristian Dumitrescu * is not allowed to call rte_pmd_softnic_run() for the current device. 44a958a5c0SCristian Dumitrescu */ 45a958a5c0SCristian Dumitrescu #ifndef SOFTNIC_SC 46a958a5c0SCristian Dumitrescu #define SOFTNIC_SC 1 47a958a5c0SCristian Dumitrescu #endif 48a958a5c0SCristian Dumitrescu 49cc6d4215SJasvinder Singh /** 507e68bc20SJasvinder Singh * Soft NIC run. 51cc6d4215SJasvinder Singh * 527e68bc20SJasvinder Singh * @param port_id 537e68bc20SJasvinder Singh * Port ID of the Soft NIC device. 54cc6d4215SJasvinder Singh * @return 557e68bc20SJasvinder Singh * Zero on success, error code otherwise. 56cc6d4215SJasvinder Singh */ 57cc6d4215SJasvinder Singh int 58cc6d4215SJasvinder Singh rte_pmd_softnic_run(uint16_t port_id); 59cc6d4215SJasvinder Singh 607709a63bSJasvinder Singh /** 617709a63bSJasvinder Singh * Soft NIC manage. 627709a63bSJasvinder Singh * 637709a63bSJasvinder Singh * @param port_id 647709a63bSJasvinder Singh * Port ID of the Soft NIC device. 657709a63bSJasvinder Singh * @return 667709a63bSJasvinder Singh * Zero on success, error code otherwise. 677709a63bSJasvinder Singh */ 68*18218713SDavid Marchand int 697709a63bSJasvinder Singh rte_pmd_softnic_manage(uint16_t port_id); 707709a63bSJasvinder Singh 71cc6d4215SJasvinder Singh #ifdef __cplusplus 72cc6d4215SJasvinder Singh } 73cc6d4215SJasvinder Singh #endif 74cc6d4215SJasvinder Singh 75cc6d4215SJasvinder Singh #endif /* __INCLUDE_RTE_ETH_SOFTNIC_H__ */ 76