From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 827491CB304 for ; Tue, 22 Oct 2024 21:53:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729633982; cv=none; b=nNUiVA3goXR5HqohlhAF/dL92kE+teNiIM+6YwvUfFOjaW9rjot5DSwahh5QkV+F37iqK0syuxOESbYff4lQRW7WVBPWZLzXZhhxJW4cNgKADyjaUhJWUxR9w97dHUUaWVAH3b6r06uGfBf/uptFY3LGVL1lwPVPeUiCHKVA10c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729633982; c=relaxed/simple; bh=mZHyRJsvYbJrA/bK0xUf3xOnp/PwB9vGkP9J9h6qzUI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=FcroiociwpSt1yLL2pqOcoWfSrCCcos24NjrxDXiYcMFWxeFXy48EEFdrBqKSg9MZZY3dFe9boWRMPl5MsCDlOMz2cQSGyySNJbqO1Jg90FH1oRCjH748s967tgTcuQIqC7zwH9EBtjCUtZi6R/oOMFesrb2Ip6d0+zEHwbSkEQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com; spf=pass smtp.mailfrom=fastly.com; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b=gIAHV0kJ; arc=none smtp.client-ip=209.85.215.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastly.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="gIAHV0kJ" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-7eb00dc77f1so979020a12.1 for ; Tue, 22 Oct 2024 14:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1729633979; x=1730238779; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=27PH9KJY9xP4iasns3riOle1zadFd8sn/XZWx1MVstg=; b=gIAHV0kJx5I5RQv4FTOvL4HR3JG8MfVirQgpY8+/WGg1tV7uMFXdNIPJ46d/PNKya5 OVP1N5ZO14/xlZyg+IrN//+XvPjPnKoeN334Vwhgi3k5BhJWPlEJgo4gNmBM4IGIPrzg HV1YGpyFqnV9omvUJYQa681WS/QsxNDRl04RQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729633979; x=1730238779; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=27PH9KJY9xP4iasns3riOle1zadFd8sn/XZWx1MVstg=; b=sOxD51AyK8AWrSgUFQPWxknW/Xpe563B6gaRJDh24O8dYi7W4Iw3+VEoy30h8ijHQJ c4lZAsSUv47YCgqmO3ywi9ueRyZbbInCQrQWdHo0/i7K8+q+9VwwxtYaVUdzAaQ3pZ6h Vh9reOR6cie9XJv8k4/8adHhS+6ojhuNhTvWNkU1rLLbaEqJOVeAWVP4FURtEzbRNHOc xrPsj0AqVU7/Kpg1dHs3tiYopZXd3Xj2BMfyYfiGnPRvxSXqXJ+VWcWsRNxva/Jf0AVI x7a+uejRlupiUa7J4oz5BtqhC8mV/WbpuBAw3Ru2eAinGfj5EBndFCTlbqW28qph4cCK nEFQ== X-Gm-Message-State: AOJu0YwGieY6WOeypUArG/NDOKKf9kT9/lz5Mrn8y958B5W3nsCiTMPV w74etRQsRw/Kw249RCclIJcmIB3BAHzU/XUJt5LxEmfUaFD3egTik6mnWAP4Yf3A/AyLAklN50+ uUaCEL7NhXFOWu4BRagbwCHWvl2O/cJ5+umb9xP4bckgh7EqkY/5D0Rp7ns0gWDUydLNW+9m7LQ S4c71kNJTDN6VTaFPWCV5hUszVa5pICqDOHog= X-Google-Smtp-Source: AGHT+IF+g37BAJ/gs+9A6578kVnZDjD+Y9MC0VzOxCi8OhwVz1VkHyQIRvT2Mam28b3hFk4yJnnKLw== X-Received: by 2002:a05:6a21:4581:b0:1d8:fdf8:973c with SMTP id adf61e73a8af0-1d978b3dd71mr507279637.29.1729633979041; Tue, 22 Oct 2024 14:52:59 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71ec13d75b9sm5194375b3a.131.2024.10.22.14.52.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 14:52:58 -0700 (PDT) From: Joe Damato To: netdev@vger.kernel.org Cc: jacob.e.keller@intel.com, kurt@linutronix.de, vinicius.gomes@intel.com, Joe Damato , Alexei Starovoitov , Andrew Lunn , bpf@vger.kernel.org (open list:XDP (eXpress Data Path)), Daniel Borkmann , "David S. Miller" , Eric Dumazet , intel-wired-lan@lists.osuosl.org (moderated list:INTEL ETHERNET DRIVERS), Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , linux-kernel@vger.kernel.org (open list), Paolo Abeni , Przemek Kitszel , Tony Nguyen Subject: [iwl-next v4 0/2] igc: Link IRQs and queues to NAPIs Date: Tue, 22 Oct 2024 21:52:43 +0000 Message-Id: <20241022215246.307821-1-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Greetings: Welcome to v4. See changelog below and in each patch for changes from v3 [1]. This revision was inspired by a bug report for e1000 [2] and analysis of the call paths for igc on the mailing list [3] to ensure that RTNL is held in all appropriate paths. This series adds support for netdev-genl to igc so that userland apps can query IRQ, queue, and NAPI instance relationships. This is useful because developers who have igc NICs (for example, in their Intel NUCs) who are working on epoll-based busy polling apps and using SO_INCOMING_NAPI_ID, need access to this API to map NAPI IDs back to queues. See the commit messages of each patch for example output I got on my igc hardware. I've taken the feedback from both Kurt Kanzenbach and Vinicius Costa Gomes to simplify the code from the rfc v2. Thanks to reviewers and maintainers for their comments/feedback! Thanks, Joe [1]: https://lore.kernel.org/netdev/20241018171343.314835-1-jdamato@fastly.com/ [2]: https://lore.kernel.org/netdev/8cf62307-1965-46a0-a411-ff0080090ff9@yandex.ru/ [3]: https://lore.kernel.org/netdev/ZxgK5jsCn5VmKKrH@LQ3V64L9R2/ v4: - Fixed a typo in Patch 1's commit message for the "other" IRQ number - Based on a bug report for e1000, closer scrutiny of the code revealed two paths where rtnl_lock / rtnl_unlock should be added in Patch 2: igc_resume and igc_io_error_detected. The code added to igc_io_error_detected is inspired by ixgbe's ixgbe_io_error_detected v3: https://lore.kernel.org/netdev/20241018171343.314835-1-jdamato@fastly.com/ - No longer an RFC - Patch 1: no changes - Patch 2: - Replace igc_unset_queue_napi with igc_set_queue_napi(..., NULL), as suggested by Vinicius Costa Gomes - Simplify implementation of igc_set_queue_napi as suggested by Kurt Kanzenbach, with a minor change to use the ring->queue_index rfcv2: https://lore.kernel.org/netdev/20241014213012.187976-1-jdamato@fastly.com/ - Patch 1: update line wrapping to 80 chars - Patch 2: - Update commit message to include output for IGC_FLAG_QUEUE_PAIRS enabled and disabled - Significant refactor to move queue mapping code to helpers to be called from multiple locations - Adjusted code to handle IGC_FLAG_QUEUE_PAIRS disabled as suggested by Kurt Kanzenbach - Map / unmap queues in igc_xdp_disable_pool and igc_xdp_enable_pool, respectively, as suggested by Vinicius Costa Gomes to handle the XDP case rfcv1: https://lore.kernel.org/lkml/20241003233850.199495-1-jdamato@fastly.com/ Joe Damato (2): igc: Link IRQs to NAPI instances igc: Link queues to NAPI instances drivers/net/ethernet/intel/igc/igc.h | 2 ++ drivers/net/ethernet/intel/igc/igc_main.c | 44 ++++++++++++++++++++--- drivers/net/ethernet/intel/igc/igc_xdp.c | 2 ++ 3 files changed, 43 insertions(+), 5 deletions(-) base-commit: d811ac148f0afd2f3f7e1cd7f54de8da973ec5e3 -- 2.25.1