netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] Add linkmode_fill, use linkmode_*() in phylink/sfp code
@ 2023-11-15 11:39 Russell King (Oracle)
  2023-11-15 11:39 ` [PATCH net-next 1/3] net: linkmode: add linkmode_fill() helper Russell King (Oracle)
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Russell King (Oracle) @ 2023-11-15 11:39 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, netdev,
	Paolo Abeni

Hi,

This small series adds a linkmode_fill() op, and uses it in phylink.
The SFP code is also converted to use linkmode_*() ops.

 drivers/net/phy/phylink.c | 4 ++--
 drivers/net/phy/sfp-bus.c | 2 +-
 include/linux/linkmode.h  | 5 +++++
 3 files changed, 8 insertions(+), 3 deletions(-)

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net-next 1/3] net: linkmode: add linkmode_fill() helper
  2023-11-15 11:39 [PATCH net-next 0/3] Add linkmode_fill, use linkmode_*() in phylink/sfp code Russell King (Oracle)
@ 2023-11-15 11:39 ` Russell King (Oracle)
  2023-11-15 16:23   ` Andrew Lunn
  2023-11-15 11:39 ` [PATCH net-next 2/3] net: phylink: use linkmode_fill() Russell King (Oracle)
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Russell King (Oracle) @ 2023-11-15 11:39 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, netdev,
	Paolo Abeni

Add a linkmode_fill() helper, which will allow us to convert phylink's
open coded bitmap_fill() operations.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 include/linux/linkmode.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/linkmode.h b/include/linux/linkmode.h
index 7303b4bc2ce0..287f590ed56b 100644
--- a/include/linux/linkmode.h
+++ b/include/linux/linkmode.h
@@ -10,6 +10,11 @@ static inline void linkmode_zero(unsigned long *dst)
 	bitmap_zero(dst, __ETHTOOL_LINK_MODE_MASK_NBITS);
 }
 
+static inline void linkmode_fill(unsigned long *dst)
+{
+	bitmap_fill(dst, __ETHTOOL_LINK_MODE_MASK_NBITS);
+}
+
 static inline void linkmode_copy(unsigned long *dst, const unsigned long *src)
 {
 	bitmap_copy(dst, src, __ETHTOOL_LINK_MODE_MASK_NBITS);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net-next 2/3] net: phylink: use linkmode_fill()
  2023-11-15 11:39 [PATCH net-next 0/3] Add linkmode_fill, use linkmode_*() in phylink/sfp code Russell King (Oracle)
  2023-11-15 11:39 ` [PATCH net-next 1/3] net: linkmode: add linkmode_fill() helper Russell King (Oracle)
@ 2023-11-15 11:39 ` Russell King (Oracle)
  2023-11-15 16:23   ` Andrew Lunn
  2023-11-15 11:39 ` [PATCH net-next 3/3] net: sfp: use linkmode_*() rather than open coding Russell King (Oracle)
  2023-11-16 23:50 ` [PATCH net-next 0/3] Add linkmode_fill, use linkmode_*() in phylink/sfp code patchwork-bot+netdevbpf
  3 siblings, 1 reply; 8+ messages in thread
From: Russell King (Oracle) @ 2023-11-15 11:39 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, netdev,
	Paolo Abeni

Use linkmode_fill() rather than open coding the bitmap operation.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/phylink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 25c19496a336..d2fa949ff1ea 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -805,7 +805,7 @@ static int phylink_parse_fixedlink(struct phylink *pl,
 		phylink_warn(pl, "fixed link specifies half duplex for %dMbps link?\n",
 			     pl->link_config.speed);
 
-	bitmap_fill(pl->supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
+	linkmode_fill(pl->supported);
 	linkmode_copy(pl->link_config.advertising, pl->supported);
 	phylink_validate(pl, pl->supported, &pl->link_config);
 
@@ -1640,7 +1640,7 @@ struct phylink *phylink_create(struct phylink_config *config,
 	__set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
 	timer_setup(&pl->link_poll, phylink_fixed_poll, 0);
 
-	bitmap_fill(pl->supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
+	linkmode_fill(pl->supported);
 	linkmode_copy(pl->link_config.advertising, pl->supported);
 	phylink_validate(pl, pl->supported, &pl->link_config);
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net-next 3/3] net: sfp: use linkmode_*() rather than open coding
  2023-11-15 11:39 [PATCH net-next 0/3] Add linkmode_fill, use linkmode_*() in phylink/sfp code Russell King (Oracle)
  2023-11-15 11:39 ` [PATCH net-next 1/3] net: linkmode: add linkmode_fill() helper Russell King (Oracle)
  2023-11-15 11:39 ` [PATCH net-next 2/3] net: phylink: use linkmode_fill() Russell King (Oracle)
@ 2023-11-15 11:39 ` Russell King (Oracle)
  2023-11-15 16:23   ` Andrew Lunn
  2023-11-16 23:50 ` [PATCH net-next 0/3] Add linkmode_fill, use linkmode_*() in phylink/sfp code patchwork-bot+netdevbpf
  3 siblings, 1 reply; 8+ messages in thread
