From patchwork Wed Feb 6 23:02:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 218791 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E74712C02E9 for ; Thu, 7 Feb 2013 09:59:26 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758185Ab3BFW6t (ORCPT ); Wed, 6 Feb 2013 17:58:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44272 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757045Ab3BFW6q (ORCPT ); Wed, 6 Feb 2013 17:58:46 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r16MwWbY017522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 6 Feb 2013 17:58:32 -0500 Received: from redhat.com (vpn-200-122.tlv.redhat.com [10.35.200.122]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id r16MwPQp005055; Wed, 6 Feb 2013 17:58:25 -0500 Date: Thu, 7 Feb 2013 01:02:50 +0200 From: "Michael S. Tsirkin" To: netdev@vger.kernel.org Cc: Eilon Greenstein , Jeff Kirsher , Jesse Brandeburg , Bruce Allan , Carolyn Wyborny , Don Skidmore , Greg Rose , Peter P Waskiewicz Jr , Alex Duyck , John Ronciak , Tushar Dave , Jitendra Kalsaria , Sony Chacko , linux-driver@qlogic.com, John Fastabend , "David S. Miller" , Jacob Keller , linux-kernel@vger.kernel.org, e1000-devel@lists.sourceforge.net, bhutchings@solarflare.com, eric.dumazet@gmail.com Subject: [PATCH 1/2] ixgbe: fix gso type Message-ID: <76c44c70077f42302d7b079b29fd414205747af5.1360191528.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org ixgbe set gso_size but not gso_type. This leads to crashes in macvtap. Signed-off-by: Michael S. Tsirkin --- I tested that this fixes the crash for me. I am told on ixgbe LRO only triggers with TCP so checking protocol should be enough? drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 396e280..9d01673 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -1399,6 +1399,10 @@ static void ixgbe_set_rsc_gso_size(struct ixgbe_ring *ring, /* set gso_size to avoid messing up TCP MSS */ skb_shinfo(skb)->gso_size = DIV_ROUND_UP((skb->len - hdr_len), IXGBE_CB(skb)->append_cnt); + if (skb->protocol == ETH_P_IPV6) + skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; + else + skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; } static void ixgbe_update_rsc_stats(struct ixgbe_ring *rx_ring, @@ -1433,6 +1437,8 @@ static void ixgbe_process_skb_fields(struct ixgbe_ring *rx_ring, { struct net_device *dev = rx_ring->netdev; + skb->protocol = eth_type_trans(skb, dev); + ixgbe_update_rsc_stats(rx_ring, skb); ixgbe_rx_hash(rx_ring, rx_desc, skb); @@ -1448,8 +1454,6 @@ static void ixgbe_process_skb_fields(struct ixgbe_ring *rx_ring, } skb_record_rx_queue(skb, rx_ring->queue_index); - - skb->protocol = eth_type_trans(skb, dev); } static void ixgbe_rx_skb(struct ixgbe_q_vector *q_vector,