From: Sowmini Varadhan Date: Thu, 21 Jan 2016 12:09:49 +0000 (-0800) Subject: sunvnet: hack to work around Solaris VIO bug X-Git-Tag: v4.1.12-92~198^2~9 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e4f7192a445ba9c603e2853b29958e27cecc3c3d;p=users%2Fjedix%2Flinux-maple.git 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) --- diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index 161343fb6ac24..e061166f47cd9 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) {