From patchwork Mon Feb 24 13:12:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qinchuanyu X-Patchwork-Id: 3709151 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 85057BF13A for ; Mon, 24 Feb 2014 13:12:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 860F720154 for ; Mon, 24 Feb 2014 13:12:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A1C80200DC for ; Mon, 24 Feb 2014 13:12:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752489AbaBXNMw (ORCPT ); Mon, 24 Feb 2014 08:12:52 -0500 Received: from szxga01-in.huawei.com ([119.145.14.64]:12528 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751834AbaBXNMv (ORCPT ); Mon, 24 Feb 2014 08:12:51 -0500 Received: from 172.24.2.119 (EHLO szxeml209-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BRV08672; Mon, 24 Feb 2014 21:12:28 +0800 (CST) Received: from szxeml459-hub.china.huawei.com (10.82.67.202) by szxeml209-edg.china.huawei.com (172.24.2.184) with Microsoft SMTP Server (TLS) id 14.3.158.1; Mon, 24 Feb 2014 21:12:25 +0800 Received: from [127.0.0.1] (10.177.21.101) by szxeml459-hub.china.huawei.com (10.82.67.202) with Microsoft SMTP Server id 14.3.158.1; Mon, 24 Feb 2014 21:12:23 +0800 Message-ID: <530B4534.3000106@huawei.com> Date: Mon, 24 Feb 2014 21:12:20 +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] bridge: 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 bridge. This could easily happened when a LAST_ACK state tcp occuring between guest and host. Signed-off-by: Chuanyu Qin --- net/bridge/br_input.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c index 28d5446..744e27a 100644 --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c @@ -117,6 +117,8 @@ int br_handle_frame_finish(struct sk_buff *skb) br->dev->stats.multicast++; } else if ((dst = __br_fdb_get(br, dest, vid)) && dst->is_local) { + if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC))) + goto drop; skb2 = skb; /* Do not forward the packet since it's local. */ skb = NULL; @@ -136,6 +138,7 @@ int br_handle_frame_finish(struct sk_buff *skb) out: return 0; drop: + skb_tx_error(skb); kfree_skb(skb); goto out; }