Coverage Report

Created: 2023-03-26 07:41

/src/openvswitch/lib/netdev-afxdp.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright (c) 2018, 2019 Nicira, Inc.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at:
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
17
#ifndef NETDEV_AFXDP_H
18
#define NETDEV_AFXDP_H 1
19
20
#ifdef HAVE_AF_XDP
21
22
#include <stdint.h>
23
#include <stdbool.h>
24
25
/* These functions are Linux AF_XDP specific, so they should be used directly
26
 * only by Linux-specific code. */
27
28
enum afxdp_mode {
29
    OVS_AF_XDP_MODE_UNSPEC,
30
    OVS_AF_XDP_MODE_BEST_EFFORT,
31
    OVS_AF_XDP_MODE_NATIVE_ZC,
32
    OVS_AF_XDP_MODE_NATIVE,
33
    OVS_AF_XDP_MODE_GENERIC,
34
    OVS_AF_XDP_MODE_MAX,
35
};
36
37
struct dp_packet;
38
struct dp_packet_batch;
39
struct netdev;
40
struct netdev_afxdp_tx_lock;
41
struct netdev_custom_stats;
42
struct netdev_rxq;
43
struct netdev_stats;
44
struct smap;
45
struct xdp_umem;
46
struct xsk_socket_info;
47
48
int netdev_afxdp_rxq_construct(struct netdev_rxq *rxq_);
49
void netdev_afxdp_rxq_destruct(struct netdev_rxq *rxq_);
50
int netdev_afxdp_init(void);
51
int netdev_afxdp_construct(struct netdev *netdev_);
52
void netdev_afxdp_destruct(struct netdev *netdev_);
53
int netdev_afxdp_verify_mtu_size(const struct netdev *netdev, int mtu);
54
55
int netdev_afxdp_rxq_recv(struct netdev_rxq *rxq_,
56
                          struct dp_packet_batch *batch,
57
                          int *qfill);
58
int netdev_afxdp_batch_send(struct netdev *netdev_, int qid,
59
                            struct dp_packet_batch *batch,
60
                            bool concurrent_txq);
61
int netdev_afxdp_set_config(struct netdev *netdev, const struct smap *args,
62
                            char **errp);
63
int netdev_afxdp_get_config(const struct netdev *netdev, struct smap *args);
64
int netdev_afxdp_get_stats(const struct netdev *netdev_,
65
                           struct netdev_stats *stats);
66
int netdev_afxdp_get_custom_stats(const struct netdev *netdev,
67
                                  struct netdev_custom_stats *custom_stats);
68
69
70
void free_afxdp_buf(struct dp_packet *p);
71
int netdev_afxdp_reconfigure(struct netdev *netdev);
72
void signal_remove_xdp(struct netdev *netdev);
73
74
#else /* !HAVE_AF_XDP */
75
76
#include "openvswitch/compiler.h"
77
78
struct dp_packet;
79
80
static inline void
81
free_afxdp_buf(struct dp_packet *p OVS_UNUSED)
82
0
{
83
    /* Nothing. */
84
0
}
Unexecuted instantiation: miniflow_target.c:free_afxdp_buf
Unexecuted instantiation: dp-packet.c:free_afxdp_buf
Unexecuted instantiation: flow.c:free_afxdp_buf
Unexecuted instantiation: netdev.c:free_afxdp_buf
Unexecuted instantiation: ofp-print.c:free_afxdp_buf
Unexecuted instantiation: ovs-router.c:free_afxdp_buf
Unexecuted instantiation: packets.c:free_afxdp_buf
Unexecuted instantiation: netdev-linux.c:free_afxdp_buf
Unexecuted instantiation: netdev-offload-tc.c:free_afxdp_buf
Unexecuted instantiation: dpif.c:free_afxdp_buf
Unexecuted instantiation: netdev-offload.c:free_afxdp_buf
Unexecuted instantiation: netdev-vport.c:free_afxdp_buf
Unexecuted instantiation: odp-execute.c:free_afxdp_buf
Unexecuted instantiation: odp-execute-private.c:free_afxdp_buf
Unexecuted instantiation: odp-util.c:free_afxdp_buf
Unexecuted instantiation: ofp-packet.c:free_afxdp_buf
Unexecuted instantiation: tnl-neigh-cache.c:free_afxdp_buf
Unexecuted instantiation: netdev-native-tnl.c:free_afxdp_buf
Unexecuted instantiation: dpif-netlink.c:free_afxdp_buf
Unexecuted instantiation: conntrack.c:free_afxdp_buf
Unexecuted instantiation: ct-dpif.c:free_afxdp_buf
Unexecuted instantiation: dpctl.c:free_afxdp_buf
Unexecuted instantiation: dpif-netdev.c:free_afxdp_buf
Unexecuted instantiation: dpif-netdev-private-dfc.c:free_afxdp_buf
Unexecuted instantiation: dpif-netdev-private-dpif.c:free_afxdp_buf
Unexecuted instantiation: dpif-netdev-private-extract.c:free_afxdp_buf
Unexecuted instantiation: ipf.c:free_afxdp_buf
Unexecuted instantiation: conntrack-icmp.c:free_afxdp_buf
Unexecuted instantiation: conntrack-tcp.c:free_afxdp_buf
Unexecuted instantiation: conntrack-tp.c:free_afxdp_buf
Unexecuted instantiation: conntrack-other.c:free_afxdp_buf
Unexecuted instantiation: dpif-netdev-extract-study.c:free_afxdp_buf
Unexecuted instantiation: dpif-netdev-lookup.c:free_afxdp_buf
Unexecuted instantiation: dpif-netdev-lookup-autovalidator.c:free_afxdp_buf
Unexecuted instantiation: dpif-netdev-lookup-generic.c:free_afxdp_buf
85
86
#endif /* HAVE_AF_XDP */
87
#endif /* netdev-afxdp.h */