From patchwork Tue Jun 18 21:53:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13703083 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (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 D9710179958 for ; Tue, 18 Jun 2024 21:54:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718747651; cv=none; b=OjqFpgsfz9milMBZGXiir2kHIZJVSc0H0wR0pGam0OU3i2wwV+I5j4Gam/AJkhHeqjXxgVEzySSM8EB/nFyvN8BuqPyf5OcvM7s3UGF+bVr7ty4pSsrLchueQ1CI5SzOr0qrwc7o01wjtqZAU05/AqCDSxFjhuDkNRV84GLQxxE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718747651; c=relaxed/simple; bh=sZK56R2MRHC5bYLUOmsCffH6yFw+tGC/9TmMid6++HY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HzASj0+o062GxMdN+l+8ubNmkgwOsB7ulmtaecXXaVCc4TUzsJpqtmyXHJ764JGqC5EIsYLF2UK1I/2H2isUX5qeA93KuCGcorKeJOAlIZkDEh+20JWVex7XOIWbXaagoWqGMpc5f6MAVSrH37jHkrGxd/VrV+oWWHee5/PLhcQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=NQ8u/0iy; arc=none smtp.client-ip=209.85.215.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="NQ8u/0iy" Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-6bfd4b88608so4274889a12.1 for ; Tue, 18 Jun 2024 14:54:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1718747649; x=1719352449; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Zj0ERKJGqtPfGVRTaGx1P1JADG1lr+6MTiy1stJpakM=; b=NQ8u/0iyG5DqYeCK7VfRsiO83DxHuZeStSKowhZMSDZ6+QipTkR+RXkZU+xeA+F37q p64CelOlaiva7bspiSA5DEFejiy8aid1zxaikZ9Dw71jdRhuQhFcCctCJ5OrJnH4SneT EsYcMzA+iwSj84zGEoQ7I/P9m1Dd+oxfLLqgs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718747649; x=1719352449; h=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=Zj0ERKJGqtPfGVRTaGx1P1JADG1lr+6MTiy1stJpakM=; b=XAyK5prLAFAJ4JSZI35CHqZfNJCsi/3aRCdnHF5DJyh+9+fgG7g8rXcTPKJ0rW4erz /A9tz7IPh7TRogHjh+b0lDPrV98ojvSzsgeLvKLEPxfqQEpW1z3cbCuctUBB283sWoEA nT+2qY2FKjjpcaRhJ2BBv/+zwMC4GVlkcv5lewsrTzuebFCgKQo1vQ8D/5j7siHyncBt XXL1p5/pj7Fwaxj2+tQUTzm5aOkbtSLBKV1Fq9xzPP1Ax/UVCe+XbqcAPtL74lWXOcWW JxS9DZmUA4YmwitbzHqwWoSEKM+zv+9IES38s0RwVDhokdQFnuYngCQ8l0ypsukXCVEp kTEA== X-Gm-Message-State: AOJu0YyHNtDalABYmAbEq/7xZpQeivmCGQWMKUG1XB6OGc5ykuZ5lWb5 GFXfFMnyAk1jUf/P0EKYy00P56wSkcVHL75f6qaJXOa7bhvjsQJQCfkjEPHMIcgLs3JfrrlAfJY = X-Google-Smtp-Source: AGHT+IFaposoGo5N7FXiPBiQki2CW4hS6bhbq6OET8K23sQvgT1DHKTnrIOFpSooSc5104VF3/0xUA== X-Received: by 2002:a17:90b:3509:b0:2c7:2bbc:c48d with SMTP id 98e67ed59e1d1-2c7b57ff101mr1006758a91.1.1718747648841; Tue, 18 Jun 2024 14:54:08 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c4c45cbd05sm11501990a91.19.2024.06.18.14.54.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2024 14:54:07 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, Ajit Khaparde , Somnath Kotur Subject: [PATCH net 2/3] bnxt_en: Set TSO max segs on devices with limits Date: Tue, 18 Jun 2024 14:53:12 -0700 Message-ID: <20240618215313.29631-3-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 In-Reply-To: <20240618215313.29631-1-michael.chan@broadcom.com> References: <20240618215313.29631-1-michael.chan@broadcom.com> 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 Firmware will now advertise a non-zero TSO max segments if the device has a limit. 0 means no limit. The latest 5760X chip (early revs) has a limit of 2047 that cannot be exceeded. If exceeded, the chip will send out just a small number of segments. Call netif_set_tso_max_segs() if the device has a limit. Fixes: 2012a6abc876 ("bnxt_en: Add 5760X (P7) PCI IDs") Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++ drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index c437ca1c0fd3..89d29d6d7517 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -8996,6 +8996,7 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) memcpy(vf->mac_addr, resp->mac_address, ETH_ALEN); #endif } + bp->tso_max_segs = le16_to_cpu(resp->max_tso_segs); hwrm_func_qcaps_exit: hwrm_req_drop(bp, req); @@ -15363,6 +15364,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) dev->priv_flags |= IFF_UNICAST_FLT; netif_set_tso_max_size(dev, GSO_MAX_SIZE); + if (bp->tso_max_segs) + netif_set_tso_max_segs(dev, bp->tso_max_segs); dev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT | NETDEV_XDP_ACT_RX_SG; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index bbc7edccd5a4..9cf0acfa04e5 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -2318,6 +2318,7 @@ struct bnxt { u8 rss_hash_key_updated:1; u16 max_mtu; + u16 tso_max_segs; u8 max_tc; u8 max_lltc; /* lossless TCs */ struct bnxt_queue_info q_info[BNXT_MAX_QUEUE];