From e4f7192a445ba9c603e2853b29958e27cecc3c3d Mon Sep 17 00:00:00 2001 From: Sowmini Varadhan Date: Thu, 21 Jan 2016 04:09:49 -0800 Subject: [PATCH] sunvnet: hack to work around Solaris VIO bug Orabug 21895216 port workaround used for Bug 20455702: This patch works around a problem where Solaris drops packets bound for physical NICs (i.e., off host) that are using LSO and do not have the VIO v7 descriptor flags VNET_PKT_HASH, VNET_PKT_HCK_IPV4_HDRCKSUM, VNET_PKT_HCK_FULLCKSUM set along with VNET_PKT_IPV4_LSO. This patch can't go upstream because it doesn't actually support output hashing (all packets will hash to '0'). The full and IPv4 header checksum computations caused by the flags are unnecessary for Linux, but only affect destinations through the vswitch. (cherry picked from commit 3839694e54df457997025775894f954ea3185aff) --- drivers/net/ethernet/sun/sunvnet.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index 161343fb6ac2..e061166f47cd 100644 --- a/drivers/net/ethernet/sun/sunvnet.c +++ b/drivers/net/ethernet/sun/sunvnet.c @@ -1369,6 +1369,20 @@ static int vnet_start_xmit(struct sk_buff *skb, struct net_device *dev) dext->ipv4_lso_mss = skb_shinfo(port->tx_bufs[txi].skb) ->gso_size; dext->flags |= VNET_PKT_IPV4_LSO; + + /* + * HACK: packets going out a physical NIC are dropped + * by Solaris unless all of these are set. We: + * 1) have already generated fullcksum + * 2) have already generated IPv4 header cksum + * 3) are not generating a hash + * ...which is why these flags should NOT be set. + */ + if (port->switch_port) { + dext->flags |= VNET_PKT_HCK_FULLCKSUM; + dext->flags |= VNET_PKT_HCK_IPV4_HDRCKSUM; + dext->flags |= VNET_PKT_HASH; + } } if (vio_version_after_eq(&port->vio, 1, 8) && !port->switch_port) { -- 2.50.1