Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause
2 : : * Copyright 2018-2024 NXP
3 : : */
4 : :
5 : : #include <stdbool.h>
6 : : #include <rte_random.h>
7 : : #include <dpaax_iova_table.h>
8 : :
9 : : #include "enetc_logs.h"
10 : : #include "enetc.h"
11 : :
12 : : static int
13 : 0 : enetc_dev_start(struct rte_eth_dev *dev)
14 : : {
15 : : struct enetc_eth_hw *hw =
16 : 0 : ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);
17 : : struct enetc_hw *enetc_hw = &hw->hw;
18 : : uint32_t val;
19 : : uint16_t i;
20 : :
21 : 0 : PMD_INIT_FUNC_TRACE();
22 [ # # ]: 0 : if (hw->device_id == ENETC_DEV_ID_VF)
23 : : return 0;
24 : :
25 : 0 : val = enetc_port_rd(enetc_hw, ENETC_PM0_CMD_CFG);
26 : 0 : enetc_port_wr(enetc_hw, ENETC_PM0_CMD_CFG,
27 : : val | ENETC_PM0_TX_EN | ENETC_PM0_RX_EN);
28 : :
29 : : /* Enable port */
30 : 0 : val = enetc_port_rd(enetc_hw, ENETC_PMR);
31 : 0 : enetc_port_wr(enetc_hw, ENETC_PMR, val | ENETC_PMR_EN);
32 : :
33 : : /* set auto-speed for RGMII */
34 [ # # ]: 0 : if (enetc_port_rd(enetc_hw, ENETC_PM0_IF_MODE) & ENETC_PMO_IFM_RG) {
35 : 0 : enetc_port_wr(enetc_hw, ENETC_PM0_IF_MODE,
36 : : ENETC_PM0_IFM_RGAUTO);
37 : 0 : enetc_port_wr(enetc_hw, ENETC_PM1_IF_MODE,
38 : : ENETC_PM0_IFM_RGAUTO);
39 : : }
40 [ # # ]: 0 : if (enetc_global_rd(enetc_hw,
41 : : ENETC_G_EPFBLPR(1)) == ENETC_G_EPFBLPR1_XGMII) {
42 : 0 : enetc_port_wr(enetc_hw, ENETC_PM0_IF_MODE,
43 : : ENETC_PM0_IFM_XGMII);
44 : 0 : enetc_port_wr(enetc_hw, ENETC_PM1_IF_MODE,
45 : : ENETC_PM0_IFM_XGMII);
46 : : }
47 : :
48 [ # # ]: 0 : for (i = 0; i < dev->data->nb_rx_queues; i++)
49 : 0 : dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;
50 [ # # ]: 0 : for (i = 0; i < dev->data->nb_tx_queues; i++)
51 : 0 : dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;
52 : :
53 : : return 0;
54 : : }
55 : :
56 : : static int
57 : 0 : enetc_dev_stop(struct rte_eth_dev *dev)
58 : : {
59 : : struct enetc_eth_hw *hw =
60 : 0 : ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);
61 : : struct enetc_hw *enetc_hw = &hw->hw;
62 : : uint32_t val;
63 : : uint16_t i;
64 : :
65 : 0 : PMD_INIT_FUNC_TRACE();
66 : 0 : dev->data->dev_started = 0;
67 [ # # ]: 0 : if (hw->device_id == ENETC_DEV_ID_VF)
68 : : return 0;
69 : :
70 : : /* Disable port */
71 : 0 : val = enetc_port_rd(enetc_hw, ENETC_PMR);
72 : 0 : enetc_port_wr(enetc_hw, ENETC_PMR, val & (~ENETC_PMR_EN));
73 : :
74 : 0 : val = enetc_port_rd(enetc_hw, ENETC_PM0_CMD_CFG);
75 : 0 : enetc_port_wr(enetc_hw, ENETC_PM0_CMD_CFG,
76 : : val & (~(ENETC_PM0_TX_EN | ENETC_PM0_RX_EN)));
77 : :
78 [ # # ]: 0 : for (i = 0; i < dev->data->nb_rx_queues; i++)
79 : 0 : dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
80 [ # # ]: 0 : for (i = 0; i < dev->data->nb_tx_queues; i++)
81 : 0 : dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
82 : :
83 : : return 0;
84 : : }
85 : :
86 : : static const uint32_t *
87 : 0 : enetc_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused,
88 : : size_t *no_of_elements)
89 : : {
90 : : static const uint32_t ptypes[] = {
91 : : RTE_PTYPE_L2_ETHER,
92 : : RTE_PTYPE_L3_IPV4,
93 : : RTE_PTYPE_L3_IPV6,
94 : : RTE_PTYPE_L4_TCP,
95 : : RTE_PTYPE_L4_UDP,
96 : : RTE_PTYPE_L4_SCTP,
97 : : RTE_PTYPE_L4_ICMP,
98 : : };
99 : :
100 : 0 : *no_of_elements = RTE_DIM(ptypes);
101 : 0 : return ptypes;
102 : : }
103 : :
104 : : /* return 0 means link status changed, -1 means not changed */
105 : : static int
106 : 0 : enetc_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
107 : : {
108 : : struct enetc_eth_hw *hw =
109 : 0 : ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);
110 : : struct enetc_hw *enetc_hw = &hw->hw;
111 : : struct rte_eth_link link;
112 : : uint32_t status;
113 : :
114 : 0 : PMD_INIT_FUNC_TRACE();
115 : :
116 : : memset(&link, 0, sizeof(link));
117 : :
118 : 0 : status = enetc_port_rd(enetc_hw, ENETC_PM0_STATUS);
119 : :
120 [ # # ]: 0 : if (status & ENETC_LINK_MODE)
121 : 0 : link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;
122 : : else
123 : 0 : link.link_duplex = RTE_ETH_LINK_HALF_DUPLEX;
124 : :
125 [ # # ]: 0 : if (status & ENETC_LINK_STATUS)
126 : 0 : link.link_status = RTE_ETH_LINK_UP;
127 : : else
128 : 0 : link.link_status = RTE_ETH_LINK_DOWN;
129 : :
130 [ # # # ]: 0 : switch (status & ENETC_LINK_SPEED_MASK) {
131 : 0 : case ENETC_LINK_SPEED_1G:
132 : 0 : link.link_speed = RTE_ETH_SPEED_NUM_1G;
133 : 0 : break;
134 : :
135 : 0 : case ENETC_LINK_SPEED_100M:
136 : 0 : link.link_speed = RTE_ETH_SPEED_NUM_100M;
137 : 0 : break;
138 : :
139 : 0 : default:
140 : : case ENETC_LINK_SPEED_10M:
141 : 0 : link.link_speed = RTE_ETH_SPEED_NUM_10M;
142 : : }
143 : :
144 : 0 : return rte_eth_linkstatus_set(dev, &link);
145 : : }
146 : :
147 : : void
148 : 0 : enetc_print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)
149 : : {
150 : : char buf[RTE_ETHER_ADDR_FMT_SIZE];
151 : :
152 : 0 : rte_ether_format_addr(buf, RTE_ETHER_ADDR_FMT_SIZE, eth_addr);
153 : 0 : ENETC_PMD_NOTICE("%s%s", name, buf);
154 : 0 : }
155 : :
156 : : static int
157 : 0 : enetc_hardware_init(struct enetc_eth_hw *hw)
158 : : {
159 : : struct enetc_hw *enetc_hw = &hw->hw;
160 : 0 : uint32_t *mac = (uint32_t *)hw->mac.addr;
161 : : uint32_t high_mac = 0;
162 : : uint16_t low_mac = 0;
163 : :
164 : 0 : PMD_INIT_FUNC_TRACE();
165 : : /* Calculating and storing the base HW addresses */
166 : 0 : hw->hw.port = (void *)((size_t)hw->hw.reg + ENETC_PORT_BASE);
167 : 0 : hw->hw.global = (void *)((size_t)hw->hw.reg + ENETC_GLOBAL_BASE);
168 : :
169 : : /* WA for Rx lock-up HW erratum */
170 : 0 : enetc_port_wr(enetc_hw, ENETC_PM0_RX_FIFO, 1);
171 : :
172 : : /* set ENETC transaction flags to coherent, don't allocate.
173 : : * BD writes merge with surrounding cache line data, frame data writes
174 : : * overwrite cache line.
175 : : */
176 : 0 : enetc_wr(enetc_hw, ENETC_SICAR0, ENETC_SICAR0_COHERENT);
177 : :
178 : : /* Enabling Station Interface */
179 : 0 : enetc_wr(enetc_hw, ENETC_SIMR, ENETC_SIMR_EN);
180 : :
181 : :
182 [ # # ]: 0 : if (hw->device_id == ENETC_DEV_ID_VF) {
183 : 0 : *mac = (uint32_t)enetc_rd(enetc_hw, ENETC_SIPMAR0);
184 : : high_mac = (uint32_t)*mac;
185 : : mac++;
186 : 0 : *mac = (uint32_t)enetc_rd(enetc_hw, ENETC_SIPMAR1);
187 : 0 : low_mac = (uint16_t)*mac;
188 : : } else {
189 : 0 : *mac = (uint32_t)enetc_port_rd(enetc_hw, ENETC_PSIPMAR0(0));
190 : : high_mac = (uint32_t)*mac;
191 : : mac++;
192 : 0 : *mac = (uint16_t)enetc_port_rd(enetc_hw, ENETC_PSIPMAR1(0));
193 : : low_mac = (uint16_t)*mac;
194 : : }
195 : :
196 [ # # ]: 0 : if ((high_mac | low_mac) == 0) {
197 : : char *first_byte;
198 : :
199 : 0 : ENETC_PMD_NOTICE("MAC is not available for this SI, "
200 : : "set random MAC");
201 : : mac = (uint32_t *)hw->mac.addr;
202 : 0 : *mac = (uint32_t)rte_rand();
203 : : first_byte = (char *)mac;
204 : 0 : *first_byte &= 0xfe; /* clear multicast bit */
205 : 0 : *first_byte |= 0x02; /* set local assignment bit (IEEE802) */
206 : :
207 : 0 : enetc_port_wr(enetc_hw, ENETC_PSIPMAR0(0), *mac);
208 : : mac++;
209 : 0 : *mac = (uint16_t)rte_rand();
210 : 0 : enetc_port_wr(enetc_hw, ENETC_PSIPMAR1(0), *mac);
211 : 0 : enetc_print_ethaddr("New address: ",
212 : : (const struct rte_ether_addr *)hw->mac.addr);
213 : : }
214 : :
215 : 0 : return 0;
216 : : }
217 : :
218 : : static int
219 : 0 : enetc_dev_infos_get(struct rte_eth_dev *dev __rte_unused,
220 : : struct rte_eth_dev_info *dev_info)
221 : : {
222 : 0 : PMD_INIT_FUNC_TRACE();
223 : 0 : dev_info->rx_desc_lim = (struct rte_eth_desc_lim) {
224 : : .nb_max = MAX_BD_COUNT,
225 : : .nb_min = MIN_BD_COUNT,
226 : : .nb_align = BD_ALIGN,
227 : : };
228 : 0 : dev_info->tx_desc_lim = (struct rte_eth_desc_lim) {
229 : : .nb_max = MAX_BD_COUNT,
230 : : .nb_min = MIN_BD_COUNT,
231 : : .nb_align = BD_ALIGN,
232 : : };
233 : 0 : dev_info->max_rx_queues = MAX_RX_RINGS;
234 : 0 : dev_info->max_tx_queues = MAX_TX_RINGS;
235 : 0 : dev_info->max_rx_pktlen = ENETC_MAC_MAXFRM_SIZE;
236 : 0 : dev_info->rx_offload_capa =
237 : : (RTE_ETH_RX_OFFLOAD_IPV4_CKSUM |
238 : : RTE_ETH_RX_OFFLOAD_UDP_CKSUM |
239 : : RTE_ETH_RX_OFFLOAD_TCP_CKSUM |
240 : : RTE_ETH_RX_OFFLOAD_KEEP_CRC);
241 : :
242 : 0 : return 0;
243 : : }
244 : :
245 : : static int
246 : 0 : enetc_alloc_txbdr(struct enetc_bdr *txr, uint16_t nb_desc)
247 : : {
248 : : int size;
249 : :
250 : 0 : size = nb_desc * sizeof(struct enetc_swbd);
251 : 0 : txr->q_swbd = rte_malloc(NULL, size, ENETC_BD_RING_ALIGN);
252 [ # # ]: 0 : if (txr->q_swbd == NULL)
253 : : return -ENOMEM;
254 : :
255 : 0 : size = nb_desc * sizeof(struct enetc_tx_bd);
256 : 0 : txr->bd_base = rte_malloc(NULL, size, ENETC_BD_RING_ALIGN);
257 [ # # ]: 0 : if (txr->bd_base == NULL) {
258 : 0 : rte_free(txr->q_swbd);
259 : 0 : txr->q_swbd = NULL;
260 : 0 : return -ENOMEM;
261 : : }
262 : :
263 : 0 : txr->bd_count = nb_desc;
264 : 0 : txr->next_to_clean = 0;
265 : 0 : txr->next_to_use = 0;
266 : :
267 : 0 : return 0;
268 : : }
269 : :
270 : : static void
271 : : enetc_free_bdr(struct enetc_bdr *rxr)
272 : : {
273 : 0 : rte_free(rxr->q_swbd);
274 : 0 : rte_free(rxr->bd_base);
275 : 0 : rxr->q_swbd = NULL;
276 : 0 : rxr->bd_base = NULL;
277 : : }
278 : :
279 : : static void
280 : 0 : enetc_setup_txbdr(struct enetc_hw *hw, struct enetc_bdr *tx_ring)
281 : : {
282 : 0 : int idx = tx_ring->index;
283 : : phys_addr_t bd_address;
284 : :
285 : : bd_address = (phys_addr_t)
286 : 0 : rte_mem_virt2iova((const void *)tx_ring->bd_base);
287 : 0 : enetc_txbdr_wr(hw, idx, ENETC_TBBAR0,
288 : : lower_32_bits((uint64_t)bd_address));
289 : 0 : enetc_txbdr_wr(hw, idx, ENETC_TBBAR1,
290 : : upper_32_bits((uint64_t)bd_address));
291 : 0 : enetc_txbdr_wr(hw, idx, ENETC_TBLENR,
292 : : ENETC_RTBLENR_LEN(tx_ring->bd_count));
293 : :
294 : 0 : enetc_txbdr_wr(hw, idx, ENETC_TBCIR, 0);
295 : 0 : enetc_txbdr_wr(hw, idx, ENETC_TBCISR, 0);
296 : 0 : tx_ring->tcir = (void *)((size_t)hw->reg +
297 : : ENETC_BDR(TX, idx, ENETC_TBCIR));
298 : 0 : tx_ring->tcisr = (void *)((size_t)hw->reg +
299 : : ENETC_BDR(TX, idx, ENETC_TBCISR));
300 : 0 : }
301 : :
302 : : static int
303 : 0 : enetc_tx_queue_setup(struct rte_eth_dev *dev,
304 : : uint16_t queue_idx,
305 : : uint16_t nb_desc,
306 : : unsigned int socket_id __rte_unused,
307 : : const struct rte_eth_txconf *tx_conf)
308 : : {
309 : : int err = 0;
310 : : struct enetc_bdr *tx_ring;
311 : 0 : struct rte_eth_dev_data *data = dev->data;
312 : 0 : struct enetc_eth_adapter *priv =
313 : : ENETC_DEV_PRIVATE(data->dev_private);
314 : :
315 : 0 : PMD_INIT_FUNC_TRACE();
316 [ # # ]: 0 : if (nb_desc > MAX_BD_COUNT)
317 : : return -1;
318 : :
319 : 0 : tx_ring = rte_zmalloc(NULL, sizeof(struct enetc_bdr), 0);
320 [ # # ]: 0 : if (tx_ring == NULL) {
321 : 0 : ENETC_PMD_ERR("Failed to allocate TX ring memory");
322 : : err = -ENOMEM;
323 : 0 : return -1;
324 : : }
325 : :
326 : 0 : err = enetc_alloc_txbdr(tx_ring, nb_desc);
327 [ # # ]: 0 : if (err)
328 : 0 : goto fail;
329 : :
330 : 0 : tx_ring->index = queue_idx;
331 : 0 : tx_ring->ndev = dev;
332 : 0 : enetc_setup_txbdr(&priv->hw.hw, tx_ring);
333 : 0 : data->tx_queues[queue_idx] = tx_ring;
334 : :
335 [ # # ]: 0 : if (!tx_conf->tx_deferred_start) {
336 : : /* enable ring */
337 : 0 : enetc_txbdr_wr(&priv->hw.hw, tx_ring->index,
338 : : ENETC_TBMR, ENETC_TBMR_EN);
339 : 0 : dev->data->tx_queue_state[tx_ring->index] =
340 : : RTE_ETH_QUEUE_STATE_STARTED;
341 : : } else {
342 : 0 : dev->data->tx_queue_state[tx_ring->index] =
343 : : RTE_ETH_QUEUE_STATE_STOPPED;
344 : : }
345 : :
346 : : return 0;
347 : : fail:
348 : 0 : rte_free(tx_ring);
349 : :
350 : 0 : return err;
351 : : }
352 : :
353 : : static void
354 : 0 : enetc_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
355 : : {
356 : 0 : void *txq = dev->data->tx_queues[qid];
357 : :
358 [ # # ]: 0 : if (txq == NULL)
359 : : return;
360 : :
361 : : struct enetc_bdr *tx_ring = (struct enetc_bdr *)txq;
362 : : struct enetc_eth_hw *eth_hw =
363 : 0 : ENETC_DEV_PRIVATE_TO_HW(tx_ring->ndev->data->dev_private);
364 : : struct enetc_hw *hw;
365 : : struct enetc_swbd *tx_swbd;
366 : : int i;
367 : : uint32_t val;
368 : :
369 : : /* Disable the ring */
370 : : hw = ð_hw->hw;
371 : 0 : val = enetc_txbdr_rd(hw, tx_ring->index, ENETC_TBMR);
372 : 0 : val &= (~ENETC_TBMR_EN);
373 : 0 : enetc_txbdr_wr(hw, tx_ring->index, ENETC_TBMR, val);
374 : :
375 : : /* clean the ring*/
376 : 0 : i = tx_ring->next_to_clean;
377 : 0 : tx_swbd = &tx_ring->q_swbd[i];
378 [ # # ]: 0 : while (tx_swbd->buffer_addr != NULL) {
379 : 0 : rte_pktmbuf_free(tx_swbd->buffer_addr);
380 : 0 : tx_swbd->buffer_addr = NULL;
381 : 0 : tx_swbd++;
382 : 0 : i++;
383 [ # # ]: 0 : if (unlikely(i == tx_ring->bd_count)) {
384 : : i = 0;
385 : 0 : tx_swbd = &tx_ring->q_swbd[i];
386 : : }
387 : : }
388 : :
389 : : enetc_free_bdr(tx_ring);
390 : 0 : rte_free(tx_ring);
391 : : }
392 : :
393 : : static int
394 : 0 : enetc_alloc_rxbdr(struct enetc_bdr *rxr,
395 : : uint16_t nb_rx_desc)
396 : : {
397 : : int size;
398 : :
399 : 0 : size = nb_rx_desc * sizeof(struct enetc_swbd);
400 : 0 : rxr->q_swbd = rte_malloc(NULL, size, ENETC_BD_RING_ALIGN);
401 [ # # ]: 0 : if (rxr->q_swbd == NULL)
402 : : return -ENOMEM;
403 : :
404 : 0 : size = nb_rx_desc * sizeof(union enetc_rx_bd);
405 : 0 : rxr->bd_base = rte_malloc(NULL, size, ENETC_BD_RING_ALIGN);
406 [ # # ]: 0 : if (rxr->bd_base == NULL) {
407 : 0 : rte_free(rxr->q_swbd);
408 : 0 : rxr->q_swbd = NULL;
409 : 0 : return -ENOMEM;
410 : : }
411 : :
412 : 0 : rxr->bd_count = nb_rx_desc;
413 : 0 : rxr->next_to_clean = 0;
414 : 0 : rxr->next_to_use = 0;
415 : 0 : rxr->next_to_alloc = 0;
416 : :
417 : 0 : return 0;
418 : : }
419 : :
420 : : static void
421 : 0 : enetc_setup_rxbdr(struct enetc_hw *hw, struct enetc_bdr *rx_ring,
422 : : struct rte_mempool *mb_pool)
423 : : {
424 : 0 : int idx = rx_ring->index;
425 : : uint16_t buf_size;
426 : : phys_addr_t bd_address;
427 : :
428 : : bd_address = (phys_addr_t)
429 : 0 : rte_mem_virt2iova((const void *)rx_ring->bd_base);
430 : 0 : enetc_rxbdr_wr(hw, idx, ENETC_RBBAR0,
431 : : lower_32_bits((uint64_t)bd_address));
432 : 0 : enetc_rxbdr_wr(hw, idx, ENETC_RBBAR1,
433 : : upper_32_bits((uint64_t)bd_address));
434 : 0 : enetc_rxbdr_wr(hw, idx, ENETC_RBLENR,
435 : : ENETC_RTBLENR_LEN(rx_ring->bd_count));
436 : :
437 : 0 : rx_ring->mb_pool = mb_pool;
438 : 0 : rx_ring->rcir = (void *)((size_t)hw->reg +
439 [ # # ]: 0 : ENETC_BDR(RX, idx, ENETC_RBCIR));
440 : 0 : enetc_refill_rx_ring(rx_ring, (enetc_bd_unused(rx_ring)));
441 [ # # ]: 0 : buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rx_ring->mb_pool) -
442 : : RTE_PKTMBUF_HEADROOM);
443 : 0 : enetc_rxbdr_wr(hw, idx, ENETC_RBBSR, buf_size);
444 : 0 : enetc_rxbdr_wr(hw, idx, ENETC_RBPIR, 0);
445 : 0 : }
446 : :
447 : : static int
448 : 0 : enetc_rx_queue_setup(struct rte_eth_dev *dev,
449 : : uint16_t rx_queue_id,
450 : : uint16_t nb_rx_desc,
451 : : unsigned int socket_id __rte_unused,
452 : : const struct rte_eth_rxconf *rx_conf,
453 : : struct rte_mempool *mb_pool)
454 : : {
455 : : int err = 0;
456 : : struct enetc_bdr *rx_ring;
457 : 0 : struct rte_eth_dev_data *data = dev->data;
458 : 0 : struct enetc_eth_adapter *adapter =
459 : : ENETC_DEV_PRIVATE(data->dev_private);
460 : 0 : uint64_t rx_offloads = data->dev_conf.rxmode.offloads;
461 : :
462 : 0 : PMD_INIT_FUNC_TRACE();
463 [ # # ]: 0 : if (nb_rx_desc > MAX_BD_COUNT)
464 : : return -1;
465 : :
466 : 0 : rx_ring = rte_zmalloc(NULL, sizeof(struct enetc_bdr), 0);
467 [ # # ]: 0 : if (rx_ring == NULL) {
468 : 0 : ENETC_PMD_ERR("Failed to allocate RX ring memory");
469 : : err = -ENOMEM;
470 : 0 : return err;
471 : : }
472 : :
473 : 0 : err = enetc_alloc_rxbdr(rx_ring, nb_rx_desc);
474 [ # # ]: 0 : if (err)
475 : 0 : goto fail;
476 : :
477 : 0 : rx_ring->index = rx_queue_id;
478 : 0 : rx_ring->ndev = dev;
479 : 0 : enetc_setup_rxbdr(&adapter->hw.hw, rx_ring, mb_pool);
480 : 0 : data->rx_queues[rx_queue_id] = rx_ring;
481 : :
482 [ # # ]: 0 : if (!rx_conf->rx_deferred_start) {
483 : : /* enable ring */
484 : 0 : enetc_rxbdr_wr(&adapter->hw.hw, rx_ring->index, ENETC_RBMR,
485 : : ENETC_RBMR_EN);
486 : 0 : dev->data->rx_queue_state[rx_ring->index] =
487 : : RTE_ETH_QUEUE_STATE_STARTED;
488 : : } else {
489 : 0 : dev->data->rx_queue_state[rx_ring->index] =
490 : : RTE_ETH_QUEUE_STATE_STOPPED;
491 : : }
492 : :
493 : 0 : rx_ring->crc_len = (uint8_t)((rx_offloads & RTE_ETH_RX_OFFLOAD_KEEP_CRC) ?
494 : : RTE_ETHER_CRC_LEN : 0);
495 : :
496 : 0 : return 0;
497 : : fail:
498 : 0 : rte_free(rx_ring);
499 : :
500 : 0 : return err;
501 : : }
502 : :
503 : : static void
504 : 0 : enetc_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
505 : : {
506 : 0 : void *rxq = dev->data->rx_queues[qid];
507 : :
508 [ # # ]: 0 : if (rxq == NULL)
509 : : return;
510 : :
511 : : struct enetc_bdr *rx_ring = (struct enetc_bdr *)rxq;
512 : : struct enetc_eth_hw *eth_hw =
513 : 0 : ENETC_DEV_PRIVATE_TO_HW(rx_ring->ndev->data->dev_private);
514 : : struct enetc_swbd *q_swbd;
515 : : struct enetc_hw *hw;
516 : : uint32_t val;
517 : : int i;
518 : :
519 : : /* Disable the ring */
520 : : hw = ð_hw->hw;
521 : 0 : val = enetc_rxbdr_rd(hw, rx_ring->index, ENETC_RBMR);
522 : 0 : val &= (~ENETC_RBMR_EN);
523 : 0 : enetc_rxbdr_wr(hw, rx_ring->index, ENETC_RBMR, val);
524 : :
525 : : /* Clean the ring */
526 : 0 : i = rx_ring->next_to_clean;
527 : 0 : q_swbd = &rx_ring->q_swbd[i];
528 [ # # ]: 0 : while (i != rx_ring->next_to_use) {
529 : 0 : rte_pktmbuf_free(q_swbd->buffer_addr);
530 : 0 : q_swbd->buffer_addr = NULL;
531 : 0 : q_swbd++;
532 : 0 : i++;
533 [ # # ]: 0 : if (unlikely(i == rx_ring->bd_count)) {
534 : : i = 0;
535 : 0 : q_swbd = &rx_ring->q_swbd[i];
536 : : }
537 : : }
538 : :
539 : : enetc_free_bdr(rx_ring);
540 : 0 : rte_free(rx_ring);
541 : : }
542 : :
543 : : static
544 : 0 : int enetc_stats_get(struct rte_eth_dev *dev,
545 : : struct rte_eth_stats *stats,
546 : : struct eth_queue_stats *qstats __rte_unused)
547 : : {
548 : : struct enetc_eth_hw *hw =
549 : 0 : ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);
550 : : struct enetc_hw *enetc_hw = &hw->hw;
551 : :
552 : : /* Total received packets, bad + good, if we want to get counters of
553 : : * only good received packets then use ENETC_PM0_RFRM,
554 : : * ENETC_PM0_TFRM registers.
555 : : */
556 : 0 : stats->ipackets = enetc_port_rd(enetc_hw, ENETC_PM0_RPKT);
557 : 0 : stats->opackets = enetc_port_rd(enetc_hw, ENETC_PM0_TPKT);
558 : 0 : stats->ibytes = enetc_port_rd(enetc_hw, ENETC_PM0_REOCT);
559 : 0 : stats->obytes = enetc_port_rd(enetc_hw, ENETC_PM0_TEOCT);
560 : : /* Dropped + Truncated packets, use ENETC_PM0_RDRNTP for without
561 : : * truncated packets
562 : : */
563 : 0 : stats->imissed = enetc_port_rd(enetc_hw, ENETC_PM0_RDRP);
564 : 0 : stats->ierrors = enetc_port_rd(enetc_hw, ENETC_PM0_RERR);
565 : 0 : stats->oerrors = enetc_port_rd(enetc_hw, ENETC_PM0_TERR);
566 : :
567 : 0 : return 0;
568 : : }
569 : :
570 : : static int
571 : 0 : enetc_stats_reset(struct rte_eth_dev *dev)
572 : : {
573 : : struct enetc_eth_hw *hw =
574 : 0 : ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);
575 : : struct enetc_hw *enetc_hw = &hw->hw;
576 : :
577 : 0 : enetc_port_wr(enetc_hw, ENETC_PM0_STAT_CONFIG, ENETC_CLEAR_STATS);
578 : :
579 : 0 : return 0;
580 : : }
581 : :
582 : : static int
583 : 0 : enetc_dev_close(struct rte_eth_dev *dev)
584 : : {
585 : : uint16_t i;
586 : : int ret;
587 : :
588 : 0 : PMD_INIT_FUNC_TRACE();
589 [ # # ]: 0 : if (rte_eal_process_type() != RTE_PROC_PRIMARY)
590 : : return 0;
591 : :
592 : 0 : ret = enetc_dev_stop(dev);
593 : :
594 [ # # ]: 0 : for (i = 0; i < dev->data->nb_rx_queues; i++) {
595 : 0 : enetc_rx_queue_release(dev, i);
596 : 0 : dev->data->rx_queues[i] = NULL;
597 : : }
598 : 0 : dev->data->nb_rx_queues = 0;
599 : :
600 [ # # ]: 0 : for (i = 0; i < dev->data->nb_tx_queues; i++) {
601 : 0 : enetc_tx_queue_release(dev, i);
602 : 0 : dev->data->tx_queues[i] = NULL;
603 : : }
604 : 0 : dev->data->nb_tx_queues = 0;
605 : :
606 [ # # ]: 0 : if (rte_eal_iova_mode() == RTE_IOVA_PA)
607 : 0 : dpaax_iova_table_depopulate();
608 : :
609 : : return ret;
610 : : }
611 : :
612 : : static int
613 : 0 : enetc_promiscuous_enable(struct rte_eth_dev *dev)
614 : : {
615 : : struct enetc_eth_hw *hw =
616 : 0 : ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);
617 : : struct enetc_hw *enetc_hw = &hw->hw;
618 : : uint32_t psipmr = 0;
619 : :
620 : 0 : psipmr = enetc_port_rd(enetc_hw, ENETC_PSIPMR);
621 : :
622 : : /* Setting to enable promiscuous mode*/
623 : 0 : psipmr |= ENETC_PSIPMR_SET_UP(0) | ENETC_PSIPMR_SET_MP(0);
624 : :
625 : 0 : enetc_port_wr(enetc_hw, ENETC_PSIPMR, psipmr);
626 : :
627 : 0 : return 0;
628 : : }
629 : :
630 : : static int
631 : 0 : enetc_promiscuous_disable(struct rte_eth_dev *dev)
632 : : {
633 : : struct enetc_eth_hw *hw =
634 : 0 : ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);
635 : : struct enetc_hw *enetc_hw = &hw->hw;
636 : : uint32_t psipmr = 0;
637 : :
638 : : /* Setting to disable promiscuous mode for SI0*/
639 : 0 : psipmr = enetc_port_rd(enetc_hw, ENETC_PSIPMR);
640 : 0 : psipmr &= (~ENETC_PSIPMR_SET_UP(0));
641 : :
642 [ # # ]: 0 : if (dev->data->all_multicast == 0)
643 : 0 : psipmr &= (~ENETC_PSIPMR_SET_MP(0));
644 : :
645 : 0 : enetc_port_wr(enetc_hw, ENETC_PSIPMR, psipmr);
646 : :
647 : 0 : return 0;
648 : : }
649 : :
650 : : static int
651 : 0 : enetc_allmulticast_enable(struct rte_eth_dev *dev)
652 : : {
653 : : struct enetc_eth_hw *hw =
654 : 0 : ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);
655 : : struct enetc_hw *enetc_hw = &hw->hw;
656 : : uint32_t psipmr = 0;
657 : :
658 : 0 : psipmr = enetc_port_rd(enetc_hw, ENETC_PSIPMR);
659 : :
660 : : /* Setting to enable allmulticast mode for SI0*/
661 : 0 : psipmr |= ENETC_PSIPMR_SET_MP(0);
662 : :
663 : 0 : enetc_port_wr(enetc_hw, ENETC_PSIPMR, psipmr);
664 : :
665 : 0 : return 0;
666 : : }
667 : :
668 : : static int
669 : 0 : enetc_allmulticast_disable(struct rte_eth_dev *dev)
670 : : {
671 : : struct enetc_eth_hw *hw =
672 : 0 : ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);
673 : : struct enetc_hw *enetc_hw = &hw->hw;
674 : : uint32_t psipmr = 0;
675 : :
676 [ # # ]: 0 : if (dev->data->promiscuous == 1)
677 : : return 0; /* must remain in all_multicast mode */
678 : :
679 : : /* Setting to disable all multicast mode for SI0*/
680 : 0 : psipmr = enetc_port_rd(enetc_hw, ENETC_PSIPMR) &
681 : : ~(ENETC_PSIPMR_SET_MP(0));
682 : :
683 : 0 : enetc_port_wr(enetc_hw, ENETC_PSIPMR, psipmr);
684 : :
685 : 0 : return 0;
686 : : }
687 : :
688 : : static int
689 : 0 : enetc_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
690 : : {
691 : : struct enetc_eth_hw *hw =
692 : 0 : ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);
693 : : struct enetc_hw *enetc_hw = &hw->hw;
694 : 0 : uint32_t frame_size = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
695 : :
696 : : /*
697 : : * Refuse mtu that requires the support of scattered packets
698 : : * when this feature has not been enabled before.
699 : : */
700 [ # # ]: 0 : if (dev->data->min_rx_buf_size &&
701 [ # # ]: 0 : !dev->data->scattered_rx && frame_size >
702 [ # # ]: 0 : dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM) {
703 : 0 : ENETC_PMD_ERR("SG not enabled, will not fit in one buffer");
704 : 0 : return -EINVAL;
705 : : }
706 : :
707 : 0 : enetc_port_wr(enetc_hw, ENETC_PTCMSDUR(0), ENETC_MAC_MAXFRM_SIZE);
708 : 0 : enetc_port_wr(enetc_hw, ENETC_PTXMBAR, 2 * ENETC_MAC_MAXFRM_SIZE);
709 : :
710 : : /*setting the MTU*/
711 : 0 : enetc_port_wr(enetc_hw, ENETC_PM0_MAXFRM, ENETC_SET_MAXFRM(frame_size) |
712 : : ENETC_SET_TX_MTU(ENETC_MAC_MAXFRM_SIZE));
713 : :
714 : 0 : return 0;
715 : : }
716 : :
717 : : static int
718 : 0 : enetc_dev_configure(struct rte_eth_dev *dev)
719 : : {
720 : : struct enetc_eth_hw *hw =
721 : 0 : ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);
722 : : struct enetc_hw *enetc_hw = &hw->hw;
723 : : struct rte_eth_conf *eth_conf = &dev->data->dev_conf;
724 : 0 : uint64_t rx_offloads = eth_conf->rxmode.offloads;
725 : : uint32_t checksum = L3_CKSUM | L4_CKSUM;
726 : : uint32_t max_len;
727 : :
728 : 0 : PMD_INIT_FUNC_TRACE();
729 : :
730 : 0 : max_len = dev->data->dev_conf.rxmode.mtu + RTE_ETHER_HDR_LEN +
731 : : RTE_ETHER_CRC_LEN;
732 : 0 : enetc_port_wr(enetc_hw, ENETC_PM0_MAXFRM, ENETC_SET_MAXFRM(max_len));
733 : 0 : enetc_port_wr(enetc_hw, ENETC_PTCMSDUR(0), ENETC_MAC_MAXFRM_SIZE);
734 : 0 : enetc_port_wr(enetc_hw, ENETC_PTXMBAR, 2 * ENETC_MAC_MAXFRM_SIZE);
735 : :
736 [ # # ]: 0 : if (rx_offloads & RTE_ETH_RX_OFFLOAD_KEEP_CRC) {
737 : : int config;
738 : :
739 : 0 : config = enetc_port_rd(enetc_hw, ENETC_PM0_CMD_CFG);
740 : 0 : config |= ENETC_PM0_CRC;
741 : 0 : enetc_port_wr(enetc_hw, ENETC_PM0_CMD_CFG, config);
742 : : }
743 : :
744 [ # # ]: 0 : if (rx_offloads & RTE_ETH_RX_OFFLOAD_IPV4_CKSUM)
745 : : checksum &= ~L3_CKSUM;
746 : :
747 [ # # ]: 0 : if (rx_offloads & (RTE_ETH_RX_OFFLOAD_UDP_CKSUM | RTE_ETH_RX_OFFLOAD_TCP_CKSUM))
748 : 0 : checksum &= ~L4_CKSUM;
749 : :
750 : 0 : enetc_port_wr(enetc_hw, ENETC_PAR_PORT_CFG, checksum);
751 : :
752 : :
753 : 0 : return 0;
754 : : }
755 : :
756 : : static int
757 : 0 : enetc_rx_queue_start(struct rte_eth_dev *dev, uint16_t qidx)
758 : : {
759 : 0 : struct enetc_eth_adapter *priv =
760 : 0 : ENETC_DEV_PRIVATE(dev->data->dev_private);
761 : : struct enetc_bdr *rx_ring;
762 : : uint32_t rx_data;
763 : :
764 : 0 : rx_ring = dev->data->rx_queues[qidx];
765 [ # # ]: 0 : if (dev->data->rx_queue_state[qidx] == RTE_ETH_QUEUE_STATE_STOPPED) {
766 : 0 : rx_data = enetc_rxbdr_rd(&priv->hw.hw, rx_ring->index,
767 : : ENETC_RBMR);
768 : 0 : rx_data = rx_data | ENETC_RBMR_EN;
769 : 0 : enetc_rxbdr_wr(&priv->hw.hw, rx_ring->index, ENETC_RBMR,
770 : : rx_data);
771 : 0 : dev->data->rx_queue_state[qidx] = RTE_ETH_QUEUE_STATE_STARTED;
772 : : }
773 : :
774 : 0 : return 0;
775 : : }
776 : :
777 : : static int
778 : 0 : enetc_rx_queue_stop(struct rte_eth_dev *dev, uint16_t qidx)
779 : : {
780 : 0 : struct enetc_eth_adapter *priv =
781 : 0 : ENETC_DEV_PRIVATE(dev->data->dev_private);
782 : : struct enetc_bdr *rx_ring;
783 : : uint32_t rx_data;
784 : :
785 : 0 : rx_ring = dev->data->rx_queues[qidx];
786 [ # # ]: 0 : if (dev->data->rx_queue_state[qidx] == RTE_ETH_QUEUE_STATE_STARTED) {
787 : 0 : rx_data = enetc_rxbdr_rd(&priv->hw.hw, rx_ring->index,
788 : : ENETC_RBMR);
789 : 0 : rx_data = rx_data & (~ENETC_RBMR_EN);
790 : 0 : enetc_rxbdr_wr(&priv->hw.hw, rx_ring->index, ENETC_RBMR,
791 : : rx_data);
792 : 0 : dev->data->rx_queue_state[qidx] = RTE_ETH_QUEUE_STATE_STOPPED;
793 : : }
794 : :
795 : 0 : return 0;
796 : : }
797 : :
798 : : static int
799 : 0 : enetc_tx_queue_start(struct rte_eth_dev *dev, uint16_t qidx)
800 : : {
801 : 0 : struct enetc_eth_adapter *priv =
802 : 0 : ENETC_DEV_PRIVATE(dev->data->dev_private);
803 : : struct enetc_bdr *tx_ring;
804 : : uint32_t tx_data;
805 : :
806 : 0 : tx_ring = dev->data->tx_queues[qidx];
807 [ # # ]: 0 : if (dev->data->tx_queue_state[qidx] == RTE_ETH_QUEUE_STATE_STOPPED) {
808 : 0 : tx_data = enetc_txbdr_rd(&priv->hw.hw, tx_ring->index,
809 : : ENETC_TBMR);
810 : 0 : tx_data = tx_data | ENETC_TBMR_EN;
811 : 0 : enetc_txbdr_wr(&priv->hw.hw, tx_ring->index, ENETC_TBMR,
812 : : tx_data);
813 : 0 : dev->data->tx_queue_state[qidx] = RTE_ETH_QUEUE_STATE_STARTED;
814 : : }
815 : :
816 : 0 : return 0;
817 : : }
818 : :
819 : : static int
820 : 0 : enetc_tx_queue_stop(struct rte_eth_dev *dev, uint16_t qidx)
821 : : {
822 : 0 : struct enetc_eth_adapter *priv =
823 : 0 : ENETC_DEV_PRIVATE(dev->data->dev_private);
824 : : struct enetc_bdr *tx_ring;
825 : : uint32_t tx_data;
826 : :
827 : 0 : tx_ring = dev->data->tx_queues[qidx];
828 [ # # ]: 0 : if (dev->data->tx_queue_state[qidx] == RTE_ETH_QUEUE_STATE_STARTED) {
829 : 0 : tx_data = enetc_txbdr_rd(&priv->hw.hw, tx_ring->index,
830 : : ENETC_TBMR);
831 : 0 : tx_data = tx_data & (~ENETC_TBMR_EN);
832 : 0 : enetc_txbdr_wr(&priv->hw.hw, tx_ring->index, ENETC_TBMR,
833 : : tx_data);
834 : 0 : dev->data->tx_queue_state[qidx] = RTE_ETH_QUEUE_STATE_STOPPED;
835 : : }
836 : :
837 : 0 : return 0;
838 : : }
839 : :
840 : : /*
841 : : * The set of PCI devices this driver supports
842 : : */
843 : : static const struct rte_pci_id pci_id_enetc_map[] = {
844 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, ENETC_DEV_ID) },
845 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, ENETC_DEV_ID_VF) },
846 : : { .vendor_id = 0, /* sentinel */ },
847 : : };
848 : :
849 : : /* Features supported by this driver */
850 : : static const struct eth_dev_ops enetc_ops = {
851 : : .dev_configure = enetc_dev_configure,
852 : : .dev_start = enetc_dev_start,
853 : : .dev_stop = enetc_dev_stop,
854 : : .dev_close = enetc_dev_close,
855 : : .link_update = enetc_link_update,
856 : : .stats_get = enetc_stats_get,
857 : : .stats_reset = enetc_stats_reset,
858 : : .promiscuous_enable = enetc_promiscuous_enable,
859 : : .promiscuous_disable = enetc_promiscuous_disable,
860 : : .allmulticast_enable = enetc_allmulticast_enable,
861 : : .allmulticast_disable = enetc_allmulticast_disable,
862 : : .dev_infos_get = enetc_dev_infos_get,
863 : : .mtu_set = enetc_mtu_set,
864 : : .rx_queue_setup = enetc_rx_queue_setup,
865 : : .rx_queue_start = enetc_rx_queue_start,
866 : : .rx_queue_stop = enetc_rx_queue_stop,
867 : : .rx_queue_release = enetc_rx_queue_release,
868 : : .tx_queue_setup = enetc_tx_queue_setup,
869 : : .tx_queue_start = enetc_tx_queue_start,
870 : : .tx_queue_stop = enetc_tx_queue_stop,
871 : : .tx_queue_release = enetc_tx_queue_release,
872 : : .dev_supported_ptypes_get = enetc_supported_ptypes_get,
873 : : };
874 : :
875 : : /**
876 : : * Initialisation of the enetc device
877 : : *
878 : : * @param eth_dev
879 : : * - Pointer to the structure rte_eth_dev
880 : : *
881 : : * @return
882 : : * - On success, zero.
883 : : * - On failure, negative value.
884 : : */
885 : : static int
886 : 0 : enetc_dev_init(struct rte_eth_dev *eth_dev)
887 : : {
888 : : int error = 0;
889 : 0 : struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
890 : 0 : struct enetc_eth_hw *hw =
891 : 0 : ENETC_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
892 : :
893 : 0 : PMD_INIT_FUNC_TRACE();
894 : 0 : eth_dev->dev_ops = &enetc_ops;
895 : 0 : eth_dev->rx_pkt_burst = &enetc_recv_pkts;
896 : 0 : eth_dev->tx_pkt_burst = &enetc_xmit_pkts;
897 : :
898 : : /* Retrieving and storing the HW base address of device */
899 : 0 : hw->hw.reg = (void *)pci_dev->mem_resource[0].addr;
900 : 0 : hw->device_id = pci_dev->id.device_id;
901 : :
902 : 0 : error = enetc_hardware_init(hw);
903 [ # # ]: 0 : if (error != 0) {
904 : 0 : ENETC_PMD_ERR("Hardware initialization failed");
905 : 0 : return -1;
906 : : }
907 : :
908 : : /* Allocate memory for storing MAC addresses */
909 : 0 : eth_dev->data->mac_addrs = rte_zmalloc("enetc_eth",
910 : : RTE_ETHER_ADDR_LEN, 0);
911 [ # # ]: 0 : if (!eth_dev->data->mac_addrs) {
912 : 0 : ENETC_PMD_ERR("Failed to allocate %d bytes needed to "
913 : : "store MAC addresses",
914 : : RTE_ETHER_ADDR_LEN * 1);
915 : : error = -ENOMEM;
916 : 0 : return -1;
917 : : }
918 : :
919 : : /* Copy the permanent MAC address */
920 : : rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr,
921 : : ð_dev->data->mac_addrs[0]);
922 : :
923 : : /* Set MTU */
924 : 0 : enetc_port_wr(&hw->hw, ENETC_PM0_MAXFRM,
925 : : ENETC_SET_MAXFRM(RTE_ETHER_MAX_LEN));
926 : 0 : eth_dev->data->mtu = RTE_ETHER_MAX_LEN - RTE_ETHER_HDR_LEN -
927 : : RTE_ETHER_CRC_LEN;
928 : :
929 [ # # ]: 0 : if (rte_eal_iova_mode() == RTE_IOVA_PA)
930 : 0 : dpaax_iova_table_populate();
931 : :
932 : 0 : ENETC_PMD_DEBUG("port_id %d vendorID=0x%x deviceID=0x%x",
933 : : eth_dev->data->port_id, pci_dev->id.vendor_id,
934 : : pci_dev->id.device_id);
935 : 0 : return 0;
936 : : }
937 : :
938 : : static int
939 : 0 : enetc_dev_uninit(struct rte_eth_dev *eth_dev)
940 : : {
941 : 0 : PMD_INIT_FUNC_TRACE();
942 : :
943 : 0 : return enetc_dev_close(eth_dev);
944 : : }
945 : :
946 : : static int
947 : 0 : enetc_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
948 : : struct rte_pci_device *pci_dev)
949 : : {
950 : 0 : return rte_eth_dev_pci_generic_probe(pci_dev,
951 : : sizeof(struct enetc_eth_adapter),
952 : : enetc_dev_init);
953 : : }
954 : :
955 : : static int
956 : 0 : enetc_pci_remove(struct rte_pci_device *pci_dev)
957 : : {
958 : 0 : return rte_eth_dev_pci_generic_remove(pci_dev, enetc_dev_uninit);
959 : : }
960 : :
961 : : static struct rte_pci_driver rte_enetc_pmd = {
962 : : .id_table = pci_id_enetc_map,
963 : : .drv_flags = RTE_PCI_DRV_NEED_MAPPING,
964 : : .probe = enetc_pci_probe,
965 : : .remove = enetc_pci_remove,
966 : : };
967 : :
968 : 253 : RTE_PMD_REGISTER_PCI(net_enetc, rte_enetc_pmd);
969 : : RTE_PMD_REGISTER_PCI_TABLE(net_enetc, pci_id_enetc_map);
970 : : RTE_PMD_REGISTER_KMOD_DEP(net_enetc, "* vfio-pci");
971 [ - + ]: 253 : RTE_LOG_REGISTER_DEFAULT(enetc_logtype_pmd, NOTICE);
|