From patchwork Thu Mar 9 22:00:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13171877 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 8B58CC6FA99 for ; Sun, 12 Mar 2023 21:46:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbTVw-0000Q6-1b; Sun, 12 Mar 2023 17:46:00 -0400 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 1pbTVu-0000Pr-Eh for qemu-devel@nongnu.org; Sun, 12 Mar 2023 17:45:58 -0400 Received: from mail-db8eur05on20729.outbound.protection.outlook.com ([2a01:111:f400:7e1a::729] helo=EUR05-DB8-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 1pbTVr-0004XO-UH for qemu-devel@nongnu.org; Sun, 12 Mar 2023 17:45:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oZLnawpPQYX9owvIvktAX/f8RN7T6K0W+FMFBOfePVXerjATgcv0yxa1t8KMAbhX0aKS2TERS8r7MyINlS23NcgJs6KMV4qxYujBoR6rBMpTa6sUeSu/ixsFi/0J2G67p+3VRQRVdRw42YIlw6zCtAnGOHtZnTo7vBvTH2D1CAH10hxpiIvX06IWEh5nBUfLudWOa5kPJWpw3aNA3C8AEDuuAtbR0TvHPSxF14qOmhah4jHlqizjuC5+tPpMUhsRFxcCF9OnUZLF/KCQhsAzbBHu+/YFVy53lD9xMd6ssPHZVYi8lVCw0MzQfqsOq491uVM3qPwuY8tSh3v3Uaw4ew== 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=dhFGf4IR56Wv8uaoyJ0mtv2vpkfLmfqXBDBN8lOtdPw=; b=n0Fe8moGmQp81NiCLs4AacAwDBNxZhXVl1jvkldviLi2RfFOuwgixPewkuptkLgI1jsVmUZaR2RQHj5KFJzXSB3QBP1+HGox0EggBwdktDd1xCh9k3+FeA9QIRQ3xGxWN2dJs4BQ7YGbfH/pd5kIKkar+Z65W6wT8XjOBiStj6hJZSw5oPs38a6VWZE3Mam3XBJaKzEbzuiekxx1wmDibNRKhKNLofnkd6cRWBGzG0huHpMXgqFI0F7a1bIv6M7T9+hRm79tYeiWJA0+ulzytDPZSkwJVYeWXLJn2GcD0kjivsDE8aeFbJhb3/nF5/AiKsmM8adxs0Z0G5kvlRAyYg== 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=dhFGf4IR56Wv8uaoyJ0mtv2vpkfLmfqXBDBN8lOtdPw=; b=iWtEcnTDxKebdPkOKPDcDfZT6WGoQPVoM2PFT1H0PJzkUXxAp0AK2y4Itk/e1Uao2H0bTZS7XO9YAQlQkv3TfhVkN8j7YqnHxORL0K4E9NwOMFVuARqywCTaV9MNQYG8Rp4xNxyFR62Z3bMRmpZT3z2Iz/wf1RAdEqlm+Ss3W3s= 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 AS4P189MB2207.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:58e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Sun, 12 Mar 2023 21:45:44 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc%9]) with mapi id 15.20.6178.024; Sun, 12 Mar 2023 21:45:44 +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 v7 1/8] MAINTAINERS: Add Sriram Yagnaraman as a igb reviewer Date: Thu, 9 Mar 2023 23:00:05 +0100 Message-Id: <20230309220012.25642-2-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230309220012.25642-1-sriram.yagnaraman@est.tech> References: <20230309220012.25642-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0095.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:8::6) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|AS4P189MB2207:EE_ X-MS-Office365-Filtering-Correlation-Id: 779ad7d0-8aac-41b8-1bd5-08db23432154 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NZ+MjFje5mSR/843/hldYeEH5SKXSSw7uWEFCVfa8wpzlZ8eadbbX6EJrCRLbW4aH16XGDhvfOHs9dGLes52qt2YZOZ4xLgGIxH/JZig9BKTQ7QeMwnlWyz1Iug21KN9pZu/+mNfqN61R2AzaVnvRkmcGenKFtBgTk9iHijcu1Uy5+5DhpqfkUQtJovE5pw3RR1+MBv2XI5VfIdIEtxd0GQF6Qh7RH2GnMlLa98nTDY64eL0um40rb7v1t8X0aHywTQzydxhDYaKkKilnVj252QuFSqjMpK7CIA79KcjRWn9mB+7AcsTkradP2NLJvIZFosDLhIBpQBoJDXaRKv8JoaPf8mCt91rPSi00f2ALDlJaMbHpvMYOn4jSdLZlxYsd6t1ZLGCK+joGnm7zWCzTptaXIWf4NdXMZiHf9au9bORFs2OEr4H8E4YlSCAWq5jEFMiNZSb+QRxeRzSPqMj/Zpoj3amhDGP4/Nz4urnirRytzZBfgasCWBv0fFkDd/ZMu7tD6eYzr7cJY3gdY8iEd2/Ypcp3CJVY5lxoupQcyVnKGNbC04+Nmst61iX+1qOQYUEc2js7zV/ybZJzuobQJqCyCvqVO59ybXPigEsVIaqECn3Hl4fW5EGbYDIWHa+J30lSbdyeThhGNIWIoYCFHFeN62/d7UcDJQvQ7G8C/eBDwLpKB3KZaCM89eVTi4/+5dx1LpK/ftQ/ygUM425CZJpeSorAEpEA6JSQas/XEQ= 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)(396003)(136003)(39830400003)(346002)(451199018)(109986016)(86362001)(36756003)(38100700002)(4326008)(70586007)(8676002)(66946007)(66556008)(66476007)(41300700001)(8936002)(54906003)(478600001)(316002)(4744005)(44832011)(5660300002)(2906002)(2616005)(6506007)(6486002)(186003)(6666004)(6512007)(1076003)(26005)(266003)(37730700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03pbhYcjB98XgjCr2DxBj66wXRFKUzc9FWfCAAFMKKjWjoBmAa/XSghdDLg7EGpcpu+vOXlzp3g2t8fYSs3v7IbW4jNhXziGRBmWtp8+E9SZ6YvMK9voJ8vpF2YYMj2nUDgnO6zlNYixaEvGxVtq3hPOIvNn27bG0tzUYO25u73bFnWG/p7KRbHrV/kFn8Lir05nIzHLV/z1ruBM6UeyxXexNo1DvuMhajiQxotmDqbnfF1az68abMxvQOPyJFZLWqtAd+YXBguQBys7Mrok8V7BxVrVfDU5FdxB5lX7ILWmcdJNqlJFCOpuWe/eaVzsdz217l2qAjYLxIFYrO5eTAZW1iQE/GDjxh0ogUK+YRtNFs9sMJS684r+otxQsjrg7UiztLLYgEC7auUhwC2xs2QQuG4W8gLbLVPnvkojb648MGs70IqK9V6tf4crRh3moXAWjvBigzuQ6UkSrQoV76Sj2fyw+Xvx+iIFSezdSd1dNrC+Y4Z6i4BBYc8UYQL2GDcYYd2KUSGhcSQOZojLEp+s8fUb/9IMwiToOTEpuuHVyLAS3ab8j44jNBUUhQEVgdcUpKShT0bmykYaF7g9G4X6uJP8pX7BytG4dm4NhnrVCYgZoGA== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: 779ad7d0-8aac-41b8-1bd5-08db23432154 X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2023 21:45:43.4185 (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: jUff1ooqFHF2MRFguNuV6t4Qk2XesyQ2kvLOhnMSaR+9H0mnvmcBDOtIfwkiUcT9BzMDMI3/kAOHnrOHIRV3g6c6aL5/YADlh7dS2HSuaqo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4P189MB2207 Received-SPF: pass client-ip=2a01:111:f400:7e1a::729; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-DB8-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 95c957d587..70685c9dab 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2251,6 +2251,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 Mar 9 22:00:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13171883 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 B6472C6FA99 for ; Sun, 12 Mar 2023 21:47:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbTVx-0000QT-DA; Sun, 12 Mar 2023 17:46:01 -0400 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 1pbTVw-0000QB-1D for qemu-devel@nongnu.org; Sun, 12 Mar 2023 17:46:00 -0400 Received: from mail-db8eur05on20729.outbound.protection.outlook.com ([2a01:111:f400:7e1a::729] helo=EUR05-DB8-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 1pbTVu-0004XO-F9 for qemu-devel@nongnu.org; Sun, 12 Mar 2023 17:45:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=emv/7gn/azVzcYpjfbR2tk0tkeBQprw+i+o4qaL3//uM0LP+Xa3Lbbs6Q886GEw9/wY0+lOeBoAKSoaeqZ6gFQ1qrzpiGbQCzQi4QH0DbdVdlN2zGxe6qt1r2Qru30vPVfhFC+u8J+IrnSpbu7ch/BrRg8f8EonlexHf3uCaFiC7cuH5syCG4DZx53Q3WfOqRS3lGm9+Ar+ecmawZpvGK0o6Xn+8cMRj0aJjvfEZubVUTKxCfpGNVQYS3o5bXW1r4uQy2N6FQIVqXdh+qs7yUKXYqVW0H5l6KC/os+Cy2myR76DCrLgkGxYkiur+kvTB6VR948dDGdcwo/ZkxdW1ZQ== 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=fjw6w5OYK5BGvWXLFqgHM+Lk1D8yia65Oi5IyIeVk74=; b=d4hALEZx5VOZuMzROBeTfLb431dX2EU3imTPN8d06dXn/B2lU7RmBJ4SmYccckje01mjcA0lAqD4B8tTNDBb1zSWrNMxcyLACo5Fo+uOtGmHNpguFB7hyp9fIe8o232UXOiynol/9iz/qN6Jynzp4B4D6lvcn6lYmSMro2CPQ0FDcOZnk35Kkl7OUHn3Yvi4vPX+1XKp+BVNG1h3ItPOf72KRLOYjD/NBTdEcjFrdeuI8RL8cx8WaWL8/ftkQyjZjkMCXgFuHpxgCltFtYW4c872IZ2RRMEDVQXFZVUiJA4/nJd66wV+AIiSkK5IO/KgxxeCkMqTD77YU7+0PXoE5A== 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=fjw6w5OYK5BGvWXLFqgHM+Lk1D8yia65Oi5IyIeVk74=; b=F+ZCH9B4DfR68t8GbwzX4beAKWSzC7iia0e4q9mi/NY+mYPn7IUoJj1VIFUUCVz2oF3mrSWfMeHnyLBMOJdynf0QwOVy1Jcfib4noR0gFWdAtmR8JtSilx4lMlX/AY4QtL4Ig0wM2XdV3Dad/IJFMUMMYZ32QBZqnyDQSYHmlh8= 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 AS4P189MB2207.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:58e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Sun, 12 Mar 2023 21:45:44 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc%9]) with mapi id 15.20.6178.024; Sun, 12 Mar 2023 21:45:44 +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 v7 2/8] igb: handle PF/VF reset properly Date: Thu, 9 Mar 2023 23:00:06 +0100 Message-Id: <20230309220012.25642-3-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230309220012.25642-1-sriram.yagnaraman@est.tech> References: <20230309220012.25642-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0094.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:8::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_|AS4P189MB2207:EE_ X-MS-Office365-Filtering-Correlation-Id: 3990fcba-3af0-411e-bcf0-08db23432151 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b4CqQEVlPtOJlTjK9NgAutjclV8PpxjHHPfbd2oFMipmxyGN6yjT+PIP5KHf478DW+rE3BbgYSCZnGSqn4Y+E49JNf4xHaWLdyKCFMBTUzkS3BsJIMxzGzvr9VuYaeBS2qlR8Z4HbRpdT64KveAVrNAjwSJTNP/DYyMx3IuIx3Jf+7o/U1hJV2iPiv5fmADWjAUMQ7ZHspfCF9XKzjD+hNP6jzeykiBTS0RvqyAvwJYNBGIu0/M0xqfRR1mYUtx9ZqWMMUygcszG3myN5aFcQrWcUDvhDkm1k+TpgpiQUTjsJQMX9u3AQI5YoiTjpQDjGPSM9wjIPdGk4Ec8czF2SV4raCvtHR9dd/N2Cpm7uUO8nKG6lrFj4RGxmFaDahLVV4IfLnUCFfOFKuepNYh8m0QLmnpVdnk/I/BFxnrYz7u0LPcxRHIxRJ26/FPAWAJ58RFWQZR2W76SbENt9lZdx5fukKmu3cGOFJKsDBaDp6jOz6XkywyjrxgM7nh/reEg/lcr82/TMsgPCUnWNAiTeqqqc65Ftsrn+JxfOzRas+hsYNL8TSKUQofuo+ZKz/0/9JgX5c6AVveFcg3rYDI5KloQbpffZsi2CuakKGcpLChURgttBJ7L9W5197S6DLKyJbdCbo2rIDv5vfVIVQcKN5Zw+fXcuMFA4CK8dfgUA/7aTP4/50uHuFsOD1Z093Y3CTPj6HfApOFFY+2m+h6/uIGDKSDytfcW8WZSc3eyAkw= 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)(396003)(136003)(39830400003)(346002)(451199018)(109986016)(86362001)(36756003)(38100700002)(4326008)(70586007)(8676002)(66946007)(66556008)(66476007)(41300700001)(8936002)(54906003)(478600001)(316002)(44832011)(5660300002)(2906002)(2616005)(83380400001)(6506007)(6486002)(186003)(6666004)(6512007)(1076003)(26005)(266003)(37730700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3eJSfduYq9bPu/G0B8xjvy7eUPFNMLUNvSdRB6fzq/h19Fx+o03NOpr37KtiRBcqon9NxZcxvY4oovWja9gPNVz3LOOai6rws7yl4FBkJxP5cThdn3LvE15GvBuBL12P6OiBb7ukntNx8e3GUW5iQDwHD3D2W6MM6cDd7IAlH8QYTfJj/4cMJi6Jbc/rkabnoMpLuzJvmRT1OCBU9hNIdcid3aeZHdbxI1S1TB1XY9jXu1ata+12XIT9jXhs4Byc8brl/zBMJUnw8HLH9zc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dLd8vNrGcMyjXYFsoB2x3aZRb7onh9nHBnMfc2HULsJ+V25vhAFdETQU0wvsfZNFGzIdG6ABCOeSvz44Dj5NPuZLAwv+cNkN5zuVwbft3HUZwIMYy+DKSTPBwy9OM38SA5bKXlkiFGD6mmob4XGHhr3ODEVkuJlyFu//9S45WAvHDyMhV6nUmjn5ZZxZ1tBfkDSHvZ6zMFa6hEjQ4nP78g8ErXi8BK1KU54fAR1o434uwnlh7jGabf7R5xlIKNFTO9Kt55z58mmOw== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: 3990fcba-3af0-411e-bcf0-08db23432151 X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2023 21:45:43.4342 (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: E+L0iXRFdvBj4khGp3N+gzXCpUgso3rkr/SorgToHMwvIOtF9HK2jA3aKWJpzru6q23Xdp+5vLgqq2yDNc2z90FDlXIjh3ouznbosgAC+IE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4P189MB2207 Received-SPF: pass client-ip=2a01:111:f400:7e1a::729; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-DB8-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 a7c7bfdc75..5eb83a56f9 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1892,14 +1892,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]; @@ -1977,6 +1969,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; @@ -2231,14 +2234,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 00934d4f20..a658f9b53f 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 65753411fc..d35554fce8 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 Mar 9 22:00:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13171878 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 5C354C6FD19 for ; Sun, 12 Mar 2023 21:47:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbTW2-0000R2-LD; Sun, 12 Mar 2023 17:46:06 -0400 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 1pbTVx-0000QU-QL for qemu-devel@nongnu.org; Sun, 12 Mar 2023 17:46:01 -0400 Received: from mail-db8eur05on20729.outbound.protection.outlook.com ([2a01:111:f400:7e1a::729] helo=EUR05-DB8-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 1pbTVw-0004XO-A5 for qemu-devel@nongnu.org; Sun, 12 Mar 2023 17:46:01 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fg9a7wAqCPPTdt5/BQhVJVhwM3DQAuT/3PxB+XSWWrW3VZIiOzvwh5qR6nJTUXcSVIGVRn7MrXED0QYp3qNEWoWwxbFKKdiVQZZJjs70nodUGMF42hEiaFV6PmYoLWdinpiMMCpqpKd+1ITpiEsd1L7LwI0lTCALlu9kD62fUFifqhVFo7pg3NYIae4pkBNWQCL4p708sf8mm66FXBMGn8cAbI5NRh5soE5rC1TpU1pUS8PaOA2wba7RXkC6wn+r6h/uACxAvQ4cfMDHNgxnSL1pTDkpFqfaFyBSDiPA7I33SABdTHx9VQLbEKpy98msp+sUMaGlfBjWurZmqg0GlA== 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=/kUZjQx5/iNIDsGj9w9VwHOI/GyscuRJUQVxuSMwVDU=; b=J+OgLpWM90KTBAnPBYnpJvwWId7cVQ4xT+LXX2zJYql3fm0z1Cs8hI4stFqpSn/dhVkeS3nXvKy3f5N4rSvLRTWVIydfj/1K957igqzqxM9wJWKQYNiEZ0ZlDV9S+3X8kYNPQ3eH1ZJ0HKRu6TJ/N0EgewgDGIlMd4IrCuaQhb7NgdTZn3qKaas/OXS53dFDemADd70OfV+TNW7zqG4B6+E7dSx2IVUdnEOxIyib17sVG8DSLTsJOaJs2Zf8tFL2FOmDqFqzlhRSUZZMLtOIhmWULfAAwSqsnEDI6vIvxmgRG4e/PRmdIzsKerHHdP6yqjbgWfvTfcl2lGJHOjJXcw== 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=/kUZjQx5/iNIDsGj9w9VwHOI/GyscuRJUQVxuSMwVDU=; b=WuU6YbsadrnmzQ1VZXjSqH/cnOkD2S1tBPEiso/Jx1KcpELQ4bMHFg46T+uZVSWGVZr5049NSrsvGpfF2peezFELhX1Ln8DZ7gYP107NnIRNDrutKTcA37X/gvDjWxioZp6hnzWd++TE5toZQCF6NFIKBJdjbU2kLJcR6EgfbXQ= 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 AS4P189MB2207.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:58e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Sun, 12 Mar 2023 21:45:45 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc%9]) with mapi id 15.20.6178.024; Sun, 12 Mar 2023 21:45:45 +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 v7 3/8] igb: add ICR_RXDW Date: Thu, 9 Mar 2023 23:00:07 +0100 Message-Id: <20230309220012.25642-4-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230309220012.25642-1-sriram.yagnaraman@est.tech> References: <20230309220012.25642-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0110.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:8::17) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|AS4P189MB2207:EE_ X-MS-Office365-Filtering-Correlation-Id: bd74c114-9fce-4516-ef22-08db2343218a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MKgga7rFLZEJRHKEHWaoJoa9Y8JGSMKQd3Z3BKbnDX47m61HFsJhE7jHXJ5AOmAAzk6vMVT3bGXaMgRj93UH2yGMuFjydtgPf1jPhvUZHAHDvMP3shnilMPd1+mLopnhbelb+IiJtVk1b275U83uSgp0X1B/Q6Jr7R9ncBHoSoOuWGo49z1WYqN4Jeu1moxfOgAGSDQWMsYqMRN9Zld4axEZ/0qLf+dO9CiRZfOcMR27Qq7fiE7s8dWuJmAYNInLmxaEcmKwi4F6mC4yUCaLUYod2mQITRQRiEZTaFf8/PkqRvF43ifx5OgOk6eu5exo5KG93MlSpXJjrJ1TOdDIiuDd+321912YoV07jugScuHMJIj/18SmmK1kAkVBcfa6aXYQTvLKFn3Xk/c87Pu6/okHzteCqI9lnTWOH7Dow3e59yFCCUnNFXOrilQMmFqsAE3ntrAYOmPuKyko0p8g0iVRrYbFTuYCl7CRl9quo6UgHOOjz/NAAHAj1AmA1+bWhYTQfmoOhcJJzG+syjmKbgD2KGd2jH2SMcUvXmVgche3/KTwOSCckAlWUTmM0Io71cY3s2KAvD6jXlAdtBzofdxA188EYUWmGVMem7bTdenCSEk1YSKDfyHrZ/5CCNKTrRmiDD5aquIT3tQSqNHZkxJe2sjG/9eVKiBNXN6Gl9AqtIHBWAcia67L0Y2WmknVfT9RbgK1nkD4zBmMy3qX5w== 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)(396003)(136003)(39830400003)(346002)(451199018)(109986016)(86362001)(36756003)(38100700002)(4326008)(70586007)(8676002)(66946007)(66556008)(66476007)(41300700001)(8936002)(54906003)(478600001)(316002)(44832011)(5660300002)(2906002)(2616005)(83380400001)(6506007)(6486002)(186003)(6666004)(6512007)(1076003)(26005)(266003)(37730700002); DIR:OUT; SFP:1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ZfwCrVkYot6quxHoLqx+7FANXficWi0eL8a3UzpQBwthRc3N3eDdYC4p8oIG6CSBl1fERI12itvnN39oXVZ/CMiNLo55m7aXhIXCpCAttf85RCusc74g1TjIWmNtr/iCUdi0kIetpTSOGDyDyNKw9yRx0nz2wyx/GD2nSKe5PYV90P4T82ux6cSFALETFqIqIKz3NwdHixM92DiRwxkpywtW25Z+pUTHsynjQHzMSf8mck7tVbo7mZ37EgzkyadgPCq+HHFTrYCVxnpYayl4XD7xXSbFayNg/YUjoRu+/UZCEYiKhH+oVnnqeCJQxZy031QO/WGpbvKqyRB6KgdXHtUqSxyAWLFVDRWY2ELacD2QKDW+9644VUV2PzF8NoYyqOn+fl5R/W/01zV3Y2LKjAuuRxSx8qYXNzMeui4rr4oG+MVL2qIlBVSAgTXboNQjLa3FsZX/7W0NRdj92nhlyqeyJm/3ej9HwJIkSFaL2SdInmIv44I9CBR9js2B79nVK5fioJIc/JryMh982+203SUkfhYNM3O9xSv3OMQ1vInWb6F81Fu0SNEvaAQ7IrxnGYJvgeUm7hSd6Bg3w== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: bd74c114-9fce-4516-ef22-08db2343218a X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2023 21:45:43.6998 (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: PTMEGsN3EYWhbPuho3IIVerLAht7iD9waknOr/k8IMeVOwidmeGMHVlEaq/vvP/s68fi+QKME5iSj8Y9mqDJJ8T4bT4v0wBrAJGqhkKyuqc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4P189MB2207 Received-SPF: pass client-ip=2a01:111:f400:7e1a::729; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-DB8-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 c0832fa23d..6d3c4c6d3a 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 5eb83a56f9..2a16692448 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1577,7 +1577,7 @@ igb_receive_internal(IGBCore *core, const struct iovec *iov, int iovcnt, continue; } - n |= E1000_ICR_RXT0; + n |= E1000_ICR_RXDW; igb_rx_fix_l4_csum(core, core->rx_pkt); igb_write_packet_to_guest(core, core->rx_pkt, &rxr, &rss_info); From patchwork Thu Mar 9 22:00:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13171882 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 6D5D8C6FD19 for ; Sun, 12 Mar 2023 21:47:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbTW4-0000Rs-Ij; Sun, 12 Mar 2023 17:46:08 -0400 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 1pbTW0-0000R1-58 for qemu-devel@nongnu.org; Sun, 12 Mar 2023 17:46:06 -0400 Received: from mail-db8eur05on20729.outbound.protection.outlook.com ([2a01:111:f400:7e1a::729] helo=EUR05-DB8-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 1pbTVy-0004XO-6I for qemu-devel@nongnu.org; Sun, 12 Mar 2023 17:46:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mi9WILqAO5YeHfXcvkARChiGI4RqBU2dbGJ05U6uRFbJ26uvs8pY0TmyB52bg4FAtEfxZNWmXVUAd/qtw+tftl8GFt2DkZ9mnqGKvIe+ztHVrfZW0MdVd5q+9/leEeQuWXyYew/8hB5fDKyYuTdZ4JOBHj+dyPXBQCk/JauzrOzrF73QwBBlmPnaGp4ELbTsvhOJKnJ2U/NdrzU4PIC/X373OuO8DNmMsOiTgvBTEXzBMKxy0B4/XIAmjfIE/38ZMEP+6zfpufYLp0vQV/2FEqcj7PBw14U3uwMFhYmU9frkPgQNOD+gN3jtQdV5XjR0slSw2wccXqJ1yEoRFKKaHw== 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=fLwfmyHoJOE/dRjk0UIB8ZwHhC1A4fctgKDDrLEcI5s=; b=kzgm9rlIhihmv9yG67S21y7SnLJ6Ighlgfdb7P7s9b6u517Ef6LjDarh9wSs67KMnTiL2WotZrhl1cyRcEjz4/Ye/tqEsEZcUF5orkIKpeF0YzsgnUB9ubsDJw6SlefJa3WeDLJIjAsnCIMQ4gE2hXhMNbkvL8xNu9D2ijTLUrbF0zQ6Hk/3O1lBy2cCO8cU84syWeCnQ4fBuA5UmEGutDLiKaQrquTWbZFvUSt5PdlyWrqc/G27UVD4DrAvEWDQnJYEEP25RE70D2BXQMX/QaesRMBAFpnjepZkTDiLbJ/8pxaWW3UgK8LN3ojTGInXea4qjfONht1ZNHrPSbRHuA== 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=fLwfmyHoJOE/dRjk0UIB8ZwHhC1A4fctgKDDrLEcI5s=; b=lflhjgFhj8EUue9qI5xI244M2mCbxFfRsuadWbHGSsNhF4XaKcKFoDhzbhZCAaGoVnRGhneqcjmv9EIDug/YYVX5ygqDDeFCMW+418couXkfMgzDtAsIXqFvGhV3e38A6d8AUD5K3hCMu3TE65aGTz9gxaSv6l65SZF3BzBx5Nc= 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 AS4P189MB2207.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:58e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Sun, 12 Mar 2023 21:45:45 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc%9]) with mapi id 15.20.6178.024; Sun, 12 Mar 2023 21:45:45 +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 v7 4/8] igb: implement VFRE and VFTE registers Date: Thu, 9 Mar 2023 23:00:08 +0100 Message-Id: <20230309220012.25642-5-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230309220012.25642-1-sriram.yagnaraman@est.tech> References: <20230309220012.25642-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0098.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:8::30) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|AS4P189MB2207:EE_ X-MS-Office365-Filtering-Correlation-Id: cf568b52-07d6-4bcf-65a7-08db234321a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lxnShRkMsB2PwMxpclsXfOlv29UC04cTDLrG92Bi6BTxM7bACMAkO4m2i/2p8VP8JDlPqlTwllOs3Pu/J2iCYdBNLr7KXD6XbSJ+Po8IGB66wa8i2TK3gnfrZEJWOsOto2yKlaypWWiX8SVT0LAyg4WMVrYXcPjH+jZip0oSummKaioaFW2BGrFFBGmi5WpwDlkYFeaLtVR6js8DwsoYiyywwtuwrI9ST/hba2BJq/2Q3lkVPd0/Qa5KuiPchBr8jb5UGhTCT+Y4GA/GqIMkFNNTuDozllNfgPxk6MndfWoNEefZ/NBTIQrsFWT4rhwGsrdSv0OJjIEHIHF08Y18i4RADJqV8pHMS4aD3Y2WzCGn6z1PipWLRuleolmBqBCWtWjNfE1uN5znpXDQG0drqWzUHAVhyuXyGl+cPJrdPhZSpliDADXmVZte/6byqZeN6J+3aRZJllbNf0jtOLvunr/aSCaDfGlRUrYxJlsnrwNO37azui21CkTUIzwnZVK0Wp+hc4lOqviZ6q5+7+Ju3H3i9QsZgRaVNULzm5Ykn+3sLJlL42J0mqQuK3+8tM37chTnBWL0cZHb/qh6JrlEr9TltQmJ9OHryS7/RX7YZB1jJe+xxsk+6dVNIlV9PvAXc5cYxSHIcqw5Jb0hIFbaDIvjGyF3pDWX0XU/p8iM6kmruWoQhwJL8fL1b+0uiwEghcvh4iPR+5BzrJJ8o0GazsIjrmlhK8XlLJIqFs6UcGM= 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)(396003)(136003)(39830400003)(346002)(451199018)(109986016)(86362001)(36756003)(38100700002)(4326008)(70586007)(8676002)(66946007)(66556008)(66476007)(41300700001)(8936002)(54906003)(478600001)(316002)(44832011)(5660300002)(2906002)(2616005)(83380400001)(6506007)(6486002)(186003)(6666004)(6512007)(1076003)(26005)(266003)(37730700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 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YKt0MeSJlL0FB5jX2Gg7PnQrpgronHoBg1QqCH48le+5NDwRNk5ZtPn++P9L5kSWREa3NvSJEULBFwP7xYsF5PRvJJG9BUvBNakBX+yz/faWaOEMoYY+7jIG+YfcjPAaMTdf6K9nmpPKDEe7w5K13LhwKWE1PJMYrar1xZBaGhB5OU6l89NW71+XDTRw1likdLN79c3wO9t+oqxNacI3UCSYGhDi2oPaHdYsN7GgUCO4aP8hgPmaR+vY6FK/770bpGNk6aknchJRM/KA5eyDjcFKN/YUG6Ga2PNhsd0ivGoHrrvwyZ4O97LDopmMs4ek3I2B4gh7mbVj9xz5wZrkIG3lB+97HsxxyVdn+8rw2QxLctcohu7SK6v2OnHd40LINf5Qk7dTfLsYiLPku6m1ZbocYmWhisqU+F5hMA9qnbK5KoYpPdaplqYg5v45izfDktXaJ+SKdekze3TXWEjAWcpU0WNslRCDl4QemVndlZQWqzWuT6pSVA5U6c75iXKGimmieonCdhcsEXuBi/so6Vw9Lx6nO0rB5+BddWAZYrFEJhmCMHv7iGub4IqF5SSvTcQ== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: cf568b52-07d6-4bcf-65a7-08db234321a0 X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2023 21:45:43.8090 (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: gY3auvP7L/xy7Qv4KluK6iGRd4HfGmCJ+Giltdec/w0iF3XIbiIFIFbI7RKjOkKY9ivR65H80+fQMjO8xXgCIgoxk7bkR6gonf4svilasE4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4P189MB2207 Received-SPF: pass client-ip=2a01:111:f400:7e1a::729; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-DB8-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 | 38 +++++++++++++++++++++++++++++++------- hw/net/igb_core.h | 1 + hw/net/igb_regs.h | 3 +++ 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 2a16692448..b2ea3a18ed 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; @@ -1565,7 +1580,8 @@ igb_receive_internal(IGBCore *core, const struct iovec *iov, int iovcnt, e1000x_fcs_len(core->mac); 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; } @@ -1971,9 +1987,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 */ @@ -3908,6 +3931,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 814c1e264b..24bb67f870 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 a658f9b53f..c5c5b3c3b8 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 Mar 9 22:00:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13171880 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 6654DC74A4B for ; Sun, 12 Mar 2023 21:47:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbTW8-0000SG-Pg; Sun, 12 Mar 2023 17:46:12 -0400 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 1pbTW4-0000Rc-8M for qemu-devel@nongnu.org; Sun, 12 Mar 2023 17:46:08 -0400 Received: from mail-db8eur05on20729.outbound.protection.outlook.com ([2a01:111:f400:7e1a::729] helo=EUR05-DB8-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 1pbTW2-0004XO-K7 for qemu-devel@nongnu.org; Sun, 12 Mar 2023 17:46:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GBSLr0wfBn7NT72znK+VqNm1wg2xpWs0va/SPKm8OL7ahkau+Caw7a2GiOmt1b4K7JQdGyVUJ9m35W23vIzPNNKXP2BYfIy2tkXu4KDlWPLrKB0kYmgokE4MYkXHpdAoMUouo+ncaiXImGQ+bHrpLhlJ1p74/toTwA5CHjKt77g7CP4hu5zIIn1+p2YHxhCJV/v9TNfWRTyKm5Nd5UhCcgQ0UxGZcp/C+6msbN2Tffqepwj8HeK5smX0CLMzyn+OpHiY2pFw8rEqwJMiQkjidQr/rBp1iipGyJGCLYh2NfeQbm5jBz0uuLMUft1obf4qqnzHnfJWxTuIl89ErU7s6g== 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=njnl6LYMteRMPzThXort/qVulvNH4Y6czZRibwJHxcY=; b=IUKfwQ77Lhnwq7aIpk+beTvD1RhdqcDekTnu60Nh7CST55s2qAv1vbTko0Ms52EpfzJt1IWkPZy8H9MpyYqkzIzWJbnuR+uyTf/mBNh5reTEXshqO0uYbZnfrph8j8hiquUWoZPvb88rvP+zTOM97dIYzrBvutbWNPbS8R3er+VTYF4V+mjV4C9PEoXmvWjJRxZN/wRPyBsr29PfvK5R/oBVGUSebARkl1Iw5Fpv2/0aPqCw/3DM+orI+LnPhuj/BDabKXagb8An9AxEutgTq9t/4MuXX4c/IW4k8+NPoD1V2vTLM9+Cv3lqkg0Q+Eg4qCq/1wLpNHHfs8/prPZ0tg== 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=njnl6LYMteRMPzThXort/qVulvNH4Y6czZRibwJHxcY=; b=cIp/25QVyudBS6OBZSlHLFEy0h9eBO6TFx8qUc0/wbm2YahzRFWM462rQFgfzRZiVq/k9/4wofZDkHXJit9aXlibgxJsJs6ftrTwnXGiFX9iesOzs5Ffu/cM15a8A+dEoCEvd9/m3/HxoIJPFVvMPLlzYZtVi7H6HXJIs08qcxU= 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 AS4P189MB2207.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:58e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Sun, 12 Mar 2023 21:45:46 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc%9]) with mapi id 15.20.6178.024; Sun, 12 Mar 2023 21:45:45 +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 v7 5/8] igb: check oversized packets for VMDq Date: Thu, 9 Mar 2023 23:00:09 +0100 Message-Id: <20230309220012.25642-6-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230309220012.25642-1-sriram.yagnaraman@est.tech> References: <20230309220012.25642-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0116.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:8::15) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|AS4P189MB2207:EE_ X-MS-Office365-Filtering-Correlation-Id: 00ea7371-fbdc-4212-ddac-08db23432196 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +CZQ6QrssA48FG6ltJvH6xLL6Qs50BFp93jyEij0uCP7J+gEtr3u0QvKD7ZCBUx1Yn+DYfkZNAwJA3kiRqBvZCB9898l75JMK+MAhr6pC4oxdy46+TvP//A4jJgMq4sDTqvTMCsoc3t/0xWJKUHbAKsLIG4kcPLNtdkv2h+fTG0C4rRcc0TdIWsSqhwwowqlMLAoiVSyiHjg9tzCEsFk/VCadecIFtTw9xzF9Ed/mk7KuX0Kyo1gOjz3mFYQxQb6hHCCqrpF4I+2X6lFh/h6GS5AYDq3PlTpAi9906Tlq+OHGVRVRD/aNVJSHIFh6WgPQSUnSGWo9w4uFDWjvHRI2z1fOPxiidM27RVXhxTBLpvKlG2IeceZzmkRQxgID9lx2WqTguSRvqSMOILF2DNMMl7hkDMpcEC785AeCxfltpiEqlPCM2qPMrSXlIGbYjZd/jEIKHQI8LgmCj080xcAvEFiAldkZpPWBmc8WLE0da/Hgr9WNks/pjCobhVKXtb+Uj6dD4BMOL7t+FTI6YkZnsF8TGGNpuEmlu90vdnTyy9rUwoD1dtgPpEK/hzOPTtWTwVw+iW8vyVkdmq5USgrjY0+Xn2EMmxsdAwE2MwZeCNt7w64nFcgwUf8VrDBpgym4gNzdXfR0dKp7iXthmFIGbr6TXNROjxZHSl4mITGRfwtTNRnGvAIc/Nx4XJWf7nZYDsiRoQGDep/xSDnY8w7oUjIvwzm9CdXRexYCkUBSw8= 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)(396003)(136003)(39830400003)(346002)(451199018)(109986016)(86362001)(36756003)(38100700002)(4326008)(70586007)(8676002)(66946007)(66556008)(66476007)(41300700001)(8936002)(54906003)(478600001)(316002)(44832011)(5660300002)(2906002)(2616005)(83380400001)(6506007)(6486002)(186003)(6666004)(6512007)(1076003)(26005)(266003)(37730700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pU7XFx2o8WfJOLx8hREwUxd5uEk96rSZhgVzveXDstF3yZ0Ox88P3FH7/Vxm2eh+dOTDII/P4M4OpTzFKqgO6eS0xinCjktPa1H3DtWpd6l0g04U5ZBTDjYv6eTsawjF2Va11D01Br4cYA+gONXT4kYG7Qr04hv1eRImf8t3/Fh+XBB97e0DhRck/QRGFmZ+6jby154IP7yn0kDUCX1bKf9fTxBtV3llODhTBKxr2vly9ttFLpcx9w7YPL0en7Hyj7tgaZAjJhZKTQfecpRNeKTY75E4vjtYkBsMdjHLRSt/pqZ4UhMMeATaDL1LfsIi53V4juad6UpiXwUHn9JAs2FCEBOVS/qr0VjuvyPim6hcX9pta0d7kCT577gYu/uLuDEfH7SRHTvxH+gRifRW46ipx7c8Y7HjLd5rF4l8B1dE3tEkCjXy4ruZX39r62KYQemH4Vh2OG74fAYGiFfpVkGlqj1XxITMaPMehAT3/VxubAbeBZm6Rh3pK8TilR84krLfAPKMBFLQCcQI5MJvXWnMgAgq+ADmeDGhVg+RLmQUkNgKvKpxnDXsofunF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message-Id: 00ea7371-fbdc-4212-ddac-08db23432196 X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2023 21:45:43.8247 (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: XAaYic6dNJpTxrxffYPpjWQ3Ge1NzdZgEnbZSVy8zXPPwB4/gKL/2yKtsNjJk1o5wHpwB3nTl5xAF+xZZg8HVXjbrQIBBjs5O2lHowax6tU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4P189MB2207 Received-SPF: pass client-ip=2a01:111:f400:7e1a::729; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-DB8-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 b2ea3a18ed..cb6993dd3b 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)) { @@ -1570,7 +1601,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 Mar 9 22:00:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13172080 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 8F440C74A5B for ; Mon, 13 Mar 2023 08:55:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbdxL-0006xs-DU; Mon, 13 Mar 2023 04:54:59 -0400 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 1pbdxK-0006xh-FR for qemu-devel@nongnu.org; Mon, 13 Mar 2023 04:54:58 -0400 Received: from mail-am6eur05on20706.outbound.protection.outlook.com ([2a01:111:f400:7e1b::706] helo=EUR05-AM6-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 1pbdxI-0005qS-LF for qemu-devel@nongnu.org; Mon, 13 Mar 2023 04:54:58 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WQ8wWp+PnQzvssvRr44qQ7AV/KFShKhDg4Wi9WQXZM6jsACtqiQityDlcsxEvLw1P9Nq523oVQLNbnKF/fAOZSsVBybRFFhIaWPu4gwWpw5FFoQoZcDK3tQ8keVLjOTBelYyH3cpuupwj9lx4aHCvbszzgCNm3KOiVW9cYHdOQp8Awbo9krHjvuK+HYetqz+7uAyNr8NOmmV2r5+c7MD3GNAv4vIyDxYwsg20FwuUwtUfvbf3A0yQYooS+2WIQtMF9k/MvnZ2q2YKjB3FWKn/EY0fAH9UAoizSyb70g1ZNpDDUFme4LLskdp3C7e259thJhX3rh4qtHt+vSOlk9J3g== 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=OZHRn57Hk8aHSg2InztEgw937fYItoUUlB+7TY7If6s=; b=DwZR5CoLi0tPlR50FuYpfqUfGLQigEPOhbcLJOB8LCAN3zO1S8IqZIk7F8IR3mR2UfJMBNUt0m1LhX1klzf2Dx7ex0aHaNjA1aKrLhAcjl8WzFLDK3kqTpbQRWM1XJywizq0erXxT2/0YvGmPtNh0nWf2+ludcOvw6ZAWGmjUl0TjJitVmhJHzmI+jRJSSJbAzf75Hv/DYq74Gr0nTtEkkVLFmiWKPrqTibuwYBaVJ2n/a2B6dXW+UsyszWHJQaDlcaxVY7e8blsHeCNC+T1SUJLgjkq7ZL4Dm8zGeXs1HeSsofEOq2iFw3QwksBiYbIQpmNWDAeQOM4mHYTfuDkdw== 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=OZHRn57Hk8aHSg2InztEgw937fYItoUUlB+7TY7If6s=; b=DkwR3ymckrNLUbaRfrVIiMI16W24VkVPYxvkoVfgocd6BzChmaWQx2UXEwyM7i5F5CYtjeNNTXmw1WOInj1FKTml2G09+F1HnY/Op5Z497rQUWk513GwGtHX9CanHZB0mI4RVGz9WoARyIUdxbQOmwejMkxizFzG43fySnk6d2o= 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 PAXP189MB1928.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:277::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Mon, 13 Mar 2023 08:54:50 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc%9]) with mapi id 15.20.6178.024; Mon, 13 Mar 2023 08:54:49 +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 v7 6/8] igb: respect E1000_VMOLR_RSSE Date: Thu, 9 Mar 2023 23:00:10 +0100 Message-Id: <20230309220012.25642-7-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230309220012.25642-1-sriram.yagnaraman@est.tech> References: <20230309220012.25642-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0034.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:9::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_|PAXP189MB1928:EE_ X-MS-Office365-Filtering-Correlation-Id: 2083f56f-ebc1-435f-d1b7-08db23a09a62 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e/g9XxyjSido7mA4LveEIq6r28FRkSWjmO95zBHvjkJXaTSbYBOe6yeb2XEowbQWp9IF6X+Da39KkKD11P3+tsdTr7n9LmmpW4meosRvLDlJowtL8YHwrD7bVGAPwFJMZQtrERi4KRreMXDxWuLqcuxYhJ1/Khh+Y3nR/L129OYHqqAwfCSv0FUCWjJvPkHKt1Gle/bz2LhlSuvPx/TcVIpKzPgXCqQd1PbMqrGGHaZhpBZgrJIEHtzWsyA+5sB5lBQ53PgpcBwpcbnztT9ggAVHr5ooTcRkSZCndgIcQCt2rIdnbwPxc/KirVV4QVn3PwBwn57qAQ015GMDxWDetPmar7sRAQI3Ub1L0iPoni08fKKibh3jLPPSlnGrdGqgPMAfAKhwxIhugGSg/dQFR2cjMHmKd2FOZR86UGT9VqRU7Xeww2WfHL0iiI/JchZcF7KxvqQjlBgIyKyz91R1icNuSxHEftbtTNMlE3Iyo2RKDyRzMoejZQBdWyhbwZyt4MgPNZrr+vObJSlV4PeuR+4DFlWGguHLnYd6sw0smmjqDWTph1UVfO2XqnwIFCXNBIQVuRSIe4UIyjBKl7M7U8Ilm2JNDH75Ea7sHoDVJsysARnSdWC53HOrG2OMwjRymM76BTmgStuw09MXLeHcEAWpARCksJeD9NPVTiYSgXMsyfjRWwiMa8EmI5KGU/Tx2vTvHHNUzSRe/mJaJ6Ql57i5e8t/Fr3S8do5mdW7KlI= 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)(39830400003)(136003)(346002)(396003)(376002)(109986016)(451199018)(8936002)(2906002)(41300700001)(44832011)(66946007)(66556008)(5660300002)(66476007)(70586007)(4326008)(8676002)(4744005)(478600001)(83380400001)(54906003)(316002)(6486002)(36756003)(6506007)(6512007)(1076003)(6666004)(186003)(26005)(2616005)(38100700002)(86362001)(266003)(37730700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e6ra+17ScNejKzj+WURHXI5gouEnxTf0rSrYyojgKq80MZNMnxD2weiNSvmikrwFHbI7xXCeDmc7sv7SwdKyzJt6/uEd1TuBxcMvz2a229nQb9/oesJbUuJlrWJDMzSOiLK6Bk1eu+SiPLeItAYZPv3Qpl5OE9MpwZGKmlJRL8QWTh3tC2aNTyRBldKKJ1iLIF2FL/Ssrn720k7tbX6DeC/E0huhqG9DbOvoj5V/M+WZIBzTk3NEPiGytLog+Z2BrGo6ixDqlKlCcX15EJM/iDi8T8hEf/MAAXMvJT8RpBJJSRWZSKV/BfenDBPwqw4Rfc0NDqjVr25fuwdMRjekRs9uTpUjp/vgyrjonj5DejdDXRSLdrqX7lvbFQLVbRwkmQJlopSuKRrRnzwqWDYX1mYyVJGhCGLdWMbytyj5mrnsRdNWEP+Leac51cBpruhd5EqJ6um6ipIyR9i64uoTxNLYqPpjdiQEsn4NfRDcfHR1mF/8bZorArYNJNRzwh7/H7r/6slmzi9mrom9OIfnBsbbkFpntSkYSTfZkzdD0vnf3YP5i6Cxfv2WUKloISwpmGEX3QcIjHl7p12xeaTRA/C0A5OuuSfnekLdIiVdLCQMr/5v9eg9Ngz5Io+L+PSrc0G0vmxudffMGs4JFZnOSutxYQ8XA+1k3zEbL3CjyryAmPC5MTx/pXYi9tsMjaGrYT+/z9bSfsbdDQYN7+7b+qA/itwn0qZ6uWzpqjXqQWRCwP5ZMjm47A/xH1y3QsTWxhgqLq3+1ajJYxn5F6qdguOyE84ArAK1Hm9nbyGkTv1j1FnkHhLjN7mb3wyUc2YoVJ7lxK6bj7Uxpxi5fPI4Y7P4fR/GjkULfBv56lubA5uxGi7cHgJ8QyWKPOdpQq6MWLIy5vRGlyXdsLwUNATZ50eeLxd/nhrCZXyDxkFI546MfFeVISUr0mLPIOpUOBu89OSwpWxXRu3T0+GwbTCBXN2oDhibZ+L72HFiVQ2MabPk03LXuMr4Doy0dT1waVtF0esBqBll5YRk99OHAauRDZ7hnBBvCT6NtkQwHxAT+EwnSBYMyaIC4dtciY7pBZNhc7reolJUfGqHKT3fQQ8ar4j6DI/NjX3TMh9GrLppvYWBJRtVe1RglDQcfjkF1sdFbR1W89cYLuQS+46myzSbhAsxo9BCWb4Dln9mcYsyIiZ6HtsPJUE4wJ7tRapCct7DnWm48D5qGczuOqQrNh8UYx8ZUwjzC4fFkxz1i8AI26fagZVEkY9um0bmhKpYBo1Zbgk+qjMjLttTdnMZy3OxlBM+8vdnEgSko1ofEwkL1X4nSYppbaNRRgvFp0xz5ACQsmrM7RbX0VmDlNSR8ljCWhV7boX7sI5QMtFaLQ6KG4CobIPW6I5+4oDTSLuXVpiXPEXwbJVJ7YoAX/gjt++f1WX0AoIdToRAAu5xHySU2GLpiClwArWXuqPhhD7A5CyjutTCeYpy4O3DSTPFmId0GanrnIs8R6BRcgnS0glRCeccjUsHvunj8VVRr1S6s946vpQkb8vqXv1p/wvxxyruejgu1PTxSwtzXqjvTA94R9U2OER+j5u2uAqkE00RgRtINewe8FjsCKzDAYz732l8sg== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: 2083f56f-ebc1-435f-d1b7-08db23a09a62 X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 08:54:49.6369 (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: np1++PWOMaSkD+UN8ngwi1nb3bF2ew+Ge9lqYQcsf80zBXdMY9DLD2lSwQbh8bvFHPFqUdtseGXrnQJP+xsD/S6UozJChMvjGikgz9tKXpk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXP189MB1928 Received-SPF: pass client-ip=2a01:111:f400:7e1b::706; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-AM6-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 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 cb6993dd3b..f91cea20e5 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 Mar 9 22:00:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13171881 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 BAD1BC6FD19 for ; Sun, 12 Mar 2023 21:47:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbTWE-0000T6-8v; Sun, 12 Mar 2023 17:46:18 -0400 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 1pbTW6-0000SF-1M for qemu-devel@nongnu.org; Sun, 12 Mar 2023 17:46:12 -0400 Received: from mail-db8eur05on20729.outbound.protection.outlook.com ([2a01:111:f400:7e1a::729] helo=EUR05-DB8-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 1pbTW4-0004XO-HO for qemu-devel@nongnu.org; Sun, 12 Mar 2023 17:46:09 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D877rCyhPHamJ6OeTiVIMY2YPG+ZjJ9Zxdk9STDddyOT73ckELixDMNeI80IwjGED/1P0BQ0rLg6IIRSBNDyGdGSeJTxDTLlRAHF92dGJat607i9F1Gor/TnTEZ5e+oGjuA5JNFaLU64oTbumJVmBhja19Yz5as0mExihnQmGZIj2/6W4/Umoe+zkVLGfoeEENaMzbkoHVbVR0m54s+ujpDfHPFyWH2vekYrqqkw7bwslYJJsDx06zvZ88KUkPu/FWzIzx1WLQWH/3XL3C0ecC2PRR39WKzUr4BDGo/oSzjvEvmMQhuyrjEkT84Dh4dr3eKYv8sgTL8kA5XD8058bQ== 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=fTm58uy61u9gD4G9c6pEDw/g8z/mc2WYJIkOAG9CgOg=; b=dZ5+OJ/DGMotS3Q8RBsILQN1n3yDKVy5A2dYPVHAJ4srGF2bXdsLdDIOZ+GFpv1f0uM3efZHAMYYRocJfKt4hb1EEIce5YtYH0E9AqZ7ar/A521uW6LJmXuyQ2TLllDI+Bw3ehD/gcvasolKB+Oh8gr2THk9PZDy8ajkkIzbkh3FtysEle2QiwHcG4o+RzqFTPPTQyGKqk3Y9ecL0lgntiO3iXr/RMNyC/d0K8ElRgbrvk1NNqoXAzkiQIdBkvQtzBZOC+BfovIx9+EbXeZ3PaW8lEmMu0/5/WU8bFptkw29XElxKekAglmK6AyI8vIQ8uzsNQiAMQcubEHERZqHlQ== 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=fTm58uy61u9gD4G9c6pEDw/g8z/mc2WYJIkOAG9CgOg=; b=R5s/PsegyFDuwwOF5b5kk6D/JtE5s3F6SAvc3r94NlJQqVb6z2l8IZZNkNROk9XhPA0/E8v+xA1XxdaekSIuly29UvNXC2hiKz32NwinOUTKn9qtOndIKW2pRUOQ4C3cRkxIL9wXkxnHwk/UPyxZQbOrpboi0syV4rO4kW1Gt2M= 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 AS4P189MB2207.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:58e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Sun, 12 Mar 2023 21:45:46 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc%9]) with mapi id 15.20.6178.024; Sun, 12 Mar 2023 21:45:46 +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 v7 7/8] igb: implement VF Tx and Rx stats Date: Thu, 9 Mar 2023 23:00:11 +0100 Message-Id: <20230309220012.25642-8-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230309220012.25642-1-sriram.yagnaraman@est.tech> References: <20230309220012.25642-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0100.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:8::14) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|AS4P189MB2207:EE_ X-MS-Office365-Filtering-Correlation-Id: 12ae61ff-3505-4273-24d0-08db234321c4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U64ku1eD1BEOOURwIkq5KcGibfIxmZoDS8S8Kg+QJqlcuj6NGgEqWBLPiCYmu698PaXwiu5yUAgUWObphiGbJcT/oxzI8EXiXQJb8fMYFs5QbIZ717FA0s7GdERZh33h7Q+HRSF5Fafw1TCXR95tcjtJMe6S5yjUGv3poNgIWUYPPlyYFrw8K0mWr6sRqkjdhISu3oy6tkc1Hl7lqsUFsK6CV0V51wcBd27jE7gE8io4SJ28QgFXo7CtJf3LBpqvIVk3s8EeF2u14+dQkOFPVvV8WfU8MZz+r8SR+kM1Addpx/ZgJ9YhM3f7fIJhiwxLj8/VnyD5/mz7+T4hmXWuf7CWXN+H5TDfLMdajyTuAdBYGyb2TwxEOajl5s0XB7ggiYMT5OBPa+l7tvGY6uo4xretHCGO0eGO7WGx6wwCUDtdEf2XCWHa1+dlTgDsh1QGhAxVD24wSROzpUTLpkX7Y0071vQXaqCx/TJp8+Efy0Rm/Ph6pM3EGNdAcbtNbVU+nOETOVL1luxK9UI/QdwDQciOevmb/TTxXyjXfeAy5dqV17/1gPHK/+ZngP3lAXvYVlffel2MaNWIhQ9FNX/xjVM5XadjPYcJQMaAslPMdukOGw3BUG8L3cQUKBkiiMHAalmQaSPd0mcS2RdXXWHcD/kdjlDJ4f//w0mZ/DY4ddl+JtJeZClRErUmQOI2/NjJKOn1boIrp49oalKMHYoKuQ5lf06jLWtZ2GJE4/BoJTY= 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)(396003)(136003)(39830400003)(346002)(451199018)(109986016)(86362001)(36756003)(38100700002)(4326008)(70586007)(8676002)(66946007)(66556008)(66476007)(41300700001)(8936002)(54906003)(478600001)(316002)(44832011)(5660300002)(2906002)(2616005)(83380400001)(6506007)(6486002)(186003)(6666004)(6512007)(1076003)(26005)(266003)(37730700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-M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JSc2iQxau2iPDtaAWwWDF50mkSMClteY3k6HhXyuQA/A2cEojcQGuox0keWuXGzxO8K09+4nItDF/Dn6A/ET/P9Jhik2VDP2T1LR5cxjWdGuiTTjh578Oeyt4oEvXtd3LbOY1CUJ0DBbhP9tlZ2uekOQLAvDw7zlevPsZBDeRDwLK6XLVc03kW80ehbbVJBBWzB615rB+RlDevNlWyOAtygkm+BkSvVlu6ne/WNzcE+mTbm/B/g34XOKr8VNHgcDtmThuOe0DfFux/AWqvh9hTA0/QHE6vpSJQAVigBot/kOxHrkUoetdEsBgOEo8Digr+S8JAvuNM+BFM+0u+rNcKZQzNixtUxJJlAxb5l8vqqNIwYpdQHYq+4YcrJeOa9UhmEZTeMAWMOffBNXiShPBrco2PtSPgmBaxsNMzEX5SZ6eja4P9gHS6pcs9VbJ/iMENpS/y1hmDWTLDn0YQZvBHJjP6enwA+FpaD53LQTpV6wDOrFS6IFd9IYp3i/mv3fM3mDEaPtyK5dq1gVxEU6vxKVqBlRpM0SND4BUC9Vb/aoYPukeGCP3RPtFOw== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: 12ae61ff-3505-4273-24d0-08db234321c4 X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2023 21:45:44.0590 (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: FZhLXiDixp/uhnb7OdryzuHg1uCwG+zMyTSAXAp+6egX8aKab3cXepTONVBMyHSLk7iujn+op+tUIfB2A1GmNSJqh0taxuWFf3hI1/bi7+E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4P189MB2207 Received-SPF: pass client-ip=2a01:111:f400:7e1a::729; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-DB8-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 f91cea20e5..86de73afc8 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); } } @@ -1403,7 +1410,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); @@ -1419,6 +1427,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 @@ -1520,7 +1538,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 Mar 9 22:00:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13171879 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 479ABC6FD19 for ; Sun, 12 Mar 2023 21:47:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbTWE-0000Tq-Ri; Sun, 12 Mar 2023 17:46:18 -0400 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 1pbTW8-0000SM-C8 for qemu-devel@nongnu.org; Sun, 12 Mar 2023 17:46:12 -0400 Received: from mail-db8eur05on20729.outbound.protection.outlook.com ([2a01:111:f400:7e1a::729] helo=EUR05-DB8-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 1pbTW6-0004XO-9V for qemu-devel@nongnu.org; Sun, 12 Mar 2023 17:46:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gSFq6GhoXDZuHfoYq+mX9HKuryHzVxGBTlxsxM3b5UcSRkJ/R6Yy1KhIQsb4mSmomALA5us9mkW5iUqmg0TXMK6DtvfTaFiNzlh1UMBQYhttn+qOTcwwBiuGTxdQ+Rhs/zHNKQgysIC44N5FmnAfTXMNLRPno7KFAIqYxjAgde3g2h4jCJDqI3eYXnURtZ/jwN/ewAbjVk2FaB8Mv4LhEHh8xUIBySWuaBf3/WIjpGzl63Vb94ViJkFzDa52vBR0fUezXL+hPYGKbEeMp/WcHYyR6Aa+7o1Vjy1b4t2K5RPpgNSUEGcE+PnKdg2qTVkoL75LvrGHHMyv91O6GGMHCQ== 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=OeRkPGBdar7d/I4dBZJhsLaOIX91qkbv+w++kMRxodU=; b=THBHm7vBTs0Y6L/09h3n+0fhAC75i70/PNyrS6CUNhIRUM8oxnA4C1gKds+n2lcjjO8XPrcoiaKxUBxtLMtWS1AtkSbjlh4QOlzWt/w/uJsXtzNabAFxk05Nc/clfK76dltDsgEnVL5znPGM8GsbGdUGzUi5tpB2UFmMI5WkpoCUZurxzR0DxpPAjdUB8uyCPuGfDhcc2YDd/l6HvbzNgzRSaDVTAkT5y9uZDImMklWNNnNXA+ZPYbI8Pk5NlkNMJSxpTy2U6BJGES39YCEtDN8gW/oz7fjkoZRqMkbHoarnPMKhldWJ7ijfVZgMvdb/J7c0s5nfsnDFQV5EZN7XdA== 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=OeRkPGBdar7d/I4dBZJhsLaOIX91qkbv+w++kMRxodU=; b=YjpaoZwNHSt2fAaoqZmsgCaXrLRvDAOxa5fUoAaSToGVlahBBFpDt2jFzXsZZChdSuZVDGNt7CsukeFaeFNlc/hI/j7QZbmY3nX9a35H2JTePDCXuMdcvnGphCM0piOQ1vltAY1+qeNgX2QuWDa+erHxhNJNqEGqWD9Sr6UFNo8= 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 AS4P189MB2207.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:58e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Sun, 12 Mar 2023 21:45:46 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::13ad:a312:15c6:91dc%9]) with mapi id 15.20.6178.024; Sun, 12 Mar 2023 21:45:46 +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 v7 8/8] igb: respect VMVIR and VMOLR for VLAN Date: Thu, 9 Mar 2023 23:00:12 +0100 Message-Id: <20230309220012.25642-9-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230309220012.25642-1-sriram.yagnaraman@est.tech> References: <20230309220012.25642-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0095.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:8::6) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|AS4P189MB2207:EE_ X-MS-Office365-Filtering-Correlation-Id: ab5eeebe-1897-4116-ad9d-08db234321cd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AYryenP31rlmDz1P+xsEwJkMPjz/acfPNoEjBtrW5TxRONPQ2efhV4jcof8h1HNaTjd645dLblDjkD6mjaqyas1csZS4/hAa2qGEzYA6eGQgLJw4iFC2wD9EbLyVU5M/byrIXeRcx4abaId2wKRUjQ/WHBUpdObiF0pH5NIymZ1EexCLCyojohvrcEIR1pwGkg/wUdZ5UCeHggl91vPuA5WPpYNuNy6X8E2ttcQxb3eCmsi59+Ivpz3Q23OyzCKWugMqD4lAitM3sfATAVKlCPvT0BDP/1Zc9bhJeo0Lclh7/Vrcjdr5wjQaYLO13Ll9dZqvVokx4vcZXA9jKflW0InAO3iGSsUpizHLrmAK+9DCv6mLi67LOpKuQFGFz5ZF/EzOBOgtc7LrM2JidBKeALeaon2mgsIjEasGseqQG33g6QWvtdaTBErfUPZgyItOjLLOiI2voLXuYe9+Gz9eNv8jlmybyJOdxI4HS6ZrYBVcRnlG31t9BoNC6+nqgHQTtQURlqHScenX5BTkAIk4yAkA5xsMNXC/hpqO4LN4wdCOnUU9o4rbLt+ynF/JkdvEgKNZrlVO4SfLyyCbLrH3Vn4YtihQ0usKG2wWEIa0u9BWi4ysjvioT/iJGNbgsUhdfSSkClL20eZXTDL0jrzzYu3TS9aFsI+WMhCZ9ZVstFRamgvcvILuu5jGJxeiEPQ0tXHnpuFHq9bHK2iwAV36Py2Klb+JlyDmwV+tKADgvbM= 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)(396003)(136003)(39830400003)(346002)(451199018)(109986016)(86362001)(36756003)(38100700002)(4326008)(70586007)(8676002)(66946007)(66556008)(66476007)(41300700001)(8936002)(54906003)(478600001)(316002)(44832011)(5660300002)(2906002)(2616005)(83380400001)(6506007)(6486002)(186003)(6666004)(6512007)(1076003)(26005)(266003)(37730700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xi4VMxcFj63Hjlyf+IonFfJkq/wlTBNf+dHrgF4QvgXjEP12J5aLzOqyUKe9LTWp9MXbdPMWo5nhm8g3GgMOfyqsUCJRG67UE4RUXqSAQnwd6CeU+rGyiHv8aU/e5KrdHjVxi+yV9ePTzILT8TgjYlCk6/yZ3mZFK8Psvo+i3xwNvKxomPaspauyKycvNwjS+L3ClWkKbzBHEX+A/Tsi6+ef8VhHtMyhfaQJ+FwPn2Vmk2oVfo3aXAOFEQJBWPSipy6YZX8M4/FdUsXbDWw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LoGD1exYY/JbrbZxipBWJNuw/SOJ2cYois+5WoOAexreDxp0hSRSYy2avEEq6bV4cDJyy6HXyG+hlw2ps9OZHEw8Xf875G+BamKm9IZ4a/RjBKKLcp4KaQdGVrq50eFoKANE8lSEgCGq5+vDPmqSIyS01OFRBXno4TH3Bm88MY1wkoV07E9NtSDg2esDnUvMgRnF4t/cSXCcQUMDym9QcapjhKk6nA2JQlGj6b2lvCPIT3dAxWgAVAivcdFANUepjDsoX7f+gJu10OaGh55i5XewmXsmEKNO8w== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: ab5eeebe-1897-4116-ad9d-08db234321cd X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2023 21:45:44.1371 (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: 3f09q6QnKTUmtfnFaCkjYFvgZzZn2dUq6d7f9StredXOTzw6cgNgOppZ1Qhh6p8kcyDszLXEPgoXCOvQDWR0VOgdcSMmNDERnYB7gbaLN8Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4P189MB2207 Received-SPF: pass client-ip=2a01:111:f400:7e1a::729; envelope-from=sriram.yagnaraman@est.tech; helo=EUR05-DB8-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 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 | 51 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 86de73afc8..3c0fb19b1e 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); } @@ -1541,6 +1561,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) { @@ -1621,10 +1655,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) { @@ -1632,9 +1663,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); - for (i = 0; i < IGB_NUM_QUEUES; i++) { if (!(queues & BIT(i)) || !(core->mac[RXDCTL0 + (i * 16)] & E1000_RXDCTL_QUEUE_ENABLE)) { @@ -1643,6 +1671,13 @@ 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);