1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright 2018-2020 NXP 3 */ 4 5 #ifndef _RTE_PMD_DPAA2_H 6 #define _RTE_PMD_DPAA2_H 7 8 /** 9 * @file rte_pmd_dpaa2.h 10 * 11 * NXP dpaa2 PMD specific functions. 12 * 13 * @warning 14 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice 15 * 16 */ 17 18 #include <rte_flow.h> 19 20 /** 21 * @warning 22 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice 23 * 24 * Create a flow rule to demultiplex ethernet traffic to separate network 25 * interfaces. 26 * 27 * @param dpdmux_id 28 * ID of the DPDMUX MC object. 29 * @param[in] pattern 30 * Pattern specification. 31 * @param[in] actions 32 * Associated actions. 33 * 34 * @return 35 * A valid handle in case of success, NULL otherwise. 36 */ 37 __rte_experimental 38 struct rte_flow * 39 rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, 40 struct rte_flow_item *pattern[], 41 struct rte_flow_action *actions[]); 42 43 /** 44 * @warning 45 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice 46 * 47 * Create a custom hash key on basis of offset of start of packet and size. 48 * for e.g. if we need GRE packets (non-vlan and without any extra headers) 49 * to be hashed on basis of inner IP header, we will provide offset as: 50 * 14 (eth) + 20 (IP) + 4 (GRE) + 12 (Inner Src offset) = 50 and size 51 * as 8 bytes. 52 * 53 * @param port_id 54 * The port identifier of the Ethernet device. 55 * @param offset 56 * Offset from the start of packet which needs to be included to 57 * calculate hash 58 * @param size 59 * Size of the hash input key 60 * 61 * @return 62 * - 0 if successful. 63 * - Negative in case of failure. 64 */ 65 __rte_experimental 66 int 67 rte_pmd_dpaa2_set_custom_hash(uint16_t port_id, 68 uint16_t offset, 69 uint8_t size); 70 71 #endif /* _RTE_PMD_DPAA2_H */ 72