net/ice: support device initialization
[dpdk.git] / drivers / net / ice / ice_ethdev.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Intel Corporation
3  */
4
5 #include <rte_ethdev_pci.h>
6
7 #include "base/ice_sched.h"
8 #include "ice_ethdev.h"
9
10 #define ICE_MAX_QP_NUM "max_queue_pair_num"
11 #define ICE_DFLT_OUTER_TAG_TYPE ICE_AQ_VSI_OUTER_TAG_VLAN_9100
12
13 int ice_logtype_init;
14 int ice_logtype_driver;
15
16 static const struct rte_pci_id pci_id_ice_map[] = {
17         { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_BACKPLANE) },
18         { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_QSFP) },
19         { RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_SFP) },
20         { .vendor_id = 0, /* sentinel */ },
21 };
22
23 static const struct eth_dev_ops ice_eth_dev_ops = {
24         .dev_configure                = NULL,
25 };
26
27 static void
28 ice_init_controlq_parameter(struct ice_hw *hw)
29 {
30         /* fields for adminq */
31         hw->adminq.num_rq_entries = ICE_ADMINQ_LEN;
32         hw->adminq.num_sq_entries = ICE_ADMINQ_LEN;
33         hw->adminq.rq_buf_size = ICE_ADMINQ_BUF_SZ;
34         hw->adminq.sq_buf_size = ICE_ADMINQ_BUF_SZ;
35
36         /* fields for mailboxq, DPDK used as PF host */
37         hw->mailboxq.num_rq_entries = ICE_MAILBOXQ_LEN;
38         hw->mailboxq.num_sq_entries = ICE_MAILBOXQ_LEN;
39         hw->mailboxq.rq_buf_size = ICE_MAILBOXQ_BUF_SZ;
40         hw->mailboxq.sq_buf_size = ICE_MAILBOXQ_BUF_SZ;
41 }
42
43 static int
44 ice_check_qp_num(const char *key, const char *qp_value,
45                  __rte_unused void *opaque)
46 {
47         char *end = NULL;
48         int num = 0;
49
50         while (isblank(*qp_value))
51                 qp_value++;
52
53         num = strtoul(qp_value, &end, 10);
54
55         if (!num || (*end == '-') || errno) {
56                 PMD_DRV_LOG(WARNING, "invalid value:\"%s\" for key:\"%s\", "
57                             "value must be > 0",
58                             qp_value, key);
59                 return -1;
60         }
61
62         return num;
63 }
64
65 static int
66 ice_config_max_queue_pair_num(struct rte_devargs *devargs)
67 {
68         struct rte_kvargs *kvlist;
69         const char *queue_num_key = ICE_MAX_QP_NUM;
70         int ret;
71
72         if (!devargs)
73                 return 0;
74
75         kvlist = rte_kvargs_parse(devargs->args, NULL);
76         if (!kvlist)
77                 return 0;
78
79         if (!rte_kvargs_count(kvlist, queue_num_key)) {
80                 rte_kvargs_free(kvlist);
81                 return 0;
82         }
83
84         if (rte_kvargs_process(kvlist, queue_num_key,
85                                ice_check_qp_num, NULL) < 0) {
86                 rte_kvargs_free(kvlist);
87                 return 0;
88         }
89         ret = rte_kvargs_process(kvlist, queue_num_key,
90                                  ice_check_qp_num, NULL);
91         rte_kvargs_free(kvlist);
92
93         return ret;
94 }
95
96 static int
97 ice_res_pool_init(struct ice_res_pool_info *pool, uint32_t base,
98                   uint32_t num)
99 {
100         struct pool_entry *entry;
101
102         if (!pool || !num)
103                 return -EINVAL;
104
105         entry = rte_zmalloc(NULL, sizeof(*entry), 0);
106         if (!entry) {
107                 PMD_INIT_LOG(ERR,
108                              "Failed to allocate memory for resource pool");
109                 return -ENOMEM;
110         }
111
112         /* queue heap initialize */
113         pool->num_free = num;
114         pool->num_alloc = 0;
115         pool->base = base;
116         LIST_INIT(&pool->alloc_list);
117         LIST_INIT(&pool->free_list);
118
119         /* Initialize element  */
120         entry->base = 0;
121         entry->len = num;
122
123         LIST_INSERT_HEAD(&pool->free_list, entry, next);
124         return 0;
125 }
126
127 static int
128 ice_res_pool_alloc(struct ice_res_pool_info *pool,
129                    uint16_t num)
130 {
131         struct pool_entry *entry, *valid_entry;
132
133         if (!pool || !num) {
134                 PMD_INIT_LOG(ERR, "Invalid parameter");
135                 return -EINVAL;
136         }
137
138         if (pool->num_free < num) {
139                 PMD_INIT_LOG(ERR, "No resource. ask:%u, available:%u",
140                              num, pool->num_free);
141                 return -ENOMEM;
142         }
143
144         valid_entry = NULL;
145         /* Lookup  in free list and find most fit one */
146         LIST_FOREACH(entry, &pool->free_list, next) {
147                 if (entry->len >= num) {
148                         /* Find best one */
149                         if (entry->len == num) {
150                                 valid_entry = entry;
151                                 break;
152                         }
153                         if (!valid_entry ||
154                             valid_entry->len > entry->len)
155                                 valid_entry = entry;
156                 }
157         }
158
159         /* Not find one to satisfy the request, return */
160         if (!valid_entry) {
161                 PMD_INIT_LOG(ERR, "No valid entry found");
162                 return -ENOMEM;
163         }
164         /**
165          * The entry have equal queue number as requested,
166          * remove it from alloc_list.
167          */
168         if (valid_entry->len == num) {
169                 LIST_REMOVE(valid_entry, next);
170         } else {
171                 /**
172                  * The entry have more numbers than requested,
173                  * create a new entry for alloc_list and minus its
174                  * queue base and number in free_list.
175                  */
176                 entry = rte_zmalloc(NULL, sizeof(*entry), 0);
177                 if (!entry) {
178                         PMD_INIT_LOG(ERR,
179                                      "Failed to allocate memory for "
180                                      "resource pool");
181                         return -ENOMEM;
182                 }
183                 entry->base = valid_entry->base;
184                 entry->len = num;
185                 valid_entry->base += num;
186                 valid_entry->len -= num;
187                 valid_entry = entry;
188         }
189
190         /* Insert it into alloc list, not sorted */
191         LIST_INSERT_HEAD(&pool->alloc_list, valid_entry, next);
192
193         pool->num_free -= valid_entry->len;
194         pool->num_alloc += valid_entry->len;
195
196         return valid_entry->base + pool->base;
197 }
198
199 static void
200 ice_res_pool_destroy(struct ice_res_pool_info *pool)
201 {
202         struct pool_entry *entry, *next_entry;
203
204         if (!pool)
205                 return;
206
207         for (entry = LIST_FIRST(&pool->alloc_list);
208              entry && (next_entry = LIST_NEXT(entry, next), 1);
209              entry = next_entry) {
210                 LIST_REMOVE(entry, next);
211                 rte_free(entry);
212         }
213
214         for (entry = LIST_FIRST(&pool->free_list);
215              entry && (next_entry = LIST_NEXT(entry, next), 1);
216              entry = next_entry) {
217                 LIST_REMOVE(entry, next);
218                 rte_free(entry);
219         }
220
221         pool->num_free = 0;
222         pool->num_alloc = 0;
223         pool->base = 0;
224         LIST_INIT(&pool->alloc_list);
225         LIST_INIT(&pool->free_list);
226 }
227
228 static void
229 ice_vsi_config_default_rss(struct ice_aqc_vsi_props *info)
230 {
231         /* Set VSI LUT selection */
232         info->q_opt_rss = ICE_AQ_VSI_Q_OPT_RSS_LUT_VSI &
233                           ICE_AQ_VSI_Q_OPT_RSS_LUT_M;
234         /* Set Hash scheme */
235         info->q_opt_rss |= ICE_AQ_VSI_Q_OPT_RSS_TPLZ &
236                            ICE_AQ_VSI_Q_OPT_RSS_HASH_M;
237         /* enable TC */
238         info->q_opt_tc = ICE_AQ_VSI_Q_OPT_TC_OVR_M;
239 }
240
241 static enum ice_status
242 ice_vsi_config_tc_queue_mapping(struct ice_vsi *vsi,
243                                 struct ice_aqc_vsi_props *info,
244                                 uint8_t enabled_tcmap)
245 {
246         uint16_t bsf, qp_idx;
247
248         /* default tc 0 now. Multi-TC supporting need to be done later.
249          * Configure TC and queue mapping parameters, for enabled TC,
250          * allocate qpnum_per_tc queues to this traffic.
251          */
252         if (enabled_tcmap != 0x01) {
253                 PMD_INIT_LOG(ERR, "only TC0 is supported");
254                 return -ENOTSUP;
255         }
256
257         vsi->nb_qps = RTE_MIN(vsi->nb_qps, ICE_MAX_Q_PER_TC);
258         bsf = rte_bsf32(vsi->nb_qps);
259         /* Adjust the queue number to actual queues that can be applied */
260         vsi->nb_qps = 0x1 << bsf;
261
262         qp_idx = 0;
263         /* Set tc and queue mapping with VSI */
264         info->tc_mapping[0] = rte_cpu_to_le_16((qp_idx <<
265                                                 ICE_AQ_VSI_TC_Q_OFFSET_S) |
266                                                (bsf << ICE_AQ_VSI_TC_Q_NUM_S));
267
268         /* Associate queue number with VSI */
269         info->mapping_flags |= rte_cpu_to_le_16(ICE_AQ_VSI_Q_MAP_CONTIG);
270         info->q_mapping[0] = rte_cpu_to_le_16(vsi->base_queue);
271         info->q_mapping[1] = rte_cpu_to_le_16(vsi->nb_qps);
272         info->valid_sections |=
273                 rte_cpu_to_le_16(ICE_AQ_VSI_PROP_RXQ_MAP_VALID);
274         /* Set the info.ingress_table and info.egress_table
275          * for UP translate table. Now just set it to 1:1 map by default
276          * -- 0b 111 110 101 100 011 010 001 000 == 0xFAC688
277          */
278 #define ICE_TC_QUEUE_TABLE_DFLT 0x00FAC688
279         info->ingress_table  = rte_cpu_to_le_32(ICE_TC_QUEUE_TABLE_DFLT);
280         info->egress_table   = rte_cpu_to_le_32(ICE_TC_QUEUE_TABLE_DFLT);
281         info->outer_up_table = rte_cpu_to_le_32(ICE_TC_QUEUE_TABLE_DFLT);
282         return 0;
283 }
284
285 static int
286 ice_init_mac_address(struct rte_eth_dev *dev)
287 {
288         struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
289
290         if (!is_unicast_ether_addr
291                 ((struct ether_addr *)hw->port_info[0].mac.lan_addr)) {
292                 PMD_INIT_LOG(ERR, "Invalid MAC address");
293                 return -EINVAL;
294         }
295
296         ether_addr_copy((struct ether_addr *)hw->port_info[0].mac.lan_addr,
297                         (struct ether_addr *)hw->port_info[0].mac.perm_addr);
298
299         dev->data->mac_addrs = rte_zmalloc(NULL, sizeof(struct ether_addr), 0);
300         if (!dev->data->mac_addrs) {
301                 PMD_INIT_LOG(ERR,
302                              "Failed to allocate memory to store mac address");
303                 return -ENOMEM;
304         }
305         /* store it to dev data */
306         ether_addr_copy((struct ether_addr *)hw->port_info[0].mac.perm_addr,
307                         &dev->data->mac_addrs[0]);
308         return 0;
309 }
310
311 /*  Initialize SW parameters of PF */
312 static int
313 ice_pf_sw_init(struct rte_eth_dev *dev)
314 {
315         struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
316         struct ice_hw *hw = ICE_PF_TO_HW(pf);
317
318         if (ice_config_max_queue_pair_num(dev->device->devargs) > 0)
319                 pf->lan_nb_qp_max =
320                         ice_config_max_queue_pair_num(dev->device->devargs);
321         else
322                 pf->lan_nb_qp_max =
323                         (uint16_t)RTE_MIN(hw->func_caps.common_cap.num_txq,
324                                           hw->func_caps.common_cap.num_rxq);
325
326         pf->lan_nb_qps = pf->lan_nb_qp_max;
327
328         return 0;
329 }
330
331 static struct ice_vsi *
332 ice_setup_vsi(struct ice_pf *pf, enum ice_vsi_type type)
333 {
334         struct ice_hw *hw = ICE_PF_TO_HW(pf);
335         struct ice_vsi *vsi = NULL;
336         struct ice_vsi_ctx vsi_ctx;
337         int ret;
338         uint16_t max_txqs[ICE_MAX_TRAFFIC_CLASS] = { 0 };
339         uint8_t tc_bitmap = 0x1;
340
341         /* hw->num_lports = 1 in NIC mode */
342         vsi = rte_zmalloc(NULL, sizeof(struct ice_vsi), 0);
343         if (!vsi)
344                 return NULL;
345
346         vsi->idx = pf->next_vsi_idx;
347         pf->next_vsi_idx++;
348         vsi->type = type;
349         vsi->adapter = ICE_PF_TO_ADAPTER(pf);
350         vsi->max_macaddrs = ICE_NUM_MACADDR_MAX;
351         vsi->vlan_anti_spoof_on = 0;
352         vsi->vlan_filter_on = 1;
353         TAILQ_INIT(&vsi->mac_list);
354         TAILQ_INIT(&vsi->vlan_list);
355
356         memset(&vsi_ctx, 0, sizeof(vsi_ctx));
357         /* base_queue in used in queue mapping of VSI add/update command.
358          * Suppose vsi->base_queue is 0 now, don't consider SRIOV, VMDQ
359          * cases in the first stage. Only Main VSI.
360          */
361         vsi->base_queue = 0;
362         switch (type) {
363         case ICE_VSI_PF:
364                 vsi->nb_qps = pf->lan_nb_qps;
365                 ice_vsi_config_default_rss(&vsi_ctx.info);
366                 vsi_ctx.alloc_from_pool = true;
367                 vsi_ctx.flags = ICE_AQ_VSI_TYPE_PF;
368                 /* switch_id is queried by get_switch_config aq, which is done
369                  * by ice_init_hw
370                  */
371                 vsi_ctx.info.sw_id = hw->port_info->sw_id;
372                 vsi_ctx.info.sw_flags2 = ICE_AQ_VSI_SW_FLAG_LAN_ENA;
373                 /* Allow all untagged or tagged packets */
374                 vsi_ctx.info.vlan_flags = ICE_AQ_VSI_VLAN_MODE_ALL;
375                 vsi_ctx.info.vlan_flags |= ICE_AQ_VSI_VLAN_EMOD_NOTHING;
376                 vsi_ctx.info.q_opt_rss = ICE_AQ_VSI_Q_OPT_RSS_LUT_PF |
377                                          ICE_AQ_VSI_Q_OPT_RSS_TPLZ;
378                 /* Enable VLAN/UP trip */
379                 ret = ice_vsi_config_tc_queue_mapping(vsi,
380                                                       &vsi_ctx.info,
381                                                       ICE_DEFAULT_TCMAP);
382                 if (ret) {
383                         PMD_INIT_LOG(ERR,
384                                      "tc queue mapping with vsi failed, "
385                                      "err = %d",
386                                      ret);
387                         goto fail_mem;
388                 }
389
390                 break;
391         default:
392                 /* for other types of VSI */
393                 PMD_INIT_LOG(ERR, "other types of VSI not supported");
394                 goto fail_mem;
395         }
396
397         /* VF has MSIX interrupt in VF range, don't allocate here */
398         if (type == ICE_VSI_PF) {
399                 ret = ice_res_pool_alloc(&pf->msix_pool,
400                                          RTE_MIN(vsi->nb_qps,
401                                                  RTE_MAX_RXTX_INTR_VEC_ID));
402                 if (ret < 0) {
403                         PMD_INIT_LOG(ERR, "VSI MAIN %d get heap failed %d",
404                                      vsi->vsi_id, ret);
405                 }
406                 vsi->msix_intr = ret;
407                 vsi->nb_msix = RTE_MIN(vsi->nb_qps, RTE_MAX_RXTX_INTR_VEC_ID);
408         } else {
409                 vsi->msix_intr = 0;
410                 vsi->nb_msix = 0;
411         }
412         ret = ice_add_vsi(hw, vsi->idx, &vsi_ctx, NULL);
413         if (ret != ICE_SUCCESS) {
414                 PMD_INIT_LOG(ERR, "add vsi failed, err = %d", ret);
415                 goto fail_mem;
416         }
417         /* store vsi information is SW structure */
418         vsi->vsi_id = vsi_ctx.vsi_num;
419         vsi->info = vsi_ctx.info;
420         pf->vsis_allocated = vsi_ctx.vsis_allocd;
421         pf->vsis_unallocated = vsi_ctx.vsis_unallocated;
422
423         /* At the beginning, only TC0. */
424         /* What we need here is the maximam number of the TX queues.
425          * Currently vsi->nb_qps means it.
426          * Correct it if any change.
427          */
428         max_txqs[0] = vsi->nb_qps;
429         ret = ice_cfg_vsi_lan(hw->port_info, vsi->idx,
430                               tc_bitmap, max_txqs);
431         if (ret != ICE_SUCCESS)
432                 PMD_INIT_LOG(ERR, "Failed to config vsi sched");
433
434         return vsi;
435 fail_mem:
436         rte_free(vsi);
437         pf->next_vsi_idx--;
438         return NULL;
439 }
440
441 static int
442 ice_pf_setup(struct ice_pf *pf)
443 {
444         struct ice_vsi *vsi;
445
446         /* Clear all stats counters */
447         pf->offset_loaded = FALSE;
448         memset(&pf->stats, 0, sizeof(struct ice_hw_port_stats));
449         memset(&pf->stats_offset, 0, sizeof(struct ice_hw_port_stats));
450         memset(&pf->internal_stats, 0, sizeof(struct ice_eth_stats));
451         memset(&pf->internal_stats_offset, 0, sizeof(struct ice_eth_stats));
452
453         vsi = ice_setup_vsi(pf, ICE_VSI_PF);
454         if (!vsi) {
455                 PMD_INIT_LOG(ERR, "Failed to add vsi for PF");
456                 return -EINVAL;
457         }
458
459         pf->main_vsi = vsi;
460
461         return 0;
462 }
463
464 static int
465 ice_dev_init(struct rte_eth_dev *dev)
466 {
467         struct rte_pci_device *pci_dev;
468         struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
469         struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
470         int ret;
471
472         dev->dev_ops = &ice_eth_dev_ops;
473
474         pci_dev = RTE_DEV_TO_PCI(dev->device);
475
476         pf->adapter = ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
477         pf->adapter->eth_dev = dev;
478         pf->dev_data = dev->data;
479         hw->back = pf->adapter;
480         hw->hw_addr = (uint8_t *)pci_dev->mem_resource[0].addr;
481         hw->vendor_id = pci_dev->id.vendor_id;
482         hw->device_id = pci_dev->id.device_id;
483         hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
484         hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
485         hw->bus.device = pci_dev->addr.devid;
486         hw->bus.func = pci_dev->addr.function;
487
488         ice_init_controlq_parameter(hw);
489
490         ret = ice_init_hw(hw);
491         if (ret) {
492                 PMD_INIT_LOG(ERR, "Failed to initialize HW");
493                 return -EINVAL;
494         }
495
496         PMD_INIT_LOG(INFO, "FW %d.%d.%05d API %d.%d",
497                      hw->fw_maj_ver, hw->fw_min_ver, hw->fw_build,
498                      hw->api_maj_ver, hw->api_min_ver);
499
500         ice_pf_sw_init(dev);
501         ret = ice_init_mac_address(dev);
502         if (ret) {
503                 PMD_INIT_LOG(ERR, "Failed to initialize mac address");
504                 goto err_init_mac;
505         }
506
507         ret = ice_res_pool_init(&pf->msix_pool, 1,
508                                 hw->func_caps.common_cap.num_msix_vectors - 1);
509         if (ret) {
510                 PMD_INIT_LOG(ERR, "Failed to init MSIX pool");
511                 goto err_msix_pool_init;
512         }
513
514         ret = ice_pf_setup(pf);
515         if (ret) {
516                 PMD_INIT_LOG(ERR, "Failed to setup PF");
517                 goto err_pf_setup;
518         }
519
520         return 0;
521
522 err_pf_setup:
523         ice_res_pool_destroy(&pf->msix_pool);
524 err_msix_pool_init:
525         rte_free(dev->data->mac_addrs);
526 err_init_mac:
527         ice_sched_cleanup_all(hw);
528         rte_free(hw->port_info);
529         ice_shutdown_all_ctrlq(hw);
530
531         return ret;
532 }
533
534 static int
535 ice_release_vsi(struct ice_vsi *vsi)
536 {
537         struct ice_hw *hw;
538         struct ice_vsi_ctx vsi_ctx;
539         enum ice_status ret;
540
541         if (!vsi)
542                 return 0;
543
544         hw = ICE_VSI_TO_HW(vsi);
545
546         memset(&vsi_ctx, 0, sizeof(vsi_ctx));
547
548         vsi_ctx.vsi_num = vsi->vsi_id;
549         vsi_ctx.info = vsi->info;
550         ret = ice_free_vsi(hw, vsi->idx, &vsi_ctx, false, NULL);
551         if (ret != ICE_SUCCESS) {
552                 PMD_INIT_LOG(ERR, "Failed to free vsi by aq, %u", vsi->vsi_id);
553                 rte_free(vsi);
554                 return -1;
555         }
556
557         rte_free(vsi);
558         return 0;
559 }
560
561 static void
562 ice_dev_close(struct rte_eth_dev *dev)
563 {
564         struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
565         struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
566
567         ice_res_pool_destroy(&pf->msix_pool);
568         ice_release_vsi(pf->main_vsi);
569
570         ice_shutdown_all_ctrlq(hw);
571 }
572
573 static int
574 ice_dev_uninit(struct rte_eth_dev *dev)
575 {
576         struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
577         struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
578
579         ice_dev_close(dev);
580
581         dev->dev_ops = NULL;
582         dev->rx_pkt_burst = NULL;
583         dev->tx_pkt_burst = NULL;
584
585         rte_free(dev->data->mac_addrs);
586         dev->data->mac_addrs = NULL;
587
588         ice_release_vsi(pf->main_vsi);
589         ice_sched_cleanup_all(hw);
590         rte_free(hw->port_info);
591         ice_shutdown_all_ctrlq(hw);
592
593         return 0;
594 }
595
596 static int
597 ice_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
598               struct rte_pci_device *pci_dev)
599 {
600         return rte_eth_dev_pci_generic_probe(pci_dev,
601                                              sizeof(struct ice_adapter),
602                                              ice_dev_init);
603 }
604
605 static int
606 ice_pci_remove(struct rte_pci_device *pci_dev)
607 {
608         return rte_eth_dev_pci_generic_remove(pci_dev, ice_dev_uninit);
609 }
610
611 static struct rte_pci_driver rte_ice_pmd = {
612         .id_table = pci_id_ice_map,
613         .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
614                      RTE_PCI_DRV_IOVA_AS_VA,
615         .probe = ice_pci_probe,
616         .remove = ice_pci_remove,
617 };
618
619 /**
620  * Driver initialization routine.
621  * Invoked once at EAL init time.
622  * Register itself as the [Poll Mode] Driver of PCI devices.
623  */
624 RTE_PMD_REGISTER_PCI(net_ice, rte_ice_pmd);
625 RTE_PMD_REGISTER_PCI_TABLE(net_ice, pci_id_ice_map);
626 RTE_PMD_REGISTER_KMOD_DEP(net_ice, "* igb_uio | uio_pci_generic | vfio-pci");
627 RTE_PMD_REGISTER_PARAM_STRING(net_ice,
628                               ICE_MAX_QP_NUM "=<int>");
629
630 RTE_INIT(ice_init_log)
631 {
632         ice_logtype_init = rte_log_register("pmd.net.ice.init");
633         if (ice_logtype_init >= 0)
634                 rte_log_set_level(ice_logtype_init, RTE_LOG_NOTICE);
635         ice_logtype_driver = rte_log_register("pmd.net.ice.driver");
636         if (ice_logtype_driver >= 0)
637                 rte_log_set_level(ice_logtype_driver, RTE_LOG_NOTICE);
638 }