netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>
Subject: Re: [PATCH net-next 5/5] net: dsa: mv88e6xxx: move mv88e6xxx_hwtstamp_work() prototype
Date: Tue, 16 Sep 2025 16:31:19 +0100	[thread overview]
Message-ID: <aMmCx1Eu0pDAxWJ9@shell.armlinux.org.uk> (raw)
In-Reply-To: <9d3eb839-99be-4d08-96ec-8bee1dec073a@lunn.ch>

On Tue, Sep 16, 2025 at 02:46:05PM +0200, Andrew Lunn wrote:
> > This leaves the shim definition (for when CONFIG_NET_DSA_MV88E6XXX_PTP
> > is not defined) in ptp.h. It creates an inconsistency and potential
> > problem - the same header should provide all definitions of the same
> > function.
> 
> How big is the PTP code? We have added a lot of code to this driver
> since PTP was added. I suspect the PTP code is now small compared to
> the rest of the driver, so does it still make sense to have it
> optional? Also once the PTP code gets moved into a library and shared
> by the Marvell PHY driver and other Marvell MAC drivers, won't we have
> an overall code shrink even when it is enabled in DSA?
> 
> Maybe it is time for CONFIG_NET_DSA_MV88E6XXX_PTP to go away?

Unmodified:
wc -l:
   611 drivers/net/dsa/mv88e6xxx/hwtstamp.c
   180 drivers/net/dsa/mv88e6xxx/hwtstamp.h
   564 drivers/net/dsa/mv88e6xxx/ptp.c
   176 drivers/net/dsa/mv88e6xxx/ptp.h

size:
   text    data     bss     dec     hex filename
   4004       0      16    4020     fb4 drivers/net/dsa/mv88e6xxx/hwtstamp.o
 130360    3505     224  134089   20bc9 drivers/net/dsa/mv88e6xxx/mv88e6xxx.ko
   3917       0      64    3981     f8d drivers/net/dsa/mv88e6xxx/ptp.o

Current post-conversion:
wc -l:
   459 drivers/net/dsa/mv88e6xxx/hwtstamp.c
   169 drivers/net/dsa/mv88e6xxx/hwtstamp.h
   418 drivers/net/dsa/mv88e6xxx/ptp.c
    83 drivers/net/dsa/mv88e6xxx/ptp.h

size:
   text    data     bss     dec     hex filename
   3988       0       0    3988     f94 drivers/net/dsa/mv88e6xxx/hwtstamp.o
 129312    3505     144  132961   20761 drivers/net/dsa/mv88e6xxx/mv88e6xxx.ko
   2709       0       0    2709     a95 drivers/net/dsa/mv88e6xxx/ptp.o

With a bit more effort to avoid the repeated chip->info->ops->foo
dereferecing chains in ptp.c, I can get this down to:

   text    data     bss     dec     hex filename
   2677       0       0    2677     a75 drivers/net/dsa/mv88e6xxx/ptp.o

So that reduces the PTP .text size by between 31 and 32%.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

      reply	other threads:[~2025-09-16 15:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15 13:05 [PATCH net-next 0/5] net: dsa: mv88e6xxx: further PTP-related cleanups Russell King (Oracle)
2025-09-15 13:06 ` [PATCH net-next 1/5] net: dsa: mv88e6xxx: rename TAI definitions according to core Russell King (Oracle)
2025-09-16  8:46   ` Vladimir Oltean
2025-09-16 13:36     ` Russell King (Oracle)
2025-09-16 14:35       ` Vladimir Oltean
2025-09-16 16:14         ` Russell King (Oracle)
2025-09-15 13:06 ` [PATCH net-next 2/5] net: dsa: mv88e6xxx: remove unused TAI definitions Russell King (Oracle)
2025-09-16  9:23   ` Vladimir Oltean
2025-09-15 13:06 ` [PATCH net-next 3/5] net: dsa: mv88e6xxx: remove duplicated register definition Russell King (Oracle)
2025-09-16  9:22   ` Vladimir Oltean
2025-09-15 13:06 ` [PATCH net-next 4/5] net: dsa: mv88e6xxx: remove unused 88E6165 register definitions Russell King (Oracle)
2025-09-15 13:06 ` [PATCH net-next 5/5] net: dsa: mv88e6xxx: move mv88e6xxx_hwtstamp_work() prototype Russell King (Oracle)
2025-09-16  8:09   ` Vladimir Oltean
2025-09-16  8:36     ` Russell King (Oracle)
2025-09-16  9:03       ` Vladimir Oltean
2025-09-16 12:46     ` Andrew Lunn
2025-09-16 15:31       ` Russell King (Oracle) [this message]

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=aMmCx1Eu0pDAxWJ9@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.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;
as well as URLs for NNTP newsgroup(s).