From patchwork Thu Nov 5 10:28:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 1394887 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=uqzEHaNX; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CRfs928Jqz9sSs for ; Thu, 5 Nov 2020 21:29:33 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id DC7DB20382; Thu, 5 Nov 2020 10:29:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nLkWiNrmcz7k; Thu, 5 Nov 2020 10:29:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 1BAEB22D24; Thu, 5 Nov 2020 10:29:30 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 037491BF59A for ; Thu, 5 Nov 2020 10:29:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id F20E5855D3 for ; Thu, 5 Nov 2020 10:29:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yT1+h5k7N3xT for ; Thu, 5 Nov 2020 10:29:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by whitealder.osuosl.org (Postfix) with ESMTPS id 65FC581AED for ; Thu, 5 Nov 2020 10:29:28 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id h6so1127579pgk.4 for ; Thu, 05 Nov 2020 02:29:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o05g9lm8nxzKqTNUi88bFCci2Fg4t0bp4is002sYr4w=; b=uqzEHaNXEdvcOFYpRFYUGY3EEh5p2uuuBjKl6cXsU+RsiYBcdrtM7lDHXRPAuakWtR yLMHbRQ25U0p4exJ0TzWLlbweM3dxAiwjtLlv+F11X4mMHtJmeEpzobBfUxfblP6lhBL woIQCVlpGoD9Ed0RnOzIxQ0qexaDoSAxzom78dgtv+4NGxQzXAZsymsFcuOAFLrZ1bf+ NlumzdymzXF5CNwL1+tymgkLKuOkOX6xp8e+ZiUEiJ5jW6dI3JaTQYSN5B3V4Q5ymQGI IuYg1cDDEWmYQSyhiNLFkPwoxc5tkOZW0LRqqk9Vmrgc/BPhQlEayJ4gYCBiNfOQqk1K u36Q== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o05g9lm8nxzKqTNUi88bFCci2Fg4t0bp4is002sYr4w=; b=YLMY3od6w893w/O+OlAjGM1D2DCqaxIsTEHDk7srncVsjbnjO+uQdWKbsjtWJrs+sW CW+YnL+5KAUiVxZAY8gX9m/Yt4NTB7oz1ksm16qGvwjnVoqvcVUlE1Kiiev1xBZzf05i NssgO1Tj2fi0swLw0zwMiqzsh99f80wG99zx6yoo7sKJHHnzzlv4UWuEEAGqZgqsox9a tOKa9j9mcaoKs/23yrW1M+phc1Ty7P3LjZpp3eU3AO2GnB7RsAQa4uqlHLb3dk0g2Ozh ZgVdiBjYj0Jzf79J93pekWfFUUd8bSrRX6fzEwZ4tKnFDQLj1JNXGVu60ZQ67galIfM8 F7Ag== X-Gm-Message-State: AOAM533ceI1yDNPYiLd//BuQnb9JOKRKmlwoX/j5Bu/qU3+wvfm5H9Su 6PNY/aENV0OdjXOoUAeHbvE= X-Google-Smtp-Source: ABdhPJygWbdDi+RdXm++zo6+HKTUkEGJTSqTyIcn9A9mmP3OyL+AXdLE6DkqkgRHVLcXDsDENrkejw== X-Received: by 2002:a17:90a:1188:: with SMTP id e8mr1798390pja.61.1604572168128; Thu, 05 Nov 2020 02:29:28 -0800 (PST) Received: from btopel-mobl.ger.intel.com (fmdmzpr03-ext.fm.intel.com. [192.55.54.38]) by smtp.gmail.com with ESMTPSA id 192sm2050117pfz.200.2020.11.05.02.29.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 02:29:27 -0800 (PST) From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: netdev@vger.kernel.org, bpf@vger.kernel.org Date: Thu, 5 Nov 2020 11:28:12 +0100 Message-Id: <20201105102812.152836-10-bjorn.topel@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201105102812.152836-1-bjorn.topel@gmail.com> References: <20201105102812.152836-1-bjorn.topel@gmail.com> MIME-Version: 1.0 Subject: [Intel-wired-lan] [RFC PATCH bpf-next v2 9/9] samples/bpf: add option to set the busy-poll budget X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: daniel@iogearbox.net, jonathan.lemon@gmail.com, ast@kernel.org, edumazet@google.com, intel-wired-lan@lists.osuosl.org, qi.z.zhang@intel.com, kuba@kernel.org, =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , magnus.karlsson@intel.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" From: Björn Töpel Support for the SO_BUSY_POLL_BUDGET setsockopt, via the batching option ('b'). Signed-off-by: Björn Töpel --- samples/bpf/xdpsock_user.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/samples/bpf/xdpsock_user.c b/samples/bpf/xdpsock_user.c index 162444fa9627..0ed05e6e40e2 100644 --- a/samples/bpf/xdpsock_user.c +++ b/samples/bpf/xdpsock_user.c @@ -1482,6 +1482,11 @@ static void apply_setsockopt(struct xsk_socket_info *xsk) if (setsockopt(xsk_socket__fd(xsk->xsk), SOL_SOCKET, SO_BUSY_POLL, (void *)&sock_opt, sizeof(sock_opt)) < 0) exit_with_error(errno); + + sock_opt = opt_batch_size; + if (setsockopt(xsk_socket__fd(xsk->xsk), SOL_SOCKET, SO_BUSY_POLL_BUDGET, + (void *)&sock_opt, sizeof(sock_opt)) < 0) + exit_with_error(errno); } int main(int argc, char **argv)