Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp386204pxf; Wed, 10 Mar 2021 08:15:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDFYsX1HyursvMYSu5DCXCg5xBQGk/W6FqUiq2wBdMi7iB8VBP39Q4dPS7vYspgf0QloO0 X-Received: by 2002:a50:8a90:: with SMTP id j16mr4123334edj.334.1615392912744; Wed, 10 Mar 2021 08:15:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615392912; cv=none; d=google.com; s=arc-20160816; b=GG43pNS8f50/avHJm0UNcf3d95ciOcvS17yaTkikfMd/9/1ESkUnrmq2MEmLh2lXnw 1r2VaCKO2eo8YQeSTuS6n+syWycNeX4gaiT7kwo28QxesyPwRskc8m3dP6/X1qfw5AUp A+fnTAafjlcKsvOeKKB4KHXI2VbM3YsHMGSvUcAoF4+4Bc8eX5KmhtVpcPemyqKqhozZ GuYyW3GfMorl7TSaFyNLEAbigz03xu+oBePvex21tfYpQCQV9cnESJwEEQCZ2Uj1nMhP OU9bwb+GFN0fOZDDbyqT2Mg7DFhjlpA9GmYLOrcqyFYjO7wquoSGTJ3+BaQetseLNCGv /OAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=XiIcPOnDbjiUFDFGKloS5WCLUIURZq38VKHxRNwbGFE=; b=oR9BB4c0FW8dPCzq/uHmqU6/4QkClEEBtFEVwOEo8XZT29FmQ+GR5GXhQ/pLsJbp4k PL/HBciHq8HY7qsq6mvVlARcnPxQ3rArVZScVD7ccFghORtKyli+1cS/1/dqo4/xt9wB pjcrZP24l7QfWcXLLoWFzWktj5lakzLhHpQwbk5cG7tRAPL1YHE/Ht9z/57fnJ+P3zii JqNjFAQH/FvxpBTABTc/EoAW2+x1bUIVBpOfCW0UekEYfMa/eMW6yoi/Dw5kG/+8frqw md7jaiVKuTykunp/pbPwMbJ1sNEYja8leCSc/c00wPldLNoPgCpI2cGUbR6jy4dOKYW5 DfmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gl1si1883522ejc.456.2021.03.10.08.14.49; Wed, 10 Mar 2021 08:15:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231864AbhCJQLm (ORCPT + 99 others); Wed, 10 Mar 2021 11:11:42 -0500 Received: from smtp06.smtpout.orange.fr ([80.12.242.128]:56983 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233413AbhCJQLY (ORCPT ); Wed, 10 Mar 2021 11:11:24 -0500 Received: from localhost.localdomain ([153.202.107.157]) by mwinf5d63 with ME id egAx2400D3PnFJp03gBFtw; Wed, 10 Mar 2021 17:11:20 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: bWFpbGhvbC52aW5jZW50QHdhbmFkb28uZnI= X-ME-Date: Wed, 10 Mar 2021 17:11:20 +0100 X-ME-IP: 153.202.107.157 From: Vincent Mailhol To: Marc Kleine-Budde , linux-can@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Eric Dumazet , Dave Taht Cc: Peter Zijlstra , Randy Dunlap , "David S . Miller" , Jakub Kicinski , Vincent Mailhol Subject: [RFC PATCH v2 1/1] netdev: add netdev_queue_set_dql_min_limit() Date: Thu, 11 Mar 2021 01:10:51 +0900 Message-Id: <20210310161051.23826-2-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210310161051.23826-1-mailhol.vincent@wanadoo.fr> References: <20210310161051.23826-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a function to set the dynamic queue limit minimum value. This function is to be used by network drivers which are able to prove, at least through empirical tests on several environment (with other applications, heavy context switching, virtualization...), that they constantly reach better performances with a specific predefined dql.min_limit value with no noticeable latency impact. Signed-off-by: Vincent Mailhol --- include/linux/netdevice.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ddf4cfc12615..7fceea9a202d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3389,6 +3389,23 @@ netif_xmit_frozen_or_drv_stopped(const struct netdev_queue *dev_queue) return dev_queue->state & QUEUE_STATE_DRV_XOFF_OR_FROZEN; } +/** + * netdev_queue_set_dql_min_limit - set dql minimum limit + * @dev_queue: pointer to transmit queue + * @min_limit: dql minimum limit + * + * Forces xmit_more() to return true until the minimum threshold + * defined by @min_limit is reached. Warning: to be use with care, + * misuse will impact the latency. + */ +static inline void netdev_queue_set_dql_min_limit(struct netdev_queue *q, + unsigned int min_limit) +{ +#ifdef CONFIG_BQL + q->dql.min_limit = min_limit; +#endif +} + /** * netdev_txq_bql_enqueue_prefetchw - prefetch bql data for write * @dev_queue: pointer to transmit queue -- 2.26.2