Blog
Community
Development
Documentation
CNDP
22.08.0
Toggle main menu visibility
Loading...
Searching...
No Matches
netdev_funcs.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-3-Clause
2
* Copyright (c) 2019-2022 Intel Corporation
3
*/
4
5
#ifndef _NETDEV_FUNCS_H_
6
#define _NETDEV_FUNCS_H_
7
12
13
#include <stdint.h>
// for uint32_t, uint16_t
14
#include <
cne_common.h
>
// for CNDP_API
15
16
struct
ether_addr
;
17
18
#ifdef __cplusplus
19
extern
"C"
{
20
#endif
21
25
__extension__
struct
netdev_link
{
26
uint32_t
link_speed
;
27
uint16_t
link_duplex
: 1;
28
uint16_t
link_autoneg
: 1;
29
uint16_t
link_status
: 1;
30
} __attribute__((aligned(8)));
31
32
/* Utility constants */
33
#define ETH_LINK_HALF_DUPLEX 0
34
#define ETH_LINK_FULL_DUPLEX 1
35
#define ETH_LINK_DOWN 0
36
#define ETH_LINK_UP 1
37
#define ETH_LINK_FIXED 0
38
#define ETH_LINK_AUTONEG 1
39
43
#define CNE_ETH_SPEED_NUM_NONE 0
44
#define CNE_ETH_SPEED_NUM_10M 10
45
#define CNE_ETH_SPEED_NUM_100M 100
46
#define CNE_ETH_SPEED_NUM_1G 1000
47
#define CNE_ETH_SPEED_NUM_2_5G 2500
48
#define CNE_ETH_SPEED_NUM_5G 5000
49
#define CNE_ETH_SPEED_NUM_10G 10000
50
#define CNE_ETH_SPEED_NUM_20G 20000
51
#define CNE_ETH_SPEED_NUM_25G 25000
52
#define CNE_ETH_SPEED_NUM_40G 40000
53
#define CNE_ETH_SPEED_NUM_50G 50000
54
#define CNE_ETH_SPEED_NUM_56G 56000
55
#define CNE_ETH_SPEED_NUM_100G 100000
56
#define CNE_ETH_SPEED_NUM_200G 200000
57
#define CNE_ETH_SPEED_NUM_400G 400000
58
#define CNE_ETH_SPEED_NUM_UNKNOWN UINT32_MAX
59
63
__extension__
struct
offloads
{
64
uint32_t tx_checksum_offload;
65
uint32_t rx_checksum_offload;
66
};
67
80
CNDP_API
int
netdev_change_flags
(
const
char
*if_name, uint32_t flags, uint32_t mask);
81
90
CNDP_API
int
netdev_promiscuous_enable
(
const
char
*if_name);
91
100
CNDP_API
int
netdev_promiscuous_disable
(
const
char
*if_name);
101
112
CNDP_API
int
netdev_promiscuous_get
(
const
char
*if_name);
113
122
CNDP_API
int
netdev_set_link_up
(
const
char
*if_name);
123
132
CNDP_API
int
netdev_set_link_down
(
const
char
*if_name);
133
144
CNDP_API
int
netdev_get_mac_addr
(
const
char
*ifname,
struct
ether_addr
*eth_addr);
145
156
CNDP_API
int
netdev_get_link
(
const
char
*ifname,
struct
netdev_link
*link);
157
168
CNDP_API
int
netdev_get_offloads
(
const
char
*ifname,
struct
offloads
*off);
169
178
CNDP_API
int
netdev_get_channels
(
const
char
*ifname);
179
193
CNDP_API
int
netdev_get_ring_params
(
const
char
*ifname, uint32_t *rx_nb_desc, uint32_t *tx_nb_desc);
194
195
#ifdef __cplusplus
196
}
197
#endif
198
199
#endif
/* _NETDEV_FUNCS_H_ */
cne_common.h
netdev_promiscuous_enable
CNDP_API int netdev_promiscuous_enable(const char *if_name)
netdev_promiscuous_disable
CNDP_API int netdev_promiscuous_disable(const char *if_name)
netdev_promiscuous_get
CNDP_API int netdev_promiscuous_get(const char *if_name)
netdev_get_ring_params
CNDP_API int netdev_get_ring_params(const char *ifname, uint32_t *rx_nb_desc, uint32_t *tx_nb_desc)
netdev_set_link_down
CNDP_API int netdev_set_link_down(const char *if_name)
netdev_get_link
CNDP_API int netdev_get_link(const char *ifname, struct netdev_link *link)
netdev_set_link_up
CNDP_API int netdev_set_link_up(const char *if_name)
netdev_get_mac_addr
CNDP_API int netdev_get_mac_addr(const char *ifname, struct ether_addr *eth_addr)
netdev_get_channels
CNDP_API int netdev_get_channels(const char *ifname)
netdev_change_flags
CNDP_API int netdev_change_flags(const char *if_name, uint32_t flags, uint32_t mask)
netdev_get_offloads
CNDP_API int netdev_get_offloads(const char *ifname, struct offloads *off)
ether_addr
Definition
cne_ether.h:52
netdev_link
Definition
netdev_funcs.h:25
netdev_link::link_status
uint16_t link_status
Definition
netdev_funcs.h:29
netdev_link::link_duplex
uint16_t link_duplex
Definition
netdev_funcs.h:27
netdev_link::link_autoneg
uint16_t link_autoneg
Definition
netdev_funcs.h:28
netdev_link::link_speed
uint32_t link_speed
Definition
netdev_funcs.h:26
offloads
Definition
netdev_funcs.h:63
lib
core
osal
netdev_funcs.h
Generated by
1.18.0