1 /* SPDX-License-Identifier: BSD-3-Clause
3 * Copyright (c) 2017-2018 Solarflare Communications Inc.
6 * This software was jointly developed between OKTET Labs (under contract
7 * for Solarflare) and Solarflare Communications, Inc.
10 #include <sys/queue.h>
19 sfc_dp_queue_init(struct sfc_dp_queue *dpq, uint16_t port_id, uint16_t queue_id,
20 const struct rte_pci_addr *pci_addr)
22 dpq->port_id = port_id;
23 dpq->queue_id = queue_id;
24 dpq->pci_addr = *pci_addr;
28 sfc_dp_find_by_name(struct sfc_dp_list *head, enum sfc_dp_type type,
33 TAILQ_FOREACH(entry, head, links) {
34 if (entry->type != type)
37 if (strcmp(entry->name, name) == 0)
45 sfc_dp_find_by_caps(struct sfc_dp_list *head, enum sfc_dp_type type,
46 unsigned int avail_caps)
50 TAILQ_FOREACH(entry, head, links) {
51 if (entry->type != type)
54 /* Take the first matching */
55 if (sfc_dp_match_hw_fw_caps(entry, avail_caps))
63 sfc_dp_register(struct sfc_dp_list *head, struct sfc_dp *entry)
65 if (sfc_dp_find_by_name(head, entry->type, entry->name) != NULL) {
66 rte_log(RTE_LOG_ERR, RTE_LOGTYPE_PMD,
67 "sfc %s dapapath '%s' already registered\n",
68 entry->type == SFC_DP_RX ? "Rx" :
69 entry->type == SFC_DP_TX ? "Tx" :
75 TAILQ_INSERT_TAIL(head, entry, links);