From patchwork Thu Jun 13 19:27:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioanna Alifieraki X-Patchwork-Id: 1115584 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 45Pv0N53KPz9s5c; Fri, 14 Jun 2019 05:28:04 +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 1hbVOC-0002nv-LN; Thu, 13 Jun 2019 19:28:00 +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 1hbVOB-0002mJ-88 for kernel-team@lists.ubuntu.com; Thu, 13 Jun 2019 19:27:59 +0000 Received: from mail-wr1-f69.google.com ([209.85.221.69]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hbVOA-0005GW-Uh for kernel-team@lists.ubuntu.com; Thu, 13 Jun 2019 19:27:58 +0000 Received: by mail-wr1-f69.google.com with SMTP id g2so20686wrq.19 for ; Thu, 13 Jun 2019 12:27:58 -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=IAeg040W7EnmEks2y35cDBlk7jMdA+N5NcoKJSnFpDd6x1IuB0Q93+C7/6IFao0ZA0 gpdq+baiHV2Qc3YToGOIfgHs7tuCd/wYJ5d4gxRY7hw/5MLQdhUz0lFGBeSRVTHfESX5 Id7Uty5iTzTywWdW0a5/KhRcK5cb0UVkk6Hx0R/oaDzfhkVF9ri4AjWO7rQF0F0kqVYu BPvqbsMk7tmMc5iJn+QwuJOx3qj7lngmQKRC6qlmEsG5mqQQrm70xUY1HJQIgj3dnE94 YNwqhCC6V/r2ADEbvjngXVKW/lUKQGdZziMxTBic2xOEUhmelGlJZmBzSLTeFsPAfkcb RIYg== X-Gm-Message-State: APjAAAWUjVal23+97/1M0ellIk2mf8APDmmhxXUgRm/GPbyjFbMZ80LZ u+rQMTscpT+i7hFgCxLcok4UqpPPPQb+stdwET3lNDTyZfyyMAL/GC50hduYShfapgQZfS9Iyi8 /TGHjl0IZCfLdTGH1ggUOwdSGHY17KRcLv9nRGqEy5w== X-Received: by 2002:a05:600c:389:: with SMTP id w9mr4691110wmd.139.1560454078544; Thu, 13 Jun 2019 12:27:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnS+Y9nGp49apy7hX7sNdBojz1B3LCKClidNhTVJC9W1SbGd/1mxd+PUlkWFsdhQ0G1bFemw== X-Received: by 2002:a05:600c:389:: with SMTP id w9mr4691103wmd.139.1560454078402; Thu, 13 Jun 2019 12:27:58 -0700 (PDT) Received: from localhost ([2a02:c7d:31d6:7200:ecdd:10ea:9dc8:5da7]) by smtp.gmail.com with ESMTPSA id y38sm1082235wrd.41.2019.06.13.12.27.57 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jun 2019 12:27:58 -0700 (PDT) From: Ioanna Alifieraki To: kernel-team@lists.ubuntu.com Subject: [RFC][b/azure][PATCH 1/3] azure XDP generic fixes - option 2 Date: Thu, 13 Jun 2019 20:27:53 +0100 Message-Id: <20190613192755.31428-2-ioanna-maria.alifieraki@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190613192755.31428-1-ioanna-maria.alifieraki@canonical.com> References: <20190613192755.31428-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);