linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tirumalareddy marri <tirumalareddymarri@yahoo.com>
To: linux-raid@vger.kernel.org
Subject: Re: Debugging new HW XOR engine driver
Date: Thu, 17 Jul 2008 23:55:45 -0700 (PDT)	[thread overview]
Message-ID: <577337.58175.qm@web81301.mail.mud.yahoo.com> (raw)

I modified ops_complete_write() to compare HW XOR calculations with SW XOR . I am not sure if xor_dest is still has the result XOR at this point. But this compare is failing every time. This doesn't seem to be right of checking XOR correctness. 

Do you have any inputs on how should I check the XOR result.


static void ops_complete_write(void *stripe_head_ref)
{       
        struct stripe_head *sh = stripe_head_ref;                                                       
        struct stripe_queue *sq = sh->sq;                                                               
        int disks = sq->disks, i;                                                                       
        int pd_idx = sq->pd_idx;
        int qd_idx = (sq->raid_conf->level != 6) ? -1 :                                                 
                raid6_next_disk(pd_idx, disks);                                                         
        
        pr_debug("%s: stripe %llu\n", __FUNCTION__,                                                     
                (unsigned long long)sh->sector);                                                        
#if 1 /*marri  test start*/
        struct page *pg;                                                                                
        char *a,*b;
        //int disks = sh->sq->disks;
        struct page *xor_srcs[disks];                                                                   
        int target = sh->ops.target;
        struct r5dev *tgt = &sh->dev[target];                                                           
        struct page *xor_dest = tgt->page;                                                              
        int count = 0;                                                                                  
        int dcnt = 0;                                                                                   
        int j = 0;                                                                                      
        
        for (j = disks; j--; )
                if (j != target)
                        xor_srcs[count++] = sh->dev[j].page;                                            
        
        pg = alloc_page(GFP_KERNEL);                                                                    
        if(!pg) 
                goto no_cmp;
        a = page_address(pg);
        xor_blocks(disks,STRIPE_SIZE,a,(void **)xor_srcs);                                              
        
        b = page_address(xor_dest);
        if((memcmp(b,a,PAGE_SIZE) != 0x0))
                printk(KERN_ERR"Mem compare fialed at \n");                                             
        else {  
                if(mfdcr(0x61) == 0xfee7) {
                        for(dcnt = 0; dcnt < PAGE_SIZE; dcnt+=0x4) 
                                printk("HW = 0x%x SW = 0x%x",*(u32 *)(b + dcnt),*(u32 *)(a + dcnt));    
                }                                                                                       
        }
        if(pg)
        __free_page(pg);                                                                                
no_cmp: 
        if(0)   
                *a = NULL;                                                                              

#endif  /* marri test end */                                                                                                
        
        for (i = disks; i--; ) {
                struct r5dev *dev = &sh->dev[i];
                struct r5_queue_dev *dev_q = &sq->dev[i];                                               
                
                if (dev_q->written || i == pd_idx || i == qd_idx)                                       
                        set_bit(R5_UPTODATE, &dev->flags);                                              
        }                                                                                               

        set_bit(STRIPE_OP_BIODRAIN, &sh->ops.complete);
        set_bit(STRIPE_OP_POSTXOR, &sh->ops.complete);

        set_bit(STRIPE_HANDLE, &sh->state);
        release_stripe(sh);
}

Thanks,
Marri



----- Original Message ----
From: Dan Williams <dan.j.williams@intel.com>
To: tirumalareddy marri <tirumalareddymarri@yahoo.com>
Cc: thomas62186218@aol.com; linux-raid@vger.kernel.org
Sent: Tuesday, July 15, 2008 11:48:46 PM
Subject: Re: Debugging new HW XOR engine driver

On Tue, Jul 15, 2008 at 3:52 PM, tirumalareddy marri
<tirumalareddymarri@yahoo.com> wrote:
> I am able to create a disk size of 40MB and mount it(mkfs.ext3 -b 4096 /dev/md0 10000). I was able to copy files to this mounted disk and read them back. If I increased the size more than 40MB file system if failing to mount.
>   Is it possible that data I have read/write was in page cache and never really written to Hard Disks  ?

What does the corruption look like?  Does it seem to be wrong data or
stale data?

> Is it safe to say RAID-5 is partially working ?

Without more information this sounds like the hw-xor driver is broken.
What kernel version are you developing against?  You may want to take
a look at the dmatest client in async_tx/next [1].  It currently only
supports copy tests, but should exercise your driver's descriptor
processing routines.  When I tracked down bugs in iop-adma I used
raid5 as the test client and modified the kernel to do data
verification after each calculation in the ops_complete_* routines.
This requires userspace to use a predictable data pattern when writing
to the array.

--
Dan

[1] http://git.kernel.org/?p=linux/kernel/git/djbw/async_tx.git;a=shortlog;h=next
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


             reply	other threads:[~2008-07-18  6:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-18  6:55 tirumalareddy marri [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-07-18  1:37 Debugging new HW XOR engine driver tirumalareddy marri
2008-07-15 22:52 tirumalareddy marri
2008-07-16  6:48 ` Dan Williams
2008-07-15 20:19 tirumalareddy marri
2008-07-15 16:59 tirumalareddy marri
2008-07-15 18:34 ` Dan Williams
2008-07-14 18:26 tirumalareddy marri
2008-07-15 16:35 ` thomas62186218

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=577337.58175.qm@web81301.mail.mud.yahoo.com \
    --to=tirumalareddymarri@yahoo.com \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).