Skip to contentSkip to conversation

net: systemport: set dev->max_mtu to UMAC_MAX_MTU_SIZE

PATCH In review Florian Fainelli 2 participants 12 messages Dec 18, 2020 – Dec 21, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: systemport: set dev->max_mtu to UMAC_MAX_MTU_SIZE

The driver is already allocating receive buffers of 2KiB and the Ethernet MAC is configured to accept frames up to UMAC_MAX_MTU_SIZE.

Fixes bfcb813203e6 ("net: dsa: configure the MTU for switch ports")
---
 drivers/net/ethernet/broadcom/bcmsysport.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bcmsysport.c +1 -0
index 0fdd19d99d99..b1ae9eb8f247 100644
@@ -2577,6 +2577,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
 			 NETIF_F_HW_VLAN_CTAG_TX;
 	dev->hw_features |= dev->features;
 	dev->vlan_features |= dev->features;
+	dev->max_mtu = UMAC_MAX_MTU_SIZE;
 
 	/* Request the WOL interrupt and advertise suspend if available */
 	priv->wol_irq_disabled = 1;
Signature · 1 line
2.25.1
#1 lore raw

Hi Florian,

Quoted 24 lines · Florian Fainelli

The driver is already allocating receive buffers of 2KiB and the Ethernet MAC is configured to accept frames up to UMAC_MAX_MTU_SIZE.

Fixes bfcb813203e6 ("net: dsa: configure the MTU for switch ports")
---
 drivers/net/ethernet/broadcom/bcmsysport.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bcmsysport.c +1 -0
index 0fdd19d99d99..b1ae9eb8f247 100644
@@ -2577,6 +2577,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
 			 NETIF_F_HW_VLAN_CTAG_TX;
 	dev->hw_features |= dev->features;
 	dev->vlan_features |= dev->features;
+	dev->max_mtu = UMAC_MAX_MTU_SIZE;
 
 	/* Request the WOL interrupt and advertise suspend if available */
 	priv->wol_irq_disabled = 1;
Signature · 1 line
2.25.1

Do you want to treat the SYSTEMPORT Lite differently?

	/* Set maximum frame length */
	if (!priv->is_lite)
		umac_writel(priv, UMAC_MAX_MTU_SIZE, UMAC_MAX_FRAME_LEN);
	else
		gib_set_pad_extension(priv);
#2 lore raw
Quoted 30 lines · Vladimir Oltean

Hi Florian,

Quoted 24 lines · Florian Fainelli

The driver is already allocating receive buffers of 2KiB and the Ethernet MAC is configured to accept frames up to UMAC_MAX_MTU_SIZE.

Fixes bfcb813203e6 ("net: dsa: configure the MTU for switch ports")
---
 drivers/net/ethernet/broadcom/bcmsysport.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bcmsysport.c +1 -0
index 0fdd19d99d99..b1ae9eb8f247 100644
@@ -2577,6 +2577,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
 			 NETIF_F_HW_VLAN_CTAG_TX;
 	dev->hw_features |= dev->features;
 	dev->vlan_features |= dev->features;
+	dev->max_mtu = UMAC_MAX_MTU_SIZE;
 
 	/* Request the WOL interrupt and advertise suspend if available */
 	priv->wol_irq_disabled = 1;
Signature · 1 line
2.25.1

Do you want to treat the SYSTEMPORT Lite differently?

Quoted 5 lines
	/* Set maximum frame length */
	if (!priv->is_lite)
		umac_writel(priv, UMAC_MAX_MTU_SIZE, UMAC_MAX_FRAME_LEN);
	else
		gib_set_pad_extension(priv);

SYSTEMPORT Lite does not actually validate the frame length, so setting a maximum number to the buffer size we allocate could work, but I don't see a reason to differentiate the two types of MACs here.

Signature · 1 line
Florian
#3 lore raw
Quoted 37 lines · Florian Fainelli
Quoted 30 lines · Vladimir Oltean

Hi Florian,

Quoted 24 lines · Florian Fainelli

The driver is already allocating receive buffers of 2KiB and the Ethernet MAC is configured to accept frames up to UMAC_MAX_MTU_SIZE.

Fixes bfcb813203e6 ("net: dsa: configure the MTU for switch ports")
---
 drivers/net/ethernet/broadcom/bcmsysport.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bcmsysport.c +1 -0
