From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 49E9745838; Wed, 21 Aug 2024 23:31:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B1C7F42E44; Wed, 21 Aug 2024 23:31:10 +0200 (CEST) Received: from mail-io1-f99.google.com (mail-io1-f99.google.com [209.85.166.99]) by mails.dpdk.org (Postfix) with ESMTP id 5A11942E1C for ; Wed, 21 Aug 2024 23:31:09 +0200 (CEST) Received: by mail-io1-f99.google.com with SMTP id ca18e2360f4ac-81f9339e534so4062839f.3 for ; Wed, 21 Aug 2024 14:31:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1724275868; x=1724880668; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z8zYhPZWI64RRFqa9ZLdttUYZYQ8/fRrqM6Y+FxHvgc=; b=baUX2dWApYJ/6IRG1Bep7CZOHSKxjufo9NPrjLlfqpwMOrmTjt59ZfoH98qRgOeu3b 03LddU0HiqVI769dgFbBF9sTQT1cLgEIYMYg7HuFFZhgfUuOzdvmD6tW1vM+UGStthy8 o+kuPWsBRkkerzYQJ4FwCrBoVM5ffoFowXF0E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724275868; x=1724880668; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z8zYhPZWI64RRFqa9ZLdttUYZYQ8/fRrqM6Y+FxHvgc=; b=lxDF/2nsaPpsLB0b9t3HUhp7Qq6S2BLia86OUOfdKRglOzSXX1WsI4bMFHGpRlAbzG LGf5Ri661fl1CNY8/jah46DwSTGp/YiBQ5pYnF3yS9NwI+6Fbuc57KWwPoAAkBSukH5Y +gIh/jil8YRYxur0RoDEGjbG25AonISO474WMcdUUrICqc1ujDSdztEqmVD8QwL+DBPU x91tEFHCBomHtNjJVVeTwemT2nigkAx5jH3sCP0n+ms7M9NRvn6BzKBXm+DFaaFlm9/8 /ZejUz8wqvgIgvo7RhMAotzV3CVdtbRP4cDikiKz4STm1gKAQZDyYQrLahjACpyfgnRm 0wig== X-Gm-Message-State: AOJu0YyqItU2w/jSTAN7f9bdqJcUtI7jwse/q5YECxJ45m8i/VeISS5H plpfwqSCPq/GT9tJPrwvJ3N5kmDhMSZHr50kExqnJRaUiF0vNlAvcMwCJyY/RHVXJSBuGX6DDre N/OmFRABh4Sv+FIpXy80k2xqLyqqKOt3B X-Google-Smtp-Source: AGHT+IEJblk3GhTRrO/R+qb1tVPjEA9o0uXVAADY/5XC2wFMKMS/5JnypIwKc/E+BTbfc9ZDi9sSw82mnh+3 X-Received: by 2002:a05:6602:6087:b0:822:43ef:99d1 with SMTP id ca18e2360f4ac-8252f2f35f0mr557961539f.2.1724275868597; Wed, 21 Aug 2024 14:31:08 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id 8926c6da1cb9f-4ce70f95ff0sm10978173.50.2024.08.21.14.31.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Aug 2024 14:31:08 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id 89982605C352; Wed, 21 Aug 2024 17:31:07 -0400 (EDT) From: jspewock@iol.unh.edu To: Luca.Vizzarro@arm.com, thomas@monjalon.net, paul.szczepanek@arm.com, wathsala.vithanage@arm.com, probb@iol.unh.edu, yoan.picchi@foss.arm.com, juraj.linkes@pantheon.tech, Honnappa.Nagarahalli@arm.com, npratte@iol.unh.edu, alex.chapman@arm.com Cc: dev@dpdk.org, Jeremy Spewock Subject: [RFC PATCH v3 3/5] dts: add class for virtual functions Date: Wed, 21 Aug 2024 17:30:40 -0400 Message-ID: <20240821213042.24814-4-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240821213042.24814-1-jspewock@iol.unh.edu> References: <20240821191557.18744-1-jspewock@iol.unh.edu> <20240821213042.24814-1-jspewock@iol.unh.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock In DPDK applications virtual functions are treated the same as ports, but within the framework there are benefits to differentiating the two in order to add more metadata to VFs about where they originate from. For this reason this patch adds a new class for handling virtual functions that extends the Port class with some additional information about the VF. Bugzilla ID: 1500 Signed-off-by: Jeremy Spewock --- dts/framework/testbed_model/port.py | 37 ++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/dts/framework/testbed_model/port.py b/dts/framework/testbed_model/port.py index 817405bea4..c1d85fec2b 100644 --- a/dts/framework/testbed_model/port.py +++ b/dts/framework/testbed_model/port.py @@ -27,7 +27,7 @@ class PortIdentifier: pci: str -@dataclass(slots=True) +@dataclass class Port: """Physical port on a node. @@ -80,6 +80,41 @@ def pci(self) -> str: return self.identifier.pci +@dataclass +class VirtualFunction(Port): + """Virtual Function (VF) on a port. + + DPDK applications often treat VFs the same as they do the physical ports (PFs) on the host. + For this reason VFs are represented in the framework as a type of port with some additional + metadata that allows the framework to more easily identify which device the VF belongs to as + well as where the VF originated from. + + Attributes: + created_by_framework: :data:`True` if this VF represents one that the DTS framework created + on the node, :data:`False` otherwise. + pf_port: The PF that this VF was created on/gathered from. + """ + + created_by_framework: bool = False + pf_port: Port | None = None + + def __init__( + self, node_name: str, config: PortConfig, created_by_framework: bool, pf_port: Port + ) -> None: + """Extends :meth:`Port.__init__` with VF specific metadata. + + Args: + node_name: The name of the node the VF resides on. + config: Configuration information about the VF. + created_by_framework: :data:`True` if DTS created this VF, otherwise :data:`False` if + this class represents a VF that was preexisting on the node. + pf_port: The PF that this VF was created on/gathered from. + """ + super().__init__(node_name, config) + self.created_by_framework = created_by_framework + self.pf_port = pf_port + + @dataclass(slots=True, frozen=True) class PortLink: """The physical, cabled connection between the ports. -- 2.46.0