Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp48794lqh; Mon, 6 May 2024 10:51:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCURD3FNs60u+w0TE1LpD704rCNa/NDTJZQGfkVpU/iK0Ykd6yDUAa03pD0O13ObYZ5SecQF4xNKQfFp6ETmkGebxiJxvrHxih00QQWYNQ== X-Google-Smtp-Source: AGHT+IF3lwjGOOzz0UjLd/rtZ3mYLguMah1hFqNuK7i84aC9ixGdRmIURJoOURrQdzvUkNe/XXPL X-Received: by 2002:a05:6871:5ce:b0:23c:58fe:5df5 with SMTP id v14-20020a05687105ce00b0023c58fe5df5mr13828358oan.14.1715017861501; Mon, 06 May 2024 10:51:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715017861; cv=pass; d=google.com; s=arc-20160816; b=tdyt7yvBLD9rA1aQLl4Oo1KqHz/LcZMe62dLDt84KtRTSlED9Dt5v8cdGjZW8UeUyH Zj3yB2qr+pDvvFA8Hc5oIBQH6zJl4jgNdZ0QGXpLIHOBQ4mjaMFhi3wh2s+k1PqwdU5a egJ8G4QgvE69ueOTEzdNFC0OuSuKNFpC7ioPIKG8HEG+XD38iLuEWArg9M+/rl1tFdJY Qqz2xVk8/l218sMOMTaBzmhjpmyYXwudVGl0Q7fORhyRp2ZbOuJ62fmLfBVvUY1iybz8 veZZntLUmUrpL36aX3lzecJKx4CgiTaSiY8V9W09ufhO9qvRDZ7VAa0HinlrKIpdnclt 65VA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=y4OV1hZW/c1WkWpLCq8Tz4ymTtql2ehCSvQ+Mz2ljGU=; fh=w/1PihF7rEOprXLqDSEvkDcCMYST9N07a1mHPZqjbeU=; b=Js1SQbViMNOncExuqHmOal3WXvVWrg6Kd/FKyYBhurhxPtLB1rGjF3WhFlEx3kHIQn GoaK9SQKJQZoqgbFdkpxyzCsYNbUyfpFJ0ayLRvXkfTV4NnWbhMqDsQb71BLyHCGR8wN 2vlOLgk+oPrwDxoKcsJlNqvyPr47CbinQUDQ3ilMBE51Zy7nFvUNzxrfPyPpq6ksY5FZ IIeJH2zpc3Wjjk+NmLu2erqrRoJfRo1yHOOWN+vGC+toO93FhMGCBrwYyAdsQWSp5/Pp cVSFnL/AJ7DKrp/IK6ghmqpRtmHNNFUjl94FHzXzVpXyzyVrXJ/+9tebz0uCmHakf4ls Zb+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=UzMle71a; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-170252-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170252-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h11-20020ae9ec0b000000b007908e1db341si9312347qkg.187.2024.05.06.10.51.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 10:51:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170252-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=UzMle71a; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-170252-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170252-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3BF561C21BA2 for ; Mon, 6 May 2024 17:51:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 322721586CC; Mon, 6 May 2024 17:50:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="UzMle71a" Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.144.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2618157E7A; Mon, 6 May 2024 17:50:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.144.207 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715017853; cv=none; b=fmR8z2Jub+W4/nOf4TpBa7VlnEBqFFsFKu2oVHnScQRZZo+ArvOKskV8U97WAwP6AwnqeZ2YX0AFk5qM8nWoe3GUsA+eMWuPVfQJmwlLjVNs160dqbUTenOseEe0yvNFCOGbYVR6VhJANC3v1dlO7+2iRwiwEATwD5SPOKwaokI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715017853; c=relaxed/simple; bh=v6pEqBJ5mDe9Geb1lnQ6KB6h8NCGbjd9XTgNlYMumZA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=c6Dd3/35lLOoKNfBixFpR99tE+fM2opdPrp34LuZTuz43rjoFftjoEkTEmcU8FGB2DCD8Ydx7SGjpLq4gQxNwC08JjhQEfvO83ZtCS9Ur6rztmeiknogaoZrCVPiQ/bxnBsCbD1rJ1pWzkUoXW4fV8QSMxEL0WrDZHxjSHRxdyk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=UzMle71a; arc=none smtp.client-ip=192.19.144.207 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Received: from mail-lvn-it-01.lvn.broadcom.net (mail-lvn-it-01.lvn.broadcom.net [10.36.132.253]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id B460DC0000F1; Mon, 6 May 2024 10:50:44 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com B460DC0000F1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1715017844; bh=v6pEqBJ5mDe9Geb1lnQ6KB6h8NCGbjd9XTgNlYMumZA=; h=From:To:Cc:Subject:Date:From; b=UzMle71aRbs+gStauk6DVeYL6Te6an9ndMV4wnUqU8LlLEvtK38go+/N0lkkhR5KN kC6DC0iTQaAV3o8R15wfrO0CxMgwW7FWgkK3zrJtbt/XWrQ9N3CzccQvboq4Evo/IH Rv9141/2/8nZBOFfHbjgCFcgTLlj9Ct3UVKTDWTE= Received: from fainelli-desktop.igp.broadcom.net (fainelli-desktop.dhcp.broadcom.net [10.67.48.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-lvn-it-01.lvn.broadcom.net (Postfix) with ESMTPSA id B530718041CAC4; Mon, 6 May 2024 10:50:42 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: kuba@kernel.org, jgg@nvidia.com, leonro@nvidia.com, horms@kernel.org, Florian Fainelli , Andrew Morton , Tal Gilboa , linux-kernel@vger.kernel.org (open list:LIBRARY CODE) Subject: [PATCH net-next v2] lib: Allow for the DIM library to be modular Date: Mon, 6 May 2024 10:50:40 -0700 Message-Id: <20240506175040.410446-1-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Allow the Dynamic Interrupt Moderation (DIM) library to be built as a module. This is particularly useful in an Android GKI (Google Kernel Image) configuration where everything is built as a module, including Ethernet controller drivers. Having to build DIMLIB into the kernel image with potentially no user is wasteful. Signed-off-by: Florian Fainelli --- Changes in v2: - Added MODULE_DESCRIPTION() lib/Kconfig | 2 +- lib/dim/Makefile | 4 ++-- lib/dim/dim.c | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/Kconfig b/lib/Kconfig index 4557bb8a5256..d33a268bc256 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -628,7 +628,7 @@ config SIGNATURE Implementation is done using GnuPG MPI library config DIMLIB - bool + tristate help Dynamic Interrupt Moderation library. Implements an algorithm for dynamically changing CQ moderation values diff --git a/lib/dim/Makefile b/lib/dim/Makefile index 1d6858a108cb..c4cc4026c451 100644 --- a/lib/dim/Makefile +++ b/lib/dim/Makefile @@ -2,6 +2,6 @@ # DIM Dynamic Interrupt Moderation library # -obj-$(CONFIG_DIMLIB) += dim.o +obj-$(CONFIG_DIMLIB) += dimlib.o -dim-y := dim.o net_dim.o rdma_dim.o +dimlib-objs := dim.o net_dim.o rdma_dim.o diff --git a/lib/dim/dim.c b/lib/dim/dim.c index e89aaf07bde5..83b65ac74d73 100644 --- a/lib/dim/dim.c +++ b/lib/dim/dim.c @@ -82,3 +82,6 @@ bool dim_calc_stats(struct dim_sample *start, struct dim_sample *end, return true; } EXPORT_SYMBOL(dim_calc_stats); + +MODULE_DESCRIPTION("Dynamic Interrupt Moderation (DIM) library"); +MODULE_LICENSE("Dual BSD/GPL"); -- 2.34.1