From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C5DA3A04FA; Thu, 6 Feb 2020 05:22:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6998C1C1FD; Thu, 6 Feb 2020 05:22:19 +0100 (CET) Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) by dpdk.org (Postfix) with ESMTP id D912F1C1D4 for ; Thu, 6 Feb 2020 05:22:17 +0100 (CET) Received: by mail-il1-f172.google.com with SMTP id f10so3904358ils.8 for ; Wed, 05 Feb 2020 20:22:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xbnbhMRaZ40eNRH5xbln5f8Hrq6syW63oTWlEm+2Meo=; b=kjR/txwQkVhKtcztU6WHH4h64sNIFBkHZzS1HXLYZmj58qLyP+f7iW05KYZ7soOCy7 To0AwZNcdSWjy1lp2iCJNxdhXijlUF/3C1dkv2BEwTpU30ahL82YjhYw/KZyvvBiL7OA 4h6BoQ4KVXxA/i00rdRfv6EqUju/mt+joxv0rErbtGuVHWVIKhTU1Ic05cYx/S4z9CLt qV6NJRw6FSJLTiQiHPv1CT6MEVeaBFZkuX+mRCd3Ypx5ttnrrrNiprLB/V2Q+WfquQTF iuVPRD/NRkblwWltfBMRsci83Zo8rhA2GJxpVFLAL3M2pmsyDE5UJ95FbHh41z2b1U8G RmHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xbnbhMRaZ40eNRH5xbln5f8Hrq6syW63oTWlEm+2Meo=; b=LPmCof+s7N+jGPbt8XcmVSm817fOot/Q/8pN27fKjFF3WbbFUBl13lU9wKh3Lk21f1 ofUP+c+HgICqgvbcZmGozW2aIVQIF1FDTMhNxeXBnPtPqklN9Oop7257pe6nef5/3TH7 KntErU1zGosG3y2+oDtl46Dp/jCHVScTUqRwYMHUnHAjzO3AK4pNzGG7Nwrql2rwncEu hxXGK0pPdEW4KRBOAGTTWC/hzIkdjw+NBaE51tqiOwZoMKzWGwR/14NQluKP+mgF5qYd zaS4i2GCTMbd1QWENyVOLcgX9MTKWrZd1nCqUD3f7P+xaIdImUewmvbbxSUN0uXebDYZ P+Fw== X-Gm-Message-State: APjAAAXfmJFYu1eWfzvJn3JCcuM4Pv3Ogym8AVQMdahiEkVzR7pIU9uM IqMrAJlyEn1CDi96oeTPHkPZZyGtX+OIXbpFkjc= X-Google-Smtp-Source: APXvYqxAJAyB8zeu96nj56yp9zHUVxx2HKzZmr3oNmO1LZks0BnpJbB+nrUt4PSJCCSPmxgxYumjIbiALcvGRGjMvgs= X-Received: by 2002:a92:1906:: with SMTP id 6mr1884076ilz.130.1580962937080; Wed, 05 Feb 2020 20:22:17 -0800 (PST) MIME-Version: 1.0 References: <20200204065229.0e8a85f7@shemminger-XPS-13-9360> In-Reply-To: From: Jerin Jacob Date: Thu, 6 Feb 2020 09:52:01 +0530 Message-ID: To: "Ananyev, Konstantin" Cc: Stephen Hemminger , "dev@dpdk.org" , Jerin Jacob , "Varghese, Vipin" , "mb@smartsharesystems.com" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] BUG: eBPF missing BPF_ABS X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Feb 6, 2020 at 2:46 AM Ananyev, Konstantin wrote: > > > > > Second question is implementation. > I can see two main options here: > a) if we plan to have our own cBPF->eBPF converter and support only it, > we can add these extra instructions generation into converter itself. > I.E. cBPF->eBPF conversion for LD_ABS/LD_IND will generate series > of generic eBPF instructions. > b) support eBPF LD_ABS/LD_IND in eBPF interpreter/jit > > (a) probably a simpler way (eBPF interpreter/jit/verifier would remain unchanged), > but seems way too limited. So I think (b) is a better choice, even more work implied > (interpreter seems more or less straightforward, jit would probably need some effort). Looks like cBPF is an important use case. If we are leveraging code cBPF->eBPF code from somewhere and there is limited option to change then it is better to add our JIT. I can work on adding arm64 JIT support once base code in place. > > Any thoughts/opinions? > Konstantin > > > > > PCAP filter string: ip dst fosdem.org > > cBPF program (6 insns): > > L0: 28 00 00 00 0c 00 00 00 ldh [12] > > L1: 15 00 00 03 00 08 00 00 jeq #0x800, L2, L5 > > L2: 20 00 00 00 1e 00 00 00 ld [30] > > L3: 15 00 00 01 8c 16 16 1f jeq #0x1f16168c, L4, L5 > > L4: 06 00 00 00 ff ff ff ff ret #0xffffffff > > L5: 06 00 00 00 00 00 00 00 ret #0x0 > > eBPF program (11 insns): > > L0: af 00 00 00 00 00 00 00 xor r0, r0 > > L1: af 77 00 00 00 00 00 00 xor r7, r7 > > L2: bf 16 00 00 00 00 00 00 mov r6, r1 > > L3: 28 70 00 00 0c 00 00 00 ldh r0, [12] > > L4: 55 00 04 00 00 08 00 00 jne r0, #0x800, L9 > > L5: 20 70 00 00 1e 00 00 00 ldw r0, [30] > > L6: 55 00 02 00 8c 16 16 1f jne r0, #0x1f16168c, L9 > > L7: b4 00 00 00 01 00 00 00 mov32 r0, #0x1 > > L8: 95 00 00 00 00 00 00 00 exit > > L9: b4 00 00 00 02 00 00 00 mov32 r0, #0x2 > > L10: 95 00 00 00 00 00 00 00 exit > > validate: invalid opcode at pc: 3 > > validate: invalid opcode at pc: 5 > > rte_bpf_load failed: Invalid argument