From patchwork Thu Feb 2 07:26:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13125442 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC9BCC61DA4 for ; Thu, 2 Feb 2023 07:37:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNU8R-0008W8-24; Thu, 02 Feb 2023 02:35:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8I-0008Sr-TN for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:48 -0500 Received: from mail-vi1eur05on2070e.outbound.protection.outlook.com ([2a01:111:f400:7d00::70e] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8H-0001eR-9W for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mNtTRTFxytJ7mJLB8DSad1cWYVXJaH3BTZ+MhzV5CmivP2NBaGxtT4QNIKI0JdMUkV98QoU8tr109UrKgkUUmlYoWoTAVeBZ2bcCs5arFSCEu9qbBQbWWZFu8/gpMIZP9FImHQGOaUUOaKgA6iAqfTGs0mgRu+0JxN3/4IqNunaXTuowEBx8tK0SP5AguuMpG8iCa5F4KVL4pmi5bZlFoLD9W+FwNCptPa5a3ZTpb5xsQdbex8gYgxXpSBIAlTjd4dWY9VdwOg+a2sxHoa/tj1iU3XuJUkghFflNtZRCiXl93G4lA1VMfhojxAhc78ZtACHR3SKbmdNZnN5P8qbSlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=j9Abq45938CGnKEaQArxmSlaen8sO/agH+n/BVwCof0=; b=D6jNqMlAt/uauK0eBrgveyhCLJAEUxTTuuZLlz0QTGgoqosgDBbZYVdLwGkm1wXNByo8O7hJPuI+8zfpYiXA9QZp9zf4ZVX37jUJHxPpC21WGsBQfmouy+Bnmx3hMC/WjnE2lTpT3YdDIeO9tiL5ALF2exnDL8hj03FcTKwd/jM4I3+cdovtG31hkmXtlKvhRUysysax0Kzgga0PAjtwPgWbfTWxYBicrWVFaO01KspXSq3yL3PUTFfyQ66lVUqG42YWSbULuMuKVdY8oD7s/r8xeecybQOH54x3rWWXyEok0GLw/inG32GYo0fwbXH8/rXMvZ7K29O31OvNHcFtlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=est.tech; dmarc=pass action=none header.from=est.tech; dkim=pass header.d=est.tech; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=estab.onmicrosoft.com; s=selector2-estab-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j9Abq45938CGnKEaQArxmSlaen8sO/agH+n/BVwCof0=; b=Re4073AQHZvmoiqkpDGg6uwy+korO70wfYFZ7W4D9T20B0oWaXhFdkaIU/Alf9S8oHpiN8rSmfenyIHephRjbD9zdEPao3uPVgN0RihEc2C7sJdJ2GyD/ftG+DQJcZxfnmgBT5XL8GdkMFERuydzh+DfDBFjLjbKqlLV7NPVFfw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=est.tech; Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) by DB4P189MB2389.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:3ff::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Thu, 2 Feb 2023 07:35:38 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420%9]) with mapi id 15.20.6064.025; Thu, 2 Feb 2023 07:35:38 +0000 From: Sriram Yagnaraman To: Cc: qemu-devel@nongnu.org, Akihiko Odaki , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , Marcel Apfelbaum , Sriram Yagnaraman Subject: [PATCH v5 1/8] MAINTAINERS: Add Sriram Yagnaraman as a igb reviewer Date: Thu, 2 Feb 2023 08:26:41 +0100 Message-Id: <20230202072648.4743-2-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202072648.4743-1-sriram.yagnaraman@est.tech> References: <20230202072648.4743-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0001.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:b::31) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|DB4P189MB2389:EE_ X-MS-Office365-Filtering-Correlation-Id: 1fe4fa45-1469-4b45-3dd8-08db04f01428 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l6k6TnMtoka7uVqWDmznvBW0uH/3L1F8OFYmjt0hMr1vzN5Vh9wLBfEheNYP35x/iaS483y5hGaTe+GwmS6cZ+pxI5S67RQarfQNm+iKUGaMTG9r6QeVutdu0+4UxksOBxaEOshSrYmzyyx14xPE3Fd7MhAgVN6vKeMEavZF63txrv7sbbnq5c0+zLz/vKfrSqOCFZlvcdTOkocYxsnOxCEySoLfF3ILCaZDY0omNo8fzG7wRseDkYejCFMbcpOiwd0RuJiQTTTJzdWILWv8jtfPCH1E87TGPRqWHWHwCG6rHDQ+RsQUiaMe8LpINDB4N7t0w7fYz4bn2dUUAAegnBYa/jPYa3Cf0tQWsdze9Ug+t4qb9i3cf0sEsQm1Eeo9sqCD+M3lmqjY9cOZla5V4VxuLsIYHOUq2GTGp41QatepAiQciPc9v8dE3vXbjuFoDKPRgvIdrdiTuigYbGe32EQ2Mmm+3Gujzir9h/+CAGK/XsYcTk59KISiIjwnezt78URHpfJG8e2QKc1/P/RbXpMl4j3tIFwQ0I7DVlLJclQ28+z30w2OVjmLO/tnTG3L0ZnxYJrfgn95S3EvWw3GhkFaJQyPXtd+SeMvXwxTOXJIzu23U9m3qS88hR4/rLr2xp3kTwTKtBVpdf0TtPZF8WB1ItjixTZ9AwfcJos0/6fBHbXPdu1zbfwjKFGAkWWE08qghH2Ic9j9kcf9vJF2JxirmgyUaQl1Kej3AOg4Keo= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBP189MB1433.EURP189.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230025)(376002)(346002)(39840400004)(396003)(136003)(451199018)(109986016)(6666004)(1076003)(186003)(6506007)(6512007)(26005)(2616005)(38100700002)(36756003)(86362001)(8936002)(41300700001)(44832011)(5660300002)(4744005)(478600001)(2906002)(6486002)(66476007)(316002)(4326008)(8676002)(66556008)(66946007)(70586007)(54906003)(266003)(37730700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QpCK/BarH4yrcisRpMDpHjNLgQKQvg8CvvyWkqNdol+zdsGBBcnZWwjr0Pws5p3G5HCeYpPzk9lRvE/10VO4scR4QUC0kRbcMelOt1xdDygI6nXItktgkHOVyEpvKu3xWY3VkpB0a5heJw4ccen11aReO7/FwsksGe31t3a754E+Ja5p1l/0CdT4SCzMpjLfSWJaZY8CUWaItaePq8dqHsVueZOBn4t0SyD0ZQgT3OJ5TpCbRxOm3CLDhQgKNO59WUtrZkJLqZ5FWWRWmvGCHRhYs4ThSr7YbW6Fc8PwW8H3kXzkVc+txfIWN7LdsNNsy3NTSuFiVnCOje479T9+t0pP7FkBd5CnQXL2PKr4m/Pxqe5FknO85gYlLYtsNaeKAzO+eWCb9Uo42CM2rqH/+qII25jq0cbQCe/MoJI8rgosLRJF9NbOVDEcgb0QWANrJmmmO9mdwKnYQPUIts5vcHwyslvgVmC/hzvmTgdlMX2zVZgVGucWz50C/uuDiX/0gJpUbXq4lsI0NCS0CLafIQXGwLfgIBfbJt6QpWF96GPwPp6W3W39NerqQhemqylJgkAGPesFqW2gjrji4sOSahfN5TFMbhbEjHsycE77BH29aqSTva8+hg0UVr0IdXtg9Rb8Qk+2kJ/tmgU7Lga1AYF9XYX101I2X/wtHj6j/aYNn1FFL9X+wR+uivVgg3SU+DQ7yk7btbAmUOyUCdnT1FEMw+IGj0V1xRyrAnb8e0KYihMO9ZicHtMzNNAtd4dDagDt8PFy5klFWK2/ljDwYpnOzCBs989GTRdmqnq3/kz6HaqSXcx5vuv5qqb9LcTRIacLei2mVC1Uq1DjlOmFTlEqMeONFLV7Jvpob3Jr483qH7bFaBpMzFTvqgW3EzZsaBinENXcxGQSLO5s9+h+6vW0HpOHsBvma09to5BLVm83OQz6skZqZw7NZb8PHa0vhIiJzF+DAytPvJHdQUJpMlgmgkaHybbnjAMBK5NwsVcB+bqQCaERAWxI5t99ce99VyFFJU7fWZYgxsp+XL5SunImlgHQAZ/ybto/u8wpqH41koMJ3JRwip10pNNMY6n3bRs9p3eKQACcKGL64RrDQdyHUPMZ+tbYQjrOFi30hnQyBFBRUtI4mL76TLKSXqoxH0fz6iQk+DMoL5bqqAusSyoLqS5PvYyMYSYyjOTy4mYodAniuSvUBDIyY2mwnQbI5rFFi/DJNzqZTuLZCVYgeMFNrky/CWyoICBlkLxTRVObmn4+xU4yfVvgpfVq+uva4DwoZngpJQhIRqCbKng+NifPxuK7NGPXmGacc2XnDvEwAqXJpLM2tH8txGccPXFYRFf2NpvhjrPBBcnbEuj9mnO2611QIvR/hblakkm9lMmDNs+84VA4yDjIRLipIZiYf4dD2RqBLotTHl7b4yBDJ4XH0rPc4I71U6wX7PnBZFSADgaPgec6BvPi5pWTuiGOUNJeP1NGv3NP2pUC72MkUrgKvmcBmmvBbck3KmsQ3ESSJHC8DIZUUNij+m3MmAUmMeVEbhprXLzH7OlEqEuGPKDPwyCsEWbYECGhLLGUngwT/7Qg2oJYla+tiY/IMNddQC+Dbiv9HoiZFHyBCexOFQ== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: 1fe4fa45-1469-4b45-3dd8-08db04f01428 X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 07:35:38.1306 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d2585e63-66b9-44b6-a76e-4f4b217d97fd X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EtzGvRTnQGzNCQIdE4XK3WoMTifTX2PS79OED/aOgwe7nJmPI3fPscO0hgpLypiW8lNeUr9hn0AkdamM9z5iowNYFr0NuLPLhJx9H2HCuuY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4P189MB2389 Received-SPF: pass client-ip=2a01:111:f400:7d00::70e; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org I would like to review and be informed on changes to igb device Signed-off-by: Sriram Yagnaraman --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index ece23b2b15..7d0e84ce37 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2224,6 +2224,7 @@ F: tests/qtest/libqos/e1000e.* igb M: Akihiko Odaki +R: Sriram Yagnaraman S: Maintained F: docs/system/devices/igb.rst F: hw/net/igb* From patchwork Thu Feb 2 07:26:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13125437 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3DDC3C05027 for ; Thu, 2 Feb 2023 07:36:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNU8M-0008T3-C6; Thu, 02 Feb 2023 02:35:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8G-0008SU-UE for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:44 -0500 Received: from mail-vi1eur05on2070e.outbound.protection.outlook.com ([2a01:111:f400:7d00::70e] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8F-0001eR-87 for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KV1ows4RZWKnNuHdg0G4yuZjVzzuz1gNPsMuMYLFeOSAA4EpkaGwmJeW4+H5GTV6FO8aHvRcWGnOdNSdrw2Ij5TU7rQccrfRxg6VzZqY5Lz1pju/FJa3YiLpbZr3xq/Eim3hIZnJMZVF9/YXcKhWgChmuvuICzIoaiBvY09zbO9vz1w+7AQDigEbaAEwDc9J/KnD3OyjdoUefSZKHZpsdB2AQwSUC/n2MmfVF7CI4+rihpH/3zVRzAyzFqSyhD+7ONWt0CEPvGOeviQBRz/48e8njbKrQDWOhru0ze4Xx1v0QUqQmTjqYvk3NB4N+hi8+c96Qz+f7TCS33MzKd7NQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cH8eb0Ku50eAOzZOrdXz9GiXP/+yYlyCWgiOKa//Xlw=; b=YNfikpLdL3J/Ks8jN4yIi62J3erTvO9EgqpUkoQ5QQXwHcY8H7WF6FNs23mBZyuMZLGNyi67uWHKHK2hrtm68eWAJAu+raCVCzxTxCq3ZFePDxWTjGYgX2zo4VKvm3IGkiW30bjUxc4pnWjwKSkMxwWbQMRRD5qYJsz9+HDCY3Rtt4x2VmKvUTgDSm+Q0h3CmWeBbfoanM5k7LxD8jUnQgFIgdzrEnYPWbzUEqvJyANH4SvEwEJXeMWBgUsLZt5N2ddbdDGK4IxswaLxAnUq1aBKt7bGNHKMwEuZ5qZ0cN0vqLpSBRAqpMY3Y/VZSqwq/8BxfaygA/bWLYBVLdQJBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=est.tech; dmarc=pass action=none header.from=est.tech; dkim=pass header.d=est.tech; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=estab.onmicrosoft.com; s=selector2-estab-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cH8eb0Ku50eAOzZOrdXz9GiXP/+yYlyCWgiOKa//Xlw=; b=m9zDfdmu2iHlh8QG7vdKPw1X7ElfOk4nocd3N3Wx5x2j0CLX6ze68YVn2iCz3O+ZGAZ8l2bna4qyk0hWALUk8/tekFIFXiCb3oY9QJoNuhXhYbM0TQeOpDpgPEXSwHjWgGFcZFaFHPnRi8b9PX03h+TzrayoAKDyaHn1WtZdrgc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=est.tech; Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) by DB4P189MB2389.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:3ff::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Thu, 2 Feb 2023 07:35:38 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420%9]) with mapi id 15.20.6064.025; Thu, 2 Feb 2023 07:35:38 +0000 From: Sriram Yagnaraman To: Cc: qemu-devel@nongnu.org, Akihiko Odaki , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , Marcel Apfelbaum , Sriram Yagnaraman Subject: [PATCH v5 2/8] igb: handle PF/VF reset properly Date: Thu, 2 Feb 2023 08:26:42 +0100 Message-Id: <20230202072648.4743-3-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202072648.4743-1-sriram.yagnaraman@est.tech> References: <20230202072648.4743-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0023.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:b::24) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|DB4P189MB2389:EE_ X-MS-Office365-Filtering-Correlation-Id: 879210bc-fc7a-4dbf-d9e4-08db04f01425 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UEFmgWhlxfOsmB5kIMZaZwZR2KAqXmQIqf0V+ewFUvqY/C7/ND8vELNxDS1b9FQqAHKiLQaBPN+FEfjiUIdbN0PRR5w/yafG/Jh/e4WNvyIhwsOZf18kisQLHoVrgATvmDSxoID0V26TmxyJH482SvzEJEBlnMzgOkeYPwx4ZLPlwIC2g0FpVkjlWj5rz9EEzVa2BBWJGZEl1Kog62Wp4BZT3B/aBSug+t9uz8VpCTRqrX27WVdeJGTVrGpE8+6C7zqF6DHKQQmBAUnjF8Pp7G1lYe3S/a/Ikoh8H0rqdXMuQYVWdEIpDFJD2RTPDHUp1Isz4mjanR53WrQ9Bv/bCx9XQ2kxKATYZIAjtyzunD4EKbvFZTkysKIwv+TNPTud7jSJUiDdp7IAbY3CcqRWFh8Y0h2O2QUCJ1LnNVG3ttoUdhIEv/SCnY1cakAaGJ4MCjg0ezigJK4cFTeooSqomIC6uKpNxDpCw4SFEhTvH726hUcjdMy+cPyCA3rKdbOEZbZZN3Tvm4Tmy6Kb7fh+yV3YZB08YhWglokkycP0wXDsemfhiR74+0Rg6b+/fP1HZo9q2eqVsw5ytPHE0XYFCFU1nw8Tq7xcGc5eRSPx2uvRwPV3jAD/jN71wUoed/TEUJuW9YxfI0T/3FIBQk2DyS4djUPFlVwF7eDWdfAswNz/VW3WBN6k2XZlDXBunK72IHZumaMYaFslILryCIzvdVZjxT+EXJ006w0mKLNAf50= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBP189MB1433.EURP189.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230025)(376002)(346002)(39840400004)(396003)(136003)(451199018)(109986016)(6666004)(1076003)(186003)(6506007)(6512007)(83380400001)(26005)(2616005)(38100700002)(36756003)(86362001)(8936002)(41300700001)(44832011)(5660300002)(478600001)(2906002)(6486002)(66476007)(316002)(4326008)(8676002)(66556008)(66946007)(70586007)(54906003)(266003)(37730700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XqAqUVe4iHD8D+xqbYv6HxWKDynfeZn861RV2V0eMGP2275PI/5Id19Q8cSwxA35mToMFO3009MuQYVDvU6ZoynWCQ+xCi+QI/F33IXrYuExqTPKSZIYm2jbaSN7nB0quUEoODamBtf1+lx82Vs4CtsP/hq1JTn1kWZjuW5DYUk0n2iw1RXcjdft6EBbOb/Fm8LLirES6iuhuX7PN0xU8AlLirIMbnEdOx1yW7rwgxUY4gcaifwWN6WilKyBKvGyvU21YS1dOU60MTyedZj+uOFlkazHAI8Fj0McH1+EqlF+KPQSmFx+TP0VFdV27/cdird1gMmPsfNUBidcp8G9FqyBoDSldUnCqTQQRa9IMjgwMSTD96Ai8G36ealW2xw5jCrqSpf+o8hC+2UJon5Fq8NMcSfrqYjiUq7ueXB816JdDSXtjJCnV1LcPKcsaqyS8x1W8gNm1MfxVsBNQBt2FZlWW06W6XyIvhNCYBmDDr1FFH9LyvFV0H/1QaVD2YGPt6Ess7D1za4ZFnik+H1ml4ReWMFXXER1v0M7r88DRehrt7OwH3p9niaxrgaRjKgTbQIEiUwBRC5/YWXkvB+iC/ErSzUwV5D7lpRqcB1DwGeh2lHgEqgpT5/PRGzU5fSUj1LA89xOUoE6gdZhHg/MgEaWRlWabcym0VkKRPFCyuGGlHt2oJhLaguMDEDXQgfcfMvmke1HZTOokNG5+5N0j4tKeVdSXp6d2zgpQxhAgfQbrQQhq2er2bg5Kg+AINd80dcXwP9KGJDJdi/0J7A2fhjJWmnlNAIY/kAu0b8n+6DLaZEpbBz0DjA8DbJflj/VXeXyvt/HucSOScqVup4hjBoWW5v8FhEz7BwktTaoJB6nkAUNh08+XJos+WT13HCOwxeEITFDHPRRfnCELlQb4pE+3d7gdc9qI7Niso1whxz3cjtqh9Kf1xej4Z6uJFY2UIg6vgYV4RV+1O3ypj56qKzsoDxXZY8A5Lt4kVa/HXNdFRBsq0WmfTMLkbJl7DPkyRX9AYu0NGjMojeiiJ04woVDOUfVNvmA/uD8K7Eti410gwRBlVOEu/m4nXS8AY/t3yqS3PsE5MG8m7eXjfo4L2pZ+zuoeAWfksx04OIzaAk7bb9oE7VH4YjoSr+xBdNJbrHzqVzm/nURxAAZN81c5iIwWJhdCqE2PmBvQCQhRDVBjyaUAgevfuTG/CwQopxz4vE5nLbewMabK5DbO0nW3MS8uqqAf5HykpIWxaYh4he4yITRUYX1JKcp3nZb8J+40n6gA0NVgJ2Y6LevmT0vFIdSTDJE/5lCBXZrp+uyL2Xh5TbS0WQWOtBi7K/tuwmC50JtV+6npu+ILO0mTsKUFVFu9g14h29ULiRz2lAknRs4kcysr7xpYBGCymrRJEZrK0EiOSBQ9KatiNfikEMDbjYr1boO2lxUaE6H2RC6w5riQj8nj8fz/a1ZytOQMlDY2ttzxSXGoWm+n6VaUejZaqF7Lg0LjnyOVMo1MlDUzNv2Tr5jkHxfJJxtUPhhFiV8jttutkARuzwm9+q8DYMJkrCepzrdo/M6Bnpd+a26JyCs1qQCaj3mJhya0zQVnW4qmb/qYk3AbU/YwNptk+IdpQ== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: 879210bc-fc7a-4dbf-d9e4-08db04f01425 X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 07:35:38.1150 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d2585e63-66b9-44b6-a76e-4f4b217d97fd X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DhMqcvE3K4hNgAeDqHVQMpTBVxZpfDT/lBTPLmBe8PDtBW0BqEKjPK3LWNKcHJ5sT0EtkFkzJssbBP/DXn99YaIsJulD+3D/S4t1d60EsWA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4P189MB2389 Received-SPF: pass client-ip=2a01:111:f400:7d00::70e; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use PFRSTD to reset RSTI bit for VFs, and raise VFLRE interrupt when VF is reset. Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 33 +++++++++++++++++++++------------ hw/net/igb_regs.h | 3 +++ hw/net/trace-events | 2 ++ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index cb3e2d0be3..b484e6ac30 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1887,14 +1887,6 @@ static void igb_set_eims(IGBCore *core, int index, uint32_t val) igb_update_interrupt_state(core); } -static void igb_vf_reset(IGBCore *core, uint16_t vfn) -{ - /* TODO: Reset of the queue enable and the interrupt registers of the VF. */ - - core->mac[V2PMAILBOX0 + vfn] &= ~E1000_V2PMAILBOX_RSTI; - core->mac[V2PMAILBOX0 + vfn] = E1000_V2PMAILBOX_RSTD; -} - static void mailbox_interrupt_to_vf(IGBCore *core, uint16_t vfn) { uint32_t ent = core->mac[VTIVAR_MISC + vfn]; @@ -1972,6 +1964,17 @@ static void igb_set_vfmailbox(IGBCore *core, int index, uint32_t val) } } +static void igb_vf_reset(IGBCore *core, uint16_t vfn) +{ + /* disable Rx and Tx for the VF*/ + core->mac[VFTE] &= ~BIT(vfn); + core->mac[VFRE] &= ~BIT(vfn); + /* indicate VF reset to PF */ + core->mac[VFLRE] |= BIT(vfn); + /* VFLRE and mailbox use the same interrupt cause */ + mailbox_interrupt_to_pf(core); +} + static void igb_w1c(IGBCore *core, int index, uint32_t val) { core->mac[index] &= ~val; @@ -2226,14 +2229,20 @@ igb_set_status(IGBCore *core, int index, uint32_t val) static void igb_set_ctrlext(IGBCore *core, int index, uint32_t val) { - trace_e1000e_link_set_ext_params(!!(val & E1000_CTRL_EXT_ASDCHK), - !!(val & E1000_CTRL_EXT_SPD_BYPS)); - - /* TODO: PFRSTD */ + trace_igb_link_set_ext_params(!!(val & E1000_CTRL_EXT_ASDCHK), + !!(val & E1000_CTRL_EXT_SPD_BYPS), + !!(val & E1000_CTRL_EXT_PFRSTD)); /* Zero self-clearing bits */ val &= ~(E1000_CTRL_EXT_ASDCHK | E1000_CTRL_EXT_EE_RST); core->mac[CTRL_EXT] = val; + + if (core->mac[CTRL_EXT] & E1000_CTRL_EXT_PFRSTD) { + for (int vfn = 0; vfn < IGB_MAX_VF_FUNCTIONS; vfn++) { + core->mac[V2PMAILBOX0 + vfn] &= ~E1000_V2PMAILBOX_RSTI; + core->mac[V2PMAILBOX0 + vfn] |= E1000_V2PMAILBOX_RSTD; + } + } } static void diff --git a/hw/net/igb_regs.h b/hw/net/igb_regs.h index ebf3e95023..ddc0f931d6 100644 --- a/hw/net/igb_regs.h +++ b/hw/net/igb_regs.h @@ -240,6 +240,9 @@ union e1000_adv_rx_desc { /* from igb/e1000_defines.h */ +/* Physical Func Reset Done Indication */ +#define E1000_CTRL_EXT_PFRSTD 0x00004000 + #define E1000_IVAR_VALID 0x80 #define E1000_GPIE_NSICR 0x00000001 #define E1000_GPIE_MSIX_MODE 0x00000010 diff --git a/hw/net/trace-events b/hw/net/trace-events index 0092919b9b..5665cccc1f 100644 --- a/hw/net/trace-events +++ b/hw/net/trace-events @@ -280,6 +280,8 @@ igb_core_mdic_read_unhandled(uint32_t addr) "MDIC READ: PHY[%u] UNHANDLED" igb_core_mdic_write(uint32_t addr, uint32_t data) "MDIC WRITE: PHY[%u] = 0x%x" igb_core_mdic_write_unhandled(uint32_t addr) "MDIC WRITE: PHY[%u] UNHANDLED" +igb_link_set_ext_params(bool asd_check, bool speed_select_bypass, bool pfrstd) "Set extended link params: ASD check: %d, Speed select bypass: %d, PF reset done: %d" + igb_rx_desc_buff_size(uint32_t b) "buffer size: %u" igb_rx_desc_buff_write(uint64_t addr, uint16_t offset, const void* source, uint32_t len) "addr: 0x%"PRIx64", offset: %u, from: %p, length: %u" From patchwork Thu Feb 2 07:26:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13125441 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A27F7C61DA4 for ; Thu, 2 Feb 2023 07:37:24 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNU8N-0008U3-1t; Thu, 02 Feb 2023 02:35:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8G-0008SV-V2 for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:45 -0500 Received: from mail-vi1eur05on20726.outbound.protection.outlook.com ([2a01:111:f400:7d00::726] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8D-0001d4-VL for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IGYlkPneJi1hmTDPCV7cTypyWMdxHYUExnQUaqi0x3mcNa3tZMEFZIIPVM0/U1WCKYkXRf6K4YVRC6InUSM8yXcgtXiUXb0+yIUrBTKebLv0OHvYU6eT1uAWLCc2XVexLmq/EjBEkrzxdDeNkKUVx78nfLobOxmHIin6oiy3F73aUq9hQQD6vwPrOaeoaAJJ+RV+yQOoLOasWwjMBR3k/XMsKf6NPlB0qnmknOFjHUk8hh/LKE2PQYQWU40N6bYjmAFIyz45D43ODHNQTc9YT2BB3I4DTNmMVPYc5NcCMlAqJaZqRKUpCUixheAbd4GQCJA/olSeKQ79XlYOprUNnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ml7PYWUwcO9OgfgeE8wjUWxpwkyeQMPKGixdTVNt8zo=; b=LXAL9Cm0bvu901RjmkJkOzxb1lawsYRaJE5dmiS6+HTs1U/dRLsXGQc2UJcp8jvyMDgTLOU5UprHC1DYfKftPdU5cd26DBptAz6IX2V/E/XeqLAFcdo1MMln7yx642Qki616CebSvKaRhxTfSWki9x5Q0MPtInmnmiQEomM02Xq2+a0f9AiZ95pi4dUaTF2rogHX0n2Bh57SCv02Vs+X+XUyyMPfLdty/YquQAIaFbxaOipjL3H9GMIDVsiGcFhde+Ow4Ex5G3GmwAP22wQEiXdeVaD1rVfCBb2RQHzFhyjPupN3FqdYlIOgSx6SDUSpm5lS/qXfe4sbF6h/gCbFjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=est.tech; dmarc=pass action=none header.from=est.tech; dkim=pass header.d=est.tech; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=estab.onmicrosoft.com; s=selector2-estab-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ml7PYWUwcO9OgfgeE8wjUWxpwkyeQMPKGixdTVNt8zo=; b=GOAW9inGFzbTtR15Kp/JrOO4pNIsyROgD5k1fCqJ0WRjo9Mr9m0H9qjr0ZoKLvZSQnQlBAM8kUW/u2wtMM2cu+PHkoTPUKJMruB/FgRGSR3ygfN/vSAY8xdgU+6N5qKGk88FFJChPQXpNJQVOPFWJDpM5l+l1GbmuQnpI43cm4o= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=est.tech; Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) by DB4P189MB2389.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:3ff::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Thu, 2 Feb 2023 07:35:38 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420%9]) with mapi id 15.20.6064.025; Thu, 2 Feb 2023 07:35:38 +0000 From: Sriram Yagnaraman To: Cc: qemu-devel@nongnu.org, Akihiko Odaki , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , Marcel Apfelbaum , Sriram Yagnaraman Subject: [PATCH v5 3/8] igb: add ICR_RXDW Date: Thu, 2 Feb 2023 08:26:43 +0100 Message-Id: <20230202072648.4743-4-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202072648.4743-1-sriram.yagnaraman@est.tech> References: <20230202072648.4743-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0004.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:b::18) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|DB4P189MB2389:EE_ X-MS-Office365-Filtering-Correlation-Id: f434395d-d4d4-48c0-d9e4-08db04f01425 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZNmf/4+x1IWEPxMKvJPKmVJwz9TfDZ2nFyAx+ReHKw7gSuM5bQQzMy/nnGqcxzR9/ID2ip0yo4oGfqMgdY2oH871UxqVqSIrGNBryYi7hJ/cNS11rYruu2C1/+vRriN1QDZ1dUhxtJanZDZptvnqvAMZzdIeSzmE7uxfuoPIzdanGI75T+oR4Ft1H024F3o77h0cDncAUSnk7bCO8qfZuiRyYe59WfTDgwTyCT5SVHX40WNtImifV6yOXiymNO9uu3jEw3bK+Sb1BgvNNRAbQ0LttaabncoHGNFRrqRd0A6oSlcs9c1e018+RDi1By6oQUaAKERGl+qEeAucFvJBw+LhppD0tNal1FQgDKPaTNfRs3mrX9wyLy7soFKXnt3gIR6zdFB98NhkflH4zq25GTiBlrwe7/farnhWInGJNhKXPDMb3+KteMyepbvuSv86ven/ASNe/91LDqLNXQLL14TvUBie16O2dR0+c2CciMErWAIHfGpyT4wS2HABT5RaOKvyiL5ZU2oGoR+tZtbDGmvYPlZX/rl543VYVPOSy037jRutrcLamQ2EkWNV3fOj+yLoeVrwN5QGPY3kaqMeHP6XkK/CVb7FJHgTsSyn5NpGnTqMLZv8Vba6vrclLfZJg0SyhJLIAKMTFp+3H2wiAHOSHoEDcP9ooJ3fztHgxXzhE8p9eFriuK4Pzs0ARBQLEDNg0JJhdMTJX4dr7A213WtmmAtJ7hZSYOaGY8UlKo8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBP189MB1433.EURP189.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230025)(376002)(346002)(39840400004)(396003)(136003)(451199018)(109986016)(6666004)(1076003)(186003)(6506007)(6512007)(83380400001)(26005)(2616005)(38100700002)(36756003)(86362001)(8936002)(41300700001)(44832011)(5660300002)(478600001)(2906002)(6486002)(66476007)(316002)(4326008)(8676002)(66556008)(66946007)(70586007)(54906003)(266003)(37730700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uZTnVnAdKW2+tfFk1kMg+Ox1fjZEUSAe8Or9JyXtduVs3+o3T63+CzUpXvZrq0Uer7TWYT7A2MV7Vzy8poSVJeh7B/gamM7xRyebwRRO2WeZqji5o2hlPOFI4a78iJ10GGu/Ma5hZNumIA7xjfosjPf80cmIeffc4DDhYm/a0E0fMcJuN4qhGgpYz9CdgnBWZ7rDyeKQkKJ5Cpt0qEUoiCG3eMpvL2vubvJqVwM6s/sHoBrWfAUE03U0sx2d4C1oKoKFKmaF8AKZrpnuGJlKixWfD9VFFtnLvJ6HpiDuTiSTM5Ngq4xLRPGYBEimuqfPV6dY6xpqG8ULB9jeuhAELT4zW8yfazy97Dv6gt0DSz54EdkQSpEcmYvdWH6twH3e8xBAQqZ8I02o1GRZk+X/4oIlifayBQg/cM2G68ON1t56yVubD7rDk4kfOLk54cs+xqg3KQqh0Mj3XWyb9OSit0WYFoxTZKcmhKEDxiaPIcKAuPg9SdGpgtfo+2fCPlLfUHvs0ow2qJ+tjZ0tGj6nyp+t2A5H/DdEa8mZot1YQ88HmW3HmGAuiCfg8F2VWypE8pvF7aHaXDBWY4fJEHrzgTKX/RQrSAJEO3JgOaxcV/Zot1RA/+kXpjcCYbsyxmGVir4rOx8gOUIoUYokxCZ/95rmtaQ1N5ClxNWNifoz9tNkBSK8I++VPof6QZrSFiQQsfp14jrVUt3vkBaY/QWpN2zRnHl2k1fWP1iW7kDlHsnqKr5ptCS/1+yrdrZDYFA/1uZrziXQP0+8iniQy74pQHL7qiFEnIk5AZ17vXGblIUY75ZqPvdOGz6u7IeedUsPn1vksqkLS1M1zbOym5HksRLUKfvgc1GGiNZ52PxyFB8YV9NH/++Jb/QeUBD7mxNzmDMGwjQ4ZgPKJIaMoaePwdiPSVRlU6amkMdoDem0zBcq8FMeiyiRJJ6uza6HVfpIFhkFNVrntbDUhSfJiq7/7jYrQV9oOd9eHnsGg/iZ6gExtBty+wQ25Qia+m6xvJ3fsGtIWvcxDHDLejbSF+IPPhd2R72ZGqMeVZtD/p98PLrCyoDokykupQZT9xItDkxvmL71RfBdruEg/5S9jbTaEop+Bkyv9REHDEhPVrqY7fJJ6YdFd4I9YuRfxC6biSJgLazpK+u1erihQS5qoogVI3r2Yyt0Yi9YzQzdX+U8TUxyQJ07N2c/o8W52uvIZNdgBYq0MFwxhQTDPZIsYrUzD2Y2DlhzlkL6xT4GphZpsB9BOS+9ZhNYg4dSsD8ApkxxlgGoBMtCwqBJ23/Yf8En53llKp0jfaPzCaQGf3Jf/Y1ANKdPsOX8O3KO3+Be/VrzefLUhviIsHQLacrF1gq+j/yH/5u2P12hUWksPDAGpA8yvb3kq2cm1UMK8MKmcegxIw/OiWvVnGFS+YabyfW3FS6yIBh1Q4xVbAd3p9IP7uGvRC6o9aqYkbvKXHS1ARtQyjtYc/fPsJaItC+vvLXpqoPnmczQHhcDXDVRk3z5KZ013u3w8vhYYahj0BmWdvhyolSAFslx9dM+s4a94Xd4IG9piQLWAzyCUP+3lfbOapxh7Y16uZts6s1z7D8jJRNNqMZPkcLvu0FfTmOahGvLDQ== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: f434395d-d4d4-48c0-d9e4-08db04f01425 X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 07:35:38.1150 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d2585e63-66b9-44b6-a76e-4f4b217d97fd X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NwhHqDacNKDNZUQJSOMWdf+jXb1RCq6+gKSOArcR49IC/39YEDnBwzQkvPtlftf11vlUaJZxgarqfH9mgUNVJHVTJr+XJUOmlBKXgXzRibc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4P189MB2389 Received-SPF: pass client-ip=2a01:111:f400:7d00::726; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org IGB uses RXDW ICR bit to indicate that rx descriptor has been written back. This is the same as RXT0 bit in older HW. Signed-off-by: Sriram Yagnaraman --- hw/net/e1000x_regs.h | 4 ++++ hw/net/igb_core.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/net/e1000x_regs.h b/hw/net/e1000x_regs.h index fb5b861135..f509db73a7 100644 --- a/hw/net/e1000x_regs.h +++ b/hw/net/e1000x_regs.h @@ -335,6 +335,7 @@ #define E1000_ICR_RXDMT0 0x00000010 /* rx desc min. threshold (0) */ #define E1000_ICR_RXO 0x00000040 /* rx overrun */ #define E1000_ICR_RXT0 0x00000080 /* rx timer intr (ring 0) */ +#define E1000_ICR_RXDW 0x00000080 /* rx desc written back */ #define E1000_ICR_MDAC 0x00000200 /* MDIO access complete */ #define E1000_ICR_RXCFG 0x00000400 /* RX /c/ ordered set */ #define E1000_ICR_GPI_EN0 0x00000800 /* GP Int 0 */ @@ -378,6 +379,7 @@ #define E1000_ICS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ #define E1000_ICS_RXO E1000_ICR_RXO /* rx overrun */ #define E1000_ICS_RXT0 E1000_ICR_RXT0 /* rx timer intr */ +#define E1000_ICS_RXDW E1000_ICR_RXDW /* rx desc written back */ #define E1000_ICS_MDAC E1000_ICR_MDAC /* MDIO access complete */ #define E1000_ICS_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */ #define E1000_ICS_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */ @@ -407,6 +409,7 @@ #define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ #define E1000_IMS_RXO E1000_ICR_RXO /* rx overrun */ #define E1000_IMS_RXT0 E1000_ICR_RXT0 /* rx timer intr */ +#define E1000_IMS_RXDW E1000_ICR_RXDW /* rx desc written back */ #define E1000_IMS_MDAC E1000_ICR_MDAC /* MDIO access complete */ #define E1000_IMS_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */ #define E1000_IMS_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */ @@ -441,6 +444,7 @@ #define E1000_IMC_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ #define E1000_IMC_RXO E1000_ICR_RXO /* rx overrun */ #define E1000_IMC_RXT0 E1000_ICR_RXT0 /* rx timer intr */ +#define E1000_IMC_RXDW E1000_ICR_RXDW /* rx desc written back */ #define E1000_IMC_MDAC E1000_ICR_MDAC /* MDIO access complete */ #define E1000_IMC_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */ #define E1000_IMC_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */ diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index b484e6ac30..1ddf54f630 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1582,7 +1582,7 @@ igb_receive_internal(IGBCore *core, const struct iovec *iov, int iovcnt, n |= E1000_ICS_RXDMT0; } - n |= E1000_ICR_RXT0; + n |= E1000_ICR_RXDW; trace_e1000e_rx_written_to_guest(rxr.i->idx); } From patchwork Thu Feb 2 07:26:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13125444 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F374AC05027 for ; Thu, 2 Feb 2023 07:38:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNU8O-0008UH-CH; Thu, 02 Feb 2023 02:35:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8K-0008TE-UT for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:50 -0500 Received: from mail-vi1eur05on2070e.outbound.protection.outlook.com ([2a01:111:f400:7d00::70e] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8J-0001eR-4i for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UUSmtJlP3IPVR1ORJa0AWsK7aD+mnWlyz76VYz+29U0N2W5u0DZd7JJgfUcBVofnK3eLkOqT0InmfOe7bURmAdl4gMlO4tzedYZPca915JEhJMFQ4l0qP2eqyc3GC9I+MAHXR83rTix5RTC/AgaZff0au+b7LzZ7ydKdgT/yNrUOrUXSz5c4gRsfuHP1BKelGCz1YMl0G8k48o1YBnC6pMvVik6QqLL3QZZIMVSCL3C450x5K6g+1NEoqyWFi7wmHmm1rKZ1Mih/F7uu0KrgHahN8Ng++26PxKa9cdxDLxx4zr5wMLlXduphkZbVs8vVFwO1w2HDYgU3yhyl+Q4mSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TGuqrlO+Z2nsfb0B6f4bykMY9zo8Yyst8rI1UR4sd3s=; b=WTk5/jo3Y7zZEHfgTbZySFzP1lhyyXZPuQP8xfxP6m5lt3Nf4Iew/6utS15iPnTgpBvBy0ZNcX0LEfH5vtWF9d0re8gurCidPlgFDFbmup0juuuUbgl8iIM+sNlcm2aW7Ioc7zwLtOxmdMQ/mN0YzTiqB7g+PNHMaIK2AW0+kdL7HL4OLKNGePeONaA57H3FjXm3d84mFDnCudr95JAKvPQwvCuC8yphgnp3Jg1Pi3VlvhBfC4wmhSrCachXZ1SQicSftN/paapI9Jyjh14EPkFKrApYqWIUEtGXcNQN0Iq8T2wLdHCYr3u9wF1byx46OUVklVtAmNrSUWplVBgVBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=est.tech; dmarc=pass action=none header.from=est.tech; dkim=pass header.d=est.tech; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=estab.onmicrosoft.com; s=selector2-estab-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TGuqrlO+Z2nsfb0B6f4bykMY9zo8Yyst8rI1UR4sd3s=; b=jZ4OsYaaeno8z9Wg/V8j7wA3rnQQkwuI9FeGqRlcVYn9ETGBVpRDVOIS67uXzCHaA6L6DuBd7uM5aNTSlq/IGbhjAD/iv+m0h7GpaIn0HhSS/ZL90Qm2R2GuaB1R1chG2fjvy8/Aeq6DEvYUzbBVRsZKswYcs7pFDEtXpQvKHPs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=est.tech; Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) by DB4P189MB2389.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:3ff::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Thu, 2 Feb 2023 07:35:39 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420%9]) with mapi id 15.20.6064.025; Thu, 2 Feb 2023 07:35:39 +0000 From: Sriram Yagnaraman To: Cc: qemu-devel@nongnu.org, Akihiko Odaki , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , Marcel Apfelbaum , Sriram Yagnaraman Subject: [PATCH v5 4/8] igb: implement VFRE and VFTE registers Date: Thu, 2 Feb 2023 08:26:44 +0100 Message-Id: <20230202072648.4743-5-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202072648.4743-1-sriram.yagnaraman@est.tech> References: <20230202072648.4743-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0007.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:b::10) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|DB4P189MB2389:EE_ X-MS-Office365-Filtering-Correlation-Id: a069eef8-758a-445d-5ccd-08db04f0146d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8IcIBIw5ILmBOGotalJpyFhLAS6K4jBTilWVTClN1HFuDdfVysHzjnLuQq0HzoDAWADzlD/3X+CwMC0nZq6HNP6XYVvMt9asd+Pln+V1xxi4CL7SaEpAQOTzHYDehvkDFHWbwl1K7g4O2oAN4gqJ2qV8ZHb59N75oYgRvXZXRoZKDvgXEgRrhABWNjGzClTo3agGXxg/lNANZOw1bTJvfbTtkdtxnIaJFOdHVZhxg8eLnMQc517x+YOFmP+21Lc4xfa9YpGf7tKoIgBMjYH2jFLA1vtRHX4Jr2jGgWstYaTx0/4gIPN1xtT/OwcFSUtRWj++VTv1TZ5L+YPqtUAuNydeuV6/ntWVTwLfGk2wXf68XVgnP0m2VGtN04vxYrNJHaeny4POruWD+YjVcws287gd3Thr6qjKaqSHLSYGTW6b/xEs1NNly6C5aMXtuU85rnipp3DEkEEKiN0OO8g26T2W5691wMOOVCCYo2oycIEolSmjxwvm/uMJhzpahppFrkScmJvgva07I3EINpDnihzrRDWt7on+9qe/lzPx3DjQUxQpqnBZt6+VsLToYYv2SrJR9yc39dC0DWWqFgnwF6iGCShkleGs/LCt6ojKhsssLED1Utg9VwggK+52mhqBPVqy4q2tLMLKDqciCFB/pbVKm3R0BSNFc7nFERv4cJSzEw218GRqdmsu+qqcHjf/ZSdezDVBsM/Cjfj3D0pj5PvV0AIwHGyS8pOomcpm2CE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBP189MB1433.EURP189.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230025)(376002)(346002)(39840400004)(396003)(136003)(451199018)(109986016)(6666004)(1076003)(186003)(6506007)(6512007)(83380400001)(26005)(2616005)(38100700002)(36756003)(86362001)(8936002)(41300700001)(44832011)(5660300002)(478600001)(2906002)(6486002)(66476007)(316002)(4326008)(8676002)(66556008)(66946007)(70586007)(54906003)(266003)(37730700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gJf41lxSC0F+TRGsJgvRMf2xpLzvM6NmtRYoEt69Rq/yEwJzOAJDnzRnpm1x7hANw/AOv2pPSlgWaDmRytyw38SkAChWGKRS07BLks0oClQnYwBcZGzOvXsoPqNsQFJjBbv1EWSem072mb3tl69sLDD3rIZGe+Wsz7l6frHbSIt31V7jHLDmJLFAq19cUNCkaVxYug/EzxZXqDM4Zal0FViCw9TqsZ8xVGJn115wgU6zAanyWcdvK/vIwgrDl9VB+HCXDLe8eVEGmagtChPADskVp8ku5PsUSOl9pX0OCUtCEX+8E+/iXqlHOFx0DU3SHVIBP9lRMGy8aWytKKGSTbXYFrYvzbt6vW/xojkIA5m0p9P4vnl1gLhLU1uzwWkvcydILm+j3mXVq0l3LwSJOtSKArtWxFg1wKRake4UGKL97Awh3i4Eo3V2yuScev93uSIfOSfLQNfM+BUMKZ0MHzGz2m/8IBYhnmtib1TiwgCa2jDxoe6xctE9DF1g8EDknp6JzB7Tu0Ji8qgP6rYX0qwS+wb5lHlI9aRVHM2XWEUELqTk9wZAYpQeeCUJGIAZKKuq+/y90RzR7B1LebEyHOI2M7wcvICmxiYaWoscB9wNXpiXSKbF2ot3yYOgx05/bdkiroa7jBTRew3os4O78mcinPrL7mYIMtAAKNRP4/xaWgc9t5EdEEzBn3yFWuVOYfIU241wC/NEryCssIeJSTpEj7tXN3Q0De25J9UIYc4me6ja119g0ETbroTqDbIwzFKOo3t0ARcdSmMCm+eLD3q5LefaznVdI3WxquiIq7C0kv9ytBtLdRbOCPBYr8B8ZcT6QVggQm4SXOWjQbn2rfB7KbpBChWw7OpgtghZkaNSICKAvbvu2bHnfR2+Nw+zv/6rP2fg5wlw/j0CRHaLq34iknilxskQ/xoS4idM3CsfGrKFHHxkAjvlPJgOLJDy779lXWEk6lNT5EqGa9dQLEgh5uyTVnACPSFuzfJxOkxQNB0+L/iFPcXc39qx2LNVUzLuwGvrIhxnfT+4vO9dRu8tMn92oBJ3+vNajEAkEihypHyN0QfvxYKdio0kzjA0cPNHYdqBXMzwVzFe2cgVj41mf1FC30nIJadnTUiDHSjM+dCeSqjwVLEngSGAf5hFRsapwb8OPpmGMsHKSzrvfMaAdmptbtgFBa2A8fRW+U/SMhPUNqIiCZQJ4X8yutwoAhWAc7SMsdNpjws895WbYtfVSZ5C1xpi/t3SPWKC772ny5l8h4ahxgwwY/qfQVch1jVLNfB3BjzKNxVagcmpUtnw8MTmKYF3du/j2phP/D+ghbGdtbuKUSxK7NBjrMferRUE0y0xWgehjju4LV/Ygviom4yEA40mQbRaC3qkH6aaHuQt4KoqRG7e+hn6vdB3ZG72t2A90Yr0pA4Vdg1cEULV/vaKfRiJzw1HXv76o58XzvOloDvvlG7d071jXaHmu7ANDjKsGwYkymP2BJpgkJqJNOy3XNxmSxz3wi9/BA6klXEKq4KymVIg1rixWCekzTvOAOkV2xWc7EOLl2YYso8M2gUZYyFLYm9AkircG+0ShQVrGhJzBNaSChIWqt1bllNVvssIl+emzZHHIRS5og== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: a069eef8-758a-445d-5ccd-08db04f0146d X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 07:35:38.5368 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d2585e63-66b9-44b6-a76e-4f4b217d97fd X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qjKZ/xso+8EnC7ELM7GJiQFxjfxKLOcTrD41esg+SjyPZAy3Qb6Ii5x4+h11YuZ7LOCTxYk3cdEcgxa6JxGa5Ej7VCCr+H0svYaBsypjlUg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4P189MB2389 Received-SPF: pass client-ip=2a01:111:f400:7d00::70e; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Also introduce: - Checks for RXDCTL/TXDCTL queue enable bits - IGB_NUM_VM_POOLS enum (Sec 1.5: Table 1-7) Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 39 +++++++++++++++++++++++++++++++-------- hw/net/igb_core.h | 1 + hw/net/igb_regs.h | 3 +++ 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 1ddf54f630..8437cd6829 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -780,6 +780,18 @@ igb_txdesc_writeback(IGBCore *core, dma_addr_t base, return igb_tx_wb_eic(core, txi->idx); } +static inline bool +igb_tx_enabled(IGBCore *core, const E1000E_RingInfo *txi) +{ + bool vmdq = core->mac[MRQC] & 1; + uint16_t qn = txi->idx; + uint16_t pool = qn % IGB_NUM_VM_POOLS; + + return (core->mac[TCTL] & E1000_TCTL_EN) && + (!vmdq || core->mac[VFTE] & BIT(pool)) && + (core->mac[TXDCTL0 + (qn * 16)] & E1000_TXDCTL_QUEUE_ENABLE); +} + static void igb_start_xmit(IGBCore *core, const IGB_TxRing *txr) { @@ -789,8 +801,7 @@ igb_start_xmit(IGBCore *core, const IGB_TxRing *txr) const E1000E_RingInfo *txi = txr->i; uint32_t eic = 0; - /* TODO: check if the queue itself is enabled too. */ - if (!(core->mac[TCTL] & E1000_TCTL_EN)) { + if (!igb_tx_enabled(core, txi)) { trace_e1000e_tx_disabled(); return; } @@ -866,6 +877,9 @@ igb_can_receive(IGBCore *core) for (i = 0; i < IGB_NUM_QUEUES; i++) { E1000E_RxRing rxr; + if (!(core->mac[RXDCTL0 + (i * 16)] & E1000_RXDCTL_QUEUE_ENABLE)) { + continue; + } igb_rx_ring_init(core, &rxr, i); if (igb_ring_enabled(core, rxr.i) && igb_has_rxbufs(core, rxr.i, 1)) { @@ -932,7 +946,7 @@ static uint16_t igb_receive_assign(IGBCore *core, const struct eth_header *ehdr, if (core->mac[MRQC] & 1) { if (is_broadcast_ether_addr(ehdr->h_dest)) { - for (i = 0; i < 8; i++) { + for (i = 0; i < IGB_NUM_VM_POOLS; i++) { if (core->mac[VMOLR0 + i] & E1000_VMOLR_BAM) { queues |= BIT(i); } @@ -966,7 +980,7 @@ static uint16_t igb_receive_assign(IGBCore *core, const struct eth_header *ehdr, f = ta_shift[(rctl >> E1000_RCTL_MO_SHIFT) & 3]; f = (((ehdr->h_dest[5] << 8) | ehdr->h_dest[4]) >> f) & 0xfff; if (macp[f >> 5] & (1 << (f & 0x1f))) { - for (i = 0; i < 8; i++) { + for (i = 0; i < IGB_NUM_VM_POOLS; i++) { if (core->mac[VMOLR0 + i] & E1000_VMOLR_ROMPE) { queues |= BIT(i); } @@ -989,7 +1003,7 @@ static uint16_t igb_receive_assign(IGBCore *core, const struct eth_header *ehdr, } } } else { - for (i = 0; i < 8; i++) { + for (i = 0; i < IGB_NUM_VM_POOLS; i++) { if (core->mac[VMOLR0 + i] & E1000_VMOLR_AUPE) { mask |= BIT(i); } @@ -1005,6 +1019,7 @@ static uint16_t igb_receive_assign(IGBCore *core, const struct eth_header *ehdr, queues = BIT(def_pl >> E1000_VT_CTL_DEFAULT_POOL_SHIFT); } + queues &= core->mac[VFRE]; igb_rss_parse_packet(core, core->rx_pkt, external_tx != NULL, rss_info); if (rss_info->queue & 1) { queues <<= 8; @@ -1562,12 +1577,12 @@ igb_receive_internal(IGBCore *core, const struct iovec *iov, int iovcnt, igb_rx_fix_l4_csum(core, core->rx_pkt); for (i = 0; i < IGB_NUM_QUEUES; i++) { - if (!(queues & BIT(i))) { + if (!(queues & BIT(i)) || + !(core->mac[RXDCTL0 + (i * 16)] & E1000_RXDCTL_QUEUE_ENABLE)) { continue; } igb_rx_ring_init(core, &rxr, i); - if (!igb_has_rxbufs(core, rxr.i, total_size)) { n |= E1000_ICS_RXO; trace_e1000e_rx_not_written_to_guest(rxr.i->idx); @@ -1966,9 +1981,16 @@ static void igb_set_vfmailbox(IGBCore *core, int index, uint32_t val) static void igb_vf_reset(IGBCore *core, uint16_t vfn) { + uint16_t qn0 = vfn; + uint16_t qn1 = vfn + IGB_NUM_VM_POOLS; + /* disable Rx and Tx for the VF*/ - core->mac[VFTE] &= ~BIT(vfn); + core->mac[RXDCTL0 + (qn0 * 16)] &= ~E1000_RXDCTL_QUEUE_ENABLE; + core->mac[RXDCTL0 + (qn1 * 16)] &= ~E1000_RXDCTL_QUEUE_ENABLE; + core->mac[TXDCTL0 + (qn0 * 16)] &= ~E1000_TXDCTL_QUEUE_ENABLE; + core->mac[TXDCTL0 + (qn1 * 16)] &= ~E1000_TXDCTL_QUEUE_ENABLE; core->mac[VFRE] &= ~BIT(vfn); + core->mac[VFTE] &= ~BIT(vfn); /* indicate VF reset to PF */ core->mac[VFLRE] |= BIT(vfn); /* VFLRE and mailbox use the same interrupt cause */ @@ -3874,6 +3896,7 @@ igb_phy_reg_init[] = { static const uint32_t igb_mac_reg_init[] = { [LEDCTL] = 2 | (3 << 8) | BIT(15) | (6 << 16) | (7 << 24), [EEMNGCTL] = BIT(31), + [TXDCTL0] = E1000_TXDCTL_QUEUE_ENABLE, [RXDCTL0] = E1000_RXDCTL_QUEUE_ENABLE | (1 << 16), [RXDCTL1] = 1 << 16, [RXDCTL2] = 1 << 16, diff --git a/hw/net/igb_core.h b/hw/net/igb_core.h index cc3b4d1f2b..9938922598 100644 --- a/hw/net/igb_core.h +++ b/hw/net/igb_core.h @@ -47,6 +47,7 @@ #define IGB_MSIX_VEC_NUM (10) #define IGBVF_MSIX_VEC_NUM (3) #define IGB_NUM_QUEUES (16) +#define IGB_NUM_VM_POOLS (8) typedef struct IGBCore IGBCore; diff --git a/hw/net/igb_regs.h b/hw/net/igb_regs.h index ddc0f931d6..4d98079906 100644 --- a/hw/net/igb_regs.h +++ b/hw/net/igb_regs.h @@ -160,6 +160,9 @@ union e1000_adv_rx_desc { #define E1000_MRQC_RSS_FIELD_IPV6_UDP 0x00800000 #define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX 0x01000000 +/* Additional Transmit Descriptor Control definitions */ +#define E1000_TXDCTL_QUEUE_ENABLE 0x02000000 /* Enable specific Tx Queue */ + /* Additional Receive Descriptor Control definitions */ #define E1000_RXDCTL_QUEUE_ENABLE 0x02000000 /* Enable specific Rx Queue */ From patchwork Thu Feb 2 07:26:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13125436 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 40DBCC636D4 for ; Thu, 2 Feb 2023 07:36:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNU8Q-0008Vo-DI; Thu, 02 Feb 2023 02:35:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8J-0008St-OJ for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:48 -0500 Received: from mail-vi1eur05on20726.outbound.protection.outlook.com ([2a01:111:f400:7d00::726] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8H-0001d4-AF for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:47 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KOeMm/MfJuTuhkPNv2l4LTx1z4KLHJm7W+JvPJqi85WkOIVjN1FvV+xx2OPBtG7T+ItdC5/Ux/1e9qfNDx6Sblud1543lXwZp7QD7RMK3QIu5GuKqXNfXcPrh2U7DZ8yuUrzQ2ZUpvLV5UdcXakptALN0lx8/OGAlN2lVidYO2dk4SlyRcbRjR2/lKNP3fzCsIX07sjlg975cqgEJ2yAyJNDVrP3VR7tMWpOfHwT3QnPcg7rB83IfW7Sa9nLMV5fvPKiuXU9gSyQADCvg6jVmDNamCSnk8Pw2eU48Lef0fUDIb2zk3FkcM2paeyuptcCCvIt7rhvEfcPx6wHR9FYjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jx7ey18JLMTQwWlpCVOL51FSmm5a1QE8LMJ2Xw/B4As=; b=M+AaAHEh2wVgui+s5qVtIz+YNrokctlNwamhwmW3CsFrwhWHc+AcKWV/nzBB0iJNOy5JR4cSU6PTzHgTBMiw8JkxVrGfD6exihME1vtuz5v6G6VEXgMsvoX74Ao0xiYqEYXqHAD0P6mnkpXyLTCg/LRdUVz4dhsDQ5l1LEWkLe/JHGryaekhFGQaRU1fYJhNfJgT7/+s5sVXXXkDocpMycQsDfrmwyZ+bfy99opEZgxQnkECWJTcYPLB+J4aI3BDKbMqtpCeEyHCGE/MLz+nceXkVhiBwoJDq8duSmYqY9bo/0JlTXFzHJg3cbDedTBfJA8p92XAPPNP8r2NOAxd8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=est.tech; dmarc=pass action=none header.from=est.tech; dkim=pass header.d=est.tech; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=estab.onmicrosoft.com; s=selector2-estab-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jx7ey18JLMTQwWlpCVOL51FSmm5a1QE8LMJ2Xw/B4As=; b=At7fufKijq0MCHJEZHsiPVLD6+bKpHYrGe+J73AJpf14aPKGAmwgtWzSQQytoGVERq7ACx9DWqsz/zQedcM2mRfrzm8E1DqMZAQeJg9cxVY4bqfMajV0oQ3+vRU6jfn91SWMMN1qzaF3KznBGQd5VK7ehQk3+j879dIVmZDecMA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=est.tech; Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) by DB4P189MB2389.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:3ff::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Thu, 2 Feb 2023 07:35:39 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420%9]) with mapi id 15.20.6064.025; Thu, 2 Feb 2023 07:35:39 +0000 From: Sriram Yagnaraman To: Cc: qemu-devel@nongnu.org, Akihiko Odaki , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , Marcel Apfelbaum , Sriram Yagnaraman Subject: [PATCH v5 5/8] igb: check oversized packets for VMDq Date: Thu, 2 Feb 2023 08:26:45 +0100 Message-Id: <20230202072648.4743-6-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202072648.4743-1-sriram.yagnaraman@est.tech> References: <20230202072648.4743-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0018.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:b::33) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|DB4P189MB2389:EE_ X-MS-Office365-Filtering-Correlation-Id: 00fc22a3-b21e-4656-71a4-08db04f01461 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T2PhHTM5COUbn7rUuUmzszOX9zomPG2+OCr796ZRP79L8SsoUDDvNFJJ5zzVTYBesKet3ti4IorwLtkdls6O5FPtvolIXsv7OSj6YUnVpexUBYuwsJODXe1YRQVLaiRecuHYq1+rIpx1KktVY9mUz8s9TnefoLpgvlxWIkCU8L5dNANGxKCL6dvJScymmHyEpKcXHvLyGg5Y3NMlL7wsJcQJb81fxklvhZLVmFfPfud8EZetYyZ1h8OlyA1Um5vm0iw3ue1KlWpqqzpuprhSEIMPtByLxsf9ysY/kj+Ig5rHEWGsXKFLS5J7mAA7ETPwZvWOEi4JhAchYSx6Hked1s2fYtei0udc3N3Ucr3SZ0zuZKlFFrSOiSHbyLPI5MHwAYGZOE6C+IzmUycsiEo36qiXBJzp3uFCxP2RNKNrVAuYVOKPSaFqGKJvLeDuXhzGS98D0PG/hxbn40FZI7CAIK+TUQtL7tvhP/GxgmMtFVbpfzHi4aww5xbOmMGrmj1l3xWDHcp/M1MxX23jniQgoIsOcyV0GxoXeJhkIg4EognG/xaeLl4Ft2iCXMGNbXFPqvG5DRwdlxBNHbiuehwuY7VrxTWRSumS9hUvmGF/9jCKrtBta4BQxguH2mZwymlAsuOYYG1fzLlVQjfSr+noVd+55gMCt9x+iLps5GW1+ngu6/lW3SZyAHZ3cJpuFQJYwu5HlFx3kgG3kXnIqsDxN4o4Nf5GGR+/BaRhwy2v0i0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBP189MB1433.EURP189.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230025)(376002)(346002)(39840400004)(396003)(136003)(451199018)(109986016)(6666004)(1076003)(186003)(6506007)(6512007)(83380400001)(26005)(2616005)(38100700002)(36756003)(86362001)(8936002)(41300700001)(44832011)(5660300002)(478600001)(2906002)(6486002)(66476007)(316002)(4326008)(8676002)(66556008)(66946007)(70586007)(54906003)(266003)(37730700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mf3mq6/h+lz1uzILU0R2DDZ1cvUuQtncy0evicVIVnrmUSHFPbBiFG8N4ynmYPBKBOwEnktb3zedc3jYo3ZLN3y+SCMM5HQfVlRplPq5zxxOy6nZAgevY9TLZ/5N/WklGta+tm1fxvvj/9dAsf4QjA+d4tClS5VUuzHTijM3cQ4UhcsEBMp8pTj1qPvVYS+J+4CU5BkKgVdLmIiQhAC3VkVeS4kujjjgMk+9mRHwYfHHH8/nyHpL0YLyCq7Goy2wbnORrRTvi1vt5pMqdLyoa2a8+0nUm8vooJ2mbgY3Hy1nkfpv0OEa3q/sKmSR0aQGAlyAuRq1JGbanbTXI7MG94toalU+X9dkeLWgqQGqfHA5W8OYmq5gJZly8o17SEJCC2oSqYgZtc7deuVfPG5xirm/3WLA17j8HBKfyX8DvpPoWcD00qVEVWt7y5MvS1F2rZSZYdFb2VUxSxAlkAxI5NAOjFEyQGsX2NAkAYus9OHoQMIU6rCZNfMUR6Qt5E146e/7+H6n66gewXa6RG2qAi7cf523a5XoT3w/zoxOdNqZwc4jWaGtCSVWkGWkiLEkBN/kIuDG/JrLg2hOZndC72T0uHxc69QUf4XxZi193pkY5UY6e1JnEuMEWK7CoiQ+T2rzBtdU0Z6nBE/JUKHWBdTJ/zUA3TnUHv5QAnLnAUyTNTxgNjHxslZY//Ev86bfLCxthrDtn1gJnQ/Ln8tLU4hTloqPowZWwBCHMV7t5t+7q0GHybXIrBGXPs6KQdUkuFBpa2lHi8RhpHJRHRrZvqn4+LVLeiypPyqlNOZz2hN1xXvuhMhSbnd0RSEng2CywGMLOb6mIIl4Cqdxlw35EpV+3urSD1Jo99blW3C8zF3mWGa2ASwdjssCMEa9zLWX7USo+rnL/bmhpxMqSRGptmfxVz67iq24QL/m+WL7hgYiCwxloazBRiIC5FCDWHztNX4512fNXEMaqUtXDJJILYbjl8qIO+fPZDG57vHPW4wyApQivY/IIrOXEcEEcEPcVK/Gr362T+pS9cL87BW0RZOASRAY/gHgThS0AOiJeNvEN7iDSPQnOrkDpWTPieXt3mxUlOPw4g6BQ7mgYTusjkX+SFHStmlby9sh401vr+qhMUyMbOlcF0E6ZZ9VLcdA0K8HRGcxCJmzyoZzJaclhUojDEHHE/TCMCK/mojJua59fKCglI0w36PZn/j3ZPfL1Vy9d3QuSNwBnQc4ADiFea7lNTXh2NotgLDN2OagRumnIPlvfWMT9Vlh1aQLHFCI4cLzKBaXrBp8nE6tJOpjnoTZFZ9au2JVbLaLyQFuH39P8WGVMqEMCUMS/FkGyrTDqVax5sAwjTVDQDXWRFlFxyoCwEc2NISkDFB8ObPs6Cvrh6OisKMx85RbJVd8DFAc6qiHnyuqQ2rk1+emtFzD0YVv2Xadu9vX6jNjqRA73GCvw9VIc8gu5FdPlL4OpXAXC1u48z+iFAMVevusKXtKOY0GILRsfFLXhywV5QCm2E45go92uxGUyZ6tQmELS/TufuoQbn9FkG6vh8Gy8gCKTVy2StARRiM2s1hCxtqulZmbWXq61jJkBSB1UUtCOGT+ul6icRFA+HQeCmG7t474OQ== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: 00fc22a3-b21e-4656-71a4-08db04f01461 X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 07:35:38.4743 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d2585e63-66b9-44b6-a76e-4f4b217d97fd X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: phe6qIb64rC6w9EgG8IvIf7m9bDkx2VTgZ7yD5BCgwfVTBHk5qlNHnoLx+OKiY9CGB2/0OXD8GV9mFN8LoU+Kt9UD0UJDSrHg2TPoZmR760= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4P189MB2389 Received-SPF: pass client-ip=2a01:111:f400:7d00::726; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 8437cd6829..eab140070b 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -915,12 +915,26 @@ igb_rx_l4_cso_enabled(IGBCore *core) return !!(core->mac[RXCSUM] & E1000_RXCSUM_TUOFLD); } +static bool +igb_rx_is_oversized(IGBCore *core, uint16_t qn, size_t size) +{ + uint16_t pool = qn % IGB_NUM_VM_POOLS; + bool lpe = !!(core->mac[VMOLR0 + pool] & E1000_VMOLR_LPE); + int max_ethernet_lpe_size = + core->mac[VMOLR0 + pool] & E1000_VMOLR_RLPML_MASK; + int max_ethernet_vlan_size = 1522; + + return size > (lpe ? max_ethernet_lpe_size : max_ethernet_vlan_size); +} + static uint16_t igb_receive_assign(IGBCore *core, const struct eth_header *ehdr, - E1000E_RSSInfo *rss_info, bool *external_tx) + size_t size, E1000E_RSSInfo *rss_info, + bool *external_tx) { static const int ta_shift[] = { 4, 3, 2, 0 }; uint32_t f, ra[2], *macp, rctl = core->mac[RCTL]; uint16_t queues = 0; + uint16_t oversized = 0; uint16_t vid = lduw_be_p(&PKT_GET_VLAN_HDR(ehdr)->h_tci) & VLAN_VID_MASK; bool accepted = false; int i; @@ -1020,9 +1034,26 @@ static uint16_t igb_receive_assign(IGBCore *core, const struct eth_header *ehdr, } queues &= core->mac[VFRE]; - igb_rss_parse_packet(core, core->rx_pkt, external_tx != NULL, rss_info); - if (rss_info->queue & 1) { - queues <<= 8; + if (queues) { + for (i = 0; i < IGB_NUM_VM_POOLS; i++) { + if ((queues & BIT(i)) && igb_rx_is_oversized(core, i, size)) { + oversized |= BIT(i); + } + } + /* 8.19.37 increment ROC if packet is oversized for all queues */ + if (oversized == queues) { + trace_e1000x_rx_oversized(size); + e1000x_inc_reg_if_not_full(core->mac, ROC); + } + queues &= ~oversized; + } + + if (queues) { + igb_rss_parse_packet(core, core->rx_pkt, + external_tx != NULL, rss_info); + if (rss_info->queue & 1) { + queues <<= 8; + } } } else { switch (net_rx_pkt_get_packet_type(core->rx_pkt)) { @@ -1565,7 +1596,7 @@ igb_receive_internal(IGBCore *core, const struct iovec *iov, int iovcnt, e1000x_vlan_enabled(core->mac), core->mac[VET] & 0xffff); - queues = igb_receive_assign(core, ehdr, &rss_info, external_tx); + queues = igb_receive_assign(core, ehdr, size, &rss_info, external_tx); if (!queues) { trace_e1000e_rx_flt_dropped(); return orig_size; From patchwork Thu Feb 2 07:26:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13125443 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 58323C05027 for ; Thu, 2 Feb 2023 07:37:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNU8R-0008W4-29; Thu, 02 Feb 2023 02:35:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8N-0008U4-G8 for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:51 -0500 Received: from mail-vi1eur05on2070e.outbound.protection.outlook.com ([2a01:111:f400:7d00::70e] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8L-0001eR-9U for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:51 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cVplFpbVBZ5qBQtEabHHPqpVOzv6OkEd30cJUlX0iSzhHD7UKQIJlAO+RvSjtT5lTjiMW6Nd8FfIkowi6mmqzsbycKYC/H5AveJ+xn51gr1ESO+vZxwF0duOPfLxtNlgLQfcIPQ3XQGu5fiZCsHrrX70nPDLqNpGZgGBSjwtHGpJkrr8/YcO6NpKvJaC8sHRk7l1hM/rssdrXYVfQuIRkScCl9017QM3TEuQP2r1c0ID1F3HodZ+lpey2H22LB3TMrmigt5B9EDE9k7zWiFVYWh3pt2Lbf8wtghWQPUH1toUoJMIRH9hryfC848bDCXI/Gso3I2VMMayR8KKOhek/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UN2dmeYD6myOaEsjsEBoj94RLVb9kiG9UatzaSQqjJI=; b=UvzOFPLYUNZZ5yj2mHNt35osLONTJKc2YaI/FN7jljRj7OHpR0wtY1hfaSKp06NWQKMcDuOP3g9vl8s5ysD5emjK+WboTaYIInm3pFaqeRqoW9eLVDTh9HUqyWaNV7IWz+OSLkDYfX09JyBHNSgCX9dL7awnZMlgMwQZJ8/IJUCDDqPzLUw2xsXTDW+kEf6ZqhmgeQHjb30PN/RD+te62iM9qyymbqaccqGEm/AtVQh3k3eaPD3OlAMzQ7c4qbTTQkmmcgw/vy63rWJd5nwOp1ZYF50jGwOmSBtFm+ZDfAhY1sqnrz4YKLfCAlCI+UPmR27xCvjuEaTUqHbH2hm22A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=est.tech; dmarc=pass action=none header.from=est.tech; dkim=pass header.d=est.tech; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=estab.onmicrosoft.com; s=selector2-estab-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UN2dmeYD6myOaEsjsEBoj94RLVb9kiG9UatzaSQqjJI=; b=U6LQ/EBgX5Zdl227lPA3XZ90q25ZPtAF7gJY88uk6YQY3lbgjL/tDd5o4b5NbXHLA2K16k9AJmhac07IvimJassZQh1cdUsP9j3qMDV2s+XjfuRbUcg9UxqE9NZA9zy75a0iMi+jr96ihbHHuA6S9InEaiHOdP5eU9QnBZKxdB8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=est.tech; Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) by DB4P189MB2389.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:3ff::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Thu, 2 Feb 2023 07:35:39 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420%9]) with mapi id 15.20.6064.025; Thu, 2 Feb 2023 07:35:39 +0000 From: Sriram Yagnaraman To: Cc: qemu-devel@nongnu.org, Akihiko Odaki , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , Marcel Apfelbaum , Sriram Yagnaraman Subject: [PATCH v5 6/8] igb: respect E1000_VMOLR_RSSE Date: Thu, 2 Feb 2023 08:26:46 +0100 Message-Id: <20230202072648.4743-7-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202072648.4743-1-sriram.yagnaraman@est.tech> References: <20230202072648.4743-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0011.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:b::7) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|DB4P189MB2389:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f99e164-31a4-45b7-3018-08db04f014a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GPK5UlmrZnnegUWv8SunEVlihCNH+fIsunqiUqlyndvxSZ2a9os2yaowaLLEBehE4w3na5lD9jJdd3jW8axx1WPIbLgFvk5WjbuqLpDOiYaIyOTysO2sU46LifWJQVW+MwV3ByK3zvKUMPyRUZvxJOdD1ZYPEJJpf/JEhbS/RhdO/OPeX9rgbokVaCHSgeZPHk+yqk0UBqMutbK6ObLeVNSInaMqN1BQBozeo9mQ8NsG5bmUW/8H+gCJM7L+kYnw8tDvKP1tmcHjmMNQlxvoNXpGsNDp29niujPDqt98iHhcgTo5XEMjiOamAhOpqNuHR2VPdkaki7Sh7NbNVQVC0Gc3UFzHkodzZkIHZARlPW/Wr6ZbtYLLeEBsWzCihIb+jgMKbQWb9dRUFN5bJrz6DfsvnHkRlqh2LO/qVxqp5DrX1iANMjlOAHkM2/BFxWIHSwLwF/Z6SPHLsLwCTtCrBj6z1dfRO4GrEVZgAibnQvcqy05dMPpQKmqwRroPLCIqjz4+7Sk2VPVJwWq6aYXKhlWIWh0AGw/uNDlU89vEJiRrveowpKEJreoCYGWAh5kVSGKbSdvZa8Tthkur2uWFYn0fgreHh34ZrS1ycfcpEtDRc4OsUFuYWbx2wiZWlQ8owCQM1ptMDmlENQFNxBv+jWktjbo0fqf1AdfU8h1lHHma7/Bl0cLwYoRwQKdP6IqcOKpM4QKKIMMRH/EVK+IqJsJEROgdqbOquXq9FmguqzQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBP189MB1433.EURP189.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230025)(376002)(346002)(39840400004)(396003)(136003)(451199018)(109986016)(6666004)(1076003)(186003)(6506007)(6512007)(83380400001)(26005)(2616005)(38100700002)(36756003)(86362001)(8936002)(41300700001)(44832011)(5660300002)(4744005)(478600001)(2906002)(6486002)(66476007)(316002)(4326008)(8676002)(66556008)(66946007)(70586007)(54906003)(266003)(37730700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7SzRCA4nGGPjYSs2YNXqG9Luf4cGehSgYaExxnq5/JKacCUCujI1WMpZJBVfF2U3xA3d2MapUFbu3HE+Hsan5yz9E7U1cbCW/UripGkWnXFkTMig4/sAN9W4ZFVc3ogUP9tKdHpQIBPvOw51/XlTC1JXClqqChVkoDyrvikB6uPrSxI7raeUZsFwECYwfMQnfdA9sCq/N0vn/p1YzKk3DJmvuI4sr7IRUqFJt6FnfiafGTIKvj3W853Vu4dWaXrKFziih4FrUI3/qdwwOraB4Wh5apENgPFd9OCmCkKXsR0Igxlx5wOWZ5dXaUBybCmWkq/pg4UZSjMLVyRd5BjwyCvbbPNNVaJehz853XPx7vIjYWiKhC/hyDzHL37I866Fd5B1vdNMozjthngH9c5efCDmXRSISPisNL6/sCGv3Csy2qW0Af9ptzOv0gu1FiZPoWJFSpJCZvoEe4j7OOV9qgn0WM/42g3xMNaqQJRIRL0VYiwaRCENa8vEBQKpeA4an6g1dTFwQt8J7pVDixbpHVEjTXmKPh4hsuGVht3Vr+rO59RvCO2pHbI/udL7v/u8uG1U32tbc1UJxuwohl5ZT9DsP5QAbVWJ85Y7BdeZ5N4bCbr6rfgEcgemsPK9tVYr7pRFFSfWy9a7gcwqw0CuwAyoWjLXGc5A6Bjp0ZwMoOhQtjEK8mZdFHMteNQeEnccn5prAjgnIFjWEx3mFbfptce75sxKCOn5gcEOruRK6obsH+3wnfA22RKYErYKNS2j2TzoVlAIHCBOPjz992s2bY9ao01+AvKWmCwqrbehdYNIsU/1QNtQV9cv9biKaj8A3PKYLEVcu2b6ctaRLCfxDIq4HCeRHEZzQ6cGfVRDaXxbpfDfo+wIRGTX+vloEky7YdZry+CPVxmPUNHAZeRW8HtLJeoiJW3oqwCP9/+JTkRJU/1mgMezdjX1qwuhe95VVrXRgoGjyyl0BhMpW4pezIPBYjta0VSqjH59VfbYcM48UyTQL4+ANOWPyAitBlIe3fkqA2ALBjFdDQ0NhBFqCWs+WQ1iHac4RIvwCenn4tH5fPkPAIliOxZW1A6LQpKHBsfRDUU4vx1UJZGdU82mwQ0B5KFYh2F950Hzqt9bbD/fnXD+c6M0qaFUIlWU+jtxMTknOPQNtK+3u0ZGVXoBcCdFRGsY2K0vs47b1NSda98af8kbqcqeU+T881VTtQoM7LtHqWour92rM0RYmxV8480jXWXz+Mg48dU2HS+Ni12N3XtrRTJW0pRm08jfBJDw0ak/Zq0LDthbZiUYFqq6FMPsZMU7JbUFdXWfAixR+JIIqPUB60SiAXqH2RErQifYaVHu8fIR2eDf53LNDBWGuNK0MLe2DnN4QcUyfb6KW7bE4vHCrXUnEmc+AqgRTfI+5pcD+kGwsYd6F2EDFfJBhIZSC9TDRPFavbCBRZUj7UQ39jGWul0KKDYuuEgAe+lTDhsQhVkszzuG2HEaiawmqzAhiadWJvp9D6oPrJROUT0Hi+21Dv+MWZfQv9I8gBxv9tPKJVm/RzRxxGR2QVEQykgNGfAaqg5DdNfdb2d2CpuBLEiR1IuDQHnb7JLXkhls4rEk3m7KsbY/VhLna5/dCw== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: 5f99e164-31a4-45b7-3018-08db04f014a4 X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 07:35:38.9742 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d2585e63-66b9-44b6-a76e-4f4b217d97fd X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3O3nj+ZbX7NJ9x780HVMUS5zOUa6thoCkYQv7TamtrKMejCRrhRTVBLVrif7CK2p0LTngWVmyuTV0jei701K9l0H8YkPRHnIfVOII25Xf6k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4P189MB2389 Received-SPF: pass client-ip=2a01:111:f400:7d00::70e; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org RSS for VFs is only enabled if VMOLR[n].RSSE is set. Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index eab140070b..9bedaa1e5f 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1051,8 +1051,15 @@ static uint16_t igb_receive_assign(IGBCore *core, const struct eth_header *ehdr, if (queues) { igb_rss_parse_packet(core, core->rx_pkt, external_tx != NULL, rss_info); + /* Sec 8.26.1: PQn = VFn + VQn*8 */ if (rss_info->queue & 1) { - queues <<= 8; + for (i = 0; i < IGB_NUM_VM_POOLS; i++) { + if ((queues & BIT(i)) && + (core->mac[VMOLR0 + i] & E1000_VMOLR_RSSE)) { + queues |= BIT(i + IGB_NUM_VM_POOLS); + queues &= ~BIT(i); + } + } } } } else { From patchwork Thu Feb 2 07:26:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13125439 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AFE98C05027 for ; Thu, 2 Feb 2023 07:37:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNU8N-0008UC-Pg; Thu, 02 Feb 2023 02:35:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8M-0008TJ-BD for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:50 -0500 Received: from mail-vi1eur05on20726.outbound.protection.outlook.com ([2a01:111:f400:7d00::726] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8K-0001d4-I0 for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BVL7CaXmNByLP5eW7IN8OKvA6b+swro206GXQk0GmHWFKY/jjnv1vQmDC62bAOKlWLhBZsTeA+GGfzxZDHevyPXI5TnO6zI0NlcixdvoSVmWaNK3kcKkyGfH10VfigJ4CpWSe7eFuPPXGlJ6+yHCFCx2rlXuTbt16egBQSXqExQ/DRPFfDy1fyNk38XquGBkI7EMbipAXrroBUPwcuWnkv4ZNvavUb7Fu1Kn/d72/UphlJq8AzHCPIGTxDIiii5vjfON8rx4t/bLJwCN7e0Re35piPY5657oCOGGjBWbAsOFIvGjDSE4OG2K2bDGiBDkAP/ZomghRUCED0FTp2Qcsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dubGTxz3D+Vb1lxN/2AFF00SeMK2xSB8M4VgYsRnquM=; b=GnxhHoSmbwVMrJvna8PvGVpEisNrDAXoViXZtrYANHQLh9RDprwSmwC9Ulu+9eVK91B3z/uvXPjHi4VSrxJdns53DKy+TjxQHVqWxL2H3Kf90rh5wpcLpIdtcjzAULY1FVXqYi2m3WrN/cvkuByjiBPjF3vqlDZibV8CuOoy4WubCcmFgnrMUOZK9RF2hBDuEPDJScZJqmHf7xK/wOyMsINNv0rXEOCLJyLydqSDoRG8OuqFg/BRD4qar2OiAkKGU+tKxv4CwVftkeBoMP20lwRGp6TZyGOt9+HmZ256f48nrV8z52j4PKWB8POPZP68Ip5YvrZouVzsSdH61SuuPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=est.tech; dmarc=pass action=none header.from=est.tech; dkim=pass header.d=est.tech; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=estab.onmicrosoft.com; s=selector2-estab-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dubGTxz3D+Vb1lxN/2AFF00SeMK2xSB8M4VgYsRnquM=; b=Qj4tKZjFTZd3UlGsYDDdBzsgbpDoJyA7uc8MRwpZ9/jn1Tqrrc4gbzLjp3/Jj647dU+L7dWH0i+biVBHoFw6HKrP5805zLSSmBVh/oifAtK+ZyKU5lVCIuA5JwFPaCEx4f8o1rMl+ySKvV1RDPbCQqTynLOoa71a1S0r53HaBbs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=est.tech; Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) by DB4P189MB2389.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:3ff::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Thu, 2 Feb 2023 07:35:39 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420%9]) with mapi id 15.20.6064.025; Thu, 2 Feb 2023 07:35:39 +0000 From: Sriram Yagnaraman To: Cc: qemu-devel@nongnu.org, Akihiko Odaki , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , Marcel Apfelbaum , Sriram Yagnaraman Subject: [PATCH v5 7/8] igb: implement VF Tx and Rx stats Date: Thu, 2 Feb 2023 08:26:47 +0100 Message-Id: <20230202072648.4743-8-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202072648.4743-1-sriram.yagnaraman@est.tech> References: <20230202072648.4743-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0007.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:b::10) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|DB4P189MB2389:EE_ X-MS-Office365-Filtering-Correlation-Id: 116dc594-9505-49b7-3018-08db04f014a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MVqZ02hyLRrENQa6Eyo0/qh0I/5Mpah1/+kJgZ9R+9rMAUw8F9NYT2c4Uzz+QnNIsR462F3MA0850RTk4MSHD/hQZnF/khsMDo/YP2ZbTMvuSaXdSfYt3TgNwOsEn4c5HzQXDV8emckusETYXrjbdTXAc6+wANOaUjKFnFPB8t4vhWZFyvkdVxUdupKRppLztoV9NahehqIHj4Vrz3e+8AIIL4mxv0eKDg8mXv0c3v9TAmUFuiwEAfJM6Od7m+yob4OIXKlLiwRCMQUjjn71j5yFNI/eAxlsFjg/4bfzcc+aEyrRO0EJJ5ogfGWN/TMkk1YTf8ZVliFeGBf0qsG7PSCsWvIZDR6P0D6FGvDUzygoTxMS6p9lgPRJcL4hX5/QVJPOaVctFhB9iNRzsE0q1UajeMBrhvQ1pD7+JX4ZM+SfgSTikvZBctfc7lEoeOwizEKaMIUmUyianqW43gfKQ7lzA5rwvcwLw+FllXGKUd0WPkfECPjLTKchovGdwNkiMUKWxFnF5a4Jq6mrvHWUr4+vdNNwWyvbiQ7yZIPxFmJgH+OA8PQnFCzLRTI8EMa3o90Tas4J2ZNi5SR9i7bgT55Oba6molCEwh/XgH24uqbCW1SeioJodH1+ho4GA1KJ7n0Rbb3sUTElYhUb/4Q3Bwop/yHQdG0HnBNSHBoh0rvRRq/OqBRbT48nD22dgAIU+AD1pMBuwEGNsozT+Vs66XdnmpCNLaDmRYX5Sud/PYM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBP189MB1433.EURP189.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230025)(376002)(346002)(39840400004)(396003)(136003)(451199018)(109986016)(6666004)(1076003)(186003)(6506007)(6512007)(83380400001)(26005)(2616005)(38100700002)(36756003)(86362001)(8936002)(41300700001)(44832011)(5660300002)(478600001)(2906002)(6486002)(66476007)(316002)(4326008)(8676002)(66556008)(66946007)(70586007)(54906003)(266003)(37730700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: J5C5WAJX2rRGrSKKh4rqxVX+6aYlZ1cCP05CgVkYsFBh0o/3cK7Dsrvp9W4ESufTsrtS9Q6GC8eRWTjLlHkrYLSC5OHgEz2eGNUj6b+U1cit+pN8S0OVBmQPIvbnEb5O4FxELkDCryDybPkneAB2ln1BfW4j99TiLd9gkYi+C1yWfTZ4mhXONyRSlT/rr/T1Yunx8b8EaY1XnT99lt128pCvd1XDv9WFgqkaYMXomM7OiscMNJDAteO06tX5S7chLylnSq5q4JjEyIUYliHKCTh3rcaiovYD8wpFSAgUw+ItSWCMdzYBMY6tuIqWE2t9siqMy3r/G9DnPiH1DNu2PPNMseW5K49joRsb7zXhVT/0plyVQ4oaQUgofo1HHc4h/Hvry0tDpw6UOqQ7Uj+5YE5cRX6W3DMojuz3vHBx/0bdIHx+zplTix5OV4C+97Up1wvImKNPvA0pH/l8CbDucoO644RxK9QI03SVvvFlzjxZasT2Xw8gcXrEbG4Lg6zT34FrCK4C3yh0bOkhYXYtGsPNN187marxvwI3I0canG6PdjpqTgJI+aTdymsjwytEaNvTDVisfvU6Sw8G4H7lMVDS9NyQZOOatFsTXF9NP+iJsOGZWTSSFlCJXpbWmpVdNeijWAZgELc9OP+ANEphvktFpxWc0gfgQnTvcuvQ2CmXtueoy9zkIWNuktzlcIYqpCUaetJ4/x6gtY7iwp8p3z1MVtO6EoFyDScJgp+xKubG11CA7OxaU2cVAUzkvuV5kdKdCr2l0O/LFTcO0L0NZQA+evNKzKyaEIOwR5YJmMJGZ0eS5VdBXNBd63bYrYekH0DblRUJSQZLyrXd+UJcn/UHAhZCMlBw5LP32T6SW2ZvDoXT0RBHiHbnhnZh9ns4uptPuoumvHN3H1MuJcOwRaaxLLES6hh4g2kKHDW1DMyR8/O3lDHdN8P0Qt2Dg40m1Z/JVFbP5du7vHYzeFepVCbODkqYOrPnCVK1s3lyzbPwnqxoQOGMElkHBmyqnyourrNkkq/I7rcthHTdpWHT7pkeffTUF6N2VmVjKgb7EThJ9zHoI/YcN4NIOtBThjLlCk2bkpzHpSBfzEhFub6bcSvKzxvat9/yJYpeNpuS7ukDWNy3b+QpBW6dFQbMQWlbD7xFJn8nvbt/28tmK9R1E0byIggIAwEhabddNJ1Ck6zcsAgtcy64amvp/3fhKEG2VhRYt04LJPkws6a9OO29F3eajEMUS2PsKNXuHzoxmmIQRhWfcry5/TYCBUeTiH+fCK7hyLPa7IaaRfcPtWnZHyapJrcKvVnWNQHR9gz3Tpm1aVZ6G7z6kIT8NNhSgfF8txPblq5uf5yofcVkWKShrQGMQfvO/hA4siqVH5NLMLpDc85au0VfQqD3ZOPtYBXW2VRYHyyyxRhxK1641WS1txztlKpAtmOeQPty+5W3cu+80lJZPSCodIfBVzTY9ANdRGZzErm9yhsemspOrD9AwOyS8IJlOLoD+AMmgbF2JVDFbq4O34C0ClKyXzY3KpD8xvqowl0SATC54eC2drep63wDwlqBHH4J0p5AqPHFsqIQpUNX+YOS/cW/zHJgrfiCy9gQUjAenFqikl/ThkO/1Q== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: 116dc594-9505-49b7-3018-08db04f014a4 X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 07:35:38.9274 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d2585e63-66b9-44b6-a76e-4f4b217d97fd X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KcPqAfLMx/tMqDp7sueRssmZnm0uTDjkxnuwKvBP6oz4s7WNzsczIwegLGMkBNLP43/LidU1ircFtoLyKM4p+GRMjKwyTfYaucmBowzKYlg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4P189MB2389 Received-SPF: pass client-ip=2a01:111:f400:7d00::726; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Please note that loopback counters for VM to VM traffic is not implemented yet: VFGOTLBC, VFGPTLBC, VFGORLBC and VFGPRLBC. Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 9bedaa1e5f..42e3517695 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -490,7 +490,7 @@ igb_tx_pkt_send(IGBCore *core, struct igb_tx *tx, int queue_index) } static void -igb_on_tx_done_update_stats(IGBCore *core, struct NetTxPkt *tx_pkt) +igb_on_tx_done_update_stats(IGBCore *core, struct NetTxPkt *tx_pkt, int qn) { static const int PTCregs[6] = { PTC64, PTC127, PTC255, PTC511, PTC1023, PTC1522 }; @@ -517,6 +517,13 @@ igb_on_tx_done_update_stats(IGBCore *core, struct NetTxPkt *tx_pkt) core->mac[GPTC] = core->mac[TPT]; core->mac[GOTCL] = core->mac[TOTL]; core->mac[GOTCH] = core->mac[TOTH]; + + if (core->mac[MRQC] & 1) { + uint16_t pool = qn % IGB_NUM_VM_POOLS; + + core->mac[PVFGOTC0 + (pool * 64)] += tot_len; + core->mac[PVFGPTC0 + (pool * 64)]++; + } } static void @@ -579,7 +586,7 @@ igb_process_tx_desc(IGBCore *core, core->mac[VET] & 0xffff); } if (igb_tx_pkt_send(core, tx, queue_index)) { - igb_on_tx_done_update_stats(core, tx->tx_pkt); + igb_on_tx_done_update_stats(core, tx->tx_pkt, queue_index); } } @@ -1398,7 +1405,8 @@ igb_write_to_rx_buffers(IGBCore *core, } static void -igb_update_rx_stats(IGBCore *core, size_t data_size, size_t data_fcs_size) +igb_update_rx_stats(IGBCore *core, const E1000E_RingInfo *rxi, + size_t data_size, size_t data_fcs_size) { e1000x_update_rx_total_stats(core->mac, data_size, data_fcs_size); @@ -1414,6 +1422,16 @@ igb_update_rx_stats(IGBCore *core, size_t data_size, size_t data_fcs_size) default: break; } + + if (core->mac[MRQC] & 1) { + uint16_t pool = rxi->idx % IGB_NUM_VM_POOLS; + + core->mac[PVFGORC0 + (pool * 64)] += data_size + 4; + core->mac[PVFGPRC0 + (pool * 64)]++; + if (net_rx_pkt_get_packet_type(core->rx_pkt) == ETH_PKT_MCAST) { + core->mac[PVFMPRC0 + (pool * 64)]++; + } + } } static inline bool @@ -1515,7 +1533,7 @@ igb_write_packet_to_guest(IGBCore *core, struct NetRxPkt *pkt, } while (desc_offset < total_size); - igb_update_rx_stats(core, size, total_size); + igb_update_rx_stats(core, rxi, size, total_size); } static inline void From patchwork Thu Feb 2 07:26:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13125440 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86B0BC61DA4 for ; Thu, 2 Feb 2023 07:37:09 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNU8O-0008UX-GL; Thu, 02 Feb 2023 02:35:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8I-0008Sq-Pc for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:48 -0500 Received: from mail-he1eur01on0702.outbound.protection.outlook.com ([2a01:111:f400:fe1e::702] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNU8G-0001fz-R3 for qemu-devel@nongnu.org; Thu, 02 Feb 2023 02:35:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Js2YL3IWu8hraXGU7LgVqPjDbQHoeIl4irjR4lfE3qTTUQJLoN3NcviQlbcgR1fxSHh5GM4aJ5e5wUqlPJeWi2S8mYdooMPSzH0GEjO15Fvdvu1Ug5FbS9oTdkSy58kniAb1k0RZC9gfIJW5QZcZPBAznAFUa7NXxaQZwHkGjdZoGWr3a4YPbUe4LMv4ePdwU0hR/OgJHPOveHjfN2sP13Xm/B2iiuayuO+ikIYmtJOJpIHTMM1n9VE9Tz+wFoJ/aEe6mjZmbaYpldJedeRP9m6WAgCc69Ooq3bd2Vu1CeoA3qsTz4nkdPsV48ydsS3hqwf29R6pZFKSzzHDO8AUrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W7JK40CwZeb70AQ+EygfoxIECINj0at+6on8CxGiSh0=; b=bmo6mBih5a3eHRyqxITAdD7ggI4ItSQ+P8PkxcvNMfm5N1Iaaq0rccyAGyZOZh0v44Pd0SEs7UiYihOOqgNx8Ilh3kzTZSof/gcDAJXECM+YlzixUG19fAePY95Bx2epxNBxR1BF2jvo+M/F+sV+7fiCcfgeGYcvOUXQUvRK82E/8IDfD1XqO+Lor6jjpRU0klousz9IeqVHDX7tGpQXbP7vEoZWeaSadCXVnQqoyfsjnsPTv8eVYdt+r2AEluIqvHj1TifDVE5/18Bvzx7tvkmQppdXtGJKpsrAG6l566jdv/XP0fX8JDCrb4aIM9V4t1mdxX7X6MdFKsKNg5t5JQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=est.tech; dmarc=pass action=none header.from=est.tech; dkim=pass header.d=est.tech; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=estab.onmicrosoft.com; s=selector2-estab-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W7JK40CwZeb70AQ+EygfoxIECINj0at+6on8CxGiSh0=; b=OKuUAYeUEItAXmRiRX2ZB70g9UxKvt9eYo0BBY93OtN8IuMO/0L0Bh5S1kJA1AUdx9bnBXBapA/m7NBt5FhIautLZKn4FkZkYz1KZ2V95KZlEc+8DV4RY+ucBJHFa3R85gQREdZQvPhjcH61unmjk1Dg32EOBcJGVUWmA7VXep8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=est.tech; Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) by PAXP189MB1877.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:276::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27; Thu, 2 Feb 2023 07:35:40 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::8f70:435b:ab64:9420%9]) with mapi id 15.20.6064.025; Thu, 2 Feb 2023 07:35:40 +0000 From: Sriram Yagnaraman To: Cc: qemu-devel@nongnu.org, Akihiko Odaki , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , Marcel Apfelbaum , Sriram Yagnaraman Subject: [PATCH v5 8/8] igb: respect VMVIR and VMOLR for VLAN Date: Thu, 2 Feb 2023 08:26:48 +0100 Message-Id: <20230202072648.4743-9-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202072648.4743-1-sriram.yagnaraman@est.tech> References: <20230202072648.4743-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0001.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:b::31) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|PAXP189MB1877:EE_ X-MS-Office365-Filtering-Correlation-Id: 892d8861-a1ac-4c6d-1b43-08db04f014b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w36Nh3aAAeOD2OvwuN3CDayRLZPP7+46cS/83TV9e9X12ER2pyQcXkL5DBmpRoixdzdcCC894aNCZqwcjUwyMN8sWrmcwojmHS0naJxBhZw5WU2XlXGNmAOwov9+O+m6unRoTwh+C/vdPBQQltHkIEBs5o9/wCh6xsnyE2W2bHSeKdQ0noxCoM/lpktQIXLYnIGVRONoqjstzrxfbm/7wrqUGruATu/uWFP7LlSEfToHV3tbqt9yu1hoi56LL/atASy+QtGwXYEPuWqOoGQPQqR/2Wg69AMS9Gnu3aetTHUugJ1erJwNBITlwXsALdTjmMhdlpgSh/lhzyqz9O6uXiabTOarlL9Mbk0+2+tBnq8DcabCWmyfmCCmKaDdK3qzzK71FXrnFtiGyZAFZJr/xCobVha9gglH1wV+6t6IFQjwnlzE54nUHC1GXchcLi3r+p7yjJHQOLk01cXad95EVG3zW0NiP0MavRYJahZs/myWOvAmp6bsfbgH6dBb559pkaBfi4uRxQa1/p6o87pEtWWW9fH1uQBw9ERtiGIiVXHTicbwO7YQv2ylli5Tve2YSLNIdq0cHgcpabBXlE6EuL9hZ8HP3+VaFqbAuqiDXo5ud6Pl2sZq7iTM4Sja5yBohL3ygAXAL8xNSERIvCUys9CBxpbuzu8OFJCTmG3pLwp/luHt2dDLmchURV1xApTkPTMpWmtZ6VzOvqzJmBOi9RkrTbZls2lwaCmvLySHxRY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBP189MB1433.EURP189.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230025)(136003)(396003)(346002)(39840400004)(376002)(109986016)(451199018)(44832011)(36756003)(2906002)(83380400001)(6512007)(186003)(26005)(38100700002)(6506007)(1076003)(2616005)(70586007)(86362001)(316002)(66946007)(5660300002)(54906003)(8936002)(8676002)(66476007)(4326008)(66556008)(41300700001)(6486002)(478600001)(266003)(37730700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zigOcep19B0WtY5qtbeGsSodvXyN598suqV8gT5OUncABfRzyYZQMTIhL5A0MHHMCmq8c5z8Rm9MzU1hDnLDKJRck3vwT2luCIIBuQGnCM+ohGDn8J1bfWySyi2lD0wBDMLozHlWjdM+ut3MnpA6ySQhQh0iCCZgJATTCH0sqwraEBWcT82KyzV+froQw+/PqVFeset6XAc0NU4WZ/6ok5tUAUE8IcPbuBKrUvG7zaUCFK+dHVXZb04ZVj/XPTAo6tA/vcR7rxKdYynipT2wHbq09d/5o7lW1I55SsYayRdiblO5hsgJ2yAPlovDUlE+hoSMBpql13MZHBk800mA1Wa45UNkNppHsP8vupFPNHRnjPVIRVKQJJb6qx/dYNk+aDCtAq4FF0halDaofPJ2BFs4dBojAygVFRBylRcb+XolAKgT+HclvfM/31L60quqL+Lrff1KP4PNcvv6sV2XtbUP70e8/2j7MSGBNg/o6+q48iGUXRAYdu1fMvlIyZJ0V3peX+ccYumh584vr2uIUqPWNcrU/AgzmL1Q7HZZOsEYyOAZ1SpDau7UvPlNVoqEjliTjamK9FPIUSygQoFodaqcEzsUzqvkoHUxtr0TRiF4YFE2AlNd/D3p6wUzLKmaTdP3I0tUPN1FmrhSeJl94L8Fl98hO8U5kBNLx2C0cEbVCREqRyYHlZOYg9hpa1CYvIS5ML3s3lobj6fDFbvIceUqBXip9CISRaniaVL9B/gnW1F7/qPaifESXLSfiuOVkBvLh7CZzRL1f3JkEurcnkLan3y0S3anh5UdbnTGV0ePp6k+3wYwarajSHhWjfswz35PDaXjo1tqtfeQb9Lf1Gz35kE6ruW23Hrag3rkSjbzU8kXCpNUUek/5A1b+Kr214VjM/rvcfsP51QpU3UJ/CklWe5cTtTY2y3P4JFLgcv7Mdfk5MArCJ7E8XQ3F+WcosNGUPcQthQMKaMtSyE6UoTr6vrQBx/+rx3tQ79xp4cNxGs7OLa+sBze3BYh1Ewct72q/uMx5yHVgA0MLqy+H/P6SJMEh43B9JoPVMPMOON2u9IuQcL0ryU2U5+eOM5qBKdkVe7AZwjUPTTgMhgje9UqvcV66DwlNK61Y36WYeQ/X4nqpYFkVKcYNdnzT7nNPvfAPzwD6SUe0kQHnFl+d1VzcLm47zsrv47Eygtb/0nYGn20Li8StTYhmX1r9NuiZXRdnyOWpQlXq72PBN1lHerKUiy5nE9yM0WQPDaI+lT0cndbbTGhceBrRxnWhGPtD9ub88BSQHeOnT2odWanrci7p4wVjl3CLwp9oJOfsjnxR9eK1c8qbCi/Rjae5bX5nkeNlOZ8HSfGL9HhiVAXknG+skkJb/zZQrqXJ1622+9AriwNWJPv0n5GAJXthYoCe1+le/gUZVOQdyZ/FuQjgXxm42Ou70RXLjsl30KEyUqCKswPnxzKZ90M0sR7DaoW0pDtekHfw8pi40UyXRP2wYV8LHoXEAFdE3y8pRI6bF3ULPWQgYt74AwjceGzSDSnuoIgbGuhrgoUgd3eb0qKAgTffbh7w3mQbrHQS48iI8mHGBzFwjwoA6Weut1vZ+SorJQgx0scewdSMJBBQkSXjA== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: 892d8861-a1ac-4c6d-1b43-08db04f014b0 X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 07:35:38.9911 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d2585e63-66b9-44b6-a76e-4f4b217d97fd X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jlpxhypfMrNy8r6GCGzdsn1L4vITRztzvul+dW0eNzM+bP0A/iofvfdazn0bGHODaljppLRpe+PEi9Ko0d4/2CKjR5MlifkHiJ+c2jSn2gM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXP189MB1877 Received-SPF: pass client-ip=2a01:111:f400:fe1e::702; envelope-from=sriram.yagnaraman@est.tech; helo=EUR01-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Add support for stripping/inserting VLAN for VFs. Had to move CSUM calculation back into the for loop, since packet data is pulled inside the loop based on strip VLAN decision for every VF. net_rx_pkt_fix_l4_csum should be extended to accept a buffer instead for igb. Work for a future patch. Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 54 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 42e3517695..d85f39a25f 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -386,6 +386,25 @@ igb_rss_parse_packet(IGBCore *core, struct NetRxPkt *pkt, bool tx, info->queue = E1000_RSS_QUEUE(&core->mac[RETA], info->hash); } +static inline bool +igb_tx_insert_vlan(IGBCore *core, uint16_t qn, + struct igb_tx *tx, bool desc_vle) +{ + if (core->mac[MRQC] & 1) { + uint16_t pool = qn % IGB_NUM_VM_POOLS; + + if (core->mac[VMVIR0 + pool] & E1000_VMVIR_VLANA_DEFAULT) { + /* always insert default VLAN */ + desc_vle = true; + tx->vlan = core->mac[VMVIR0 + pool] & 0xffff; + } else if (core->mac[VMVIR0 + pool] & E1000_VMVIR_VLANA_NEVER) { + return false; + } + } + + return desc_vle && e1000x_vlan_enabled(core->mac); +} + static bool igb_setup_tx_offloads(IGBCore *core, struct igb_tx *tx) { @@ -581,7 +600,8 @@ igb_process_tx_desc(IGBCore *core, if (cmd_type_len & E1000_TXD_CMD_EOP) { if (!tx->skip_cp && net_tx_pkt_parse(tx->tx_pkt)) { - if (cmd_type_len & E1000_TXD_CMD_VLE) { + if (igb_tx_insert_vlan(core, queue_index, tx, + !!(cmd_type_len & E1000_TXD_CMD_VLE))) { net_tx_pkt_setup_vlan_header_ex(tx->tx_pkt, tx->vlan, core->mac[VET] & 0xffff); } @@ -1536,6 +1556,20 @@ igb_write_packet_to_guest(IGBCore *core, struct NetRxPkt *pkt, igb_update_rx_stats(core, rxi, size, total_size); } +static bool +igb_rx_strip_vlan(IGBCore *core, const E1000E_RingInfo *rxi) +{ + if (core->mac[MRQC] & 1) { + uint16_t pool = rxi->idx % IGB_NUM_VM_POOLS; + /* Sec 7.10.3.8: CTRL.VME is ignored, only VMOLR/RPLOLR is used */ + return (net_rx_pkt_get_packet_type(core->rx_pkt) == ETH_PKT_MCAST) ? + core->mac[RPLOLR] & E1000_RPLOLR_STRVLAN : + core->mac[VMOLR0 + pool] & E1000_VMOLR_STRVLAN; + } + + return e1000x_vlan_enabled(core->mac); +} + static inline void igb_rx_fix_l4_csum(IGBCore *core, struct NetRxPkt *pkt) { @@ -1616,10 +1650,7 @@ igb_receive_internal(IGBCore *core, const struct iovec *iov, int iovcnt, ehdr = PKT_GET_ETH_HDR(filter_buf); net_rx_pkt_set_packet_type(core->rx_pkt, get_eth_packet_type(ehdr)); - - net_rx_pkt_attach_iovec_ex(core->rx_pkt, iov, iovcnt, iov_ofs, - e1000x_vlan_enabled(core->mac), - core->mac[VET] & 0xffff); + net_rx_pkt_set_protocols(core->rx_pkt, filter_buf, size); queues = igb_receive_assign(core, ehdr, size, &rss_info, external_tx); if (!queues) { @@ -1627,11 +1658,6 @@ igb_receive_internal(IGBCore *core, const struct iovec *iov, int iovcnt, return orig_size; } - total_size = net_rx_pkt_get_total_len(core->rx_pkt) + - e1000x_fcs_len(core->mac); - - igb_rx_fix_l4_csum(core, core->rx_pkt); - for (i = 0; i < IGB_NUM_QUEUES; i++) { if (!(queues & BIT(i)) || !(core->mac[RXDCTL0 + (i * 16)] & E1000_RXDCTL_QUEUE_ENABLE)) { @@ -1639,12 +1665,20 @@ igb_receive_internal(IGBCore *core, const struct iovec *iov, int iovcnt, } igb_rx_ring_init(core, &rxr, i); + net_rx_pkt_attach_iovec_ex(core->rx_pkt, iov, iovcnt, iov_ofs, + igb_rx_strip_vlan(core, rxr.i), + core->mac[VET] & 0xffff); + + total_size = net_rx_pkt_get_total_len(core->rx_pkt) + + e1000x_fcs_len(core->mac); + if (!igb_has_rxbufs(core, rxr.i, total_size)) { n |= E1000_ICS_RXO; trace_e1000e_rx_not_written_to_guest(rxr.i->idx); continue; } + igb_rx_fix_l4_csum(core, core->rx_pkt); igb_write_packet_to_guest(core, core->rx_pkt, &rxr, &rss_info); core->mac[EICR] |= igb_rx_wb_eic(core, rxr.i->idx);