Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp810193ybe; Wed, 11 Sep 2019 05:11:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxU8uhHMU/dhBMHRXxbcI4m7g78eYytTCXg5yCguGdPWbZWAKvNWFY30gb0f1EjK8zbQJfv X-Received: by 2002:aa7:c24f:: with SMTP id y15mr37275642edo.152.1568203896637; Wed, 11 Sep 2019 05:11:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568203896; cv=none; d=google.com; s=arc-20160816; b=hHKN/d0rt+M0I/N5UPDTJzTMBuHtdEbOSWVQR9rcyzSy6E1+sMC7ylbA4qmLXB2uMK q5H/D0mWtPCbz5G9RJPo0ml8IyWekz/l2gvMe5z//EamX9UFh5H9PB8q5liaZEV701pA 9/AbmMYMSadVsJz9QOfZ7x4Fg7pXQhX7kcyV+WoX8CDWVbEcHE8djCLZcjhtmpSZeMYX 8LcFF5FqcTjWKH5dO8cCM4bt2SopIoYciytnstV+hbrXPCQnRqMFahNOUbK8tudkZTZN 5oVYxDXQJ93d6s0qKvjMoocoRF6w3s3lsnEndWksigMUOo5hAcrc8eEv6B0jGW4YAlu1 9eTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from; bh=1K3KKwgLiEHido3gAphmbDzBhu5wAe6uwfDMZyuCmEw=; b=gq/nqte8UpHa3n9jzxe1UPu9M7X+wkB18AbYFeuP2U4lsE28wOfZoMQ/NGUEl1QK9P EIYYrG7WwVefQypEgnZcggNkLkfO3JN23o8f8ichhsc5CK8Nqs/G1PSWjgMouHqPkOI7 8bz1tKoQpnoO2PrWArRdimCUnt5uTtIDffNWILk0kzQks+9sPgHv3VmwSw91ax903Gn6 u1W2wd3V1oHVNI9QWjMXa2crdQTdgluuPoybbE6NyhtFfd4q/i4fCYBB9IThEC5LbiZO wE0haDLbnZmG6IH8cTX4tuKyBFpM6eoPDmyh+iZCV2QVUDRLjaAaPcfY1WrmBehR9WQJ tVTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ss2si831404ejb.322.2019.09.11.05.11.12; Wed, 11 Sep 2019 05:11:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727850AbfIKMJI convert rfc822-to-8bit (ORCPT + 99 others); Wed, 11 Sep 2019 08:09:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55037 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727656AbfIKMJH (ORCPT ); Wed, 11 Sep 2019 08:09:07 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A61983F42 for ; Wed, 11 Sep 2019 12:09:07 +0000 (UTC) Received: by mail-ed1-f70.google.com with SMTP id a22so6466849edx.7 for ; Wed, 11 Sep 2019 05:09:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=wiKMwbrFTWMlvoFQ+WcXmY6U5v89DRZRbjwpcrU0/0g=; b=JZ/zDj+tdiGbZXrS6UbxLj0csVlC0qVs0iTdapBIUH8V9IAxZoYhPSCAmt6d1HkpgO evg7kHmHl1qUFGnozyZ124UlPS6CuracHi9Er0pbIQQmG0ouzVkp/wx2E0nwkRf10fzr x47+J3Bogw72abTB6lWhdIh84MxByOc+ttiZwHzFSG/StgOUs6sH//ntjOIusMWaA0LU lp+SqQ8L7csNPdMmYnwQkSmQuFGfLBvbu9usydNlRYc8K4lAlzh6gaEFwluEMZ7/b83G 8WCbYMnh9VXq/K7VzEaB3Qw6Oxfy0LTJdPVDBrBuFkTCieIwN0ET112nlwAMNKjIS/u+ 3rHA== X-Gm-Message-State: APjAAAW0DiJF4ozb3dtXM16L1n5rKPQbYeJyk2gXlfMt0uI1NhdQdalr AqUd0ROfAnTfzm60yhOcQAp4nlPaCoL60xfYF5+jRh245LeE5KPy1zOe8ncnCCjWI6ydxYuu5HU 0LoKrfFwSbD8uzRldSeLh5r/N X-Received: by 2002:a50:baab:: with SMTP id x40mr10586842ede.60.1568203744134; Wed, 11 Sep 2019 05:09:04 -0700 (PDT) X-Received: by 2002:a50:baab:: with SMTP id x40mr10586809ede.60.1568203743936; Wed, 11 Sep 2019 05:09:03 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk (borgediget.toke.dk. [85.204.121.218]) by smtp.gmail.com with ESMTPSA id o4sm4097666edq.84.2019.09.11.05.09.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2019 05:09:03 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 0D6111804C6; Wed, 11 Sep 2019 13:09:02 +0100 (WEST) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , Yonghong Song , Sami Tolvanen Cc: Alexei Starovoitov , Daniel Borkmann , Kees Cook , Martin Lau , Song Liu , "netdev\@vger.kernel.org" , "bpf\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" , Jesper Dangaard Brouer Subject: Re: [PATCH] bpf: validate bpf_func when BPF_JIT is enabled In-Reply-To: References: <20190909223236.157099-1-samitolvanen@google.com> <4f4136f5-db54-f541-2843-ccb35be25ab4@fb.com> <20190910172253.GA164966@google.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Wed, 11 Sep 2019 13:09:01 +0100 Message-ID: <87impzt4pu.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Björn Töpel writes: > On 2019-09-11 09:42, Yonghong Song wrote: >> I am not an expert in XDP testing. Toke, Björn, could you give some >> suggestions what to test for XDP performance here? > > I ran the "xdp_rxq_info" sample with and without Sami's patch: Thanks for doing this! > $ sudo ./xdp_rxq_info --dev enp134s0f0 --action XDP_DROP > > Before: > > Running XDP on dev:enp134s0f0 (ifindex:6) action:XDP_DROP options:no_touch > XDP stats CPU pps issue-pps > XDP-RX CPU 20 23923874 0 > XDP-RX CPU total 23923874 > > RXQ stats RXQ:CPU pps issue-pps > rx_queue_index 20:20 23923878 0 > rx_queue_index 20:sum 23923878 > > After Sami's patch: > > Running XDP on dev:enp134s0f0 (ifindex:6) action:XDP_DROP options:no_touch > XDP stats CPU pps issue-pps > XDP-RX CPU 20 22998700 0 > XDP-RX CPU total 22998700 > > RXQ stats RXQ:CPU pps issue-pps > rx_queue_index 20:20 22998705 0 > rx_queue_index 20:sum 22998705 > > > So, roughly ~4% for this somewhat naive scenario. Or (1/22998700 - 1/23923874) * 10**9 == 1.7 nanoseconds of overhead. I guess that is not *too* bad; but it's still chipping away at performance; anything we could do to lower the overhead? -Toke