From: Russell King (Oracle) @ 2023-11-15 11:39 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, netdev,
	Paolo Abeni

Use the linkmode_*() helpers rather than open coding the calls to the
bitmap operators.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/sfp-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index 208a9393c2df..6fa679b36290 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -328,7 +328,7 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
 	 * modules use 2500Mbaud rather than 3100 or 3200Mbaud for
 	 * 2500BASE-X, so we allow some slack here.
 	 */
-	if (bitmap_empty(modes, __ETHTOOL_LINK_MODE_MASK_NBITS) && br_nom) {
+	if (linkmode_empty(modes) && br_nom) {
 		if (br_min <= 1300 && br_max >= 1200) {
 			phylink_set(modes, 1000baseX_Full);
 			__set_bit(PHY_INTERFACE_MODE_1000BASEX, interfaces);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next 1/3] net: linkmode: add linkmode_fill() helper
  2023-11-15 11:39 ` [PATCH net-next 1/3] net: linkmode: add linkmode_fill() helper Russell King (Oracle)
@ 2023-11-15 16:23   ` Andrew Lunn
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2023-11-15 16:23 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Heiner Kallweit, David S. Miller, Eric Dumazet, Jakub Kicinski,
	netdev, Paolo Abeni

On Wed, Nov 15, 2023 at 11:39:18AM +0000, Russell King (Oracle) wrote:
> Add a linkmode_fill() helper, which will allow us to convert phylink's
> open coded bitmap_fill() operations.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next 2/3] net: phylink: use linkmode_fill()
  2023-11-15 11:39 ` [PATCH net-next 2/3] net: phylink: use linkmode_fill() Russell King (Oracle)
@ 2023-11-15 16:23   ` Andrew Lunn
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2023-11-15 16:23 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Heiner Kallweit, David S. Miller, Eric Dumazet, Jakub Kicinski,
	netdev, Paolo Abeni

On Wed, Nov 15, 2023 at 11:39:23AM +0000, Russell King (Oracle) wrote:
> Use linkmode_fill() rather than open coding the bitmap operation.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next 3/3] net: sfp: use linkmode_*() rather than open coding
  2023-11-15 11:39 ` [PATCH net-next 3/3] net: sfp: use linkmode_*() rather than open coding Russell King (Oracle)
@ 2023-11-15 16:23   ` Andrew Lunn
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2023-11-15 16:23 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Heiner Kallweit, David S. Miller, Eric Dumazet, Jakub Kicinski,
	netdev, Paolo Abeni

On Wed, Nov 15, 2023 at 11:39:28AM +0000, Russell King (Oracle) wrote:
> Use the linkmode_*() helpers rather than open coding the calls to the
> bitmap operators.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next 0/3] Add linkmode_fill, use linkmode_*() in phylink/sfp code
  2023-11-15 11:39 [PATCH net-next 0/3] Add linkmode_fill, use linkmode_*() in phylink/sfp code Russell King (Oracle)
                   ` (2 preceding siblings ...)
  2023-11-15 11:39 ` [PATCH net-next 3/3] net: sfp: use linkmode_*() rather than open coding Russell King (Oracle)
@ 2023-11-16 23:50 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-11-16 23:50 UTC (permalink / raw)
  To: Russell King; +Cc: andrew, hkallweit1, davem, edumazet, kuba, netdev, pabeni

Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Wed, 15 Nov 2023 11:39:05 +0000 you wrote:
> Hi,
> 
> This small series adds a linkmode_fill() op, and uses it in phylink.
> The SFP code is also converted to use linkmode_*() ops.
> 
>  drivers/net/phy/phylink.c | 4 ++--
>  drivers/net/phy/sfp-bus.c | 2 +-
>  include/linux/linkmode.h  | 5 +++++
>  3 files changed, 8 insertions(+), 3 deletions(-)

Here is the summary with links:
  - [net-next,1/3] net: linkmode: add linkmode_fill() helper
    https://git.kernel.org/netdev/net-next/c/96fa96e198f9
  - [net-next,2/3] net: phylink: use linkmode_fill()
    https://git.kernel.org/netdev/net-next/c/ba50a8d40258
  - [net-next,3/3] net: sfp: use linkmode_*() rather than open coding
    https://git.kernel.org/netdev/net-next/c/466b97b1871a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-11-16 23:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-15 11:39 [PATCH net-next 0/3] Add linkmode_fill, use linkmode_*() in phylink/sfp code Russell King (Oracle)
2023-11-15 11:39 ` [PATCH net-next 1/3] net: linkmode: add linkmode_fill() helper Russell King (Oracle)
2023-11-15 16:23   ` Andrew Lunn
2023-11-15 11:39 ` [PATCH net-next 2/3] net: phylink: use linkmode_fill() Russell King (Oracle)
2023-11-15 16:23   ` Andrew Lunn
2023-11-15 11:39 ` [PATCH net-next 3/3] net: sfp: use linkmode_*() rather than open coding Russell King (Oracle)
2023-11-15 16:23   ` Andrew Lunn
2023-11-16 23:50 ` [PATCH net-next 0/3] Add linkmode_fill, use linkmode_*() in phylink/sfp code patchwork-bot+netdevbpf

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).