1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2015 - 2016 CESNET
5 #ifndef RTE_PMD_SZEDATA2_H_
6 #define RTE_PMD_SZEDATA2_H_
12 #include <rte_common.h>
15 #define PCI_VENDOR_ID_NETCOPE 0x1b26
18 #define PCI_DEVICE_ID_NETCOPE_COMBO80G 0xcb80
19 #define PCI_DEVICE_ID_NETCOPE_COMBO100G 0xc1c1
20 #define PCI_DEVICE_ID_NETCOPE_COMBO100G2 0xc2c1
21 #define PCI_DEVICE_ID_NETCOPE_NFB200G2QL 0xc250
23 /* szedata2_packet header length == 4 bytes == 2B segment size + 2B hw size */
24 #define RTE_SZE2_PACKET_HEADER_SIZE 4
26 #define RTE_SZE2_MMIO_MAX 10
29 * Round 'what' to the nearest larger (or equal) multiple of '8'
30 * (szedata2 packet is aligned to 8 bytes)
32 #define RTE_SZE2_ALIGN8(what) RTE_ALIGN(what, 8)
34 /*! main handle structure */
37 struct sze2_instance_info *info;
39 void *space[RTE_SZE2_MMIO_MAX];
40 struct szedata_lock lock[2][2];
42 __u32 *rx_asize, *tx_asize;
44 /* szedata_read_next variables - to keep context (ct) */
49 /** initial sze lock ptr */
50 const struct szedata_lock *ct_rx_lck_orig;
51 /** current sze lock ptr (initial or next) */
52 const struct szedata_lock *ct_rx_lck;
53 /** remaining bytes (not read) within current lock */
54 unsigned int ct_rx_rem_bytes;
55 /** current pointer to locked memory */
56 unsigned char *ct_rx_cur_ptr;
58 * allocated buffer to store RX packet if it was split
61 unsigned char *ct_rx_buffer;
62 /** registered function to provide filtering based on hwdata */
63 int (*ct_rx_filter)(u_int16_t hwdata_len, u_char *hwdata);
69 * buffer for tx - packet is prepared here
70 * (in future for burst write)
72 unsigned char *ct_tx_buffer;
73 /** initial sze TX lock ptrs - number according to TX interfaces */
74 const struct szedata_lock **ct_tx_lck_orig;
75 /** current sze TX lock ptrs - number according to TX interfaces */
76 const struct szedata_lock **ct_tx_lck;
77 /** already written bytes in both locks */
78 unsigned int *ct_tx_written_bytes;
79 /** remaining bytes (not written) within current lock */
80 unsigned int *ct_tx_rem_bytes;
81 /** current pointers to locked memory */
82 unsigned char **ct_tx_cur_ptr;
83 /** NUMA node closest to PCIe device, or -1 */
87 #endif /* RTE_PMD_SZEDATA2_H_ */