File: hotplug_mp.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 (60 lines) | stat: -rw-r--r-- 1,452 bytes parent folder | download | duplicates (3)
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
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright(c) 2018 Intel Corporation
 */

#ifndef _HOTPLUG_MP_H_
#define _HOTPLUG_MP_H_

#include "rte_dev.h"

#define EAL_DEV_MP_ACTION_REQUEST      "eal_dev_mp_request"
#define EAL_DEV_MP_ACTION_RESPONSE     "eal_dev_mp_response"

#define EAL_DEV_MP_DEV_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
#define EAL_DEV_MP_BUS_NAME_MAX_LEN 32
#define EAL_DEV_MP_DEV_ARGS_MAX_LEN 128

enum eal_dev_req_type {
	EAL_DEV_REQ_TYPE_ATTACH,
	EAL_DEV_REQ_TYPE_DETACH,
	EAL_DEV_REQ_TYPE_ATTACH_ROLLBACK,
	EAL_DEV_REQ_TYPE_DETACH_ROLLBACK,
};

struct eal_dev_mp_req {
	enum eal_dev_req_type t;
	char devargs[EAL_DEV_MP_DEV_ARGS_MAX_LEN];
	int result;
};

/**
 * Register all mp action callbacks for hotplug.
 *
 * @return
 *   0 on success, negative on error.
 */
int
eal_mp_dev_hotplug_init(void);

/**
 * Unregister all mp action callbacks for hotplug.
 */
void
eal_mp_dev_hotplug_cleanup(void);

/**
 * This is a synchronous wrapper for secondary process send
 * request to primary process, this is invoked when an attach
 * or detach request is issued from primary process.
 */
int eal_dev_hotplug_request_to_primary(struct eal_dev_mp_req *req);

/**
 * this is a synchronous wrapper for primary process send
 * request to secondary process, this is invoked when an attach
 * or detach request issued from secondary process.
 */
int eal_dev_hotplug_request_to_secondary(struct eal_dev_mp_req *req);


#endif /* _HOTPLUG_MP_H_ */