netdev-afxdp requires XDP program to be loaded. When prog_id == 0,
it indicates no XDP program, so return error and free resources.
Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
/* Make sure the built-in AF_XDP program is loaded. */
ret = bpf_get_link_xdp_id(ifindex, &prog_id, cfg.xdp_flags);
- if (ret) {
- VLOG_ERR("Get XDP prog ID failed (%s)", ovs_strerror(errno));
+ if (ret || !prog_id) {
+ if (ret) {
+ VLOG_ERR("Get XDP prog ID failed (%s)", ovs_strerror(errno));
+ } else {
+ VLOG_ERR("No XDP program is loaded at ifindex %d", ifindex);
+ }
xsk_socket__delete(xsk->xsk);
free(xsk);
return NULL;