index 0fdd19d99d99..b1ae9eb8f247 100644
@@ -2577,6 +2577,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
 			 NETIF_F_HW_VLAN_CTAG_TX;
 	dev->hw_features |= dev->features;
 	dev->vlan_features |= dev->features;
+	dev->max_mtu = UMAC_MAX_MTU_SIZE;
 
 	/* Request the WOL interrupt and advertise suspend if available */
 	priv->wol_irq_disabled = 1;
Signature · 1 line
2.25.1

Do you want to treat the SYSTEMPORT Lite differently?

Quoted 5 lines
	/* Set maximum frame length */
	if (!priv->is_lite)
		umac_writel(priv, UMAC_MAX_MTU_SIZE, UMAC_MAX_FRAME_LEN);
	else
		gib_set_pad_extension(priv);
Quoted 3 lines

SYSTEMPORT Lite does not actually validate the frame length, so setting a maximum number to the buffer size we allocate could work, but I don't see a reason to differentiate the two types of MACs here.

And if the Lite doesn't validate the frame length, then shouldn't it report a max_mtu equal to the max_mtu of the attached DSA switch, plus the Broadcom tag length? Doesn't the b53 driver support jumbo frames?

#4 lore raw
Quoted 38 lines · Vladimir Oltean
Quoted 37 lines · Florian Fainelli
Quoted 35 lines · Vladimir Oltean

Hi Florian,

Quoted 24 lines · Florian Fainelli

The driver is already allocating receive buffers of 2KiB and the Ethernet MAC is configured to accept frames up to UMAC_MAX_MTU_SIZE.

Fixes bfcb813203e6 ("net: dsa: configure the MTU for switch ports")
---
 drivers/net/ethernet/broadcom/bcmsysport.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bcmsysport.c +1 -0
index 0fdd19d99d99..b1ae9eb8f247 100644
@@ -2577,6 +2577,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
 			 NETIF_F_HW_VLAN_CTAG_TX;
 	dev->hw_features |= dev->features;
 	dev->vlan_features |= dev->features;
+	dev->max_mtu = UMAC_MAX_MTU_SIZE;
 
 	/* Request the WOL interrupt and advertise suspend if available */
 	priv->wol_irq_disabled = 1;
Signature · 1 line
2.25.1

Do you want to treat the SYSTEMPORT Lite differently?

	/* Set maximum frame length */
	if (!priv->is_lite)
		umac_writel(priv, UMAC_MAX_MTU_SIZE, UMAC_MAX_FRAME_LEN);
	else
		gib_set_pad_extension(priv);
Quoted 7 lines
Quoted 3 lines

SYSTEMPORT Lite does not actually validate the frame length, so setting a maximum number to the buffer size we allocate could work, but I don't see a reason to differentiate the two types of MACs here.

And if the Lite doesn't validate the frame length, then shouldn't it report a max_mtu equal to the max_mtu of the attached DSA switch, plus the Broadcom tag length? Doesn't the b53 driver support jumbo frames?

And how would I do that without create a horrible layering violation in either the systemport driver or DSA? Yes the b53 driver supports jumbo frames.

Signature · 1 line
Florian
#5 lore raw
Quoted 43 lines · Florian Fainelli
Quoted 42 lines · Vladimir Oltean
Quoted 40 lines · Florian Fainelli
Quoted 30 lines · Vladimir Oltean

Hi Florian,

Quoted 24 lines · Florian Fainelli

The driver is already allocating receive buffers of 2KiB and the Ethernet MAC is configured to accept frames up to UMAC_MAX_MTU_SIZE.

Fixes bfcb813203e6 ("net: dsa: configure the MTU for switch ports")
---
 drivers/net/ethernet/broadcom/bcmsysport.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bcmsysport.c +1 -0
index 0fdd19d99d99..b1ae9eb8f247 100644
@@ -2577,6 +2577,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
 			 NETIF_F_HW_VLAN_CTAG_TX;
 	dev->hw_features |= dev->features;
 	dev->vlan_features |= dev->features;
+	dev->max_mtu = UMAC_MAX_MTU_SIZE;
 
 	/* Request the WOL interrupt and advertise suspend if available */
 	priv->wol_irq_disabled = 1;
Signature · 1 line
2.25.1

Do you want to treat the SYSTEMPORT Lite differently?

Quoted 5 lines
	/* Set maximum frame length */
	if (!priv->is_lite)
		umac_writel(priv, UMAC_MAX_MTU_SIZE, UMAC_MAX_FRAME_LEN);
	else
		gib_set_pad_extension(priv);

