I modified the simulator to be able to reproduce this, which took some time, but here's the patch to fix the issue. Sorry, it was a silly mistake.

You won't need the option stuff with this change.

-corey

On 01/24/2017 11:30 AM, Korynkevych, RomanX wrote:

Hi Guys,

I’m writing application which uses OpenIPMI v2.0.22 library SEL mechanism similar to eventd.c sample application. I register threshold and discrete event handlers for available sensors for domain called mydomain2. When I generate event using ipmitool I’m receive event successfully but it comes twice and all the data is the same (duplicated). After investigation it looks like event is invoked from different MCs. I’m seeing that OpenIPMI lib handler (handle_sel_data()) is called for MC names “mydomain2(0.20)” and “mydomain2(6.20)”. In my event handler I’m calling ipmi_sensor_get_mc() and ipmi_mc_get_name() to understand which MC the sensor belongs to and it returns “mydomain2(0.20)”. Also I added event handler for SMI interface and when the event arrives there are no doubled events observed.

Does anybody has seen this issue? Is this behavior expected? What is the reason I’m receiving events twice?

Regards,

Roman.

--------------------------------------------------------------
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.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer


>From 8bcfdb4c0c05488a51282aaa1b6a3184a0dfc62c Mon Sep 17 00:00:00 2001
From: Corey Minyard <[email protected]>
Date: Tue, 7 Feb 2017 12:12:47 -0600
Subject: [PATCH] domain: Fix scanning of IPMB addresses

The scan was scanning addresses it shouldn't have scanned
due to calculations not being done correctly.

Signed-off-by: Corey Minyard <[email protected]>
---
 lib/domain.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/domain.c b/lib/domain.c
index 2bb68b7..2c1d458 100644
--- a/lib/domain.c
+++ b/lib/domain.c
@@ -2525,8 +2525,9 @@ rescan_timeout_handler(void *cb_data, os_hnd_timer_id_t *id)
 
  next_addr_nolock:
     ipmb = (ipmi_ipmb_addr_t *) &info->addr;
+    ipmb->slave_addr += 2;
     if ((info->addr.addr_type == IPMI_SYSTEM_INTERFACE_ADDR_TYPE)
-	|| (ipmb->slave_addr >= info->end_addr)) {
+	|| (ipmb->slave_addr > info->end_addr)) {
 	/* We've hit the end, we can quit now. */
 	if (info->done_handler)
 	    info->done_handler(domain, 0, info->cb_data);
@@ -2536,7 +2537,6 @@ rescan_timeout_handler(void *cb_data, os_hnd_timer_id_t *id)
 	ipmi_mem_free(info);
 	goto out;
     }
-    ipmb->slave_addr += 2;
     info->missed_responses = 0;
     if (in_ipmb_ignores(domain, ipmb->channel, ipmb->slave_addr))
 	goto next_addr_nolock;
@@ -2691,8 +2691,9 @@ devid_bc_rsp_handler(ipmi_domain_t *domain, ipmi_msgi_t *rspi)
 
  next_addr_nolock:
     ipmb = (ipmi_ipmb_addr_t *) &info->addr;
+    ipmb->slave_addr += 2;
     if ((info->addr.addr_type == IPMI_SYSTEM_INTERFACE_ADDR_TYPE)
-	|| (ipmb->slave_addr >= info->end_addr)) {
+	|| (ipmb->slave_addr > info->end_addr)) {
 	/* We've hit the end, we can quit now. */
 	if (info->done_handler)
 	    info->done_handler(domain, 0, info->cb_data);
@@ -2702,7 +2703,6 @@ devid_bc_rsp_handler(ipmi_domain_t *domain, ipmi_msgi_t *rspi)
 	ipmi_mem_free(info);
 	goto out;
     }
-    ipmb->slave_addr += 2;
     info->missed_responses = 0;
     if (in_ipmb_ignores(domain, ipmb->channel, ipmb->slave_addr))
 	goto next_addr_nolock;
-- 
2.7.4

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

Reply via email to