File: xsc_ethdev.h

package info (click to toggle)
dpdk 25.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 127,892 kB
  • sloc: ansic: 2,358,479; python: 16,426; sh: 4,474; makefile: 1,713; awk: 70
file content (59 lines) | stat: -rw-r--r-- 1,335 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright 2025 Yunsilicon Technology Co., Ltd.
 */

#ifndef _XSC_ETHDEV_H_
#define _XSC_ETHDEV_H_

#include "xsc_dev.h"

struct xsc_ethdev_priv {
	struct rte_eth_dev *eth_dev;
	struct rte_pci_device *pci_dev;
	struct xsc_dev *xdev;
	struct xsc_repr_port *repr_port;
	struct xsc_dev_config config;
	struct rte_eth_dev_data *dev_data;
	struct rte_ether_addr mac[XSC_MAX_MAC_ADDRESSES];
	struct rte_eth_rss_conf rss_conf;

	int representor_id;
	uint32_t ifindex;
	uint16_t mtu;
	uint8_t isolated;
	uint8_t is_representor;

	uint32_t mode:7;
	uint32_t member_bitmap:8;
	uint32_t funcid_type:3;
	uint32_t funcid:14;

	uint16_t eth_type;
	uint16_t qp_set_id;

	uint16_t num_sq;
	uint16_t num_rq;

	struct xsc_txq_data *(*txqs)[];
	struct xsc_rxq_data *(*rxqs)[];
};

#define TO_XSC_ETHDEV_PRIV(dev) ((struct xsc_ethdev_priv *)(dev)->data->dev_private)

static __rte_always_inline struct xsc_txq_data *
xsc_txq_get(struct xsc_ethdev_priv *priv, uint16_t idx)
{
	if (priv->txqs != NULL && (*priv->txqs)[idx] != NULL)
		return (*priv->txqs)[idx];
	return NULL;
}

static __rte_always_inline struct xsc_rxq_data *
xsc_rxq_get(struct xsc_ethdev_priv *priv, uint16_t idx)
{
	if (priv->rxqs != NULL && (*priv->rxqs)[idx] != NULL)
		return (*priv->rxqs)[idx];
	return NULL;
}

#endif /* _XSC_ETHDEV_H_ */