SYSTEMPORT Lite does not actually validate the frame length, so setting a maximum number to the buffer size we allocate could work, but I don't see a reason to differentiate the two types of MACs here.

Quoted 7 lines
Quoted 3 lines

And if the Lite doesn't validate the frame length, then shouldn't it report a max_mtu equal to the max_mtu of the attached DSA switch, plus the Broadcom tag length? Doesn't the b53 driver support jumbo frames?

And how would I do that without create a horrible layering violation in either the systemport driver or DSA? Yes the b53 driver supports jumbo frames.

Sorry, I don't understand where is the layering violation (maybe it doesn't help me either that I'm not familiar with Broadcom architectures).

Is the SYSTEMPORT Lite always used as a DSA master, or could it also be used standalone? What would be the issue with hardcoding a max_mtu value which is large enough for b53 to use jumbo frames?

#6 lore raw
Quoted 52 lines · Vladimir Oltean
Quoted 43 lines · Florian Fainelli
Quoted 42 lines · Vladimir Oltean
Quoted 40 lines · Florian Fainelli
Quoted 30 lines · Vladimir Oltean

Hi Florian,

Quoted 24 lines · Florian Fainelli

The driver is already allocating receive buffers of 2KiB and the Ethernet MAC is configured to accept frames up to UMAC_MAX_MTU_SIZE.

Fixes bfcb813203e6 ("net: dsa: configure the MTU for switch ports")
---
 drivers/net/ethernet/broadcom/bcmsysport.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bcmsysport.c +1 -0
index 0fdd19d99d99..b1ae9eb8f247 100644
@@ -2577,6 +2577,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
 			 NETIF_F_HW_VLAN_CTAG_TX;
 	dev->hw_features |= dev->features;
 	dev->vlan_features |= dev->features;
+	dev->max_mtu = UMAC_MAX_MTU_SIZE;
 
 	/* Request the WOL interrupt and advertise suspend if available */
 	priv->wol_irq_disabled = 1;
Signature · 1 line
2.25.1

Do you want to treat the SYSTEMPORT Lite differently?

Quoted 5 lines
	/* Set maximum frame length */
	if (!priv->is_lite)
		umac_writel(priv, UMAC_MAX_MTU_SIZE, UMAC_MAX_FRAME_LEN);
	else
		gib_set_pad_extension(priv);

SYSTEMPORT Lite does not actually validate the frame length, so setting a maximum number to the buffer size we allocate could work, but I don't see a reason to differentiate the two types of MACs here.

Quoted 7 lines
Quoted 3 lines

And if the Lite doesn't validate the frame length, then shouldn't it report a max_mtu equal to the max_mtu of the attached DSA switch, plus the Broadcom tag length? Doesn't the b53 driver support jumbo frames?

And how would I do that without create a horrible layering violation in either the systemport driver or DSA? Yes the b53 driver supports jumbo frames.

Quoted 6 lines

Sorry, I don't understand where is the layering violation (maybe it doesn't help me either that I'm not familiar with Broadcom architectures).

Is the SYSTEMPORT Lite always used as a DSA master, or could it also be used standalone? What would be the issue with hardcoding a max_mtu value which is large enough for b53 to use jumbo frames?

SYSTEMPORT Lite is always used as a DSA master AFAICT given its GMII Integration Block (GIB) was specifically designed with another MAC and particularly that of a switch on the other side.

The layering violation I am concerned with is that we do not know ahead of time which b53 switch we are going to be interfaced with, and they have various limitations on the sizes they support. Right now b53 only concerns itself with returning JMS_MAX_SIZE, but I am fairly positive this needs fixing given the existing switches supported by the driver.

Signature · 1 line
Florian
#7 lore raw
Quoted 64 lines · Florian Fainelli
Quoted 52 lines · Vladimir Oltean
Quoted 43 lines · Florian Fainelli
Quoted 42 lines · Vladimir Oltean
Quoted 40 lines · Florian Fainelli
Quoted 30 lines · Vladimir Oltean

Hi Florian,

Quoted 24 lines · Florian Fainelli

The driver is already allocating receive buffers of 2KiB and the Ethernet MAC is configured to accept frames up to UMAC_MAX_MTU_SIZE.

Fixes bfcb813203e6 ("net: dsa: configure the MTU for switch ports")
---
 drivers/net/ethernet/broadcom/bcmsysport.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bcmsysport.c +1 -0
