From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD3A7C43381 for ; Tue, 19 Feb 2019 19:36:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 940532147C for ; Tue, 19 Feb 2019 19:36:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726289AbfBSTg5 (ORCPT ); Tue, 19 Feb 2019 14:36:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34660 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725963AbfBSTg5 (ORCPT ); Tue, 19 Feb 2019 14:36:57 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A41B80496; Tue, 19 Feb 2019 19:36:57 +0000 (UTC) Received: from carbon (ovpn-200-42.brq.redhat.com [10.40.200.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE2BC608C1; Tue, 19 Feb 2019 19:36:52 +0000 (UTC) Date: Tue, 19 Feb 2019 20:36:50 +0100 From: Jesper Dangaard Brouer To: Daniel Borkmann Cc: netdev@vger.kernel.org, Daniel Borkmann , Alexei Starovoitov , brouer@redhat.com Subject: Re: [PATCH bpf-next] bpf: add skb->queue_mapping write access from tc clsact Message-ID: <20190219203650.489b19f5@carbon> In-Reply-To: References: <155057184028.20935.11848804617158437103.stgit@firesoul> <11d2572e-3ff5-2fc0-8f05-c50dd0fb1d6d@iogearbox.net> <20190219155259.677d195c@carbon> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 19 Feb 2019 19:36:57 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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); > *insn++ = BPF_STX_MEM(BPF_H, si->dst_reg, si->src_reg, > bpf_target_off(struct sk_buff, queue_mapping, 2, > target_size)); > } else { > *insn++ = BPF_LDX_MEM(BPF_H, si->dst_reg, si->src_reg, > bpf_target_off(struct sk_buff, queue_mapping, 2, > target_size)); > } > break; In-cooperated in V2 and tested. -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer