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>
20 sfc_dp_queue_init(struct sfc_dp_queue *dpq, uint16_t port_id, uint16_t queue_id,
21 const struct rte_pci_addr *pci_addr)
23 dpq->port_id = port_id;
24 dpq->queue_id = queue_id;
25 dpq->pci_addr = *pci_addr;
29 sfc_dp_find_by_name(struct sfc_dp_list *head, enum sfc_dp_type type,
34 TAILQ_FOREACH(entry, head, links) {
35 if (entry->type != type)
38 if (strcmp(entry->name, name) == 0)
46 sfc_dp_find_by_caps(struct sfc_dp_list *head, enum sfc_dp_type type,
47 unsigned int avail_caps)
51 TAILQ_FOREACH(entry, head, links) {
52 if (entry->type != type)
55 /* Take the first matching */
56 if (sfc_dp_match_hw_fw_caps(entry, avail_caps))
64 sfc_dp_register(struct sfc_dp_list *head, struct sfc_dp *entry)
66 if (sfc_dp_find_by_name(head, entry->type, entry->name) != NULL) {
68 "sfc %s dapapath '%s' already registered",
69 entry->type == SFC_DP_RX ? "Rx" :
70 entry->type == SFC_DP_TX ? "Tx" :
76 TAILQ_INSERT_TAIL(head, entry, links);