index 0fdd19d99d99..b1ae9eb8f247 100644
@@ -2577,6 +2577,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
 			 NETIF_F_HW_VLAN_CTAG_TX;
 	dev->hw_features |= dev->features;
 	dev->vlan_features |= dev->features;
+	dev->max_mtu = UMAC_MAX_MTU_SIZE;
 
 	/* Request the WOL interrupt and advertise suspend if available */
 	priv->wol_irq_disabled = 1;
Signature · 1 line
2.25.1

Do you want to treat the SYSTEMPORT Lite differently?

Quoted 5 lines
	/* Set maximum frame length */
	if (!priv->is_lite)
		umac_writel(priv, UMAC_MAX_MTU_SIZE, UMAC_MAX_FRAME_LEN);
	else
		gib_set_pad_extension(priv);

SYSTEMPORT Lite does not actually validate the frame length, so setting a maximum number to the buffer size we allocate could work, but I don't see a reason to differentiate the two types of MACs here.

Quoted 7 lines
Quoted 3 lines

And if the Lite doesn't validate the frame length, then shouldn't it report a max_mtu equal to the max_mtu of the attached DSA switch, plus the Broadcom tag length? Doesn't the b53 driver support jumbo frames?

And how would I do that without create a horrible layering violation in either the systemport driver or DSA? Yes the b53 driver supports jumbo frames.

Quoted 6 lines

Sorry, I don't understand where is the layering violation (maybe it doesn't help me either that I'm not familiar with Broadcom architectures).

Is the SYSTEMPORT Lite always used as a DSA master, or could it also be used standalone? What would be the issue with hardcoding a max_mtu value which is large enough for b53 to use jumbo frames?

SYSTEMPORT Lite is always used as a DSA master AFAICT given its GMII Integration Block (GIB) was specifically designed with another MAC and particularly that of a switch on the other side.

Quoted 5 lines

The layering violation I am concerned with is that we do not know ahead of time which b53 switch we are going to be interfaced with, and they have various limitations on the sizes they support. Right now b53 only concerns itself with returning JMS_MAX_SIZE, but I am fairly positive this needs fixing given the existing switches supported by the driver.

Maybe we don't need to over-engineer this. As long as you report a large enough max_mtu in the SYSTEMPORT Lite driver to accomodate for all possible revisions of embedded switches, and the max_mtu of the switch itself is still accurate and representative of the switch revision limits, I think that's good enough.

#8 lore raw
Quoted 71 lines · Vladimir Oltean
Quoted 64 lines · Florian Fainelli
Quoted 52 lines · Vladimir Oltean
Quoted 43 lines · Florian Fainelli
Quoted 42 lines · Vladimir Oltean
Quoted 40 lines · Florian Fainelli
Quoted 30 lines · Vladimir Oltean

Hi Florian,

Quoted 24 lines · Florian Fainelli

The driver is already allocating receive buffers of 2KiB and the Ethernet MAC is configured to accept frames up to UMAC_MAX_MTU_SIZE.

Fixes bfcb813203e6 ("net: dsa: configure the MTU for switch ports")
---
 drivers/net/ethernet/broadcom/bcmsysport.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bcmsysport.c +1 -0
index 0fdd19d99d99..b1ae9eb8f247 100644
@@ -2577,6 +2577,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
 			 NETIF_F_HW_VLAN_CTAG_TX;
 	dev->hw_features |= dev->features;
 	dev->vlan_features |= dev->features;
+	dev->max_mtu = UMAC_MAX_MTU_SIZE;
 
 	/* Request the WOL interrupt and advertise suspend if available */
 	priv->wol_irq_disabled = 1;
Signature · 1 line
2.25.1

Do you want to treat the SYSTEMPORT Lite differently?

Quoted 5 lines
	/* Set maximum frame length */
	if (!priv->is_lite)
		umac_writel(priv, UMAC_MAX_MTU_SIZE, UMAC_MAX_FRAME_LEN);
	else
		gib_set_pad_extension(priv);

SYSTEMPORT Lite does not actually validate the frame length, so setting a maximum number to the buffer size we allocate could work, but I don't see a reason to differentiate the two types of MACs here.

Quoted 7 lines
Quoted 3 lines

And if the Lite doesn't validate the frame length, then shouldn't it report a max_mtu equal to the max_mtu of the attached DSA switch, plus the Broadcom tag length? Doesn't the b53 driver support jumbo frames?

