netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Tushar Dave <tushar.n.dave@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 1/8] e1000e: Minimum packet size must be 17 bytes
Date: Tue, 23 Oct 2012 03:24:40 -0700	[thread overview]
Message-ID: <1350987887-16161-2-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1350987887-16161-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Tushar Dave <tushar.n.dave@intel.com>

This is a HW requirement. Although a buffer as short as 1 byte is allowed,
the total length of packet before, padding and CRC insertion, must be at
least 17 bytes.  So pad all small packets manually up to 17 bytes before
delivering them to HW.

Signed-off-by: Tushar Dave <tushar.n.dave@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index f444eb0..dadb13b 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -5067,6 +5067,17 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
 		return NETDEV_TX_OK;
 	}
 
+	/*
+	 * The minimum packet size with TCTL.PSP set is 17 bytes so
+	 * pad skb in order to meet this minimum size requirement
+	 */
+	if (unlikely(skb->len < 17)) {
+		if (skb_pad(skb, 17 - skb->len))
+			return NETDEV_TX_OK;
+		skb->len = 17;
+		skb_set_tail_pointer(skb, 17);
+	}
+
 	mss = skb_shinfo(skb)->gso_size;
 	if (mss) {
 		u8 hdr_len;
-- 
1.7.11.7

  reply	other threads:[~2012-10-23 10:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23 10:24 [net-next 0/8][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-10-23 10:24 ` Jeff Kirsher [this message]
2012-10-23 15:25   ` [net-next 1/8] e1000e: Minimum packet size must be 17 bytes David Laight
2012-10-23 16:37     ` Alexander Duyck
2012-10-23 10:24 ` [net-next 2/8] maintainers: update with official intel support link, new maintainer Jeff Kirsher
2012-10-23 13:25   ` Joe Perches
2012-10-24  4:32     ` Jeff Kirsher
2012-10-24  4:52       ` Joe Perches
2012-10-24  5:13         ` Jeff Kirsher
2012-10-24 17:31       ` Rick Jones
2012-10-23 10:24 ` [net-next 3/8] igb: Update get cable length function for i210/i211 Jeff Kirsher
2012-10-23 10:24 ` [net-next 4/8] igb: Update version Jeff Kirsher
2012-10-23 10:24 ` [net-next 5/8] ixgbevf: make netif_napi_add and netif_napi_del symmetric Jeff Kirsher
2012-10-23 10:24 ` [net-next 6/8] ixgbevf: Check for error on dma_map_single call Jeff Kirsher
2012-10-23 10:24 ` [net-next 7/8] ixgbevf: fix softirq-safe to unsafe splat on internal mbx_lock Jeff Kirsher
2012-10-23 10:24 ` [net-next 8/8] ixgbevf: Update version string Jeff Kirsher
2012-10-23 17:28 ` [net-next 0/8][pull request] Intel Wired LAN Driver Updates David Miller

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=1350987887-16161-2-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    --cc=tushar.n.dave@intel.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).