Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp667823lqh; Fri, 31 May 2024 12:32:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQ2w8kSfA7eC1DYC45L6pv3eRbeprnybyHJy+Gq88OxFvcPOuoptMT8urVcDNRD+bB3bCLYB2doScHvpXqL4gac+bp5Yz1Fn+t9HVzAQ== X-Google-Smtp-Source: AGHT+IHMKOn+gK8HbMbU9//DBjBoG5zDvJpJ2Gjnb71ofAFoG9qlikqHU/wg90cpvWbm0CosouPA X-Received: by 2002:a05:6a00:a27:b0:6f8:beb9:c0e1 with SMTP id d2e1a72fcca58-70247663027mr3053682b3a.0.1717183934636; Fri, 31 May 2024 12:32:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717183934; cv=pass; d=google.com; s=arc-20160816; b=Z/8BWEiYjJC4oIyfjz8zNLWZw3KQGxouY4kD5hnArf8o9qXPP+38rEuoqXv93cMZVj GLFw5JrYgEUXYKoo/uWHER66CjJJERyGUJUVyYYYzycI8hfyEYZeudCEDapEw+13uo3G H829O1FRuMmzNQ3txOu50sybbvLnjMU2op5U3fBvw6D2cbeGMBhK/xTN5N4Spy2yO+Tn 5sQ0H8kquXFMntmQ9rhdiB20sDA23qcVjypAsMlbQYArlw6IAGAJ12d+btlvL+aSIut0 m/vAO6/fRoAnLI3ml8O65dMUr9uy0rWqrDBo15X8gQLbf1gLsDw+EmdtB7UYwMtDbzzC vudw== 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=LNiSFFkgTlrUrLST6rnHxNBcVz2Y8nVKH2f06qkCTTo=; fh=yPyBVueOlV0xh9WIpneyBjPV+wI+YQTxV6XUuh1OKK4=; b=Fz6HOKHTROmDwh3BcOrvoXCTUbJ3dLG+BOQOhoANDQgnCC0I9M2PphBEeRwDsKb676 FcSPAl5kGaar4umQRTL0rIoIu/EU2MOINnhrYA5VBoaMZuh4n/ft1GQYq0qz9zy57xbx qxA+jJuHy9MhFLKjigyMLm42sU0bbwX5uderEKNftAsYZT6xO7rd350rp7IVwsPPcdyp XXBeX6Y7iuFuhUWFqSADLVj9bVaXlcvaicKK6aw2yoAN+irflKWwIbnDIbQ5LMzGhm9v hEQ9XBVsuglZLBSRCAJqn6SeNbNcnwlkQXhbn/vg0gjR7NFduBoEWwfXYYcO77iYSWUn eOhw==; 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-197367-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197367-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c3540f9608si1982825a12.130.2024.05.31.12.32.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 12:32:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197367-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=vmware.com); spf=pass (google.com: domain of linux-kernel+bounces-197367-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197367-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 14E2D283AFA for ; Fri, 31 May 2024 19:32:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7852D1822CC; Fri, 31 May 2024 19:31:11 +0000 (UTC) Received: from EX-PRD-EDGE01.vmware.com (EX-PRD-EDGE01.vmware.com [208.91.3.33]) (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 66CD417D35A; Fri, 31 May 2024 19:31:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=208.91.3.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717183870; cv=none; b=GfVa4XVVrD81PfK+Z/X1/rCfNJLIyXFs4m+Vx6czcNWpiKaJvBcvCeYmBCq6aEPrmNq6XTAMloNbhSigGmVzh/cHkFNOl1tzzCDeiLCwtRTp1OZG5InR7BXYzq8FazID/UboAp/HW3iN22kTjsWbLUf7dHMZE40Rydv1VzSsrP4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717183870; c=relaxed/simple; bh=z3TA2Pyh5iL5iHoyqIePu3tYmCwqk19EjybdfTrNXDg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=myAT24F/R6LFFfNufVVrvuBGM6aAqGOKFIx50efwdm7NUugQMW6gJA/Joe9woZBQzi6+d9D4jc2vii5BNvFN5Ky8dfoRus6bY1ojMhvpxF33xPHJg0K/hD+QrSn+IjkzASr0E/IM86OqIQFmsw6R+RB6+22OYYYD7ISO4S0QVeo= 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.33 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-mailhost3.vmware.com (10.113.161.73) by EX-PRD-EDGE01.vmware.com (10.188.245.6) with Microsoft SMTP Server id 15.1.2375.34; Fri, 31 May 2024 12:30:35 -0700 Received: from htb-1n-eng-dhcp122.eng.vmware.com (unknown [10.172.6.252]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id DA3E320175; Fri, 31 May 2024 12:30:56 -0700 (PDT) Received: by htb-1n-eng-dhcp122.eng.vmware.com (Postfix, from userid 0) id D6AB2B04D3; Fri, 31 May 2024 12:30:56 -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 v2 net-next 4/4] vmxnet3: update to version 9 Date: Fri, 31 May 2024 12:30:49 -0700 Message-ID: <20240531193050.4132-5-ronak.doshi@broadcom.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240531193050.4132-1-ronak.doshi@broadcom.com> References: <20240531193050.4132-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-EDGE01.vmware.com: domain of transitioning ronak.doshi@broadcom.com discourages use of 10.113.161.73 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 e26d223a659f..b16449671b8b 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c @@ -3951,7 +3951,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; @@ -4018,42 +4018,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