net/af_xdp: make UMEM configure more readable
The below compile time defined style make the code not so readable, the first function end block is after "#endif" segment. #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG) xdp_umem_configure() { #else xdp_umem_configure() { #endif 'shared code block' } Signed-off-by: Haiyue Wang <haiyue.wang@intel.com> Acked-by: Ciara Loftus <ciara.loftus@intel.com>
This commit is contained in:
parent
8507a16902
commit
e1543baea3
@ -1078,6 +1078,12 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,
|
|||||||
__atomic_store_n(&umem->refcnt, 1, __ATOMIC_RELEASE);
|
__atomic_store_n(&umem->refcnt, 1, __ATOMIC_RELEASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return umem;
|
||||||
|
|
||||||
|
err:
|
||||||
|
xdp_umem_destroy(umem);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
static struct
|
static struct
|
||||||
xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,
|
xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,
|
||||||
@ -1138,13 +1144,13 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,
|
|||||||
}
|
}
|
||||||
umem->mz = mz;
|
umem->mz = mz;
|
||||||
|
|
||||||
#endif
|
|
||||||
return umem;
|
return umem;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
xdp_umem_destroy(umem);
|
xdp_umem_destroy(umem);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
load_custom_xdp_prog(const char *prog_path, int if_index, struct bpf_map **map)
|
load_custom_xdp_prog(const char *prog_path, int if_index, struct bpf_map **map)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user