Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2868789lqo; Tue, 14 May 2024 11:37:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWRb913HEsCYxumkkOqpidoSuvdy2KiURY9IPsziodhwy68R76teNeirfhG+ZIOevck/yl9Lr7+GXdhIcM1sMrHcwGlEm8CJjHPhtMpLA== X-Google-Smtp-Source: AGHT+IEgQvpuI2f2AM1NCfS38UKxBPUHyfu8Cl4k7MDwmdqknY3DPRhnhl01hz6IZ6dKL/GqDXAv X-Received: by 2002:a17:903:41cb:b0:1e5:8629:44d with SMTP id d9443c01a7336-1ef43c0ca09mr161837185ad.1.1715711859566; Tue, 14 May 2024 11:37:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715711859; cv=pass; d=google.com; s=arc-20160816; b=CM0aghWIg/zy9PIEXozZM6vQPq6IMpaXfRZFEBbES/bXWoglebTYkgt2emo+tVbMnK JNljGQ34MYr+iQgC1dGKf4xiBdAO65vI3yGb0+eySTXxTI//VNmFLtu8nOIt8Ikg7qxC co/a6ln2IsMEx2uWMGmjAqdwJRsmIHZpu4BqWtnYGsoI/MxWMgn0j2xxScJfzHoCftqq 0DmWYcrnJYR8JXT6YP4cw78ggRhTRSeZykrJfTlaUNlVrn5nTFzIUx2fLWJSWWcgN3+n Q1NdY/GkaTcTu2mSgPiF2vtWrbR5ScVBWnXqwuW1euXm+sJRgQIEfcs6s1GzmYXMlO1q jaLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qCb+TRavFBJtg0ThBN7Y/J861/Tj9G469A/jOmRWqFE=; fh=yPyBVueOlV0xh9WIpneyBjPV+wI+YQTxV6XUuh1OKK4=; b=UKL1Dtsvlw0DagHGKtdhiooFmp7o21H7reXzzXlR5NPIidfxGUJQD1c7970bwKp+Ge Nn05GkpD4m4BJbgpbSWW1J1sr0r20gwVUdQTrae2/aJVoiulij03FftCDReqeyh9qXEq Lg98Ykrm2j82UABguHg8PCEwGOx398aDatVpO7J+kv7QeMTVwyh2mde1Wfo3X5f4l9/M Waw/c7z1ODF75Uy4dnMHMo8kR8FW3cls6m0DotXRiMj/HU5CUQhtc11V9vMULYYGnSoA 9uMRX2Q+5GDV2B6+mjvxE3xsDGaR+uMF7hjhSAlrq3Cu1SFm0tQKr/msWuRovc1gB/hb G4vA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=vmware.com); spf=pass (google.com: domain of linux-kernel+bounces-179065-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179065-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b670f4cbdbsi12169690a91.54.2024.05.14.11.37.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 11:37:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179065-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=vmware.com); spf=pass (google.com: domain of linux-kernel+bounces-179065-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179065-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 298B72836C5 for ; Tue, 14 May 2024 18:37:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F705181CEF; Tue, 14 May 2024 18:36:36 +0000 (UTC) Received: from EX-PRD-EDGE02.vmware.com (ex-prd-edge02.vmware.com [208.91.3.34]) (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 1CA3E181BAA; Tue, 14 May 2024 18:36:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=208.91.3.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715711795; cv=none; b=apmRpPsAVrh9UFCmv2W2nxzzmIp3oX5r/wj58KhzTmbsqpJHH2k03l1uLcihPTGCX10WhdRoANHp9ROo0WFnb+qMLPyPPvLEcTcS1Nxb1k0uqzTAT9YFEQklhuwHIBca+3sqDYLcRGhKwy6Qbgnt7Y4OTZwQ3IOiU+8QskUqQ2M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715711795; c=relaxed/simple; bh=hSPREc8LOly3/w17MuuM5ilVI8Br+C9iCA2zy3DQJv0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Jx6gc8AjRmSz8X+NIVYpmk7XiW2/habalCSghSaa9sfquUWKWUYdY6gdk6WyfkowNnf4hOuFr2NGpVgR6yJ0UHOYgGXs0R/PNtU8pcT67wEqwM3kDEq0UToPBKOcxAY//u0gNIYV4BEWw/GvpO6St3J6FznuMsH3qF+xgrYMOyI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=broadcom.com; spf=pass smtp.mailfrom=vmware.com; arc=none smtp.client-ip=208.91.3.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vmware.com Received: from sc9-mailhost1.vmware.com (10.113.161.71) by EX-PRD-EDGE02.vmware.com (10.188.245.7) with Microsoft SMTP Server id 15.1.2375.34; Tue, 14 May 2024 11:21:00 -0700 Received: from htb-1n-eng-dhcp122.eng.vmware.com (unknown [10.172.6.252]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 7E0C820314; Tue, 14 May 2024 11:21:08 -0700 (PDT) Received: by htb-1n-eng-dhcp122.eng.vmware.com (Postfix, from userid 0) id 7B96BAECCE; Tue, 14 May 2024 11:21:08 -0700 (PDT) From: Ronak Doshi To: CC: Ronak Doshi , Broadcom internal kernel review list , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , open list Subject: [PATCH net-next 4/4] vmxnet3: update to version 9 Date: Tue, 14 May 2024 11:20:49 -0700 Message-ID: <20240514182050.20931-5-ronak.doshi@broadcom.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240514182050.20931-1-ronak.doshi@broadcom.com> References: <20240514182050.20931-1-ronak.doshi@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: SoftFail (EX-PRD-EDGE02.vmware.com: domain of transitioning ronak.doshi@broadcom.com discourages use of 10.113.161.71 as permitted sender) With all vmxnet3 version 9 changes incorporated in the vmxnet3 driver, the driver can configure emulation to run at vmxnet3 version 9, provided the emulation advertises support for version 9. Signed-off-by: Ronak Doshi Acked-by: Guolin Yang --- drivers/net/vmxnet3/vmxnet3_drv.c | 46 ++++++++------------------------------- drivers/net/vmxnet3/vmxnet3_int.h | 4 ++-- 2 files changed, 11 insertions(+), 39 deletions(-) diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index 2eaa9204c38e..aeb7a4a4be1c 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c @@ -3952,7 +3952,7 @@ vmxnet3_probe_device(struct pci_dev *pdev, struct net_device *netdev; struct vmxnet3_adapter *adapter; u8 mac[ETH_ALEN]; - int size; + int size, i; int num_tx_queues; int num_rx_queues; int queues; @@ -4019,42 +4019,14 @@ vmxnet3_probe_device(struct pci_dev *pdev, goto err_alloc_pci; ver = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_VRRS); - if (ver & (1 << VMXNET3_REV_7)) { - VMXNET3_WRITE_BAR1_REG(adapter, - VMXNET3_REG_VRRS, - 1 << VMXNET3_REV_7); - adapter->version = VMXNET3_REV_7 + 1; - } else if (ver & (1 << VMXNET3_REV_6)) { - VMXNET3_WRITE_BAR1_REG(adapter, - VMXNET3_REG_VRRS, - 1 << VMXNET3_REV_6); - adapter->version = VMXNET3_REV_6 + 1; - } else if (ver & (1 << VMXNET3_REV_5)) { - VMXNET3_WRITE_BAR1_REG(adapter, - VMXNET3_REG_VRRS, - 1 << VMXNET3_REV_5); - adapter->version = VMXNET3_REV_5 + 1; - } else if (ver & (1 << VMXNET3_REV_4)) { - VMXNET3_WRITE_BAR1_REG(adapter, - VMXNET3_REG_VRRS, - 1 << VMXNET3_REV_4); - adapter->version = VMXNET3_REV_4 + 1; - } else if (ver & (1 << VMXNET3_REV_3)) { - VMXNET3_WRITE_BAR1_REG(adapter, - VMXNET3_REG_VRRS, - 1 << VMXNET3_REV_3); - adapter->version = VMXNET3_REV_3 + 1; - } else if (ver & (1 << VMXNET3_REV_2)) { - VMXNET3_WRITE_BAR1_REG(adapter, - VMXNET3_REG_VRRS, - 1 << VMXNET3_REV_2); - adapter->version = VMXNET3_REV_2 + 1; - } else if (ver & (1 << VMXNET3_REV_1)) { - VMXNET3_WRITE_BAR1_REG(adapter, - VMXNET3_REG_VRRS, - 1 << VMXNET3_REV_1); - adapter->version = VMXNET3_REV_1 + 1; - } else { + for (i = VMXNET3_REV_9; i >= VMXNET3_REV_1; i--) { + if (ver & (1 << i)) { + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_VRRS, 1 << i); + adapter->version = i + 1; + break; + } + } + if (i < VMXNET3_REV_1) { dev_err(&pdev->dev, "Incompatible h/w version (0x%x) for adapter\n", ver); err = -EBUSY; diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h index 31e8db568db2..9f24d66dbb27 100644 --- a/drivers/net/vmxnet3/vmxnet3_int.h +++ b/drivers/net/vmxnet3/vmxnet3_int.h @@ -72,12 +72,12 @@ /* * Version numbers */ -#define VMXNET3_DRIVER_VERSION_STRING "1.7.0.0-k" +#define VMXNET3_DRIVER_VERSION_STRING "1.9.0.0-k" /* Each byte of this 32-bit integer encodes a version number in * VMXNET3_DRIVER_VERSION_STRING. */ -#define VMXNET3_DRIVER_VERSION_NUM 0x01070000 +#define VMXNET3_DRIVER_VERSION_NUM 0x01090000 #if defined(CONFIG_PCI_MSI) /* RSS only makes sense if MSI-X is supported. */ -- 2.11.0