testing mail_noise

This commit is contained in:
Simon Pickartz 2011-08-27 11:20:18 -07:00
parent 762d39e69a
commit 1a7eeaa16b
3 changed files with 22 additions and 17 deletions

View file

@ -392,6 +392,8 @@ int iRCCE_mail_send(
char* payload, // pointer to buffer for header payload
int dest // UE that will receive the header
) {
uint32_t flags;
// check for an attempt to send to own mailbox
if( dest == RCCE_IAM ) {
return iRCCE_MAILBOX_INVALID;
@ -400,13 +402,16 @@ 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();
iRCCE_mailbox_check();
NOP8;
NOP8;
NOP8;
RC_cache_invalidate();
}
/* disable interrupts */
flags = irq_nested_disable();
// check if mailbox is closed
RCCE_acquire_lock( dest );
RC_cache_invalidate();
@ -438,6 +443,9 @@ int iRCCE_mail_send(
RCCE_release_lock( dest );
/* enable interrupts */
irq_nested_enable(flags);
return iRCCE_SUCCESS;
}

View file

@ -267,7 +267,10 @@ static inline void icc_mail_check_tag(iRCCE_MAIL_HEADER* mail) {
char* recv_buffer;
static int count = 0;
if( !mail ) return;
if( !mail ) {
kprintf( "NO MAIL + ");
return;
}
switch( mail->tag ) {
case iRCCE_ANYLENGTH:
@ -431,11 +434,11 @@ int icc_mail_noise() {
int flags;
// leave function if not participating
if( (my_ue == CORE_A) /* || (my_ue == CORE_B)*/ ) {
/* if( !((my_ue == 1) || (my_ue == 2) || (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 );
@ -444,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 */
@ -457,30 +460,24 @@ 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
}
/* recv noise mails */
while( iRCCE_mail_recv(&recv_mail) == iRCCE_SUCCESS ) {
icc_mail_check_tag(recv_mail);
iRCCE_mail_release(&recv_mail);
NOP8;
NOP8;
NOP8;
}
return 0;
}

View file

@ -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);