And how would I do that without create a horrible layering violation in either the systemport driver or DSA? Yes the b53 driver supports jumbo frames.

Quoted 6 lines

Sorry, I don't understand where is the layering violation (maybe it doesn't help me either that I'm not familiar with Broadcom architectures).

Is the SYSTEMPORT Lite always used as a DSA master, or could it also be used standalone? What would be the issue with hardcoding a max_mtu value which is large enough for b53 to use jumbo frames?

SYSTEMPORT Lite is always used as a DSA master AFAICT given its GMII Integration Block (GIB) was specifically designed with another MAC and particularly that of a switch on the other side.

Quoted 5 lines

The layering violation I am concerned with is that we do not know ahead of time which b53 switch we are going to be interfaced with, and they have various limitations on the sizes they support. Right now b53 only concerns itself with returning JMS_MAX_SIZE, but I am fairly positive this needs fixing given the existing switches supported by the driver.

Quoted 5 lines

Maybe we don't need to over-engineer this. As long as you report a large enough max_mtu in the SYSTEMPORT Lite driver to accomodate for all possible revisions of embedded switches, and the max_mtu of the switch itself is still accurate and representative of the switch revision limits, I think that's good enough.

I suppose that is fair, v2 coming, thanks!

Signature · 1 line
Florian
#9 lore raw
Quoted 29 lines · Florian Fainelli
Quoted 29 lines
Quoted 28 lines
Quoted 12 lines
Quoted 11 lines
Quoted 7 lines
Quoted 3 lines

SYSTEMPORT Lite does not actually validate the frame length, so setting a maximum number to the buffer size we allocate could work, but I don't see a reason to differentiate the two types of MACs here.

And if the Lite doesn't validate the frame length, then shouldn't it report a max_mtu equal to the max_mtu of the attached DSA switch, plus the Broadcom tag length? Doesn't the b53 driver support jumbo frames?

And how would I do that without create a horrible layering violation in either the systemport driver or DSA? Yes the b53 driver supports jumbo frames.

Quoted 6 lines

Sorry, I don't understand where is the layering violation (maybe it doesn't help me either that I'm not familiar with Broadcom architectures).

Is the SYSTEMPORT Lite always used as a DSA master, or could it also be used standalone? What would be the issue with hardcoding a max_mtu value which is large enough for b53 to use jumbo frames?

SYSTEMPORT Lite is always used as a DSA master AFAICT given its GMII Integration Block (GIB) was specifically designed with another MAC and particularly that of a switch on the other side.

The layering violation I am concerned with is that we do not know ahead of time which b53 switch we are going to be interfaced with, and they have various limitations on the sizes they support. Right now b53 only concerns itself with returning JMS_MAX_SIZE, but I am fairly positive this needs fixing given the existing switches supported by the driver.

Quoted 7 lines
Quoted 5 lines

Maybe we don't need to over-engineer this. As long as you report a large enough max_mtu in the SYSTEMPORT Lite driver to accomodate for all possible revisions of embedded switches, and the max_mtu of the switch itself is still accurate and representative of the switch revision limits, I think that's good enough.

I suppose that is fair, v2 coming, thanks!

I was going to issue a v2 for this patch, but given that we don't allocate buffers larger than 2KiB and there is really no need to implement ndo_change_mtu(), is there really a point not to use UMAC_MAX_MTU_SIZE for both variants of the SYSTEMPORT MAC?

Signature · 1 line
Florian
Reviewed-by
#10 lore raw
Quoted 36 lines · Florian Fainelli
Quoted 35 lines · Florian Fainelli
Quoted 34 lines
Quoted 23 lines
Quoted 12 lines
Quoted 11 lines
Quoted 7 lines
Quoted 3 lines

SYSTEMPORT Lite does not actually validate the frame length, so setting a maximum number to the buffer size we allocate could work, but I don't see a reason to differentiate the two types of MACs here.

And if the Lite doesn't validate the frame length, then shouldn't it report a max_mtu equal to the max_mtu of the attached DSA switch, plus the Broadcom tag length? Doesn't the b53 driver support jumbo frames?

And how would I do that without create a horrible layering violation in either the systemport driver or DSA? Yes the b53 driver supports jumbo frames.

Quoted 6 lines

Sorry, I don't understand where is the layering violation (maybe it doesn't help me either that I'm not familiar with Broadcom architectures).

