@@ -305,17 +305,17 @@ static netdev_tx_t __ei_start_xmit(struct sk_buff *skb,
{
unsigned long e8390_base = dev->base_addr;
struct ei_device *ei_local = netdev_priv(dev);
- int send_length = skb->len, output_page;
+ int send_length, output_page;
unsigned long flags;
- char buf[ETH_ZLEN];
- char *data = skb->data;
-
- if (skb->len < ETH_ZLEN) {
- memset(buf, 0, ETH_ZLEN); /* more efficient than doing just the needed bits */
- memcpy(buf, data, skb->len);
- send_length = ETH_ZLEN;
- data = buf;
+ char *data;
+
+ /* The Hardware does not pad undersized frames */
+ if (eth_skb_pad(skb)) {
+ dev->stats.tx_dropped++;
+ return NETDEV_TX_OK;
}
+ data = skb->data;
+ send_length = skb->len;
/* Mask interrupts from the ethercard.
SMP: We have to grab the lock here otherwise the IRQ handler
According to Joe Perches, this bit seems less than optimal because it overwrites already zeroed content. But instead of fixing the custom padding solution, replace them entirely with generic eth_skb_pad(). Signed-off-by: Armin Wolf <W_Armin@gmx.de> --- drivers/net/ethernet/8390/lib8390.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 2.20.1