From patchwork Mon Feb 24 13:15:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qinchuanyu X-Patchwork-Id: 3709181 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 461919F2F7 for ; Mon, 24 Feb 2014 13:15:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7AC1120154 for ; Mon, 24 Feb 2014 13:15:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B32FE20120 for ; Mon, 24 Feb 2014 13:15:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752287AbaBXNPg (ORCPT ); Mon, 24 Feb 2014 08:15:36 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:42052 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751787AbaBXNPf (ORCPT ); Mon, 24 Feb 2014 08:15:35 -0500 Received: from 172.24.2.119 (EHLO szxeml211-edg.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id ALA49590; Mon, 24 Feb 2014 21:15:17 +0800 (CST) Received: from SZXEML408-HUB.china.huawei.com (10.82.67.95) by szxeml211-edg.china.huawei.com (172.24.2.182) with Microsoft SMTP Server (TLS) id 14.3.158.1; Mon, 24 Feb 2014 21:15:17 +0800 Received: from [127.0.0.1] (10.177.21.101) by szxeml408-hub.china.huawei.com (10.82.67.95) with Microsoft SMTP Server id 14.3.158.1; Mon, 24 Feb 2014 21:15:14 +0800 Message-ID: <530B45E0.20009@huawei.com> Date: Mon, 24 Feb 2014 21:15:12 +0800 From: Qin Chuanyu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: , "Michael S. Tsirkin" CC: KVM list , Subject: [PATCH] openvswitch: orphan frags on local receive X-Originating-IP: [10.177.21.101] X-CFilter-Loop: Reflected Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP with vhost tx zero_copy, guest nic might get hang when host reserving skb in socket queue delivered by guest, the case has been solved in tun, it also been needed by openvswitch. This could easily happened when a LAST_ACK state tcp occuring between guest and host. Signed-off-by: Chuanyu Qin --- net/openvswitch/vport-internal_dev.c | 3 +++ net/openvswitch/vport.c | 1 + 2 files changed, 4 insertions(+), 0 deletions(-) ovs_vport_record_error(vport, VPORT_E_TX_DROPPED); diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c index 729c687..adb25e2 100644 --- a/net/openvswitch/vport-internal_dev.c +++ b/net/openvswitch/vport-internal_dev.c @@ -212,6 +212,9 @@ static int internal_dev_recv(struct vport *vport, struct sk_buff *skb) struct net_device *netdev = netdev_vport_priv(vport)->dev; int len; + if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC))) + return -NET_RX_DROP; + len = skb->len; skb_dst_drop(skb); diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c index 208dd9a..04172d6 100644 --- a/net/openvswitch/vport.c +++ b/net/openvswitch/vport.c @@ -383,6 +383,7 @@ int ovs_vport_send(struct vport *vport, struct sk_buff *skb) u64_stats_update_end(&stats->syncp); } else if (sent < 0) { ovs_vport_record_error(vport, VPORT_E_TX_ERROR); + skb_tx_error(skb); kfree_skb(skb); } else