Is the SYSTEMPORT Lite always used as a DSA master, or could it also be used standalone? What would be the issue with hardcoding a max_mtu value which is large enough for b53 to use jumbo frames?

SYSTEMPORT Lite is always used as a DSA master AFAICT given its GMII Integration Block (GIB) was specifically designed with another MAC and particularly that of a switch on the other side.

Quoted 5 lines

The layering violation I am concerned with is that we do not know ahead of time which b53 switch we are going to be interfaced with, and they have various limitations on the sizes they support. Right now b53 only concerns itself with returning JMS_MAX_SIZE, but I am fairly positive this needs fixing given the existing switches supported by the driver.

Maybe we don't need to over-engineer this. As long as you report a large enough max_mtu in the SYSTEMPORT Lite driver to accomodate for all possible revisions of embedded switches, and the max_mtu of the switch itself is still accurate and representative of the switch revision limits, I think that's good enough.

Quoted 6 lines
Quoted 1 line

I suppose that is fair, v2 coming, thanks!

I was going to issue a v2 for this patch, but given that we don't allocate buffers larger than 2KiB and there is really no need to implement ndo_change_mtu(), is there really a point not to use UMAC_MAX_MTU_SIZE for both variants of the SYSTEMPORT MAC?

After your first reply that "the Lite doesn't validate the frame length", I was under the impression that it is sufficient to declare a larger max_mtu such as JMS_MAX_SIZE and 9K jumbo frames would just work. But with the current buffer allocation in bcm_sysport_rx_refill it clearly wouldn't. A stupid confusion really. So yeah, sorry for having you resend a v2 with no change. If it helps you could add to the patch:

Thanks again for explaining.

#11 lore raw
Quoted 51 lines · Vladimir Oltean
Quoted 36 lines · Florian Fainelli
Quoted 35 lines · Florian Fainelli
Quoted 34 lines
Quoted 23 lines
Quoted 12 lines
Quoted 11 lines
Quoted 7 lines
Quoted 3 lines

SYSTEMPORT Lite does not actually validate the frame length, so setting a maximum number to the buffer size we allocate could work, but I don't see a reason to differentiate the two types of MACs here.

And if the Lite doesn't validate the frame length, then shouldn't it report a max_mtu equal to the max_mtu of the attached DSA switch, plus the Broadcom tag length? Doesn't the b53 driver support jumbo frames?

And how would I do that without create a horrible layering violation in either the systemport driver or DSA? Yes the b53 driver supports jumbo frames.

Quoted 6 lines

Sorry, I don't understand where is the layering violation (maybe it doesn't help me either that I'm not familiar with Broadcom architectures).

Is the SYSTEMPORT Lite always used as a DSA master, or could it also be used standalone? What would be the issue with hardcoding a max_mtu value which is large enough for b53 to use jumbo frames?

SYSTEMPORT Lite is always used as a DSA master AFAICT given its GMII Integration Block (GIB) was specifically designed with another MAC and particularly that of a switch on the other side.

Quoted 5 lines

The layering violation I am concerned with is that we do not know ahead of time which b53 switch we are going to be interfaced with, and they have various limitations on the sizes they support. Right now b53 only concerns itself with returning JMS_MAX_SIZE, but I am fairly positive this needs fixing given the existing switches supported by the driver.

Maybe we don't need to over-engineer this. As long as you report a large enough max_mtu in the SYSTEMPORT Lite driver to accomodate for all possible revisions of embedded switches, and the max_mtu of the switch itself is still accurate and representative of the switch revision limits, I think that's good enough.

Quoted 6 lines
Quoted 1 line

I suppose that is fair, v2 coming, thanks!

I was going to issue a v2 for this patch, but given that we don't allocate buffers larger than 2KiB and there is really no need to implement ndo_change_mtu(), is there really a point not to use UMAC_MAX_MTU_SIZE for both variants of the SYSTEMPORT MAC?

After your first reply that "the Lite doesn't validate the frame length", I was under the impression that it is sufficient to declare a larger max_mtu such as JMS_MAX_SIZE and 9K jumbo frames would just work. But with the current buffer allocation in bcm_sysport_rx_refill it clearly wouldn't. A stupid confusion really. So yeah, sorry for having you resend a v2 with no change. If it helps you could add to the patch:

Quoted 3 lines

Thanks again for explaining.

No worries, Jakub, David, do you need me to resend or can you pick it up from patchwork?

Signature · 1 line
Florian