[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] ioreq_broadcast(): accept partial broadcast success


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Per Bilse <per.bilse@xxxxxxxxxx>
  • Date: Fri, 25 Nov 2022 14:15:57 +0000
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Per Bilse <per.bilse@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 25 Nov 2022 14:16:39 +0000
  • Ironport-data: A9a23:TKwoT6Ou9Q8hzWTvrR2hl8FynXyQoLVcMsEvi/4bfWQNrUol0WQOy WIaDGGCPf6LYjf9etgib4vnoUsP7cLRnYAyGQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQA+KmU4YoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGj9SuvzrRC9H5qyo4mpB5AFmP5ingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0vd3JWVPs uJGEzZXSEmZjsOZ4OqjFPY506zPLOGzVG8eknRpzDWfBvc6W5HTBa7N4Le03h9p2JoIR6yHI ZNEN3w/N3wsYDUWUrsTIKozhqGCh33kfhVTqU6PpLpx6G/WpOB0+OixboKIIIzRLSlTtkmDi W3H3kn5PkklFvjP9GCgriyKr8aayEsXX6pNTeblp5aGmma72Wg7GBAQE1yhrpGRiESzRtZeI Ew84Tc1oO4580nDZsnwWVi0rWCJujYYWsFMCKsq5QeV0K3W7g2FQG8eQVZpcNU7sOcmSDps0 UWG9+4FHhQ27ufTEyjEsO7J83XiYkD5MFPuewcVTS8B4p79/ro11DSWVN9CP47tloPqTGSYL y+xkAAygLAajMgu3qq9/Ezajz/EmqUlXjLZ9S2MADv7s1oRiJqNItXxtAOFtaoowJOxFAHpg ZQSpySJAAni57mpnTfFfugCFarBCx2tYGyF2g4H83XMGl2QF5+fkWJ4umkWyKRBaJxsldrVj Kj752tsCGd7ZifCUEOOS9vZ5gRD5fGI+S7Zfv7VdMFSRZN6aRWK+ipjDWbJgT68yxFwwfxuZ M7BGSpJMZr9If03pAdaus9HieN7rszA7T27qW/HI+SPjuPFOS/9pUYtO1qSdOEphJ5oUy2Mm +uy9qKilX1ibQEJSnSNqN5DcwxaRZX5bLivw/Fqmie4ClIOMAkc5zX5mNvNp6QNc3xpq9r1
  • Ironport-hdrordr: A9a23:+JDjsatDUKt0EiND1FVXMsHK7skDfNV00zEX/kB9WHVpmszxra +TdZMgpHrJYVcqKRYdcL+7WZVoLUmwyXcX2/hyAV7BZmnbUQKTRekIh7cKqweQfxEWndQy6U 4PScRD4aXLfDtHsfo=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

A change to XAPI varstored causes an unnecessary error message
to be logged in hypervisor.log whenever an RTC timeoffset update
is broadcast.  In extreme cases this could flood the log file.
This patch modifies ioreq_broadcast() to allow partial success.

Signed-off-by: Per Bilse <per.bilse@xxxxxxxxxx>
---
 xen/arch/x86/hvm/io.c   | 2 +-
 xen/common/ioreq.c      | 9 +++++----
 xen/include/xen/ioreq.h | 2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 0309d05cfd..c4022bf7c2 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -60,7 +60,7 @@ void send_timeoffset_req(unsigned long timeoff)
     if ( timeoff == 0 )
         return;
 
-    if ( ioreq_broadcast(&p, true) != 0 )
+    if ( !ioreq_broadcast(&p, true, true) )
         gprintk(XENLOG_ERR, "Unsuccessful timeoffset update\n");
 }
 
diff --git a/xen/common/ioreq.c b/xen/common/ioreq.c
index 4617aef29b..1d6ca4d1ac 100644
--- a/xen/common/ioreq.c
+++ b/xen/common/ioreq.c
@@ -54,7 +54,7 @@ void ioreq_signal_mapcache_invalidate(void)
         .data = ~0UL, /* flush all */
     };
 
-    if ( ioreq_broadcast(&p, false) != 0 )
+    if ( !ioreq_broadcast(&p, false, false) )
         gprintk(XENLOG_ERR, "Unsuccessful map-cache invalidate\n");
 }
 
@@ -1309,11 +1309,11 @@ int ioreq_send(struct ioreq_server *s, ioreq_t *proto_p,
     return IOREQ_STATUS_UNHANDLED;
 }
 
-unsigned int ioreq_broadcast(ioreq_t *p, bool buffered)
+bool ioreq_broadcast(ioreq_t *p, bool buffered, bool partial)
 {
     struct domain *d = current->domain;
     struct ioreq_server *s;
-    unsigned int id, failed = 0;
+    unsigned int id, sent = 0, failed = 0;
 
     FOR_EACH_IOREQ_SERVER(d, id, s)
     {
@@ -1322,9 +1322,10 @@ unsigned int ioreq_broadcast(ioreq_t *p, bool buffered)
 
         if ( ioreq_send(s, p, buffered) == IOREQ_STATUS_UNHANDLED )
             failed++;
+        sent++;
     }
 
-    return failed;
+    return failed == 0 || (partial && failed < sent);
 }
 
 void ioreq_domain_init(struct domain *d)
diff --git a/xen/include/xen/ioreq.h b/xen/include/xen/ioreq.h
index a26614d331..65457ca5ba 100644
--- a/xen/include/xen/ioreq.h
+++ b/xen/include/xen/ioreq.h
@@ -102,7 +102,7 @@ struct ioreq_server *ioreq_server_select(struct domain *d,
                                          ioreq_t *p);
 int ioreq_send(struct ioreq_server *s, ioreq_t *proto_p,
                bool buffered);
-unsigned int ioreq_broadcast(ioreq_t *p, bool buffered);
+bool ioreq_broadcast(ioreq_t *p, bool buffered, bool partial);
 void ioreq_request_mapcache_invalidate(const struct domain *d);
 void ioreq_signal_mapcache_invalidate(void);
 
-- 
2.31.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.