public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Arnd Bergmann <arnd@kernel.org>,
	Sunil Goutham <sgoutham@marvell.com>,
	Geetha sowjanya <gakula@marvell.com>,
	Subbaraya Sundeep <sbhatta@marvell.com>,
	hariprasad <hkelam@marvell.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Suman Ghosh <sumang@marvell.com>, Simon Horman <horms@kernel.org>,
	"Tony Nguyen" <anthony.l.nguyen@intel.com>,
	Jiri Pirko <jiri@resnulli.us>,
	"Mateusz Polchlopek" <mateusz.polchlopek@intel.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ethernet: octeontx2: avoid linking objects into multiple modules
Date: Thu, 30 May 2024 10:54:34 -0700	[thread overview]
Message-ID: <2f1603fa-d03c-412c-895c-bc4afa06834b@intel.com> (raw)
In-Reply-To: <20240528152527.2148092-1-arnd@kernel.org>



On 5/28/2024 8:25 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Each object file contains information about which module it gets linked
> into, so linking the same file into multiple modules now causes a warning:
> 
> scripts/Makefile.build:254: drivers/net/ethernet/marvell/octeontx2/nic/Makefile: otx2_devlink.o is added to multiple modules: rvu_nicpf rvu_nicvf
> 

When I tried to build, I don't see any warnings produced on the current
net-next with W=1. Is this something new and not yet in net-next tree?
If not, how do I enable this warning in my local build?

> Change the way that octeontx2 ethernet is built by moving the common
> file into a separate module with exported symbols instead.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

The change makes sense to me. I built and tested both before and after
this change.

On my system, before the build change, the driver built to 3 separate
modules totaling 2029176 bytes:

> -rw-r--r--. 1 jekeller jekeller   72104 May 30 10:46 otx2_ptp.ko
> -rw-r--r--. 1 jekeller jekeller 1774008 May 30 10:46 rvu_nicpf.ko
> -rw-r--r--. 1 jekeller jekeller  183064 May 30 10:46 rvu_nicvf.ko
After this change, the driver builds to 5 separate modules totaling
1977984 bytes:

> -rw-r--r--. 1 jekeller jekeller   81480 May 30 10:46 otx2_dcbnl.ko
> -rw-r--r--. 1 jekeller jekeller   19784 May 30 10:46 otx2_devlink.ko
> -rw-r--r--. 1 jekeller jekeller   72104 May 30 10:46 otx2_ptp.ko
> -rw-r--r--. 1 jekeller jekeller 1698880 May 30 10:46 rvu_nicpf.ko
> -rw-r--r--. 1 jekeller jekeller  105736 May 30 10:46 rvu_nicvf.ko

This is a savings of 51192 bytes from removing the duplicated object code.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

  reply	other threads:[~2024-05-30 17:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28 15:25 [PATCH] ethernet: octeontx2: avoid linking objects into multiple modules Arnd Bergmann
2024-05-30 17:54 ` Jacob Keller [this message]
2024-05-30 18:52   ` Arnd Bergmann
2024-05-30 20:30     ` Jacob Keller
2024-05-31  1:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f1603fa-d03c-412c-895c-bc4afa06834b@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=horms@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mateusz.polchlopek@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    --cc=sumang@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox