fix in mail_noise
This commit is contained in:
parent
1a7eeaa16b
commit
6d065f8621
4 changed files with 20 additions and 25 deletions
|
@ -55,6 +55,7 @@ inline static uint32_t irq_nested_disable(void) {
|
|||
asm volatile("pushf; cli; popl %0": "=r"(flags) : : "memory");
|
||||
if (flags & (1 << 9))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -71,8 +72,9 @@ inline static void irq_enable(void) {
|
|||
* @param flags Flags to set. Could be the old ones you got from irq_nested_disable.
|
||||
*/
|
||||
inline static void irq_nested_enable(uint32_t flags) {
|
||||
if (flags)
|
||||
if (flags) {
|
||||
irq_enable();
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -393,6 +393,7 @@ int iRCCE_mail_send(
|
|||
int dest // UE that will receive the header
|
||||
) {
|
||||
uint32_t flags;
|
||||
int i;
|
||||
|
||||
// check for an attempt to send to own mailbox
|
||||
if( dest == RCCE_IAM ) {
|
||||
|
@ -402,16 +403,10 @@ int iRCCE_mail_send(
|
|||
// if dest mailbox is full, check for incoming mail
|
||||
RC_cache_invalidate();
|
||||
while( iRCCE_mailbox_send[dest]->sent ) {
|
||||
iRCCE_mailbox_check();
|
||||
NOP8;
|
||||
NOP8;
|
||||
NOP8;
|
||||
//iRCCE_mailbox_check();
|
||||
RC_cache_invalidate();
|
||||
}
|
||||
|
||||
/* disable interrupts */
|
||||
flags = irq_nested_disable();
|
||||
|
||||
// check if mailbox is closed
|
||||
RCCE_acquire_lock( dest );
|
||||
RC_cache_invalidate();
|
||||
|
@ -420,6 +415,9 @@ int iRCCE_mail_send(
|
|||
return iRCCE_MAILBOX_CLOSED;
|
||||
}
|
||||
|
||||
/* disable interrupts */
|
||||
// flags = irq_nested_disable();
|
||||
|
||||
// prepare header
|
||||
iRCCE_MAIL_HEADER header = { RCCE_IAM, size, tag, NULL, prio,
|
||||
RCCE_FLAG_UNSET, RCCE_FLAG_UNSET,
|
||||
|
@ -441,10 +439,10 @@ int iRCCE_mail_send(
|
|||
*(int *)RCCE_fool_write_combine_buffer = 1;
|
||||
RC_cache_invalidate();
|
||||
|
||||
RCCE_release_lock( dest );
|
||||
|
||||
/* enable interrupts */
|
||||
irq_nested_enable(flags);
|
||||
// irq_nested_enable(flags);
|
||||
|
||||
RCCE_release_lock( dest );
|
||||
|
||||
return iRCCE_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -265,7 +265,7 @@ int icc_irq_ping()
|
|||
|
||||
static inline void icc_mail_check_tag(iRCCE_MAIL_HEADER* mail) {
|
||||
char* recv_buffer;
|
||||
static int count = 0;
|
||||
static int i = 0;
|
||||
|
||||
if( !mail ) {
|
||||
kprintf( "NO MAIL + ");
|
||||
|
@ -280,8 +280,8 @@ static inline void icc_mail_check_tag(iRCCE_MAIL_HEADER* mail) {
|
|||
break;
|
||||
|
||||
case PING_REQ:
|
||||
// count++;
|
||||
|
||||
++i;
|
||||
if( !(i%1000) ) kprintf( "PingReq%d ", i );
|
||||
iRCCE_mail_send(0, PING_RESP, 0, NULL, mail->source);
|
||||
break;
|
||||
|
||||
|
@ -434,11 +434,11 @@ int icc_mail_noise() {
|
|||
int flags;
|
||||
|
||||
// leave function if not participating
|
||||
/* if( !((my_ue == 1) || (my_ue == 2) || (my_ue == CORE_A) || (my_ue == CORE_B)) ) {
|
||||
if( (my_ue == CORE_A) /*|| (my_ue == CORE_B)*/ ) {
|
||||
kprintf( "mail_noise: leaving" );
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
kprintf( "Hello from icc_mail_noise: my_ue = %d\n", my_ue );
|
||||
kprintf( "num_ues = %d\n", num_ranks );
|
||||
|
@ -447,7 +447,7 @@ int icc_mail_noise() {
|
|||
if( !(i%1000) ) kprintf( "%d ", i );
|
||||
/* send a mail to each UE */
|
||||
for( j=0; j<num_ranks; ++j ) {
|
||||
if( (j == CORE_A) || (j == CORE_B) )
|
||||
if( (j == CORE_A) || (j == CORE_B) )
|
||||
continue;
|
||||
|
||||
/* send noise mail */
|
||||
|
@ -460,22 +460,17 @@ int icc_mail_noise() {
|
|||
|
||||
#ifndef _IRQ_NOISE_
|
||||
/* read some mails */
|
||||
/* if( my_ue == CORE_B )
|
||||
if( my_ue == CORE_B )
|
||||
continue;
|
||||
*/
|
||||
|
||||
|
||||
iRCCE_mail_check(iRCCE_MAILBOX_ALL);
|
||||
|
||||
while( iRCCE_mail_recv(&recv_mail) == iRCCE_SUCCESS ) {
|
||||
icc_mail_check_tag(recv_mail);
|
||||
iRCCE_mail_release(&recv_mail);
|
||||
NOP8;
|
||||
NOP8;
|
||||
NOP8;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -415,7 +415,7 @@ int test_init(void)
|
|||
//create_kernel_task(NULL, join_test, NULL);
|
||||
//create_kernel_task(NULL, producer, NULL);
|
||||
//create_kernel_task(NULL, consumer, NULL);
|
||||
// create_kernel_task(NULL, mail_ping, NULL);
|
||||
create_kernel_task(NULL, mail_ping, NULL);
|
||||
create_kernel_task(NULL, mail_noise, NULL);
|
||||
//create_user_task(NULL, "/bin/hello", argv);
|
||||
//create_user_task(NULL, "/bin/tests", argv);
|
||||
|
|
Loading…
Add table
Reference in a new issue