From patchwork Fri Jun 22 22:18:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li,Rongqing via dev" X-Patchwork-Id: 933624 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=openvswitch.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=digitalocean.com header.i=@digitalocean.com header.b="HjSq2kUR"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41CCdw4G4yz9s2L for ; Sat, 23 Jun 2018 08:18:59 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 813D2CD1; Fri, 22 Jun 2018 22:18:56 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 147FDCAC for ; Fri, 22 Jun 2018 22:18:56 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-qt0-f194.google.com (mail-qt0-f194.google.com [209.85.216.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 6BA8C75D for ; Fri, 22 Jun 2018 22:18:55 +0000 (UTC) Received: by mail-qt0-f194.google.com with SMTP id y31-v6so7306156qty.9 for ; Fri, 22 Jun 2018 15:18:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digitalocean.com; s=google; h=from:to:cc:subject:date:message-id; bh=EocCf6gbznei7h8QUXUujKR4S/h/uzJbP60+ILDgPXo=; b=HjSq2kURjWmUo2G6Ot7oCe53xzOGhEYTPm8k1i0I9WwPQ6WOp0Y2P+vEIEzkXem8qD yrZgk7SNyzRL1nK/sNGRlMljxxN2o0eWUSxn2MSfVBNxOISB83hIvyFwrSQ5ooDBYBYQ Wya1+29QWo9nsRZegFrzlayU/cEHnRT4t2ICo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EocCf6gbznei7h8QUXUujKR4S/h/uzJbP60+ILDgPXo=; b=uBDcnIUq+XdPRRSuAd7GK1G3iNPb4maEzl8HKZup6zR3ggtSDii7BiYNHI437OTCTN dhyTO2GF8vtTYGeN2aLngtv+usUqZ682dKmQ2+yKZ3pLCCRL59DjeN2CjcWsUj70RrXX k4aqZkKFpkQKqe7EaSOwWC7vj7r9t31WaYY9tyiAPg9SCsAkq4nsxkfhrScGZ5KCbB+c uGuXKpy7QuEk6XwlQleQTJjhvSIaJz7FND4p6CSCQCwheeLKJw9FnaerYABIdQX17cE5 H4EKEpkmesoJjMJmyd6tSeHMMQjMebqckwmSWdst7GBJQwNf0f+xVvlRzl/2ZH7GX0b6 XLxw== X-Gm-Message-State: APt69E2cHi+zPylK+C3cLW97p20ItHOLSXYwdPSWJjx/200VSHzIdWw9 Dh7oomuog/E7bEpPZPh96VNE0zzN7LM= X-Google-Smtp-Source: AAOMgpd81hPjNB8RiJSDMIqDConS/u7tfsviqWhTXgaGu/1upDxq5dbeih2TFCF/LCFD/JsC7vRLRw== X-Received: by 2002:aed:359d:: with SMTP id c29-v6mr3008385qte.240.1529705934110; Fri, 22 Jun 2018 15:18:54 -0700 (PDT) Received: from localhost.localdomain ([158.106.193.162]) by smtp.gmail.com with ESMTPSA id n23-v6sm6775167qtc.27.2018.06.22.15.18.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jun 2018 15:18:53 -0700 (PDT) To: dev@openvswitch.org Date: Fri, 22 Jun 2018 18:18:50 -0400 Message-Id: <20180622221850.55454-1-neal@digitalocean.com> X-Mailer: git-send-email 2.14.1 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] datapath: stt: linearize in SKIP_ZERO_COPY case X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Neal Shrader via dev From: "Li,Rongqing via dev" Reply-To: Neal Shrader MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org During the investigation of a kernel panic, we encountered a condition that triggered a kernel panic due to a large skb with an unusual geometry. Inside of the STT codepath, an effort is made to linearize such packets to avoid trouble during both fragment reassembly and segmentation in the linux networking core. As currently implemented, kernels with CONFIG_SLUB defined will skip this process because it does not expect an skb with a frag_list to be present. This patch removes the assumption, and allows these skb to be linearized as intended. We confirmed this corrects the panic we encountered. Reported-by: Johannes Erdfelt Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018-May/046800.html Requested-by: Pravin Shelar Signed-off-by: Neal Shrader --- datapath/linux/compat/stt.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c index ca9f03988..64fc550fe 100644 --- a/datapath/linux/compat/stt.c +++ b/datapath/linux/compat/stt.c @@ -559,12 +559,6 @@ static int __try_to_segment(struct sk_buff *skb, bool csum_partial, static int try_to_segment(struct sk_buff *skb) { -#ifdef SKIP_ZERO_COPY - /* coalesce_skb() since does not generate frag-list no need to - * linearize it here. - */ - return 0; -#else struct stthdr *stth = stt_hdr(skb); bool csum_partial = !!(stth->flags & STT_CSUM_PARTIAL); bool ipv4 = !!(stth->flags & STT_PROTO_IPV4); @@ -572,7 +566,6 @@ static int try_to_segment(struct sk_buff *skb) int l4_offset = stth->l4_offset; return __try_to_segment(skb, csum_partial, ipv4, tcp, l4_offset); -#endif } static int segment_skb(struct sk_buff **headp, bool csum_partial,