<div dir="ltr"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><br>
> + def run_app(self, numvfs: int | None = 0) -> list[CryptodevResults]:<br>
> + """Run the cryptodev application with the given app parameters.<br>
> +<br>
> + Raises:<br>
> + SkippedTestException: If the device type is not supported on the main session.<br>
> + RemoteCommandExecutionError: If there is an error running the command.<br>
> +<br>
> + Returns:<br>
> + list[CryptodevResults]: The list of parsed results for the cryptodev application.<br>
<br>
Missing the args docstring. Speaking of which, What is the theory<br>
behind passing a vf count from the testsuites to the app? In terms of<br>
what the testsuites require, and whether that aspect should be<br>
configurable from the user side, why the default is zero, etc.<br></blockquote><div><br>The theory behind this is that some test suites in the future that use scheduling will require to use multiple VFs.<br>I think that if this varies on a per test case basis, then it should be configurable within a test case. In regard to the<br>default, it should be assigned to one, not zero. As the application requires at least one VF. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
> diff --git a/dts/configurations/nodes.example.yaml b/dts/configurations/nodes.example.yaml<br>
> index 3f23df11ec..1fc0a38bf5 100644<br>
> --- a/dts/configurations/nodes.example.yaml<br>
> +++ b/dts/configurations/nodes.example.yaml<br>
> @@ -20,6 +20,12 @@<br>
> hugepages_2mb: # optional; if removed, will use system hugepage configuration<br>
> number_of: 256<br>
> force_first_numa: false<br>
> + # cryptodevs: # optional; add each physical bdf as its own element in the list<br>
<br>
I would rephrase to clarify:<br>
<br>
"Uncomment to run cryptodev tests; add physical cryptodev devices by their BDF"<br>
<br>
I also think that we are at a place now where we have a number of<br>
optional fields in the config files that can be commented or<br>
uncommented, and there may be value in explicitly calling this out,<br>
perhaps with a one liner above all of the YAML fields. I think you are<br>
going in the right direction with your comment, but then we have other<br>
fields which are optional that don't have the same explanation, or<br>
it's phrased differently, resulting in documentation which is<br>
inconsistent and potentially confusing to new people who just want to<br>
fill out their config files. What do you think agree/disagree? If you<br>
agree can you come up with something? Thanks.<br></blockquote><div><br>I think this is a reasonable request, maybe we can have a disclaimer at the top of the file<br>that states which variables are optional with a short description of each one and some optional<br>tag each time it is used within the file. For example, <br><br># Optional Arguments:<br># cryptodevs: uncomment to run cryptodev tests; add physical cryptodev devices by their BDF<br># crypto_driver: the device type of the DUT e.g. (crypto_qat, crypto_zuc, crypto_aesni_mb)<br># hugepages_2mb: optional; add each physical bdf as its own element in the list,<br># if removed, will use system hugepage configuration </div><div><br> cryptodevs: # see 'Optional Arguments'<br> - name: cryptodev-0<br> pci: "ffff:ff:ff.f"<br> os_driver_for_dpdk: vfio-pci # OS driver that DPDK will use for the cryptodev VFs<br> os_driver: _ # This is unused but a value is necessary to run dts<br> crypto_driver: # see 'Optional Arguments'<br><br>Let me know what you think. :) </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> + # os_driver: _ # This is unused but a value is necessary to run dts<br>
<br>
If there is really no point in populating the os_driver field, is it<br>
possible to remove the field and force the config parser step in the<br>
framework be tolerant to this?<br></blockquote><div><br>This is kind of a shortcut, A crypto device is identical to the already implemented port class; except that it<br>does not require an os driver. This field cannot be made optional with this approach but its value has no<br>effect on test runs.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> + """Retrieve virtual functions from active crypto vfs.<br>
> +<br>
> + If numvfs is `None`, returns all crypto virtual functions. Otherwise, returns<br>
> + `numvfs` number of virtual functions per physical function rounded down. If a number of<br>
> + `numvfs` is less than the number of physical functions, one virtual function is returned.<br>
<br>
I am wondering about this design. So, the form of the return value is<br>
unpredictable? What do the testsuites actually require?<br>
<br></blockquote><div> <br>This will be redesigned in my v4, It should return the exact number of vfs requested or raise an exception<br>if an invalid number of vfs are called.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
> + def instantiate_crypto_vf_ports(self) -> None:<br>
> + """Create max number of virtual functions allowed on the SUT node.<br>
> +<br>
> + Raises:<br>
> + InternalError: If crypto virtual functions could not be created on a port.<br>
> + """<br>
> + from framework.context import get_ctx<br>
> +<br>
> + ctx = get_ctx()<br>
> +<br>
> + for port in ctx.sut_node.cryptodevs:<br>
> + self.crypto_pf_ports.append(port)<br>
> + self.delete_crypto_vf_ports()<br>
<br>
populating crypto_pf_ports in the instantiate_crypto_vf_ports method?<br>
Possible single responsibility principle violation but not a huge deal<br>
if it cannot be cleanly populated "earlier."<br><br></blockquote><div>This follows the behavior of the 'instantiate_vf_ports' method. The idea here is that we will never want to instantiate <br>the crypto PF ports without the VFs. For this reason I thought it was appropriate to do it in one method.<br></div></div></div>