From patchwork Tue Nov 14 00:16:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13454636 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1694C63E for ; Tue, 14 Nov 2023 00:16:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="fPUWpDoj" Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6098DD4A for ; Mon, 13 Nov 2023 16:16:53 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6b709048f32so4318900b3a.0 for ; Mon, 13 Nov 2023 16:16:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1699921013; x=1700525813; darn=vger.kernel.org; h=mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=xv/abzA8a1XEWHPI/DcHoTBDhmVriMHzoon+rMGrHYA=; b=fPUWpDojC9E4+4I3KVppRY+ivPOwzUnAB88kSxeW1QHcKNkl25TkoOXhDjj0wqORTi 9VvaRqFJm8c+Vs4rXYXdjyOqZKvbhOY/ErvthIBxW6KK7WaSkgLAD6pYp+yqy+qDTQ/v Rklq953o9L4xynXgsTChKaqteMCdiSK/3T5jw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699921013; x=1700525813; h=mime-version:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xv/abzA8a1XEWHPI/DcHoTBDhmVriMHzoon+rMGrHYA=; b=Ffy/+R4P/SOdApMFxcCWiGXKuJQToT/865M4YJL9FNgzNco2xLrxg+OljGQz0txCB9 oIHqQ3HUov1EQk92t49JSJSG8v5l+K/zgnBf1rgEgHUaq92SfYfRNgbJs8UB2wdkBpfX 3l/jp9LrP/0QVlTu6ZmTCIJeyuJhuEneCrhXnv9Ys4OH48EcW48HFH3GR0ZtM5qHufCu 9cvLER5q3jsNIsXwhVgsWdTYONV+J4QyiCUl5Q3n811+389ysSW2LUTlEkb4jOrmTxi0 fDVZlcrEwRTq7uIYYSWrQH20iGfg7Qh8MEiMXKMhpGjkNCJJ5KTVzSi7utvXMtoXCRKV LhHw== X-Gm-Message-State: AOJu0YxlEQZyjt9Wb0/ebI+JlnkerRzUwTjI0w0je6/U5qmD+7TyHxNY Q8Gfxdim8g8jXd3GyJjfvrqjuQ== X-Google-Smtp-Source: AGHT+IGRSwQSDqlo6eHGEkx9cq8cA0JMbRXNqmAvGEceJlsf1ZIRn1oqzUSbkEr73YHe90qOHALWJA== X-Received: by 2002:a05:6a20:244a:b0:16b:80f2:f30c with SMTP id t10-20020a056a20244a00b0016b80f2f30cmr6586565pzc.26.1699921012323; Mon, 13 Nov 2023 16:16:52 -0800 (PST) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id p6-20020a17090a680600b0027ffff956bcsm4063478pjj.47.2023.11.13.16.16.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2023 16:16:51 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com Subject: [PATCH net-next v2 00/13] bnxt_en: TX path improvements Date: Mon, 13 Nov 2023 16:16:08 -0800 Message-Id: <20231114001621.101284-1-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org All patches in this patchset are related to improving the TX path. There are 2 areas of improvements: 1. The TX interrupt logic currently counts the number of TX completions to determine the number of TX SKBs to free. We now change it so that the TX completion will now contain the hardware consumer index information. The driver will keep track of the latest hardware consumer index from the last TX completion and clean up all TX SKBs up to that index. This scheme aligns better with future chips and allows xmit_more code path to be more optimized. 2. The current driver logic requires an additional MSIX for each additional MQPRIO TX ring. This scheme uses too many MSIX vectors if the user enables a large number of MQPRIO TCs. We now use a new scheme that will use the same MSIX for all the MQPRIO TX rings for each ethtool channel. Each ethtool TX channel can have up to 8 MQPRIO TX rings and now they all will share the same MSIX. v2: Rebased v1 posted on Oct 27 2023 right before the close of net-next: https://lore.kernel.org/netdev/20231027232252.36111-1-michael.chan@broadcom.com/ Michael Chan (13): bnxt_en: Put the TX producer information in the TX BD opaque field bnxt_en: Add completion ring pointer in TX and RX ring structures bnxt_en: Restructure cp_ring_arr in struct bnxt_cp_ring_info bnxt_en: Add completion ring pointer in TX and RX ring structures bnxt_en: Remove BNXT_RX_HDL and BNXT_TX_HDL bnxt_en: Refactor bnxt_tx_int() bnxt_en: New encoding for the TX opaque field bnxt_en: Refactor bnxt_hwrm_set_coal() bnxt_en: Support up to 8 TX rings per MSIX bnxt_en: Add helper to get the number of CP rings required for TX rings bnxt_en: Add macros related to TC and TX rings bnxt_en: Use existing MSIX vectors for all mqprio TX rings bnxt_en: Optimize xmit_more TX path drivers/net/ethernet/broadcom/bnxt/bnxt.c | 513 +++++++++++------- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 59 +- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 11 +- drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 23 +- 4 files changed, 385 insertions(+), 221 deletions(-)