Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause
2 : : * Copyright (c) 2015-2018 Atomic Rules LLC
3 : : */
4 : :
5 : : #include <unistd.h>
6 : : #include <sys/stat.h>
7 : : #include <dlfcn.h>
8 : :
9 : : #include <bus_pci_driver.h>
10 : : #include <ethdev_pci.h>
11 : : #include <rte_kvargs.h>
12 : :
13 : : #include "ark_global.h"
14 : : #include "ark_logs.h"
15 : : #include "ark_ethdev_tx.h"
16 : : #include "ark_ethdev_rx.h"
17 : : #include "ark_mpu.h"
18 : : #include "ark_ddm.h"
19 : : #include "ark_udm.h"
20 : : #include "ark_pktdir.h"
21 : : #include "ark_pktgen.h"
22 : : #include "ark_pktchkr.h"
23 : :
24 : : /* Internal prototypes */
25 : : static int ark_check_args(struct ark_adapter *ark, const char *params);
26 : : static int ark_dev_init(struct rte_eth_dev *dev);
27 : : static int ark_config_device(struct rte_eth_dev *dev);
28 : : static int ark_dev_uninit(struct rte_eth_dev *eth_dev);
29 : : static int ark_dev_configure(struct rte_eth_dev *dev);
30 : : static int ark_dev_start(struct rte_eth_dev *dev);
31 : : static int ark_dev_stop(struct rte_eth_dev *dev);
32 : : static int ark_dev_close(struct rte_eth_dev *dev);
33 : : static int ark_dev_info_get(struct rte_eth_dev *dev,
34 : : struct rte_eth_dev_info *dev_info);
35 : : static int ark_dev_link_update(struct rte_eth_dev *dev,
36 : : int wait_to_complete);
37 : : static int ark_dev_set_link_up(struct rte_eth_dev *dev);
38 : : static int ark_dev_set_link_down(struct rte_eth_dev *dev);
39 : : static int ark_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats,
40 : : struct eth_queue_stats *qstats);
41 : : static int ark_dev_stats_reset(struct rte_eth_dev *dev);
42 : : static int ark_set_default_mac_addr(struct rte_eth_dev *dev,
43 : : struct rte_ether_addr *mac_addr);
44 : : static int ark_macaddr_add(struct rte_eth_dev *dev,
45 : : struct rte_ether_addr *mac_addr,
46 : : uint32_t index,
47 : : uint32_t pool);
48 : : static void ark_macaddr_remove(struct rte_eth_dev *dev,
49 : : uint32_t index);
50 : : static int ark_set_mtu(struct rte_eth_dev *dev, uint16_t size);
51 : :
52 : : /*
53 : : * The packet generator is a functional block used to generate packet
54 : : * patterns for testing. It is not intended for nominal use.
55 : : */
56 : : #define ARK_PKTGEN_ARG "Pkt_gen"
57 : :
58 : : /*
59 : : * The packet checker is a functional block used to verify packet
60 : : * patterns for testing. It is not intended for nominal use.
61 : : */
62 : : #define ARK_PKTCHKR_ARG "Pkt_chkr"
63 : :
64 : : /*
65 : : * The packet director is used to select the internal ingress and
66 : : * egress packets paths during testing. It is not intended for
67 : : * nominal use.
68 : : */
69 : : #define ARK_PKTDIR_ARG "Pkt_dir"
70 : :
71 : : /* Devinfo configurations */
72 : : #define ARK_RX_MAX_QUEUE (4096 * 4)
73 : : #define ARK_RX_MIN_QUEUE (512)
74 : : #define ARK_RX_MAX_PKT_LEN ((16 * 1024) - 128)
75 : : #define ARK_RX_MIN_BUFSIZE (1024)
76 : :
77 : : #define ARK_TX_MAX_QUEUE (4096 * 4)
78 : : #define ARK_TX_MIN_QUEUE (256)
79 : :
80 : : static const char * const valid_arguments[] = {
81 : : ARK_PKTGEN_ARG,
82 : : ARK_PKTCHKR_ARG,
83 : : ARK_PKTDIR_ARG,
84 : : NULL
85 : : };
86 : :
87 : : #define AR_VENDOR_ID 0x1d6c
88 : : static const struct rte_pci_id pci_id_ark_map[] = {
89 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x100d)},
90 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x100e)},
91 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x100f)},
92 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1010)},
93 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1017)},
94 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1018)},
95 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1019)},
96 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101a)},
97 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101b)},
98 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101c)},
99 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101e)},
100 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101f)},
101 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1022)},
102 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1024)},
103 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1025)},
104 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1026)},
105 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102a)},
106 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102b)},
107 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102c)},
108 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102d)},
109 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102e)},
110 : : {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102f)},
111 : : {.vendor_id = 0, /* sentinel */ },
112 : : };
113 : :
114 : : /*
115 : : * This structure is used to statically define the capabilities
116 : : * of supported devices.
117 : : * Capabilities:
118 : : * isvf -- defined for function id that are virtual
119 : : */
120 : : struct ark_caps {
121 : : bool isvf;
122 : : };
123 : : struct ark_dev_caps {
124 : : uint32_t device_id;
125 : : struct ark_caps caps;
126 : : };
127 : : #define SET_DEV_CAPS(id, vf) \
128 : : {id, {.isvf = vf} }
129 : :
130 : : static const struct ark_dev_caps
131 : : ark_device_caps[] = {
132 : : SET_DEV_CAPS(0x100d, false),
133 : : SET_DEV_CAPS(0x100e, false),
134 : : SET_DEV_CAPS(0x100f, false),
135 : : SET_DEV_CAPS(0x1010, false),
136 : : SET_DEV_CAPS(0x1017, false),
137 : : SET_DEV_CAPS(0x1018, false),
138 : : SET_DEV_CAPS(0x1019, false),
139 : : SET_DEV_CAPS(0x101a, false),
140 : : SET_DEV_CAPS(0x101b, false),
141 : : SET_DEV_CAPS(0x101c, true),
142 : : SET_DEV_CAPS(0x101e, false),
143 : : SET_DEV_CAPS(0x101f, false),
144 : : {.device_id = 0,}
145 : : };
146 : :
147 : : static int
148 : 0 : ark_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
149 : : struct rte_pci_device *pci_dev)
150 : : {
151 : : struct rte_eth_dev *eth_dev;
152 : : int ret;
153 : :
154 : 0 : eth_dev = rte_eth_dev_pci_allocate(pci_dev, sizeof(struct ark_adapter));
155 : :
156 [ # # ]: 0 : if (eth_dev == NULL)
157 : : return -ENOMEM;
158 : :
159 : 0 : ret = ark_dev_init(eth_dev);
160 [ # # ]: 0 : if (ret)
161 : 0 : rte_eth_dev_release_port(eth_dev);
162 : :
163 : : return ret;
164 : : }
165 : :
166 : : static int
167 : 0 : ark_pci_remove(struct rte_pci_device *pci_dev)
168 : : {
169 : 0 : return rte_eth_dev_pci_generic_remove(pci_dev, ark_dev_uninit);
170 : : }
171 : :
172 : : static struct rte_pci_driver rte_ark_pmd = {
173 : : .id_table = pci_id_ark_map,
174 : : .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
175 : : .probe = ark_pci_probe,
176 : : .remove = ark_pci_remove,
177 : : };
178 : :
179 : : static const struct eth_dev_ops ark_eth_dev_ops = {
180 : : .dev_configure = ark_dev_configure,
181 : : .dev_start = ark_dev_start,
182 : : .dev_stop = ark_dev_stop,
183 : : .dev_close = ark_dev_close,
184 : :
185 : : .dev_infos_get = ark_dev_info_get,
186 : :
187 : : .rx_queue_setup = ark_dev_rx_queue_setup,
188 : : .tx_queue_setup = ark_tx_queue_setup,
189 : :
190 : : .link_update = ark_dev_link_update,
191 : : .dev_set_link_up = ark_dev_set_link_up,
192 : : .dev_set_link_down = ark_dev_set_link_down,
193 : :
194 : : .rx_queue_start = ark_rx_start_queue,
195 : : .rx_queue_stop = ark_rx_stop_queue,
196 : :
197 : : .tx_queue_start = ark_tx_queue_start,
198 : : .tx_queue_stop = ark_tx_queue_stop,
199 : :
200 : : .stats_get = ark_dev_stats_get,
201 : : .stats_reset = ark_dev_stats_reset,
202 : :
203 : : .mac_addr_add = ark_macaddr_add,
204 : : .mac_addr_remove = ark_macaddr_remove,
205 : : .mac_addr_set = ark_set_default_mac_addr,
206 : :
207 : : .mtu_set = ark_set_mtu,
208 : : };
209 : :
210 : : static int
211 : 0 : check_for_ext(struct ark_adapter *ark)
212 : : {
213 : : int found = 0;
214 : :
215 : : /* Get the env */
216 : 0 : const char *dllpath = getenv("ARK_EXT_PATH");
217 : :
218 [ # # ]: 0 : if (dllpath == NULL) {
219 : 0 : ARK_PMD_LOG(DEBUG, "EXT NO dll path specified\n");
220 : 0 : return 0;
221 : : }
222 : 0 : ARK_PMD_LOG(NOTICE, "EXT found dll path at %s\n", dllpath);
223 : :
224 : : /* Open and load the .so */
225 : 0 : ark->d_handle = dlopen(dllpath, RTLD_LOCAL | RTLD_LAZY);
226 [ # # ]: 0 : if (ark->d_handle == NULL) {
227 : 0 : ARK_PMD_LOG(ERR, "Could not load user extension %s\n",
228 : : dllpath);
229 : 0 : return -1;
230 : : }
231 : 0 : ARK_PMD_LOG(DEBUG, "SUCCESS: loaded user extension %s\n",
232 : : dllpath);
233 : :
234 : : /* Get the entry points */
235 : 0 : ark->user_ext.dev_init =
236 : 0 : (void *(*)(struct rte_eth_dev *, void *, int))
237 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_dev_init");
238 : 0 : ARK_PMD_LOG(DEBUG, "device ext init pointer = %p\n",
239 : : ark->user_ext.dev_init);
240 : 0 : ark->user_ext.dev_get_port_count =
241 : 0 : (int (*)(struct rte_eth_dev *, void *))
242 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_dev_get_port_count");
243 : 0 : ark->user_ext.dev_uninit =
244 : 0 : (void (*)(struct rte_eth_dev *, void *))
245 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_dev_uninit");
246 : 0 : ark->user_ext.dev_configure =
247 : 0 : (int (*)(struct rte_eth_dev *, void *))
248 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_dev_configure");
249 : 0 : ark->user_ext.dev_start =
250 : 0 : (int (*)(struct rte_eth_dev *, void *))
251 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_dev_start");
252 : 0 : ark->user_ext.dev_stop =
253 : 0 : (void (*)(struct rte_eth_dev *, void *))
254 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_dev_stop");
255 : 0 : ark->user_ext.dev_close =
256 : 0 : (void (*)(struct rte_eth_dev *, void *))
257 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_dev_close");
258 : 0 : ark->user_ext.link_update =
259 : 0 : (int (*)(struct rte_eth_dev *, int, void *))
260 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_link_update");
261 : 0 : ark->user_ext.dev_set_link_up =
262 : 0 : (int (*)(struct rte_eth_dev *, void *))
263 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_dev_set_link_up");
264 : 0 : ark->user_ext.dev_set_link_down =
265 : 0 : (int (*)(struct rte_eth_dev *, void *))
266 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_dev_set_link_down");
267 : 0 : ark->user_ext.stats_get =
268 : 0 : (int (*)(struct rte_eth_dev *, struct rte_eth_stats *,
269 : : void *))
270 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_stats_get");
271 : 0 : ark->user_ext.stats_reset =
272 : 0 : (void (*)(struct rte_eth_dev *, void *))
273 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_stats_reset");
274 : 0 : ark->user_ext.mac_addr_add =
275 : 0 : (void (*)(struct rte_eth_dev *, struct rte_ether_addr *,
276 : : uint32_t, uint32_t, void *))
277 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_mac_addr_add");
278 : 0 : ark->user_ext.mac_addr_remove =
279 : 0 : (void (*)(struct rte_eth_dev *, uint32_t, void *))
280 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_mac_addr_remove");
281 : 0 : ark->user_ext.mac_addr_set =
282 : 0 : (void (*)(struct rte_eth_dev *, struct rte_ether_addr *,
283 : : void *))
284 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_mac_addr_set");
285 : 0 : ark->user_ext.set_mtu =
286 : 0 : (int (*)(struct rte_eth_dev *, uint16_t,
287 : : void *))
288 : 0 : dlsym(ark->d_handle, "rte_pmd_ark_set_mtu");
289 : 0 : ark->user_ext.rx_user_meta_hook =
290 : 0 : (rx_user_meta_hook_fn)dlsym(ark->d_handle,
291 : : "rte_pmd_ark_rx_user_meta_hook");
292 : 0 : ark->user_ext.tx_user_meta_hook =
293 : 0 : (tx_user_meta_hook_fn)dlsym(ark->d_handle,
294 : : "rte_pmd_ark_tx_user_meta_hook");
295 : :
296 : 0 : return found;
297 : : }
298 : :
299 : : static int
300 : 0 : ark_dev_init(struct rte_eth_dev *dev)
301 : : {
302 : 0 : struct ark_adapter *ark = dev->data->dev_private;
303 : : struct rte_pci_device *pci_dev;
304 : : int ret;
305 : : int port_count = 1;
306 : : int p;
307 : : uint16_t num_queues;
308 : :
309 : 0 : ark->eth_dev = dev;
310 : :
311 : 0 : ARK_PMD_LOG(DEBUG, "\n");
312 : :
313 : : /* Check to see if there is an extension that we need to load */
314 : 0 : ret = check_for_ext(ark);
315 [ # # ]: 0 : if (ret)
316 : : return ret;
317 : :
318 : 0 : pci_dev = RTE_CLASS_TO_BUS_DEVICE(dev, *pci_dev);
319 : 0 : rte_eth_copy_pci_info(dev, pci_dev);
320 : 0 : dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
321 : :
322 : : p = 0;
323 [ # # ]: 0 : while (ark_device_caps[p].device_id != 0) {
324 [ # # ]: 0 : if (pci_dev->id.device_id == ark_device_caps[p].device_id) {
325 : 0 : ark->isvf = ark_device_caps[p].caps.isvf;
326 : 0 : break;
327 : : }
328 : 0 : p++;
329 : : }
330 : :
331 : : /* Use dummy function until setup */
332 : 0 : dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
333 : 0 : dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
334 : :
335 : 0 : ark->bar0 = (uint8_t *)pci_dev->mem_resource[0].addr;
336 : 0 : ark->a_bar = (uint8_t *)pci_dev->mem_resource[2].addr;
337 : :
338 : 0 : ark->sysctrl.v = (void *)&ark->bar0[ARK_SYSCTRL_BASE];
339 : 0 : ark->mpurx.v = (void *)&ark->bar0[ARK_MPU_RX_BASE];
340 : 0 : ark->udm.v = (void *)&ark->bar0[ARK_UDM_BASE];
341 : 0 : ark->mputx.v = (void *)&ark->bar0[ARK_MPU_TX_BASE];
342 : 0 : ark->ddm.v = (void *)&ark->bar0[ARK_DDM_BASE];
343 : 0 : ark->cmac.v = (void *)&ark->bar0[ARK_CMAC_BASE];
344 : 0 : ark->external.v = (void *)&ark->bar0[ARK_EXTERNAL_BASE];
345 : 0 : ark->pktdir.v = (void *)&ark->bar0[ARK_PKTDIR_BASE];
346 : 0 : ark->pktgen.v = (void *)&ark->bar0[ARK_PKTGEN_BASE];
347 : 0 : ark->pktchkr.v = (void *)&ark->bar0[ARK_PKTCHKR_BASE];
348 : :
349 : 0 : ark->started = 0;
350 : 0 : ark->pkt_dir_v = ARK_PKT_DIR_INIT_VAL;
351 : :
352 [ # # ]: 0 : ARK_PMD_LOG(INFO, "Sys Ctrl Const = 0x%x HW Commit_ID: %08x\n",
353 : : ark->sysctrl.t32[4],
354 : : rte_be_to_cpu_32(ark->sysctrl.t32[0x20 / 4]));
355 [ # # ]: 0 : ARK_PMD_LOG(NOTICE, "Arkville HW Commit_ID: %08x\n",
356 : : rte_be_to_cpu_32(ark->sysctrl.t32[0x20 / 4]));
357 : :
358 : : /* If HW sanity test fails, return an error */
359 [ # # ]: 0 : if (ark->sysctrl.t32[4] != 0xcafef00d) {
360 : 0 : ARK_PMD_LOG(ERR,
361 : : "HW Sanity test has failed, expected constant"
362 : : " 0x%x, read 0x%x (%s)\n",
363 : : 0xcafef00d,
364 : : ark->sysctrl.t32[4], __func__);
365 : 0 : return -1;
366 : : }
367 : :
368 : 0 : ARK_PMD_LOG(DEBUG,
369 : : "HW Sanity test has PASSED, expected constant"
370 : : " 0x%x, read 0x%x (%s)\n",
371 : : 0xcafef00d, ark->sysctrl.t32[4], __func__);
372 : :
373 : : /* We are a single function multi-port device. */
374 : 0 : ret = ark_config_device(dev);
375 [ # # ]: 0 : if (ret)
376 : : return -1;
377 : :
378 : 0 : dev->dev_ops = &ark_eth_dev_ops;
379 : 0 : dev->rx_queue_count = ark_dev_rx_queue_count;
380 : :
381 : 0 : dev->data->mac_addrs = rte_zmalloc("ark", RTE_ETHER_ADDR_LEN, 0);
382 [ # # ]: 0 : if (!dev->data->mac_addrs) {
383 : 0 : ARK_PMD_LOG(ERR,
384 : : "Failed to allocated memory for storing mac address"
385 : : );
386 : : }
387 : :
388 [ # # ]: 0 : if (ark->user_ext.dev_init) {
389 : 0 : ark->user_data[dev->data->port_id] =
390 : 0 : ark->user_ext.dev_init(dev, ark->a_bar, 0);
391 [ # # ]: 0 : if (!ark->user_data[dev->data->port_id]) {
392 : 0 : ARK_PMD_LOG(WARNING,
393 : : "Failed to initialize PMD extension!"
394 : : " continuing without it\n");
395 : 0 : memset(&ark->user_ext, 0, sizeof(struct ark_user_ext));
396 : 0 : dlclose(ark->d_handle);
397 : : }
398 : : }
399 : :
400 [ # # ]: 0 : if (pci_dev->device.devargs)
401 : 0 : ret = ark_check_args(ark, pci_dev->device.devargs->args);
402 : : else
403 : 0 : ARK_PMD_LOG(INFO, "No Device args found\n");
404 : :
405 [ # # ]: 0 : if (ret)
406 : 0 : goto error;
407 : : /*
408 : : * We will create additional devices based on the number of requested
409 : : * ports
410 : : */
411 [ # # ]: 0 : if (ark->user_ext.dev_get_port_count)
412 : : port_count =
413 : 0 : ark->user_ext.dev_get_port_count(dev,
414 : 0 : ark->user_data[dev->data->port_id]);
415 : 0 : ark->num_ports = port_count;
416 : 0 : num_queues = ark_api_num_queues_per_port(ark->mpurx.v, port_count);
417 : :
418 [ # # ]: 0 : for (p = 0; p < port_count; p++) {
419 : : struct rte_eth_dev *eth_dev;
420 : : char name[RTE_ETH_NAME_MAX_LEN];
421 : :
422 : 0 : snprintf(name, sizeof(name), "arketh%d",
423 [ # # ]: 0 : dev->data->port_id + p);
424 : :
425 [ # # ]: 0 : if (p == 0) {
426 : : /* First port is already allocated by DPDK */
427 : 0 : eth_dev = ark->eth_dev;
428 : 0 : rte_eth_dev_probing_finish(eth_dev);
429 : 0 : continue;
430 : : }
431 : :
432 : : /* reserve an ethdev entry */
433 : 0 : eth_dev = rte_eth_dev_allocate(name);
434 [ # # ]: 0 : if (!eth_dev) {
435 : 0 : ARK_PMD_LOG(ERR,
436 : : "Could not allocate eth_dev for port %d\n",
437 : : p);
438 : 0 : goto error;
439 : : }
440 : :
441 : 0 : eth_dev->device = &pci_dev->device;
442 : : /* Device requires new dev_private data */
443 : 0 : eth_dev->data->dev_private =
444 : 0 : rte_zmalloc_socket(name,
445 : : sizeof(struct ark_adapter),
446 : : RTE_CACHE_LINE_SIZE,
447 : 0 : rte_socket_id());
448 [ # # ]: 0 : if (eth_dev->data->dev_private == NULL) {
449 : 0 : ARK_PMD_LOG(ERR, "Memory allocation for dev_private failed\n");
450 : 0 : goto error;
451 : : }
452 : :
453 : : memcpy(eth_dev->data->dev_private, ark,
454 : : sizeof(struct ark_adapter));
455 : 0 : ark = eth_dev->data->dev_private;
456 : 0 : ark->qbase = p * num_queues;
457 : :
458 : 0 : eth_dev->dev_ops = ark->eth_dev->dev_ops;
459 : 0 : eth_dev->tx_pkt_burst = ark->eth_dev->tx_pkt_burst;
460 : 0 : eth_dev->rx_pkt_burst = ark->eth_dev->rx_pkt_burst;
461 : :
462 : 0 : rte_eth_copy_pci_info(eth_dev, pci_dev);
463 : 0 : eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
464 : :
465 : 0 : eth_dev->data->mac_addrs = rte_zmalloc(name,
466 : : RTE_ETHER_ADDR_LEN, 0);
467 [ # # ]: 0 : if (!eth_dev->data->mac_addrs) {
468 : 0 : ARK_PMD_LOG(ERR,
469 : : "Memory allocation for MAC failed!"
470 : : " Exiting.\n");
471 : 0 : goto error;
472 : : }
473 : :
474 [ # # ]: 0 : if (ark->user_ext.dev_init) {
475 : 0 : ark->user_data[eth_dev->data->port_id] =
476 : 0 : ark->user_ext.dev_init(dev, ark->a_bar, p);
477 : : }
478 : :
479 : 0 : rte_eth_dev_probing_finish(eth_dev);
480 : : }
481 : :
482 : : return ret;
483 : :
484 : 0 : error:
485 : 0 : rte_free(dev->data->mac_addrs);
486 : 0 : dev->data->mac_addrs = NULL;
487 : 0 : return -1;
488 : : }
489 : :
490 : : /*
491 : : *Initial device configuration when device is opened
492 : : * setup the DDM, and UDM
493 : : * Called once per PCIE device
494 : : */
495 : : static int
496 : 0 : ark_config_device(struct rte_eth_dev *dev)
497 : : {
498 : 0 : struct ark_adapter *ark = dev->data->dev_private;
499 : : uint16_t num_q, i;
500 : : struct ark_mpu_t *mpu;
501 : :
502 : : /*
503 : : * Make sure that the packet director, generator and checker are in a
504 : : * known state
505 : : */
506 [ # # ]: 0 : if (!ark->isvf) {
507 : 0 : ark->start_pg = 0;
508 : 0 : ark->pg_running = 0;
509 : 0 : ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
510 [ # # ]: 0 : if (ark->pg == NULL)
511 : : return -1;
512 : 0 : ark_pktgen_reset(ark->pg);
513 : 0 : ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);
514 [ # # ]: 0 : if (ark->pc == NULL)
515 : : return -1;
516 : 0 : ark_pktchkr_stop(ark->pc);
517 : 0 : ark->pd = ark_pktdir_init(ark->pktdir.v);
518 [ # # ]: 0 : if (ark->pd == NULL)
519 : : return -1;
520 : : }
521 : : /* Verify HW */
522 [ # # ]: 0 : if (ark_udm_verify(ark->udm.v))
523 : : return -1;
524 [ # # ]: 0 : if (ark_ddm_verify(ark->ddm.v))
525 : : return -1;
526 : :
527 : : /* MPU reset */
528 : 0 : mpu = ark->mpurx.v;
529 : 0 : num_q = ark_api_num_queues(mpu);
530 : 0 : ark->rx_queues = num_q;
531 : : for (i = 0; i < num_q; i++) {
532 : : mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
533 : : }
534 : :
535 : 0 : mpu = ark->mputx.v;
536 : 0 : num_q = ark_api_num_queues(mpu);
537 : 0 : ark->tx_queues = num_q;
538 : 0 : for (i = 0; i < num_q; i++) {
539 : : mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
540 : : }
541 : :
542 : : return 0;
543 : : }
544 : :
545 : : static int
546 : 0 : ark_dev_uninit(struct rte_eth_dev *dev)
547 : : {
548 : 0 : struct ark_adapter *ark = dev->data->dev_private;
549 : :
550 [ # # ]: 0 : if (rte_eal_process_type() != RTE_PROC_PRIMARY)
551 : : return 0;
552 : :
553 [ # # ]: 0 : if (ark->user_ext.dev_uninit)
554 : 0 : ark->user_ext.dev_uninit(dev,
555 : 0 : ark->user_data[dev->data->port_id]);
556 : :
557 [ # # ]: 0 : if (!ark->isvf) {
558 : 0 : ark_pktgen_uninit(ark->pg);
559 : 0 : ark_pktchkr_uninit(ark->pc);
560 : : }
561 : :
562 : : return 0;
563 : : }
564 : :
565 : : static int
566 : 0 : ark_dev_configure(struct rte_eth_dev *dev)
567 : : {
568 : 0 : struct ark_adapter *ark = dev->data->dev_private;
569 : :
570 : : ark_dev_set_link_up(dev);
571 [ # # ]: 0 : if (ark->user_ext.dev_configure)
572 : 0 : return ark->user_ext.dev_configure(dev,
573 : 0 : ark->user_data[dev->data->port_id]);
574 : : return 0;
575 : : }
576 : :
577 : : static int
578 : 0 : ark_dev_start(struct rte_eth_dev *dev)
579 : : {
580 : 0 : struct ark_adapter *ark = dev->data->dev_private;
581 : : int i;
582 : :
583 : : /* RX Side */
584 [ # # ]: 0 : for (i = 0; i < dev->data->nb_rx_queues; i++)
585 : 0 : ark_rx_start_queue(dev, i);
586 : :
587 : : /* TX Side */
588 [ # # ]: 0 : for (i = 0; i < dev->data->nb_tx_queues; i++)
589 : 0 : ark_tx_queue_start(dev, i);
590 : :
591 : 0 : ark->started = 1;
592 : : /* set xmit and receive function */
593 : 0 : dev->rx_pkt_burst = &ark_recv_pkts;
594 : 0 : dev->tx_pkt_burst = &ark_xmit_pkts;
595 : :
596 [ # # # # ]: 0 : if (!ark->isvf && ark->start_pg)
597 : 0 : ark_pktchkr_run(ark->pc);
598 : :
599 [ # # # # : 0 : if (!ark->isvf && ark->start_pg && !ark->pg_running) {
# # ]
600 : : rte_thread_t thread;
601 : :
602 : : /* Delay packet generator start allow the hardware to be ready
603 : : * This is only used for sanity checking with internal generator
604 : : */
605 : : char tname[RTE_THREAD_INTERNAL_NAME_SIZE];
606 : 0 : snprintf(tname, sizeof(tname), "ark-pg%d", dev->data->port_id);
607 : :
608 [ # # ]: 0 : if (rte_thread_create_internal_control(&thread, tname,
609 : : ark_pktgen_delay_start, ark->pg)) {
610 : 0 : ARK_PMD_LOG(ERR, "Could not create pktgen "
611 : : "starter thread\n");
612 : 0 : return -1;
613 : : }
614 : 0 : ark->pg_running = 1;
615 : : }
616 : :
617 [ # # ]: 0 : if (ark->user_ext.dev_start)
618 : 0 : ark->user_ext.dev_start(dev,
619 : 0 : ark->user_data[dev->data->port_id]);
620 : :
621 : : return 0;
622 : : }
623 : :
624 : : static int
625 : 0 : ark_dev_stop(struct rte_eth_dev *dev)
626 : : {
627 : : uint16_t i;
628 : : int status;
629 : 0 : struct ark_adapter *ark = dev->data->dev_private;
630 : :
631 [ # # ]: 0 : if (ark->started == 0)
632 : : return 0;
633 : 0 : ark->started = 0;
634 : 0 : dev->data->dev_started = 0;
635 : :
636 : : /* Stop the extension first */
637 [ # # ]: 0 : if (ark->user_ext.dev_stop)
638 : 0 : ark->user_ext.dev_stop(dev,
639 : 0 : ark->user_data[dev->data->port_id]);
640 : :
641 : : /* Stop the packet generator */
642 [ # # # # : 0 : if (!ark->isvf && ark->start_pg && ark->pg_running) {
# # ]
643 : 0 : ark_pktgen_pause(ark->pg);
644 : 0 : ark->pg_running = 0;
645 : : }
646 : :
647 : 0 : dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
648 : 0 : dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
649 : :
650 : : /* Stop RX Side */
651 [ # # ]: 0 : for (i = 0; i < dev->data->nb_rx_queues; i++)
652 : 0 : ark_rx_stop_queue(dev, i);
653 : :
654 : : /* STOP TX Side */
655 [ # # ]: 0 : for (i = 0; i < dev->data->nb_tx_queues; i++) {
656 : 0 : status = ark_tx_queue_stop(dev, i);
657 [ # # ]: 0 : if (status != 0) {
658 : 0 : uint16_t port = dev->data->port_id;
659 : 0 : ARK_PMD_LOG(ERR,
660 : : "tx_queue stop anomaly"
661 : : " port %u, queue %u\n",
662 : : port, i);
663 : : }
664 : : }
665 : :
666 : 0 : ark_udm_dump_stats(ark->udm.v, "Post stop");
667 : :
668 [ # # ]: 0 : for (i = 0; i < dev->data->nb_rx_queues; i++)
669 : 0 : ark_rx_dump_queue(dev, i, __func__);
670 : :
671 : : /* Stop the packet checker if it is running */
672 [ # # # # ]: 0 : if (!ark->isvf && ark->start_pg) {
673 : 0 : ark_pktchkr_dump_stats(ark->pc);
674 : 0 : ark_pktchkr_stop(ark->pc);
675 : : }
676 : :
677 : : return 0;
678 : : }
679 : :
680 : : static int
681 : 0 : ark_dev_close(struct rte_eth_dev *dev)
682 : : {
683 : 0 : struct ark_adapter *ark = dev->data->dev_private;
684 : : uint16_t i;
685 : :
686 [ # # ]: 0 : if (rte_eal_process_type() != RTE_PROC_PRIMARY)
687 : : return 0;
688 : :
689 [ # # ]: 0 : if (ark->user_ext.dev_close)
690 : 0 : ark->user_ext.dev_close(dev,
691 : 0 : ark->user_data[dev->data->port_id]);
692 : :
693 : 0 : ark_dev_stop(dev);
694 : :
695 : : /*
696 : : * This should only be called once for the device during shutdown
697 : : */
698 : : /* return to power-on state */
699 [ # # ]: 0 : if (ark->pd)
700 : 0 : ark_pktdir_setup(ark->pd, ARK_PKT_DIR_INIT_VAL);
701 : :
702 [ # # ]: 0 : for (i = 0; i < dev->data->nb_tx_queues; i++) {
703 : 0 : ark_tx_queue_release(dev->data->tx_queues[i]);
704 : 0 : dev->data->tx_queues[i] = 0;
705 : : }
706 : :
707 [ # # ]: 0 : for (i = 0; i < dev->data->nb_rx_queues; i++) {
708 : 0 : ark_dev_rx_queue_release(dev->data->rx_queues[i]);
709 : 0 : dev->data->rx_queues[i] = 0;
710 : : }
711 : :
712 : : return 0;
713 : : }
714 : :
715 : : static int
716 : 0 : ark_dev_info_get(struct rte_eth_dev *dev,
717 : : struct rte_eth_dev_info *dev_info)
718 : : {
719 : 0 : struct ark_adapter *ark = dev->data->dev_private;
720 : 0 : struct ark_mpu_t *tx_mpu = RTE_PTR_ADD(ark->bar0, ARK_MPU_TX_BASE);
721 : 0 : struct ark_mpu_t *rx_mpu = RTE_PTR_ADD(ark->bar0, ARK_MPU_RX_BASE);
722 : 0 : uint16_t ports = ark->num_ports;
723 : :
724 : 0 : dev_info->max_rx_pktlen = ARK_RX_MAX_PKT_LEN;
725 : 0 : dev_info->min_rx_bufsize = ARK_RX_MIN_BUFSIZE;
726 : :
727 : 0 : dev_info->max_rx_queues = ark_api_num_queues_per_port(rx_mpu, ports);
728 : 0 : dev_info->max_tx_queues = ark_api_num_queues_per_port(tx_mpu, ports);
729 : :
730 : 0 : dev_info->rx_desc_lim = (struct rte_eth_desc_lim) {
731 : : .nb_max = ARK_RX_MAX_QUEUE,
732 : : .nb_min = ARK_RX_MIN_QUEUE,
733 : : .nb_align = ARK_RX_MIN_QUEUE}; /* power of 2 */
734 : :
735 : 0 : dev_info->tx_desc_lim = (struct rte_eth_desc_lim) {
736 : : .nb_max = ARK_TX_MAX_QUEUE,
737 : : .nb_min = ARK_TX_MIN_QUEUE,
738 : : .nb_align = ARK_TX_MIN_QUEUE}; /* power of 2 */
739 : :
740 : : /* ARK PMD supports all line rates, how do we indicate that here ?? */
741 : 0 : dev_info->speed_capa = (RTE_ETH_LINK_SPEED_1G |
742 : : RTE_ETH_LINK_SPEED_10G |
743 : : RTE_ETH_LINK_SPEED_25G |
744 : : RTE_ETH_LINK_SPEED_40G |
745 : : RTE_ETH_LINK_SPEED_50G |
746 : : RTE_ETH_LINK_SPEED_100G |
747 : : RTE_ETH_LINK_SPEED_200G |
748 : : RTE_ETH_LINK_SPEED_400G);
749 : :
750 : 0 : dev_info->rx_offload_capa = RTE_ETH_RX_OFFLOAD_TIMESTAMP;
751 : :
752 : 0 : return 0;
753 : : }
754 : :
755 : : static int
756 : 0 : ark_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
757 : : {
758 : 0 : ARK_PMD_LOG(DEBUG, "link status = %d\n",
759 : : dev->data->dev_link.link_status);
760 : 0 : struct ark_adapter *ark = dev->data->dev_private;
761 : :
762 [ # # ]: 0 : if (ark->user_ext.link_update) {
763 : 0 : return ark->user_ext.link_update
764 : : (dev, wait_to_complete,
765 : 0 : ark->user_data[dev->data->port_id]);
766 : : }
767 : : return 0;
768 : : }
769 : :
770 : : static int
771 : 0 : ark_dev_set_link_up(struct rte_eth_dev *dev)
772 : : {
773 : 0 : dev->data->dev_link.link_status = 1;
774 : 0 : struct ark_adapter *ark = dev->data->dev_private;
775 : :
776 [ # # # # ]: 0 : if (ark->user_ext.dev_set_link_up)
777 : 0 : return ark->user_ext.dev_set_link_up(dev,
778 : 0 : ark->user_data[dev->data->port_id]);
779 : : return 0;
780 : : }
781 : :
782 : : static int
783 : 0 : ark_dev_set_link_down(struct rte_eth_dev *dev)
784 : : {
785 : 0 : dev->data->dev_link.link_status = 0;
786 : 0 : struct ark_adapter *ark = dev->data->dev_private;
787 : :
788 [ # # ]: 0 : if (ark->user_ext.dev_set_link_down)
789 : 0 : return ark->user_ext.dev_set_link_down(dev,
790 : 0 : ark->user_data[dev->data->port_id]);
791 : : return 0;
792 : : }
793 : :
794 : : static int
795 : 0 : ark_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats,
796 : : struct eth_queue_stats *qstats)
797 : : {
798 : : uint16_t i;
799 : 0 : struct ark_adapter *ark = dev->data->dev_private;
800 : :
801 : 0 : stats->ipackets = 0;
802 : 0 : stats->ibytes = 0;
803 : 0 : stats->opackets = 0;
804 : 0 : stats->obytes = 0;
805 : 0 : stats->imissed = 0;
806 : 0 : stats->oerrors = 0;
807 : :
808 [ # # ]: 0 : for (i = 0; i < dev->data->nb_tx_queues; i++)
809 : 0 : ark_tx_queue_stats_get(dev->data->tx_queues[i], stats, qstats);
810 [ # # ]: 0 : for (i = 0; i < dev->data->nb_rx_queues; i++)
811 : 0 : ark_rx_queue_stats_get(dev->data->rx_queues[i], stats, qstats);
812 [ # # ]: 0 : if (ark->user_ext.stats_get)
813 : 0 : return ark->user_ext.stats_get(dev, stats,
814 : 0 : ark->user_data[dev->data->port_id]);
815 : : return 0;
816 : : }
817 : :
818 : : static int
819 : 0 : ark_dev_stats_reset(struct rte_eth_dev *dev)
820 : : {
821 : : uint16_t i;
822 : 0 : struct ark_adapter *ark = dev->data->dev_private;
823 : :
824 [ # # ]: 0 : for (i = 0; i < dev->data->nb_tx_queues; i++)
825 : 0 : ark_tx_queue_stats_reset(dev->data->tx_queues[i]);
826 [ # # ]: 0 : for (i = 0; i < dev->data->nb_rx_queues; i++)
827 : 0 : ark_rx_queue_stats_reset(dev->data->rx_queues[i]);
828 [ # # ]: 0 : if (ark->user_ext.stats_reset)
829 : 0 : ark->user_ext.stats_reset(dev,
830 : 0 : ark->user_data[dev->data->port_id]);
831 : :
832 : 0 : return 0;
833 : : }
834 : :
835 : : static int
836 : 0 : ark_macaddr_add(struct rte_eth_dev *dev,
837 : : struct rte_ether_addr *mac_addr,
838 : : uint32_t index,
839 : : uint32_t pool)
840 : : {
841 : 0 : struct ark_adapter *ark = dev->data->dev_private;
842 : :
843 [ # # ]: 0 : if (ark->user_ext.mac_addr_add) {
844 : 0 : ark->user_ext.mac_addr_add(dev,
845 : : mac_addr,
846 : : index,
847 : : pool,
848 : 0 : ark->user_data[dev->data->port_id]);
849 : 0 : return 0;
850 : : }
851 : : return -ENOTSUP;
852 : : }
853 : :
854 : : static void
855 : 0 : ark_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
856 : : {
857 : 0 : struct ark_adapter *ark = dev->data->dev_private;
858 : :
859 [ # # ]: 0 : if (ark->user_ext.mac_addr_remove)
860 : 0 : ark->user_ext.mac_addr_remove(dev, index,
861 : 0 : ark->user_data[dev->data->port_id]);
862 : 0 : }
863 : :
864 : : static int
865 : 0 : ark_set_default_mac_addr(struct rte_eth_dev *dev,
866 : : struct rte_ether_addr *mac_addr)
867 : : {
868 : 0 : struct ark_adapter *ark = dev->data->dev_private;
869 : :
870 [ # # ]: 0 : if (ark->user_ext.mac_addr_set) {
871 : 0 : ark->user_ext.mac_addr_set(dev, mac_addr,
872 : 0 : ark->user_data[dev->data->port_id]);
873 : 0 : return 0;
874 : : }
875 : : return -ENOTSUP;
876 : : }
877 : :
878 : : static int
879 : 0 : ark_set_mtu(struct rte_eth_dev *dev, uint16_t size)
880 : : {
881 : 0 : struct ark_adapter *ark = dev->data->dev_private;
882 : :
883 [ # # ]: 0 : if (ark->user_ext.set_mtu)
884 : 0 : return ark->user_ext.set_mtu(dev, size,
885 : 0 : ark->user_data[dev->data->port_id]);
886 : :
887 : : return -ENOTSUP;
888 : : }
889 : :
890 : : static inline int
891 : 0 : process_pktdir_arg(const char *key, const char *value,
892 : : void *extra_args)
893 : : {
894 : 0 : ARK_PMD_LOG(DEBUG, "key = %s, value = %s\n",
895 : : key, value);
896 : : struct ark_adapter *ark =
897 : : (struct ark_adapter *)extra_args;
898 : :
899 : 0 : ark->pkt_dir_v = strtol(value, NULL, 16);
900 : 0 : ARK_PMD_LOG(DEBUG, "pkt_dir_v = 0x%x\n", ark->pkt_dir_v);
901 : 0 : return 0;
902 : : }
903 : :
904 : : static inline int
905 : 0 : process_file_args(const char *key, const char *value, void *extra_args)
906 : : {
907 : 0 : ARK_PMD_LOG(DEBUG, "key = %s, value = %s\n",
908 : : key, value);
909 : : char *args = (char *)extra_args;
910 : :
911 : : /* Open the configuration file */
912 : 0 : FILE *file = fopen(value, "r");
913 : : char line[ARK_MAX_ARG_LEN];
914 : : int size = 0;
915 : : int first = 1;
916 : :
917 [ # # ]: 0 : if (file == NULL) {
918 : 0 : ARK_PMD_LOG(ERR, "Unable to open "
919 : : "config file %s\n", value);
920 : 0 : return -1;
921 : : }
922 : :
923 [ # # ]: 0 : while (fgets(line, sizeof(line), file)) {
924 : 0 : size += strlen(line);
925 [ # # ]: 0 : if (size >= ARK_MAX_ARG_LEN) {
926 : 0 : ARK_PMD_LOG(ERR, "Unable to parse file %s args, "
927 : : "parameter list is too long\n", value);
928 : 0 : fclose(file);
929 : 0 : return -1;
930 : : }
931 [ # # ]: 0 : if (first) {
932 : : strncpy(args, line, ARK_MAX_ARG_LEN);
933 : : first = 0;
934 : : } else {
935 : : strncat(args, line, ARK_MAX_ARG_LEN);
936 : : }
937 : : }
938 : 0 : ARK_PMD_LOG(DEBUG, "file = %s\n", args);
939 : 0 : fclose(file);
940 : 0 : return 0;
941 : : }
942 : :
943 : : static int
944 : 0 : ark_check_args(struct ark_adapter *ark, const char *params)
945 : : {
946 : : struct rte_kvargs *kvlist;
947 : : unsigned int k_idx;
948 : : struct rte_kvargs_pair *pair = NULL;
949 : : int ret = -1;
950 : :
951 : 0 : kvlist = rte_kvargs_parse(params, valid_arguments);
952 [ # # ]: 0 : if (kvlist == NULL)
953 : : return 0;
954 : :
955 : 0 : ark->pkt_gen_args[0] = 0;
956 : 0 : ark->pkt_chkr_args[0] = 0;
957 : :
958 [ # # ]: 0 : for (k_idx = 0; k_idx < kvlist->count; k_idx++) {
959 : : pair = &kvlist->pairs[k_idx];
960 : 0 : ARK_PMD_LOG(DEBUG, "**** Arg passed to PMD = %s:%s\n",
961 : : pair->key,
962 : : pair->value);
963 : : }
964 : :
965 [ # # ]: 0 : if (rte_kvargs_process(kvlist,
966 : : ARK_PKTDIR_ARG,
967 : : &process_pktdir_arg,
968 : : ark) != 0) {
969 : 0 : ARK_PMD_LOG(ERR, "Unable to parse arg %s\n", ARK_PKTDIR_ARG);
970 : 0 : goto free_kvlist;
971 : : }
972 : :
973 [ # # ]: 0 : if (rte_kvargs_process(kvlist,
974 : : ARK_PKTGEN_ARG,
975 : : &process_file_args,
976 : 0 : ark->pkt_gen_args) != 0) {
977 : 0 : ARK_PMD_LOG(ERR, "Unable to parse arg %s\n", ARK_PKTGEN_ARG);
978 : 0 : goto free_kvlist;
979 : : }
980 : :
981 [ # # ]: 0 : if (rte_kvargs_process(kvlist,
982 : : ARK_PKTCHKR_ARG,
983 : : &process_file_args,
984 : 0 : ark->pkt_chkr_args) != 0) {
985 : 0 : ARK_PMD_LOG(ERR, "Unable to parse arg %s\n", ARK_PKTCHKR_ARG);
986 : 0 : goto free_kvlist;
987 : : }
988 : :
989 [ # # ]: 0 : if (ark->isvf) {
990 : : ret = 0;
991 : 0 : goto free_kvlist;
992 : : }
993 : 0 : ARK_PMD_LOG(INFO, "packet director set to 0x%x\n", ark->pkt_dir_v);
994 : : /* Setup the packet director */
995 : 0 : ark_pktdir_setup(ark->pd, ark->pkt_dir_v);
996 : :
997 : : /* Setup the packet generator */
998 [ # # ]: 0 : if (ark->pkt_gen_args[0]) {
999 : 0 : ARK_PMD_LOG(DEBUG, "Setting up the packet generator\n");
1000 : 0 : ark_pktgen_parse(ark->pkt_gen_args);
1001 : 0 : ark_pktgen_reset(ark->pg);
1002 : 0 : ark_pktgen_setup(ark->pg);
1003 : 0 : ark->start_pg = 1;
1004 : : }
1005 : :
1006 : : /* Setup the packet checker */
1007 [ # # ]: 0 : if (ark->pkt_chkr_args[0]) {
1008 : 0 : ark_pktchkr_parse(ark->pkt_chkr_args);
1009 : 0 : ark_pktchkr_setup(ark->pc);
1010 : : }
1011 : :
1012 : : ret = 0;
1013 : :
1014 : 0 : free_kvlist:
1015 : 0 : rte_kvargs_free(kvlist);
1016 : :
1017 : 0 : return ret;
1018 : : }
1019 : :
1020 : 301 : RTE_PMD_REGISTER_PCI(net_ark, rte_ark_pmd);
1021 : : RTE_PMD_REGISTER_KMOD_DEP(net_ark, "* igb_uio | uio_pci_generic ");
1022 : : RTE_PMD_REGISTER_PCI_TABLE(net_ark, pci_id_ark_map);
1023 : : RTE_PMD_REGISTER_PARAM_STRING(net_ark,
1024 : : ARK_PKTGEN_ARG "=<filename> "
1025 : : ARK_PKTCHKR_ARG "=<filename> "
1026 : : ARK_PKTDIR_ARG "=<bitmap>");
1027 [ - + ]: 301 : RTE_LOG_REGISTER_DEFAULT(ark_logtype, NOTICE);
|