Lenin Lakshminarayanan -X (lelakshm - HCL at Cisco)
2007-Jun-13 16:18 UTC
[dtrace-discuss] Help required on invalid alignment - dtrace !
Hello, Can someone please help me understand what''s wrong here ? Basically from a streams module, i am creating a new v6 packet and pushing it to the driver. I don''t see any of those v6 packets going out of the sol box. I suspect that it''s being dropped by the driver. To clarify this understanding, i did a dtrace and i am unable to interpret the output : Here''s my dtrace script : #include <sys/types.h> #include <sys/ethernet.h> bge_send:entry { self->mp = (mblk_t *)args[1]; self->ether = (struct ether_header*)self->mp->b_rptr; self->daddr = self->ether->ether_dhost; self->saddr = self->ether->ether_shost; self->dest = self->daddr; self->src = self->saddr; self->type = (self->ether->ether_type & 0xf0)|(self->ether->ether_type & 0xf); printf(":\n"); printf("Sent Packet\n"); printf("Ethernet Header\n"); printf(" Destination: "); printf("%x:", (char)self->dest.ether_addr_octet[0]); printf("%x:", (char)self->dest.ether_addr_octet[1]); printf("%x:", (char)self->dest.ether_addr_octet[2]); printf("%x:", (char)self->dest.ether_addr_octet[3]); printf("%x:", (char)self->dest.ether_addr_octet[4]); printf("%x", (char)self->dest.ether_addr_octet[5]); printf("\n Source: "); printf("%x:", (char)self->src.ether_addr_octet[0]); printf("%x:", (char)self->src.ether_addr_octet[1]); printf("%x:", (char)self->src.ether_addr_octet[2]); printf("%x:", (char)self->src.ether_addr_octet[3]); printf("%x:", (char)self->src.ether_addr_octet[4]); printf("%x", (char)self->src.ether_addr_octet[5]); printf("\n Type: "); printf("%x\n", (self->ether->ether_type)); printf("%x\n", (self->type)); } bge_send:entry /self->type != 0x0/ { self->iphdr = (ipha_t *)((char *)self->mp->b_rptr+sizeof(struct ether_header)); printf("IP Header\n"); printf(" version and header length = %x\n", self->iphdr->ipha_version_and_hdr_length); printf(" TOS = %x\n", self->iphdr->ipha_type_of_service); printf(" length = %x%x\n", (self->iphdr->ipha_length&0xff), ((self->iphdr->ipha_length&0xff00)>>8)); printf(" ident = %x%x\n", (self->iphdr->ipha_ident&0xff), ((self->iphdr->ipha_ident&0xff00)>>8)); printf(" fragment offset = %x\n", ((self->iphdr->ipha_fragment_offset_and_flags&0xfff1)>>3)); printf(" IP flags = %x\n", (self->iphdr->ipha_fragment_offset_and_flags&0x7)); printf(" ttl = %x\n", self->iphdr->ipha_ttl); printf(" protocol = %x\n", (char)self->iphdr->ipha_protocol); self->protocol = self->iphdr->ipha_protocol; printf(" header checksum = %x%x\n", (self->iphdr->ipha_hdr_checksum&0xff), ((self->iphdr->ipha_hdr_checksum&0xff00)>>8)); printf(" Source IP Addr = %d", (self->iphdr->ipha_src&0xff)); printf(".%d", ((self->iphdr->ipha_src&0xff00)>>8)); printf(".%d", ((self->iphdr->ipha_src&0xff0000)>>16)); printf(".%d\n", ((self->iphdr->ipha_src&0xff000000)>>24)); printf(" Destination IP Addr = %d", (self->iphdr->ipha_dst&0xff)); printf(".%d", ((self->iphdr->ipha_dst&0xff00)>>8)); printf(".%d", ((self->iphdr->ipha_dst&0xff0000)>>16)); printf(".%d\n", ((self->iphdr->ipha_dst&0xff000000)>>24)); } bge_send:return { } For every v6 packet that is sent from the sol box, i get the following error from the dtrace and as a result, i don''t see the IP header printed for the v6 packets at all ? dtrace: error on enabled probe ID 2 (ID 43020: fbt:bge:bge_send:entry): invalid alignment (0x600178ffc0a) in action #16 at DIF offset 12 dtrace: error on enabled probe ID 2 (ID 43020: fbt:bge:bge_send:entry): invalid alignment (0x600178ffc0a) in action #16 at DIF offset 12 dtrace: error on enabled probe ID 2 (ID 43020: fbt:bge:bge_send:entry): invalid alignment (0x600178ffa0a) in action #16 at DIF offset 12 Can someone please clarify what''s wrong ? Does this mean that the mblk_t coming to the bge driver is malformed ? I see the IP Header properly printed for the v4 packets. I see the above errors only for those v6 packets that i create and inject. Am really stuck. Someone please clarify. Thanks, Lenin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20070613/45ae1890/attachment.html>
James Carlson
2007-Jun-13 16:43 UTC
[dtrace-discuss] Help required on invalid alignment - dtrace !
Lenin Lakshminarayanan -X (lelakshm - HCL at Cisco) writes:> self->iphdr = (ipha_t *)((char *)self->mp->b_rptr+sizeof(struct > ether_header));You''re assuming that b_rptr + 14 is 4-byte aligned. It might not be. You''re also assuming that b_rptr + 14 + 20 is less than or equal to b_wptr. It might not be.> Can someone please clarify what''s wrong ? Does this mean that the mblk_t > coming to the bge driver is malformed ?No. Just not necessarily aligned as your script is assuming. -- James Carlson, Solaris Networking <james.d.carlson at sun.com> Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084 MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677