public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Alexander Duyck <alexander.h.duyck@redhat.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 04/11] e1000e: Do not allow CRC stripping to be disabled on 82579 w/ jumbo frames
Date: Sat,  2 May 2015 03:42:31 -0700	[thread overview]
Message-ID: <1430563358-113833-5-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1430563358-113833-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Alexander Duyck <alexander.h.duyck@redhat.com>

 The driver wasn't allowing jumbo frames to be
 enabled when CRC stripping was disabled, however it was allowing CRC
 stripping to be disabled while jumbo frames were enabled.  This fixes that by
 making it so that the NETIF_F_RXFCS flag cannot be set when jumbo frames are
 enabled on 82579 and newer parts.

Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 68913d1..7dd2c11 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -6676,6 +6676,19 @@ static void e1000_eeprom_checks(struct e1000_adapter *adapter)
 	}
 }
 
+static netdev_features_t e1000_fix_features(struct net_device *netdev,
+					    netdev_features_t features)
+{
+	struct e1000_adapter *adapter = netdev_priv(netdev);
+	struct e1000_hw *hw = &adapter->hw;
+
+	/* Jumbo frame workaround on 82579 and newer requires CRC be stripped */
+	if ((hw->mac.type >= e1000_pch2lan) && (netdev->mtu > ETH_DATA_LEN))
+		features &= ~NETIF_F_RXFCS;
+
+	return features;
+}
+
 static int e1000_set_features(struct net_device *netdev,
 			      netdev_features_t features)
 {
@@ -6732,6 +6745,7 @@ static const struct net_device_ops e1000e_netdev_ops = {
 	.ndo_poll_controller	= e1000_netpoll,
 #endif
 	.ndo_set_features = e1000_set_features,
+	.ndo_fix_features = e1000_fix_features,
 };
 
 /**
-- 
2.1.0

  parent reply	other threads:[~2015-05-02 10:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-02 10:42 [net-next 00/11][pull request] Intel Wired LAN Driver Updates 2015-05-02 Jeff Kirsher
2015-05-02 10:42 ` [net-next 01/11] igb: simplify and clean up igb_enable_mas() Jeff Kirsher
2015-05-02 10:42 ` [net-next 02/11] e100: don't initialize int object to zero Jeff Kirsher
2015-05-02 10:42 ` [net-next 03/11] e1000e: Cleanup handling of VLAN_HLEN as a part of max frame size Jeff Kirsher
2015-05-02 10:42 ` Jeff Kirsher [this message]
2015-05-02 10:42 ` [net-next 05/11] e1000e: fix call to do_div() to use u64 arg Jeff Kirsher
2015-05-02 10:42 ` [net-next 06/11] ixgbe, ixgbevf: Add new mbox API to enable MC promiscuous mode Jeff Kirsher
2015-05-02 10:42 ` [net-next 07/11] if_link: Add VF multicast promiscuous control Jeff Kirsher
2015-05-03 14:16   ` Or Gerlitz
2015-05-04 16:12     ` Skidmore, Donald C
2015-05-07  5:55       ` Hiroshi Shimamoto
2015-05-07 16:44         ` Skidmore, Donald C
2015-05-08  0:23           ` Hiroshi Shimamoto
2015-05-11 23:55           ` Hiroshi Shimamoto
2015-05-12  0:21             ` Skidmore, Donald C
2015-05-12  0:33               ` Hiroshi Shimamoto
2015-05-16 11:56                 ` Jeff Kirsher
2015-05-19 23:52                   ` Hiroshi Shimamoto
2015-05-02 10:42 ` [net-next 08/11] ixgbe: Add new ndo to allow VF multicast promiscuous mode Jeff Kirsher
2015-05-02 10:42 ` [net-next 09/11] ixgbe: Fix IOSF SB access issues Jeff Kirsher
2015-05-02 10:42 ` [net-next 10/11] ixgbe: Release semaphore bits in the right order Jeff Kirsher
2015-05-02 10:42 ` [net-next 11/11] ixgbe: Use a signed type to hold error codes Jeff Kirsher
2015-05-04  3:36 ` [net-next 00/11][pull request] Intel Wired LAN Driver Updates 2015-05-02 David Miller
2015-05-04  7:34   ` Jeff Kirsher

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=1430563358-113833-5-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=alexander.h.duyck@redhat.com \
    --cc=davem@davemloft.net \
    --cc=jogreene@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.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