From patchwork Thu Jun 13 19:26:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioanna Alifieraki X-Patchwork-Id: 1115576 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45Ptyt4kXNz9sNl; Fri, 14 Jun 2019 05:26:46 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hbVMr-0002K6-Iy; Thu, 13 Jun 2019 19:26:37 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hbVMo-0002JY-UM for kernel-team@lists.ubuntu.com; Thu, 13 Jun 2019 19:26:34 +0000 Received: from mail-wm1-f72.google.com ([209.85.128.72]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hbVMo-00055H-Jw for kernel-team@lists.ubuntu.com; Thu, 13 Jun 2019 19:26:34 +0000 Received: by mail-wm1-f72.google.com with SMTP id v125so58817wme.5 for ; Thu, 13 Jun 2019 12:26:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=5lUmZwT9HKdUAGxVxGhM9/sNZYh5qQ2OWFKR8spRO2k=; b=Ym5TILrHSowUXNW10ZOvuTU0HyoWLaZ0ytEVUQ+woPhS3EDzGHGmrmQSHTYmwMiBO6 N8ODZYVxrXxDqlcxOvTuN+f61K8JrIp7PhXI89Uejfv3En6Rl43Z36dcsBcli4LY26oL ahtrvtGYnp/FjnaqCmZwZgxworvcM2xVz+iWnZF+xRg9Jx1hNMlR1ebuv1wEUq8dJCTI Vft/VRKMFFASB0v3G12ivMovgmAoDHLjrJYisvNy3mN56IBsjsMng0MKx1g+3xK5g+i1 pEsbnNYe31j3lT2AjbIlm/LExRYrEs1sZ+HbHKAg6X3IDfMyNB6wTq/3GWWHg7A76zRc B/Lg== X-Gm-Message-State: APjAAAVVLjI92F8J2d/raE5kLCXFz7QBl+3rxfO8HVYgZAFaboTGZCwH 3XgJwuaoWWbgLkNnwdyxO1ZISRiqKdTXjhXPuLExJmadlc/NMsp1qgm/SCGCuaLCZfF1Wh4sp3X SshlxMlTQN4v2RPYK5w75Elv80IjZsLKOTpAvt5K60g== X-Received: by 2002:adf:8044:: with SMTP id 62mr13482022wrk.20.1560453994090; Thu, 13 Jun 2019 12:26:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/TDVuYKJ+/aNxr6ABG9E+tz/4TkztPE3iuo9W/RQaPfn1CDKTHU0HetpFkkMvAmsh2k/F6Q== X-Received: by 2002:adf:8044:: with SMTP id 62mr13482015wrk.20.1560453993939; Thu, 13 Jun 2019 12:26:33 -0700 (PDT) Received: from localhost ([2a02:c7d:31d6:7200:ecdd:10ea:9dc8:5da7]) by smtp.gmail.com with ESMTPSA id o126sm1392976wmo.31.2019.06.13.12.26.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jun 2019 12:26:33 -0700 (PDT) From: Ioanna Alifieraki To: kernel-team@lists.ubuntu.com Subject: [RFC][b/azure][PATCH 1/8] azure XDP generic fixes - option 1 Date: Thu, 13 Jun 2019 20:26:23 +0100 Message-Id: <20190613192630.31244-2-ioanna-maria.alifieraki@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190613192630.31244-1-ioanna-maria.alifieraki@canonical.com> References: <20190613192630.31244-1-ioanna-maria.alifieraki@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Stephen Hemminger BugLink: https://bugs.launchpad.net/bugs/1831254 The netvsc VF skb handler should make sure that skb is not shared. Similar logic already exists in bonding and team device drivers. This is not an issue in practice because the VF devicex does not send up shared skb's. But the netvsc driver should do the right thing if it did. Fixes: 0c195567a8f6 ("netvsc: transparent VF management") Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller (cherry picked from commit 996ed04741467f6d1552440c92988b132a9487ec) Signed-off-by: Ioanna Alifieraki --- drivers/net/hyperv/netvsc_drv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index c0fc30a1f600..c86c79949097 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -1836,6 +1836,12 @@ static rx_handler_result_t netvsc_vf_handle_frame(struct sk_buff **pskb) struct netvsc_vf_pcpu_stats *pcpu_stats = this_cpu_ptr(ndev_ctx->vf_stats); + skb = skb_share_check(skb, GFP_ATOMIC); + if (unlikely(!skb)) + return RX_HANDLER_CONSUMED; + + *pskb = skb; + skb->dev = ndev; u64_stats_update_begin(&pcpu_stats->syncp);