};
#ifdef HAVE_AF_XDP
+#define NETDEV_AFXDP_CLASS_COMMON \
+ .construct = netdev_afxdp_construct, \
+ .destruct = netdev_afxdp_destruct, \
+ .get_stats = netdev_afxdp_get_stats, \
+ .get_custom_stats = netdev_afxdp_get_custom_stats, \
+ .get_status = netdev_linux_get_status, \
+ .set_config = netdev_afxdp_set_config, \
+ .get_config = netdev_afxdp_get_config, \
+ .reconfigure = netdev_afxdp_reconfigure, \
+ .get_numa_id = netdev_linux_get_numa_id, \
+ .send = netdev_afxdp_batch_send, \
+ .rxq_construct = netdev_afxdp_rxq_construct, \
+ .rxq_destruct = netdev_afxdp_rxq_destruct, \
+ .rxq_recv = netdev_afxdp_rxq_recv
+
const struct netdev_class netdev_afxdp_class = {
NETDEV_LINUX_CLASS_COMMON,
+ NETDEV_AFXDP_CLASS_COMMON,
.type = "afxdp",
.is_pmd = true,
- .init = netdev_afxdp_init,
- .construct = netdev_afxdp_construct,
- .destruct = netdev_afxdp_destruct,
- .get_stats = netdev_afxdp_get_stats,
- .get_custom_stats = netdev_afxdp_get_custom_stats,
- .get_status = netdev_linux_get_status,
- .set_config = netdev_afxdp_set_config,
- .get_config = netdev_afxdp_get_config,
- .reconfigure = netdev_afxdp_reconfigure,
- .get_numa_id = netdev_linux_get_numa_id,
- .send = netdev_afxdp_batch_send,
- .rxq_construct = netdev_afxdp_rxq_construct,
- .rxq_destruct = netdev_afxdp_rxq_destruct,
- .rxq_recv = netdev_afxdp_rxq_recv,
+};
+
+const struct netdev_class netdev_afxdp_nonpmd_class = {
+ NETDEV_LINUX_CLASS_COMMON,
+ NETDEV_AFXDP_CLASS_COMMON,
+ .type = "afxdp-nonpmd",
+ .is_pmd = false,
};
#endif
\f
OVS_TRAFFIC_VSWITCHD_STOP(["/ovs-p0: Too big 'n_rxq'/d
/ovs-p0: could not set configuration/d"])
AT_CLEANUP
+
+
+AT_SETUP([AF_XDP - ping between pmd and non-pmd ports])
+AT_KEYWORDS([afxdp nonpmd])
+OVS_TRAFFIC_VSWITCHD_START()
+
+AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"])
+
+ADD_NAMESPACES(at_ns0, at_ns1)
+ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24")
+ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24")
+
+AT_CHECK([ovs-vsctl del-port ovs-p0])
+AT_CHECK([ovs-vsctl add-port br0 ovs-p0 -- \
+ set interface ovs-p0 type=afxdp-nonpmd options:n_rxq=1],
+ [0], [], [stderr])
+
+NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 10.1.1.2 | FORMAT_PING], [0], [dnl
+3 packets transmitted, 3 received, 0% packet loss, time 0ms
+])
+
+OVS_TRAFFIC_VSWITCHD_STOP
+AT_CLEANUP