Skip to contentSkip to conversation

ioreq_broadcast(): accept partial broadcast success

PATCH In review Per Bilse 3 participants 4 messages Dec 6, 2022 – Dec 7, 2022 1 message not in the archive

lore
Share & tools
lore

Per Bilse

author
#0 lore raw

PATCH v2 1/1 ioreq_broadcast(): accept partial broadcast success

Avoid incorrectly triggering an error when a broadcast buffered ioreq is not handled by all registered clients, as long as the failure is strictly because the client doesn't handle buffered ioreqs.

---
v2: Complete rethink with better information. A lot of simplicity was added.

---
 xen/common/ioreq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
xen/common/ioreq.c +2 -1
index 4617aef29b..568e7aea91 100644
@@ -1317,7 +1317,8 @@ unsigned int ioreq_broadcast(ioreq_t *p, bool buffered)
 
     FOR_EACH_IOREQ_SERVER(d, id, s)
     {
-        if ( !s->enabled )
+        if ( !s->enabled || (buffered &&
+                    s->bufioreq_handling == HVM_IOREQSRV_BUFIOREQ_OFF) )
             continue;
 
         if ( ioreq_send(s, p, buffered) == IOREQ_STATUS_UNHANDLED )
Signature · 1 line
2.31.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 8 lines · Per Bilse

Avoid incorrectly triggering an error when a broadcast buffered ioreq is not handled by all registered clients, as long as the failure is strictly because the client doesn't handle buffered ioreqs.

---
v2: Complete rethink with better information. A lot of simplicity was added.
---

#2 lore raw
In reply to Per Bilse

xen/common/ioreq.c unsigned int ioreq_broadcast(ioreq_t *p, bool buffered) · line 1321

Quoted 9 lines · Per Bilse
xen/common/ioreq.c +2 -1
@@ -1317,7 +1317,8 @@ unsigned int ioreq_broadcast(ioreq_t *p, bool buffered)
 
     FOR_EACH_IOREQ_SERVER(d, id, s)
     {
-        if ( !s->enabled )
+        if ( !s->enabled || (buffered &&
+                    s->bufioreq_handling == HVM_IOREQSRV_BUFIOREQ_OFF) )

Nit: Bad indentation. Since inserting the missing blanks would make the line too long, the expression wants re-wrapping. Can certainly be done while committing.

Jan

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

(Cc to xen-devel@ re-added; I don't see why it was dropped)

Quoted 5 lines · On 07.12.2022 11:25, Per Bilse (3P) wrote:
Quoted 4 lines · Jan Beulich
Quoted 2 lines · Per Bilse
xen/common/ioreq.c +2 -0
+        if ( !s->enabled || (buffered &&
+                    s->bufioreq_handling == HVM_IOREQSRV_BUFIOREQ_OFF) )
Quoted 8 lines
Quoted 3 lines

Nit: Bad indentation. Since inserting the missing blanks would make the line too long, the expression wants re-wrapping. Can certainly be done while committing.

Thanks for the feedback, but what should the indentation be (and where would I find the information)? I checked the coding style and it simply says "Long line should be split at sensible places and the trailing portions indented."

You'll find ample examples throughout the tree. Indentation of pieces of expressions should be such that related pieces align. Hence in the case here it could be

        if ( !s->enabled || (buffered &&
                             s->bufioreq_handling == HVM_IOREQSRV_BUFIOREQ_OFF) )

but since that's too long a line it'll want to be e.g.

        if ( !s->enabled ||
             (buffered && s->bufioreq_handling == HVM_IOREQSRV_BUFIOREQ_OFF) )

or

        if ( !s->enabled ||
             (buffered &&
              s->bufioreq_handling == HVM_IOREQSRV_BUFIOREQ_OFF) )

(of which I prefer the former, and that's what I'll convert to if I end up committing this change).

Jan