Skip to contentSkip to conversation

doc: announce change in power API

PATCH Superseded Hajkowski 6 participants 9 messages Mar 13, 2019 – May 13, 2019

lore
Share & tools
lore

Hajkowski

author
#0 lore raw

PATCH 1/1 doc: announce change in power API

From: Marcin Hajkowski <[email protected]>

Function rte_power_set_env will no longer return success on attempt to set env in initialized state.

---
 doc/guides/rel_notes/deprecation.rst | 5 +++++
 1 file changed, 5 insertions(+)
doc/guides/rel_notes/deprecation.rst +5 -0
index 1b4fcb7e6..7899e6874 100644
@@ -75,3 +75,8 @@ Deprecation Notices
 
 * crypto/aesni_mb: the minimum supported intel-ipsec-mb library version will be
   changed from 0.49.0 to 0.52.0.
+
+* power: ``rte_power_set_env`` function will no longer return 0 on attempt
+  to set new power environment if power environment was already initialized.
+  Instead, the function will return -1 unless the environment is unset first
+  (using ``rte_power_unset_env``).
Signature · 13 lines
2.17.2

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
#4 lore raw
Quoted 11 lines · Thomas Monjalon
Quoted 8 lines
Quoted 6 lines

From: Marcin Hajkowski <[email protected]>

Function rte_power_set_env will no longer return success on attempt to set env in initialized state.

Any other comment about this deprecation notice?

Seems ok to me, though the actual text is maybe a little unclear. It implies that the function will always return -1 unless the variable is unset when the function terminates (which seems to imply a failure case). What I presume is meant is that we have three possibilities:

* The variable is set by the function -> return 0
* The varaible is already set, so no action needed -> return -1 (and set rte_errno to EEXIST or EALREADY??)
* Setting the variable failed -> return -1 (and set rte_errno to ??)

Is my understanding correct? Can the deprecation notice be improved to make it clear that only the middle case is the one being changed, e.g. by adding "in this case" to the second sentence. It might also be worthwhile calling out what the errno value will be to identify this failure vs regular failures.

/Bruce

PS: For this case, is there a reason to make it an error? Would a +1 value not also do, so anything non-zero implies no work done, and anything >=0 means that the value is set? Call set on something already set doesn't really seem like an error case to me.

#5 lore raw
Quoted 28 lines · Bruce Richardson
Quoted 11 lines · Thomas Monjalon
Quoted 8 lines
Quoted 6 lines

From: Marcin Hajkowski <[email protected]>

Function rte_power_set_env will no longer return success on attempt to set env in initialized state.

Any other comment about this deprecation notice?

Seems ok to me, though the actual text is maybe a little unclear. It implies that the function will always return -1 unless the variable is unset when the function terminates (which seems to imply a failure case). What I presume is meant is that we have three possibilities:

* The variable is set by the function -> return 0
* The varaible is already set, so no action needed -> return -1 (and set rte_errno to EEXIST or EALREADY??)
* Setting the variable failed -> return -1 (and set rte_errno to ??)

Is my understanding correct? Can the deprecation notice be improved to make it clear that only the middle case is the one being changed, e.g. by adding "in this case" to the second sentence. It might also be worthwhile calling out what the errno value will be to identify this failure vs regular failures.

Quoted 6 lines

/Bruce

PS: For this case, is there a reason to make it an error? Would a +1 value not also do, so anything non-zero implies no work done, and anything >=0 means that the value is set? Call set on something already set doesn't really seem like an error case to me.

Sorry, forgot to put:

For changing the ABI itself, no issues, so with the small rewording asked for, please add my ack.

author
#7 lore raw

PATCH v2 1/1 doc: announce change in power API

In reply to Hajkowski

From: Marcin Hajkowski <[email protected]>

Function rte_power_set_env will no longer return success on attempt to set env in initialized state.

---
 doc/guides/rel_notes/deprecation.rst | 5 +++++
 1 file changed, 5 insertions(+)
doc/guides/rel_notes/deprecation.rst +5 -0
index b47c8c254..504ca7ec6 100644
@@ -82,3 +82,8 @@ Deprecation Notices
 * cryptodev: the ``uint8_t *data`` member of ``key`` structure in the xforms
   structure (``rte_crypto_cipher_xform``, ``rte_crypto_auth_xform``, and
   ``rte_crypto_aead_xform``) will be changed to ``const uint8_t *data``.
+
+* power: ``rte_power_set_env`` function will no longer return 0 on attempt
+  to set new power environment if power environment was already initialized.
+  In this case the function will return -1 unless the environment is unset first
+  (using ``rte_power_unset_env``). Other function usage scenarios will not change.
Signature · 1 line
2.17.2