Re: [PATCH bpf-next] bpf: add skb->queue_mapping write access from tc clsact

2019-02-19 Thread Jesper Dangaard Brouer
On Tue, 19 Feb 2019 17:18:30 +0100 Daniel Borkmann wrote: > Untested / uncompiled, but should be: > > case offsetof(struct __sk_buff, queue_mapping): > if (type == BPF_WRITE) { > *insn++ = BPF_JMP_IMM(BPF_JGE, si->src_reg, > NO_QUEUE_MAPPING, 1);

Re: [PATCH bpf-next] bpf: add skb->queue_mapping write access from tc clsact

2019-02-19 Thread Daniel Borkmann
On 02/19/2019 03:52 PM, Jesper Dangaard Brouer wrote: > On Tue, 19 Feb 2019 12:46:57 +0100 > Daniel Borkmann wrote: > >> On 02/19/2019 11:24 AM, Jesper Dangaard Brouer wrote: >>> The skb->queue_mapping already have read access, via >>> __sk_buff->queue_mapping. >>> >>> This patch allow BPF tc qd

Re: [PATCH bpf-next] bpf: add skb->queue_mapping write access from tc clsact

2019-02-19 Thread Daniel Borkmann
On 02/19/2019 04:57 PM, Jesper Dangaard Brouer wrote: > On Tue, 19 Feb 2019 12:46:57 +0100 > Daniel Borkmann wrote: > >>> Due to lack of TC examples, lets show howto attach clsact BPF programs: >>> >>> # tc qdisc add dev ixgbe2 clsact >>> # tc filter replace dev ixgbe2 egress bpf da obj XX

Re: [PATCH bpf-next] bpf: add skb->queue_mapping write access from tc clsact

2019-02-19 Thread Jesper Dangaard Brouer
On Tue, 19 Feb 2019 12:46:57 +0100 Daniel Borkmann wrote: > > Due to lack of TC examples, lets show howto attach clsact BPF programs: > > > > # tc qdisc add dev ixgbe2 clsact > > # tc filter replace dev ixgbe2 egress bpf da obj XXX_kern.o sec tc_qmap2cpu > > # tc filter listdev ixgbe

Re: [PATCH bpf-next] bpf: add skb->queue_mapping write access from tc clsact

2019-02-19 Thread Jesper Dangaard Brouer
On Tue, 19 Feb 2019 12:46:57 +0100 Daniel Borkmann wrote: > On 02/19/2019 11:24 AM, Jesper Dangaard Brouer wrote: > > The skb->queue_mapping already have read access, via > > __sk_buff->queue_mapping. > > > > This patch allow BPF tc qdisc clsact write access to the queue_mapping via > > tc_cls_

Re: [PATCH bpf-next] bpf: add skb->queue_mapping write access from tc clsact

2019-02-19 Thread Daniel Borkmann
On 02/19/2019 11:24 AM, Jesper Dangaard Brouer wrote: > The skb->queue_mapping already have read access, via __sk_buff->queue_mapping. > > This patch allow BPF tc qdisc clsact write access to the queue_mapping via > tc_cls_act_is_valid_access. > > It is already possible to change this via TC filt

[PATCH bpf-next] bpf: add skb->queue_mapping write access from tc clsact

2019-02-19 Thread Jesper Dangaard Brouer
The skb->queue_mapping already have read access, via __sk_buff->queue_mapping. This patch allow BPF tc qdisc clsact write access to the queue_mapping via tc_cls_act_is_valid_access. It is already possible to change this via TC filter action skbedit tc-skbedit(8). Due to the lack of TC examples,