From patchwork Thu Oct 3 23:38:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 1992537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=3R1fMIQE; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XKSnC4TNCz1xsn for ; Fri, 4 Oct 2024 09:39:11 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1CA0760F74; Thu, 3 Oct 2024 23:39:09 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 09DOQU_UMG0y; Thu, 3 Oct 2024 23:39:08 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 7441960637 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1727998748; bh=WhYp0DiSsQbpO6IwfgRG0/juZs6Inw4x8enD4rVfZ6Y=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=3R1fMIQEk8ngd7xY1oS0tMG6lcobvuvepl1JX+yTnFiiqnQRNC9LHT41vOpHIVZ/M 4MwKPJfqIw3tcNJRP+Fq/1XzUtSY9YKuII2p6KYkX35AMqXBsI/8r3L8Uyk9CIMzeQ w1VMVNN/fPxqqDmEbadb0d6hfXSATW8Cj3lE68oYd4Qdw5EDa7ev2NZ794h/0q0TyD 67Orv/bpzmuQC/xdgsMcyYFeIx91Ytx5S+G/8JTIYhPdtcBvqOLRAf2A9afp9YGW+t nihCKZvPNn2zeFpvDb86wCSAScL647Jnt5jxqvCc46l725O/oicnT+B0aOKCgDYLZb TxPvfYRi//KKQ== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 7441960637; Thu, 3 Oct 2024 23:39:08 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 8DAEC1BF370 for ; Thu, 3 Oct 2024 23:39:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 7C5ED60F74 for ; Thu, 3 Oct 2024 23:39:06 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id vjnmmQNaVMnX for ; Thu, 3 Oct 2024 23:39:05 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::62e; helo=mail-pl1-x62e.google.com; envelope-from=jdamato@fastly.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org C09BD6070F DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org C09BD6070F Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by smtp3.osuosl.org (Postfix) with ESMTPS id C09BD6070F for ; Thu, 3 Oct 2024 23:39:05 +0000 (UTC) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-20b78ee6298so9589765ad.2 for ; Thu, 03 Oct 2024 16:39:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727998745; x=1728603545; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WhYp0DiSsQbpO6IwfgRG0/juZs6Inw4x8enD4rVfZ6Y=; b=u7mRUG+sHWxP5OQA4mL9Au3mFqPd1IyOnXGnQsv8h7HA3VLncmhz6/vrk7ZCpx7UAh bE2zfhZkZ3CWU5CT1T2VjcV/uG/g+Vk65EniWb8UHazx39hn0KES4uWeoLYADKVF46rk IyfRlLm36WGJ0TF6teCtq4DWxPfo0czJuBKfadtxXAH5qeDs109dZ6KqTI7cLKDTBwoR KRiT7qj6B4aKs3BoAn8+SUVE7yPGfC7ymWiUFBOVbh34vy2QZ38QPHTvc9HDrsSWV5xB 3ivOzYxjNwOb32GMxcR4D9jNj9v1tg9hjV6EBzx6XrUuV69hY3FTbfpIClbgY1PThT0S 5gzg== X-Forwarded-Encrypted: i=1; AJvYcCUnOjZHSizmyThsFG1LS5S3HavxM8toXUca8ffJ1HjP7kQ3keCfMQuYOl5uGtP0nElLPCxVkcrYIw93/BvZlqE=@lists.osuosl.org X-Gm-Message-State: AOJu0YxyyhNq6rWDbEpb1mgc1N5x101UKxDzpN0stt4fHWStkpjAqUN4 g4Hcrz0JmX4LRe4JiNLtR1Ix2pEB4lKaH535zdcU9Vg/TUZKLqOHHtwHt1EepGc= X-Google-Smtp-Source: AGHT+IGTpJ2+WaujujgDrlAgiMjkPmANHMw7/ysggq4USb76kJULVyruSiv/pbcSPf0FW7LJGb0RPw== X-Received: by 2002:a17:903:2a85:b0:206:ae39:9f4 with SMTP id d9443c01a7336-20bfdfc6ff8mr15955935ad.20.1727998745106; Thu, 03 Oct 2024 16:39:05 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20beef8ec6bsm13960705ad.158.2024.10.03.16.39.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 16:39:04 -0700 (PDT) From: Joe Damato To: netdev@vger.kernel.org Date: Thu, 3 Oct 2024 23:38:49 +0000 Message-Id: <20241003233850.199495-2-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241003233850.199495-1-jdamato@fastly.com> References: <20241003233850.199495-1-jdamato@fastly.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1727998745; x=1728603545; darn=lists.osuosl.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WhYp0DiSsQbpO6IwfgRG0/juZs6Inw4x8enD4rVfZ6Y=; b=Lq3tIWtV+G0eZ1y1DiDOsrcpsdtJfRcGk2JF5JsmbML0uy14DKHqgSnjMw1RfEgns7 aSxWTpkL0QOwFAHFw3SDWl9oURzKuiFwxd14q5jUM187UkFxvy4ZZEJT79CYnFq3HSxI Oytcpk2+c9qCNpIS/p7Ri3EtjnmBvEj1cHjUk= X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=reject dis=none) header.from=fastly.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=fastly.com header.i=@fastly.com header.a=rsa-sha256 header.s=google header.b=Lq3tIWtV Subject: [Intel-wired-lan] [RFC net-next 1/2] igc: Link IRQs to NAPI instances X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Przemek Kitszel , Joe Damato , open list , Eric Dumazet , Tony Nguyen , "moderated list:INTEL ETHERNET DRIVERS" , Jakub Kicinski , Paolo Abeni , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Link IRQs to NAPI instances via netdev-genl API so that users can query this information with netlink. Compare the output of /proc/interrupts (noting that IRQ 144 is the "other" IRQ which does not appear to have a NAPI instance): $ cat /proc/interrupts | grep enp86s0 | cut --delimiter=":" -f1 144 145 146 147 148 The output from netlink shows the mapping of NAPI IDs to IRQs (again noting that 144 is absent as it is the "other" IRQ): $ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \ --dump napi-get --json='{"ifindex": 2}' [{'id': 8196, 'ifindex': 2, 'irq': 148}, {'id': 8195, 'ifindex': 2, 'irq': 147}, {'id': 8194, 'ifindex': 2, 'irq': 146}, {'id': 8193, 'ifindex': 2, 'irq': 145}] Signed-off-by: Joe Damato --- drivers/net/ethernet/intel/igc/igc.h | 1 + drivers/net/ethernet/intel/igc/igc_main.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h index eac0f966e0e4..e757ba53f165 100644 --- a/drivers/net/ethernet/intel/igc/igc.h +++ b/drivers/net/ethernet/intel/igc/igc.h @@ -593,6 +593,7 @@ struct igc_q_vector { struct rcu_head rcu; /* to avoid race with update stats on free */ char name[IFNAMSIZ + 9]; + int irq; /* for dynamic allocation of rings associated with this q_vector */ struct igc_ring ring[] ____cacheline_internodealigned_in_smp; diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 6e70bca15db1..7964bbedb16c 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -5576,6 +5576,9 @@ static int igc_request_msix(struct igc_adapter *adapter) q_vector); if (err) goto err_free; + + netif_napi_set_irq(&q_vector->napi, + adapter->msix_entries[vector].vector); } igc_configure_msix(adapter); From patchwork Thu Oct 3 23:38:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 1992538 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=RiBMi4Bl; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XKSnF3QqBz1xsn for ; Fri, 4 Oct 2024 09:39:13 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 82B8B6070F; Thu, 3 Oct 2024 23:39:11 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 933BfVhP-s1B; Thu, 3 Oct 2024 23:39:10 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org BABEB60F71 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1727998750; bh=ZpDtgFKpiW6n7Ug+1YSP06l0kr3SHis2120480WaYUs=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=RiBMi4Bl8PmZ3IemERvNPWWLFjjm1ggcnNvcFRyjN6aeBb9zrA8CEanwS92LqhUwt YXBcwPd5gHqbQkPlm4Tni1aQqJ8SPT0NFTMOXTxh8Z34Em0vbtu3N83iWR7bakSv1k HT/pMU/oAkJvnSN5z1SQkv4zGXUxsIsTQWSHea+Gedq3DlzNE47bQv6p/SOgEoD/YD bBhF3YCHVTRK17sEEftzSl4BNzs8f+O3EHa9G6VMd/M5t7xSt5A9qluFi7UPf3EOlg i6a+Acs6pnkJQJIIyShTbPFJPTDl89QwDd/cMASQGty6IEBrKW8sdc99MrrI7G2kwZ NZkXrrKPCEHYQ== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id BABEB60F71; Thu, 3 Oct 2024 23:39:10 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 5A7821BF370 for ; Thu, 3 Oct 2024 23:39:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 48DD460637 for ; Thu, 3 Oct 2024 23:39:08 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id kPmWkGlu54dP for ; Thu, 3 Oct 2024 23:39:07 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::62c; helo=mail-pl1-x62c.google.com; envelope-from=jdamato@fastly.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 7962F6070F DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 7962F6070F Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by smtp3.osuosl.org (Postfix) with ESMTPS id 7962F6070F for ; Thu, 3 Oct 2024 23:39:07 +0000 (UTC) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-20ba9f3824fso12298745ad.0 for ; Thu, 03 Oct 2024 16:39:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727998746; x=1728603546; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZpDtgFKpiW6n7Ug+1YSP06l0kr3SHis2120480WaYUs=; b=uUXioRzUUBQMk1OyVBT0eG+pWBvbjbZ0xC1RRNsUZh18655b57xjaCz6GrpTvI/+rr IfQ1vqyv0byQ1VC+oF/NBawDil1vYmo76u3UvxqJjOzx8e9BZt67ioAmuUJhdy205SLj PmY3FAtxWh4UWRV4IA61r/m0eaFZkPHLPD2hOU4ZPiAFowr6dHmISuRYGuuMM2LZ+e5q 4kLrAjID1q2l1RJjLIC410p4Sgg0EtMn4SP+CCO5MS36PJsC0qCRihD+ML+MAunfSi3r Go0WMHfGkHQRCellrUtQrvinNrLvCJbPiJsHXyhfYTpr6eHFkXnu3nunGABfCjhfRpc7 bV6A== X-Forwarded-Encrypted: i=1; AJvYcCWZmS+tyExwwyUuVGnWAKMkpMIsrp1hl5FD17UmQoK1FAWHpMN5udhbyCNdYY9gmfmDQAu3ThOfQoK0E4UsVMw=@lists.osuosl.org X-Gm-Message-State: AOJu0YwdtRA6d72/sU+TX8LSqZBn7wn3f6CJY+NleFbjIPZyI23p4cLg VhVEOCISvJ8rS1RsuTZZOdpjtDu+yILMc1FRt7DC/Ak5r6xr+/3TnRVSCTJDCSo= X-Google-Smtp-Source: AGHT+IEscOgAVx/0YG9i/MINtF9xq0NivswWkuBxhiN50OJBwJky40grr6JNhThn+Z2xOj8C0ihYvQ== X-Received: by 2002:a17:902:e742:b0:20b:b7b2:b6f4 with SMTP id d9443c01a7336-20bfea5417fmr10500325ad.47.1727998746571; Thu, 03 Oct 2024 16:39:06 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20beef8ec6bsm13960705ad.158.2024.10.03.16.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 16:39:06 -0700 (PDT) From: Joe Damato To: netdev@vger.kernel.org Date: Thu, 3 Oct 2024 23:38:50 +0000 Message-Id: <20241003233850.199495-3-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241003233850.199495-1-jdamato@fastly.com> References: <20241003233850.199495-1-jdamato@fastly.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1727998746; x=1728603546; darn=lists.osuosl.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZpDtgFKpiW6n7Ug+1YSP06l0kr3SHis2120480WaYUs=; b=o9i/GXpA0FjeGN2+heI2ytXEDTYCSX2+uhRhCBFCLSuH1rddOn1fG5xaX3axiqP0dY Jlg6nOWsWxgrr16fp4K3Pk1g2e4IQ6CU7uG2YxEEkSxsddIDeziOYgHDp6Z+KuG4217K 5AzIAX0vmwEAgLWe6UWJOYRHegQrD4s3kmd6E= X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=reject dis=none) header.from=fastly.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.a=rsa-sha256 header.s=google header.b=o9i/GXpA Subject: [Intel-wired-lan] [RFC net-next 2/2] igc: Link queues to NAPI instances X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Przemek Kitszel , Joe Damato , open list , Eric Dumazet , Tony Nguyen , "moderated list:INTEL ETHERNET DRIVERS" , Jakub Kicinski , Paolo Abeni , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Link queues to NAPI instances via netdev-genl API so that users can query this information with netlink: $ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \ --dump queue-get --json='{"ifindex": 2}' [{'id': 0, 'ifindex': 2, 'napi-id': 8193, 'type': 'rx'}, {'id': 1, 'ifindex': 2, 'napi-id': 8194, 'type': 'rx'}, {'id': 2, 'ifindex': 2, 'napi-id': 8195, 'type': 'rx'}, {'id': 3, 'ifindex': 2, 'napi-id': 8196, 'type': 'rx'}, {'id': 0, 'ifindex': 2, 'napi-id': 8193, 'type': 'tx'}, {'id': 1, 'ifindex': 2, 'napi-id': 8194, 'type': 'tx'}, {'id': 2, 'ifindex': 2, 'napi-id': 8195, 'type': 'tx'}, {'id': 3, 'ifindex': 2, 'napi-id': 8196, 'type': 'tx'}] Since igc uses only combined queues, you'll note that the same NAPI ID is present for both rx and tx queues at the same index, for example index 0: {'id': 0, 'ifindex': 2, 'napi-id': 8193, 'type': 'rx'}, {'id': 0, 'ifindex': 2, 'napi-id': 8193, 'type': 'tx'}, Signed-off-by: Joe Damato --- drivers/net/ethernet/intel/igc/igc_main.c | 30 ++++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 7964bbedb16c..b3bd5bf29fa7 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -4955,6 +4955,7 @@ static int igc_sw_init(struct igc_adapter *adapter) void igc_up(struct igc_adapter *adapter) { struct igc_hw *hw = &adapter->hw; + struct napi_struct *napi; int i = 0; /* hardware has been reset, we need to reload some things */ @@ -4962,8 +4963,17 @@ void igc_up(struct igc_adapter *adapter) clear_bit(__IGC_DOWN, &adapter->state); - for (i = 0; i < adapter->num_q_vectors; i++) - napi_enable(&adapter->q_vector[i]->napi); + for (i = 0; i < adapter->num_q_vectors; i++) { + napi = &adapter->q_vector[i]->napi; + napi_enable(napi); + /* igc only supports combined queues, so link each NAPI to both + * TX and RX + */ + netif_queue_set_napi(adapter->netdev, i, NETDEV_QUEUE_TYPE_RX, + napi); + netif_queue_set_napi(adapter->netdev, i, NETDEV_QUEUE_TYPE_TX, + napi); + } if (adapter->msix_entries) igc_configure_msix(adapter); @@ -5192,6 +5202,10 @@ void igc_down(struct igc_adapter *adapter) for (i = 0; i < adapter->num_q_vectors; i++) { if (adapter->q_vector[i]) { napi_synchronize(&adapter->q_vector[i]->napi); + netif_queue_set_napi(netdev, i, NETDEV_QUEUE_TYPE_RX, + NULL); + netif_queue_set_napi(netdev, i, NETDEV_QUEUE_TYPE_TX, + NULL); napi_disable(&adapter->q_vector[i]->napi); } } @@ -6021,6 +6035,7 @@ static int __igc_open(struct net_device *netdev, bool resuming) struct igc_adapter *adapter = netdev_priv(netdev); struct pci_dev *pdev = adapter->pdev; struct igc_hw *hw = &adapter->hw; + struct napi_struct *napi; int err = 0; int i = 0; @@ -6056,8 +6071,15 @@ static int __igc_open(struct net_device *netdev, bool resuming) clear_bit(__IGC_DOWN, &adapter->state); - for (i = 0; i < adapter->num_q_vectors; i++) - napi_enable(&adapter->q_vector[i]->napi); + for (i = 0; i < adapter->num_q_vectors; i++) { + napi = &adapter->q_vector[i]->napi; + napi_enable(napi); + /* igc only supports combined queues, so link each NAPI to both + * TX and RX + */ + netif_queue_set_napi(netdev, i, NETDEV_QUEUE_TYPE_RX, napi); + netif_queue_set_napi(netdev, i, NETDEV_QUEUE_TYPE_TX, napi); + } /* Clear any pending interrupts. */ rd32(IGC_ICR);