From patchwork Mon Feb 22 07:06:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Coiby Xu X-Patchwork-Id: 12097993 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15384C433E9 for ; Mon, 22 Feb 2021 07:09:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB6E364EB4 for ; Mon, 22 Feb 2021 07:09:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229949AbhBVHJE (ORCPT ); Mon, 22 Feb 2021 02:09:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60859 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbhBVHJB (ORCPT ); Mon, 22 Feb 2021 02:09:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613977655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VDuXO5zUJ4skk3u4UbGFqeIktbCo8MisQ81CqMl1/44=; b=IC5KDmwRTYwIa9m5ZOcBQ0EewowhH5bONJHM+XClrcYyn066EXvudYS+VhmoLs9Xw2XqJ9 cYPC7cZ1/TpuO6ROhxoDWIr7NgML2PDChhw6yoC/PHAoE3NPo5yjAo2h8DffTQu8GCOFW3 WixHl0PCa0YpWQHX0IzCxBvKSQxnMbk= Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-459-tlvv7RGANIi__YvwpBIpsw-1; Mon, 22 Feb 2021 02:07:32 -0500 X-MC-Unique: tlvv7RGANIi__YvwpBIpsw-1 Received: by mail-pl1-f200.google.com with SMTP id k13so2578295plc.3 for ; Sun, 21 Feb 2021 23:07:31 -0800 (PST) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=VDuXO5zUJ4skk3u4UbGFqeIktbCo8MisQ81CqMl1/44=; b=ssME3f0sdVuwCjfIj3/HDWkstDRuygqkrZZ6TnEr+pHDZ4WysCr8ewTLpShMPD2CKo jnhYAbJKN+Wi2FE83jxgWwTL8Rbvy5TQdSW821P03UXkDeni1TwiwSxwK+CfUwOaCZMB pftPPOCg/V9k0nCJ+r5II3KE9KL8biOwOxG1udwr4IQg1pNI9HdrzsbY3KjTz0ohHdJ5 UbfZyEf1kM/uGzzOrars6bBwmoqjZCSWVQo5fldFN9FRSn3qcmOnmf1+0b08/gpgiFqG BAxaPCkmLptaqr88isQBMzO2AXSd8qYzp8hJu+9S7cB2nVkIyyyt8aWW4JQ8ziqC7Z5a eOjg== X-Gm-Message-State: AOAM531osrEWedAvc/J419QoWTxW05OxQinC4p2tcz/fSbBOzmkwZJX+ gfNKEA79mQa2GhR+ejoYV7TqZ8iAynkllKh8g8Ua3IZTNVDNSQOFn0E72A3KcIUH2KdA13YJm4y 00TZtgTxnhFqvdCSbIQvI2HnjqDzgufuz4wWW/ZqTV9MjQRuDflKRYhe0cucfhG4= X-Received: by 2002:a17:90a:cd06:: with SMTP id d6mr4867761pju.138.1613977650595; Sun, 21 Feb 2021 23:07:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJz79OrKbRrtAfiD6Esm6oEGGKH8K+mEKBsf+u12b+o9o8Q4Qyg003s3d36qBlqAERFQrUMlJA== X-Received: by 2002:a17:90a:cd06:: with SMTP id d6mr4867739pju.138.1613977650377; Sun, 21 Feb 2021 23:07:30 -0800 (PST) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id g65sm16855068pfb.20.2021.02.21.23.07.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Feb 2021 23:07:29 -0800 (PST) From: Coiby Xu To: netdev@vger.kernel.org Cc: kexec@lists.infradead.org, intel-wired-lan@lists.osuosl.org, Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org (open list) Subject: [RFC PATCH 1/4] i40e: use minimal tx and rx pairs for kdump Date: Mon, 22 Feb 2021 15:06:58 +0800 Message-Id: <20210222070701.16416-2-coxu@redhat.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210222070701.16416-1-coxu@redhat.com> References: <20210222070701.16416-1-coxu@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Set the number of the MSI-X vectors to 1. When MSI-X is enabled, it's not allowed to use more TC queue pairs than MSI-X vectors (pf->num_lan_msix) exist. Thus the number of tx and rx pairs (vsi->num_queue_pairs) will be equal to the number of MSI-X vectors, i.e., 1. Signed-off-by: Coiby Xu --- drivers/net/ethernet/intel/i40e/i40e_main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 1db482d310c2..069c86e2f69d 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -6,6 +6,7 @@ #include #include #include +#include /* Local includes */ #include "i40e.h" @@ -15000,6 +15001,14 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (err) goto err_switch_setup; + /* Reduce tx and rx pairs for kdump + * When MSI-X is enabled, it's not allowed to use more TC queue + * pairs than MSI-X vectors (pf->num_lan_msix) exist. Thus + * vsi->num_queue_pairs will be equal to pf->num_lan_msix, i.e., 1. + */ + if (is_kdump_kernel()) + pf->num_lan_msix = 1; + pf->udp_tunnel_nic.set_port = i40e_udp_tunnel_set_port; pf->udp_tunnel_nic.unset_port = i40e_udp_tunnel_unset_port; pf->udp_tunnel_nic.flags = UDP_TUNNEL_NIC_INFO_MAY_SLEEP; From patchwork Mon Feb 22 07:06:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Coiby Xu X-Patchwork-Id: 12097995 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28CDBC433E0 for ; Mon, 22 Feb 2021 07:09:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E661F64E04 for ; Mon, 22 Feb 2021 07:09:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230021AbhBVHJO (ORCPT ); Mon, 22 Feb 2021 02:09:14 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47747 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229996AbhBVHJJ (ORCPT ); Mon, 22 Feb 2021 02:09:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613977663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gAp2I2H4ORRdIzGQOTnp0OVejY1BSXenzSWMruiT71M=; b=dzq04eqZXhlutVjLsfdvIhDYCLYMIskdl2vpfC5eyu/B4W6JhfVIIhviRh+RYomYa7Gz9W F/6Eqqz3FMZ44b4ubEo7c23MZd0guG5Lqk0CxFz26930mCdHafkRGYwbMWTiubZXrtTsFU dGyvQxa4kYu6vF1JJ3InhyRo1H5iAt8= Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-215-8rvN1tgdOOWxcS6-h_Fs9g-1; Mon, 22 Feb 2021 02:07:41 -0500 X-MC-Unique: 8rvN1tgdOOWxcS6-h_Fs9g-1 Received: by mail-pl1-f200.google.com with SMTP id d21so4251719pld.5 for ; Sun, 21 Feb 2021 23:07:41 -0800 (PST) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=gAp2I2H4ORRdIzGQOTnp0OVejY1BSXenzSWMruiT71M=; b=LuacLkqbffEdM/rxufR/uY65KycZTrmw1VohS/sG0AZ9pWgH7bZK6cfb/OH5QDXQzA +qasP9/YwV7vISJPV8606IHc0G2+27Gm/E7PYZNpw9BEi9G4iQj81dEPLuG1DzYWdxvx xjjQhNKf1wH7KY+vE7Aj4TQI1Gb5y/2slA7oJHYdg05Vqmts4gdhFSCv6wvGJ172MO2B o3sgAC2DC2uHOvpXeSzQzeDS6uKhQJULsRl82xESg7+PDY7aJoGB5dL5DoHee7hKNxYV x1/BROpi/j3hVlHaSQPjoA+uHkhstoN1q+kr3Lpt+AZtuQVavumfScSbecmLbZAj51FX FgVw== X-Gm-Message-State: AOAM533wrKgPo79zkryA5nTGEJNUU7UYTsfZN+R/LYX1y/ScXvmeuxrB WcnMifw93lzzWPNvqUwMXrQhTkc7jt/yCwSEb4Dclr8NN7ELO3lEIji3rC7PHTUB8zuQuhboaqg oxDmAHehSWpyzWiqyPfGKx/c696Rv7M70dPqMeoobqokyep5yUO3F4Jb6DL7wBbg= X-Received: by 2002:a17:90a:194b:: with SMTP id 11mr21935627pjh.100.1613977660163; Sun, 21 Feb 2021 23:07:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1p7DWcYJD3VbncV/CfHu7aM+wNHjZQUVuys68WjauioDf0PpZYeqnLQl9yRTiF9YT6Xnl0w== X-Received: by 2002:a17:90a:194b:: with SMTP id 11mr21935603pjh.100.1613977659906; Sun, 21 Feb 2021 23:07:39 -0800 (PST) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id h186sm13422121pgc.38.2021.02.21.23.07.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Feb 2021 23:07:39 -0800 (PST) From: Coiby Xu To: netdev@vger.kernel.org Cc: kexec@lists.infradead.org, intel-wired-lan@lists.osuosl.org, Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org (open list) Subject: [RFC PATCH 2/4] i40e: use minimal rx and tx ring buffers for kdump Date: Mon, 22 Feb 2021 15:06:59 +0800 Message-Id: <20210222070701.16416-3-coxu@redhat.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210222070701.16416-1-coxu@redhat.com> References: <20210222070701.16416-1-coxu@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Use the minimum of the number of descriptors thus we will allocate the minimal ring buffers for kdump. Signed-off-by: Coiby Xu --- drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 069c86e2f69d..5307f1744766 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -10552,6 +10552,11 @@ static int i40e_set_num_rings_in_vsi(struct i40e_vsi *vsi) return -ENODATA; } + if (is_kdump_kernel()) { + vsi->num_tx_desc = I40E_MIN_NUM_DESCRIPTORS; + vsi->num_rx_desc = I40E_MIN_NUM_DESCRIPTORS; + } + return 0; } From patchwork Mon Feb 22 07:07:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Coiby Xu X-Patchwork-Id: 12097997 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B064C433E0 for ; Mon, 22 Feb 2021 07:09:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C7EA564EC3 for ; Mon, 22 Feb 2021 07:09:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230099AbhBVHJ1 (ORCPT ); Mon, 22 Feb 2021 02:09:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35943 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230057AbhBVHJS (ORCPT ); Mon, 22 Feb 2021 02:09:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613977671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SfjcSkeuCzE9/+CoYCFIFTm1Ke7Qr71yxOHQpPA/W1c=; b=MmLC1XCeQFJyCYx5S/0CMYJYnn4w4Jr2EWn7ig1tSiIb5fHd3oPpLVd10SNyjzdmDMQpDG N4tIGitGpQB7axz75TnckNYqxhLhJlMblcJcq8ptll8gh6Pb6AYSnqWiT8Bg/obCiQJIJF 6IkdzC+Qq0h8PEN23LFWCvMb9CKBP34= Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-401-UO7QqnbFPxqlaoLTKZXXdQ-1; Mon, 22 Feb 2021 02:07:49 -0500 X-MC-Unique: UO7QqnbFPxqlaoLTKZXXdQ-1 Received: by mail-pf1-f198.google.com with SMTP id o2so6646888pfd.1 for ; Sun, 21 Feb 2021 23:07:49 -0800 (PST) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=SfjcSkeuCzE9/+CoYCFIFTm1Ke7Qr71yxOHQpPA/W1c=; b=LhV+Xr9Akz8QK6iyF+1tZy6eP6bG3l9O4XFoEtmDXKOWzxmrMNjzbXIhUVavYZTLpy 9d5cP75c/0g2LnCU4d7D6s4GRNFEQih7F35fpaZJBCWax4JoXGcAQxcSAdnxVoW+lEaw aiyNDa8QyUAkYoSHJMncUk/Fe0/9FcTmk8PpSpZQqG/w6l2bI1iE0LFKO7KMDlK7HwnX 5AArNUQn5+cgWjYnS4qPlST8i5EaRoIv8ka3ITYk0nd4uSJFeHtyIc2jfKuX/C8wZfeQ UyVnyBsUIcmLVYEyuts4a+utoHjIBXPvLFrgy9BX7ppv80fpPI0zAqeK2VWILQZf5oel e88w== X-Gm-Message-State: AOAM531twuJ0cXiFS86R5zqQ6utvZSKpUTwIYjhFe9OXcAFyPWsj4wpp 5oWb4xEIiCHD9sYUllKpU23Osyf9a94bw/RADuJbAJqDwzYQOgDP/nvsm9xU45WBEsx7ZZiuxaJ dWnyBFV2lj4eVLco07qD6LXUyjQ5xAGxn3LM7s6wRNHe3SPlgrtnulUuNgIoqbJU= X-Received: by 2002:a63:90c9:: with SMTP id a192mr19124722pge.8.1613977668304; Sun, 21 Feb 2021 23:07:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwP+/I77AvpPaCYZWkNUEmz3EntQVTfgkKGYRyDaFQPkLb+Affv8SxoduV3LDfkj7rLRdqY7Q== X-Received: by 2002:a63:90c9:: with SMTP id a192mr19124701pge.8.1613977668054; Sun, 21 Feb 2021 23:07:48 -0800 (PST) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id a24sm18029132pff.18.2021.02.21.23.07.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Feb 2021 23:07:47 -0800 (PST) From: Coiby Xu To: netdev@vger.kernel.org Cc: kexec@lists.infradead.org, intel-wired-lan@lists.osuosl.org, Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org (open list) Subject: [RFC PATCH 3/4] i40e: use minimal admin queue for kdump Date: Mon, 22 Feb 2021 15:07:00 +0800 Message-Id: <20210222070701.16416-4-coxu@redhat.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210222070701.16416-1-coxu@redhat.com> References: <20210222070701.16416-1-coxu@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC The minimum size of admin send/receive queue is 1 and 2 respectively. The admin send queue can't be set to 1 because in that case, the firmware would fail to init. Signed-off-by: Coiby Xu --- drivers/net/ethernet/intel/i40e/i40e.h | 2 ++ drivers/net/ethernet/intel/i40e/i40e_main.c | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index 118473dfdcbd..e106c33ff958 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h @@ -66,6 +66,8 @@ #define I40E_FDIR_RING_COUNT 32 #define I40E_MAX_AQ_BUF_SIZE 4096 #define I40E_AQ_LEN 256 +#define I40E_MIN_ARQ_LEN 1 +#define I40E_MIN_ASQ_LEN 2 #define I40E_AQ_WORK_LIMIT 66 /* max number of VFs + a little */ #define I40E_MAX_USER_PRIORITY 8 #define I40E_DEFAULT_TRAFFIC_CLASS BIT(0) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 5307f1744766..2fd8db80b585 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -14847,8 +14847,13 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) i40e_check_recovery_mode(pf); - hw->aq.num_arq_entries = I40E_AQ_LEN; - hw->aq.num_asq_entries = I40E_AQ_LEN; + if (is_kdump_kernel()) { + hw->aq.num_arq_entries = I40E_MIN_ARQ_LEN; + hw->aq.num_asq_entries = I40E_MIN_ASQ_LEN; + } else { + hw->aq.num_arq_entries = I40E_AQ_LEN; + hw->aq.num_asq_entries = I40E_AQ_LEN; + } hw->aq.arq_buf_size = I40E_MAX_AQ_BUF_SIZE; hw->aq.asq_buf_size = I40E_MAX_AQ_BUF_SIZE; pf->adminq_work_limit = I40E_AQ_WORK_LIMIT; From patchwork Mon Feb 22 07:07:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Coiby Xu X-Patchwork-Id: 12097999 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E558C433E9 for ; Mon, 22 Feb 2021 07:09:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D19864EF2 for ; Mon, 22 Feb 2021 07:09:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230114AbhBVHJd (ORCPT ); Mon, 22 Feb 2021 02:09:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58641 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230087AbhBVHJ1 (ORCPT ); Mon, 22 Feb 2021 02:09:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613977681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8cGC74PMCnaWbBAWCVUBDXRxKgEXEKkWJtgVHkIGS/0=; b=Hu8BhsvQqaMrksO9Xgnac+qPEsN4nEaIiKgIEN3UEUwTTJjoiNkBJ+3MLc0L5dNAz0nJT1 ImFyLOPO2o67FRnu8RuZ0CeNp4J8/WT/mpdi0rO90h96P98Bk5/v0gET+ImT/uijVPKtaa YL1vjxsupzWImN2GAvQ/PXVHRhHZsKY= Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-585-qn0aWhBVP_KzOCfSzopfAw-1; Mon, 22 Feb 2021 02:07:59 -0500 X-MC-Unique: qn0aWhBVP_KzOCfSzopfAw-1 Received: by mail-pf1-f199.google.com with SMTP id 137so6656290pfw.4 for ; Sun, 21 Feb 2021 23:07:59 -0800 (PST) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=8cGC74PMCnaWbBAWCVUBDXRxKgEXEKkWJtgVHkIGS/0=; b=aVLKUcNN10+QHhe5qPpezXFC+DMsTq0KmpHrbCD279D2YK39Ci6M1Bji5JEGIIKi4y IOs2ov6ct6fQtbEpma6mtSwxvFvrabW8p36/1YnB+bHSPQ4LWACA+1sl2rFw8KKhtO43 VJW5QVuQKfPsPs9EeG15LZJNRiZdZl254tTAarHWPKi4Ll/Z5mjAGPa3yzC8e2PXqEEB +kwHoBMyQ6TysgCUYnI0rIVxuxo2MNX3bnm1b+U6fAhbGT6i1lZCR813oLOunqSHnDjS BP3Fb6TtLze+LjQRhEEYc2JUks0WepEHoZaNOUa12xe6Md/pPwuMzZNOEjUtZ9+U953e ce5A== X-Gm-Message-State: AOAM531qUCKccrEb0r2Fp102tCXZqRWHSqtWF/n8BvJcYQMwm0mViG6p Xp6mn7m9JkETvsmk+ZmlHgujzMFh/W/8hLx78CsHdem2U/nbD1U94j9QiMBPFPjmYVjnujwwfLD a5D0HkPv2DwGhXfEi/aCTh7pzxbbPMsvKq1NSzTStAWgZCF2viG/+iBFMjsixpLY= X-Received: by 2002:a63:3602:: with SMTP id d2mr18862407pga.81.1613977677979; Sun, 21 Feb 2021 23:07:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzG0zRT+B2eqBSHJCG+woLse614WOgfmD0XJ5e3O9heRqpM5jj6GbtUXuwOa2JP1tEgm2+OsA== X-Received: by 2002:a63:3602:: with SMTP id d2mr18862385pga.81.1613977677597; Sun, 21 Feb 2021 23:07:57 -0800 (PST) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id ig12sm8527195pjb.36.2021.02.21.23.07.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Feb 2021 23:07:57 -0800 (PST) From: Coiby Xu To: netdev@vger.kernel.org Cc: kexec@lists.infradead.org, intel-wired-lan@lists.osuosl.org, Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org (open list) Subject: [RFC PATCH 4/4] i40e: don't open i40iw client for kdump Date: Mon, 22 Feb 2021 15:07:01 +0800 Message-Id: <20210222070701.16416-5-coxu@redhat.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210222070701.16416-1-coxu@redhat.com> References: <20210222070701.16416-1-coxu@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC i40iw consumes huge amounts of memory. For example, on a x86_64 machine, i40iw consumed 1.5GB for Intel Corporation Ethernet Connection X722 for for 1GbE while "craskernel=auto" only reserved 160M. With the module parameter "resource_profile=2", we can reduce the memory usage of i40iw to ~300M which is still too much for kdump. Disabling the client registration would spare us the client interface operation open , i.e., i40iw_open for iwarp/uda device. Thus memory is saved for kdump. Signed-off-by: Coiby Xu --- drivers/net/ethernet/intel/i40e/i40e_client.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c index a2dba32383f6..aafc2587f389 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_client.c +++ b/drivers/net/ethernet/intel/i40e/i40e_client.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "i40e.h" #include "i40e_prototype.h" @@ -741,6 +742,12 @@ int i40e_register_client(struct i40e_client *client) { int ret = 0; + /* Don't open i40iw client for kdump because i40iw will consume huge + * amounts of memory. + */ + if (is_kdump_kernel()) + return ret; + if (!client) { ret = -EIO; goto out;