MPLS helper function in eBPF


William Tu
 

Hi Alexei,

I'm just starting to experimenting BPF, exploring what BPF can do, and don't have specific use case at this point. Thanks for your reply!

Regards,
William

On Sat, Apr 23, 2016 at 6:04 PM, Alexei Starovoitov <alexei.starovoitov@...> wrote:
On Sat, Apr 23, 2016 at 9:45 AM, William Tu via iovisor-dev
<iovisor-dev@...> wrote:
> Hi,
>
> I saw VLAN push/pop helper functions in BPF and wondering if there is any
> MPLS related helper functions available?
>
> Looking at sockex3_kern.c, the PROG(PARSE_MPLS) parses the mpls header. But
> to implement mpls_push/mpls_pop, are we able to use load/store bpf helper
> function to add/delete mpls header?  It seems not sufficient because some
> skb metadata also needs update, such as skb->len, and skb headroom.

yes. there is no mpls_push/pop yet. If needed they will be done as helpers,
since they change skb size and mess with metadata.
What's the use case?


Alexei Starovoitov
 

On Sat, Apr 23, 2016 at 9:45 AM, William Tu via iovisor-dev
<iovisor-dev@...> wrote:
Hi,

I saw VLAN push/pop helper functions in BPF and wondering if there is any
MPLS related helper functions available?

Looking at sockex3_kern.c, the PROG(PARSE_MPLS) parses the mpls header. But
to implement mpls_push/mpls_pop, are we able to use load/store bpf helper
function to add/delete mpls header? It seems not sufficient because some
skb metadata also needs update, such as skb->len, and skb headroom.
yes. there is no mpls_push/pop yet. If needed they will be done as helpers,
since they change skb size and mess with metadata.
What's the use case?


William Tu
 

Hi,

I saw VLAN push/pop helper functions in BPF and wondering if there is any MPLS related helper functions available?

Looking at sockex3_kern.c, the PROG(PARSE_MPLS) parses the mpls header. But to implement mpls_push/mpls_pop, are we able to use load/store bpf helper function to add/delete mpls header?  It seems not sufficient because some skb metadata also needs update, such as skb->len, and skb headroom.

Thank you
William