mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
nfp: bpf: support BPF offload only on little endian
eBPF is host-endian specific. Translating both BE and LE eBPF to the NFP is feasible, but would require quite a bit of indirection. The fact that I don't have access to any BE hosts that would fit a 25G/40G/100G NIC is also limiting my ability to test big endian. For now restrict the offload to little endian hosts only. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3119d1fd46
commit
0f6cf4ddf6
1 changed files with 2 additions and 0 deletions
|
@ -42,9 +42,11 @@
|
||||||
|
|
||||||
static bool nfp_net_ebpf_capable(struct nfp_net *nn)
|
static bool nfp_net_ebpf_capable(struct nfp_net *nn)
|
||||||
{
|
{
|
||||||
|
#ifdef __LITTLE_ENDIAN
|
||||||
if (nn->cap & NFP_NET_CFG_CTRL_BPF &&
|
if (nn->cap & NFP_NET_CFG_CTRL_BPF &&
|
||||||
nn_readb(nn, NFP_NET_CFG_BPF_ABI) == NFP_NET_BPF_ABI)
|
nn_readb(nn, NFP_NET_CFG_BPF_ABI) == NFP_NET_BPF_ABI)
|
||||||
return true;
|
return true;
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue