From patchwork Thu Jun 13 19:26:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioanna Alifieraki X-Patchwork-Id: 1115574 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 45Ptyt3q6Tz9sNT; 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 1hbVMu-0002LO-Tk; Thu, 13 Jun 2019 19:26:40 +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 1hbVMr-0002Jw-DS for kernel-team@lists.ubuntu.com; Thu, 13 Jun 2019 19:26:37 +0000 Received: from mail-wr1-f71.google.com ([209.85.221.71]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hbVMr-00055Y-35 for kernel-team@lists.ubuntu.com; Thu, 13 Jun 2019 19:26:37 +0000 Received: by mail-wr1-f71.google.com with SMTP id q14so15645wrm.23 for ; Thu, 13 Jun 2019 12:26:37 -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=umtSwf3uFTGXi5etJordmDHjCdZP/A9FnG3LvnEXlNA=; b=kGfPVAJfQiRhvAa1BS5wiCIU+blAKoPiQUEW0PiW6L0tS1T+dBwWGl6NH4F5mvVQ7m BJ+iJXHKDPeCxtfmJfSiTV2TkwP8OOUk0iyfBLMlEpZMAoRfMbnY0KTcJN6v3JZbgJ7Y ZgdlXA9Vje1LYyVntYMOx6X+UXGeXUJlf8HDEhNES4fE8Hl2V2b5zVB0Cpu0aXc4KDWA 3CSQ9vL0Cu4TO5ATC5rp5CnpI73UO0i5eWHybRd70lVO4Ba6xhQywF0djYGMVoBWfTkA OG0hJkat5WAFZLTV6D8LG7ARqmyzF0t5E8KugLBtOMAXQWpLGzVTU95MggHuRkdXtEmg 2tZQ== X-Gm-Message-State: APjAAAXGR6qntt1owtiVKvF+NcYQ7wDu7KShUGLBy5not6ca7HeOjkhs YEbNWwgjzNYMy/8O3EKTsO53HXk5YeO7B8bbOyaFWYfxBxT2eLzo9BqzOz2Ks7f9Ht6vL+TLU8j rELUhha8TwevDVWILcICUHmjJwYqT2oMtnJaAPItewQ== X-Received: by 2002:a1c:b046:: with SMTP id z67mr4634865wme.49.1560453996666; Thu, 13 Jun 2019 12:26:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/ia2FHue8GJmgEMUFBTo3Vvs8rU05BSFw9RZWSKirNO1jJi7tMbrjjCyzzQxPTCP3Qm3CBw== X-Received: by 2002:a1c:b046:: with SMTP id z67mr4634856wme.49.1560453996351; Thu, 13 Jun 2019 12:26:36 -0700 (PDT) Received: from localhost ([2a02:c7d:31d6:7200:ecdd:10ea:9dc8:5da7]) by smtp.gmail.com with ESMTPSA id f26sm651197wmh.8.2019.06.13.12.26.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jun 2019 12:26:36 -0700 (PDT) From: Ioanna Alifieraki To: kernel-team@lists.ubuntu.com Subject: [RFC][b/azure][PATCH 3/8] azure XDP generic fixes - option 1 Date: Thu, 13 Jun 2019 20:26:25 +0100 Message-Id: <20190613192630.31244-4-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: Edward Cree BugLink: https://bugs.launchpad.net/bugs/1831254 Just calls netif_receive_skb() in a loop. Signed-off-by: Edward Cree Signed-off-by: David S. Miller (cherry picked from commit f6ad8c1bcdf014272d08c55b9469536952a0a771) Signed-off-by: Ioanna Alifieraki --- include/linux/netdevice.h | 1 + net/core/dev.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3045a5cee0d8..ae8797f54850 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3391,6 +3391,7 @@ int netif_rx(struct sk_buff *skb); int netif_rx_ni(struct sk_buff *skb); int netif_receive_skb(struct sk_buff *skb); int netif_receive_skb_core(struct sk_buff *skb); +void netif_receive_skb_list(struct list_head *head); gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb); void napi_gro_flush(struct napi_struct *napi, bool flush_old); struct sk_buff *napi_get_frags(struct napi_struct *napi); diff --git a/net/core/dev.c b/net/core/dev.c index bf669e77f9f3..4977c86b79ad 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4814,6 +4814,25 @@ int netif_receive_skb(struct sk_buff *skb) } EXPORT_SYMBOL(netif_receive_skb); +/** + * netif_receive_skb_list - process many receive buffers from network + * @head: list of skbs to process. + * + * For now, just calls netif_receive_skb() in a loop, ignoring the + * return value. + * + * This function may only be called from softirq context and interrupts + * should be enabled. + */ +void netif_receive_skb_list(struct list_head *head) +{ + struct sk_buff *skb, *next; + + list_for_each_entry_safe(skb, next, head, list) + netif_receive_skb(skb); +} +EXPORT_SYMBOL(netif_receive_skb_list); + DEFINE_PER_CPU(struct work_struct, flush_works); /* Network device is going away, flush any packets still pending */