Message ID | 20171209225957.23458-3-f.fainelli@gmail.com |
---|---|
State | Accepted |
Commit | a409d91 |
Delegated to: | Joe Hershberger |
Headers | show |
Series | net: phy: Add Broadcom BCM53xx switch driver | expand |
On 09.12.2017 23:59, Florian Fainelli wrote: > Make sure that we pad small packets to a minimum length of 60 bytes > (without FCS). This is necessary to interface with Ethernet switches > that will reject RUNT frames unless padded correctly. > > Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Thanks, Stefan
On Sat, Dec 9, 2017 at 4:59 PM, Florian Fainelli <f.fainelli@gmail.com> wrote: > Make sure that we pad small packets to a minimum length of 60 bytes > (without FCS). This is necessary to interface with Ethernet switches > that will reject RUNT frames unless padded correctly. > > Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Hi Florian, https://patchwork.ozlabs.org/patch/846613/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git Thanks! -Joe
diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 036d231071ca..56fa0ebd8f31 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -17,6 +17,7 @@ #include <pci.h> #include <linux/compiler.h> #include <linux/err.h> +#include <linux/kernel.h> #include <asm/io.h> #include <power/regulator.h> #include "designware.h" @@ -343,6 +344,8 @@ int designware_eth_enable(struct dw_eth_dev *priv) return 0; } +#define ETH_ZLEN 60 + static int _dw_eth_send(struct dw_eth_dev *priv, void *packet, int length) { struct eth_dma_regs *dma_p = priv->dma_regs_p; @@ -369,6 +372,8 @@ static int _dw_eth_send(struct dw_eth_dev *priv, void *packet, int length) return -EPERM; } + length = max(length, ETH_ZLEN); + memcpy((void *)data_start, packet, length); /* Flush data to be sent */
Make sure that we pad small packets to a minimum length of 60 bytes (without FCS). This is necessary to interface with Ethernet switches that will reject RUNT frames unless padded correctly. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> --- drivers/net/designware.c | 5 +++++ 1 file changed, 5 insertions(+)