8139cp: Fix GSO MSS handling
authorDavid Woodhouse <dwmw2@infradead.org>
Thu, 24 Sep 2015 10:38:22 +0000 (11:38 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 27 Sep 2015 05:38:34 +0000 (22:38 -0700)
commite7181df944393435b05ee3593d09f8bf2230fe31
treed2fc6cc721822b02e326569b2d011bd906a6842b
parentc00a86e3942488e3729965e5ecced5296b412f53
8139cp: Fix GSO MSS handling

When fixing the TSO support I noticed we just mask ->gso_size with the
MSSMask value and don't care about the consequences.

Provide a .ndo_features_check() method which drops the NETIF_F_TSO
feature for any skb which would exceed the maximum, and thus forces it
to be segmented by software.

Then we can stop the masking in cp_start_xmit(), and just WARN if the
maximum is exceeded, which should now never happen.

Finally, Francois Romieu noticed that we didn't even have the right
value for MSSMask anyway; it should be 0x7ff (11 bits) not 0xfff.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/8139cp.c