File: process.h

package info (click to toggle)
dpdk 20.11.10-1~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 86,712 kB
  • sloc: ansic: 1,493,490; python: 4,395; sh: 4,250; makefile: 1,787; awk: 55
file content (138 lines) | stat: -rw-r--r-- 3,683 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
 *
 * Copyright 2010-2011 Freescale Semiconductor, Inc.
 * All rights reserved.
 * Copyright 2020 NXP
 *
 */

#ifndef __PROCESS_H
#define	__PROCESS_H

#include <compat.h>
#include <rte_ethdev.h>

/* The process device underlies process-wide user/kernel interactions, such as
 * mapping dma_mem memory and providing accompanying ioctl()s. (This isn't used
 * for portals, which use one UIO device each.).
 */
#define PROCESS_PATH		"/dev/fsl-usdpaa"

/* Allocation of resource IDs uses a generic interface. This enum is used to
 * distinguish between the type of underlying object being manipulated.
 */
enum dpaa_id_type {
	dpaa_id_fqid,
	dpaa_id_bpid,
	dpaa_id_qpool,
	dpaa_id_cgrid,
	dpaa_id_max /* <-- not a valid type, represents the number of types */
};

int process_alloc(enum dpaa_id_type id_type, uint32_t *base, uint32_t num,
		  uint32_t align, int partial);
void process_release(enum dpaa_id_type id_type, uint32_t base, uint32_t num);

int process_reserve(enum dpaa_id_type id_type, uint32_t base, uint32_t num);

/* Mapping and using QMan/BMan portals */
enum dpaa_portal_type {
	dpaa_portal_qman,
	dpaa_portal_bman,
};

struct dpaa_portal_map {
	void *cinh;
	void *cena;
};

struct dpaa_ioctl_portal_map {
	/* Input parameter, is a qman or bman portal required. */
	enum dpaa_portal_type type;
	/* Specifies a specific portal index to map or 0xffffffff
	 * for don't care.
	 */
	uint32_t index;

	/* Return value if the map succeeds, this gives the mapped
	 * cache-inhibited (cinh) and cache-enabled (cena) addresses.
	 */
	struct dpaa_portal_map addr;

	/* Qman-specific return values */
	u16 channel;
	uint32_t pools;
};

int process_portal_map(struct dpaa_ioctl_portal_map *params);
int process_portal_unmap(struct dpaa_portal_map *map);

struct dpaa_ioctl_irq_map {
	enum dpaa_portal_type type; /* Type of portal to map */
	int fd; /* File descriptor that contains the portal */
	void *portal_cinh; /* Cache inhibited area to identify the portal */
};

int process_portal_irq_map(int fd,  struct dpaa_ioctl_irq_map *irq);
int process_portal_irq_unmap(int fd);

struct usdpaa_ioctl_link_status {
	char            if_name[IF_NAME_MAX_LEN];
	uint32_t        efd;
};

__rte_internal
int dpaa_intr_enable(char *if_name, int efd);

__rte_internal
int dpaa_intr_disable(char *if_name);

struct usdpaa_ioctl_link_status_args_old {
	/* network device node name */
	char    if_name[IF_NAME_MAX_LEN];
	/* link status(ETH_LINK_UP/DOWN) */
	int     link_status;
};

struct usdpaa_ioctl_link_status_args {
	/* network device node name */
	char    if_name[IF_NAME_MAX_LEN];
	/* link status(ETH_LINK_UP/DOWN) */
	int     link_status;
	/* link speed (ETH_SPEED_NUM_)*/
	int     link_speed;
	/* link duplex (ETH_LINK_[HALF/FULL]_DUPLEX)*/
	int     link_duplex;
	/* link autoneg (ETH_LINK_AUTONEG/FIXED)*/
	int     link_autoneg;

};

struct usdpaa_ioctl_update_link_status_args {
	/* network device node name */
	char    if_name[IF_NAME_MAX_LEN];
	/* link status(ETH_LINK_UP/DOWN) */
	int     link_status;
};

struct usdpaa_ioctl_update_link_speed {
	/* network device node name*/
	char    if_name[IF_NAME_MAX_LEN];
	/* link speed (ETH_SPEED_NUM_)*/
	int     link_speed;
	/* link duplex (ETH_LINK_[HALF/FULL]_DUPLEX)*/
	int     link_duplex;
};

__rte_internal
int dpaa_get_link_status(char *if_name, struct rte_eth_link *link);
__rte_internal
int dpaa_update_link_status(char *if_name, int link_status);
__rte_internal
int dpaa_update_link_speed(char *if_name, int speed, int duplex);
__rte_internal
int dpaa_restart_link_autoneg(char *if_name);
__rte_internal
int dpaa_get_ioctl_version_number(void);

#endif	/*  __PROCESS_H */