Mapping C code to assembly instructions

L

linux.lover

Hello,
Help to map C code to assembly code given below. I am
getting oops message in linux kernel. so i take objdump of netif_rx
function given below AND its disassembly of .text section is also
given below. I am getting oops at address c01fa28a. I am unable to
identify the C statement that is causing this
problem Please help me?
regards,
linux_lover.



int netif_rx(struct sk_buff *skb)
{
int this_cpu = smp_processor_id();
struct softnet_data *queue;
unsigned long flags;

if (skb->stamp.tv_sec == 0)
do_gettimeofday(&skb->stamp);

/* The code is rearranged so that the path is the most
short when CPU is congested, but is still operating.
H */
queue = &softnet_data[this_cpu];

local_irq_save(flags);
printk(KERN_DEBUG "In netif_rx skb->nh.iph->ihl = %d &&
skb->nh.iph->version = %d\n",skb->nh.iph->ihl,skb->nh.iph->version);
printk(KERN_DEBUG "SRC=%u.%u.%u.%u\n",NIPQUAD(skb->nh.iph->saddr));
netdev_rx_stat[this_cpu].total++;
if (queue->input_pkt_queue.qlen <= netdev_max_backlog) {
if (queue->input_pkt_queue.qlen) {
if (queue->throttle)
goto drop;

enqueue:
dev_hold(skb->dev);
__skb_queue_tail(&queue->input_pkt_queue,skb);
local_irq_restore(flags);
#ifndef OFFLINE_SAMPLE
get_sample_stats(this_cpu);
#endif
return queue->cng_level;
}

if (queue->throttle) {
queue->throttle = 0;
#ifdef CONFIG_NET_HW_FLOWCONTROL
if (atomic_dec_and_test(&netdev_dropping))
netdev_wakeup();
#endif
}

netif_rx_schedule(&queue->blog_dev);
goto enqueue;
}

if (queue->throttle == 0) {
queue->throttle = 1;
netdev_rx_stat[this_cpu].throttled++;
#ifdef CONFIG_NET_HW_FLOWCONTROL
atomic_inc(&netdev_dropping);
#endif
}

drop:
netdev_rx_stat[this_cpu].dropped++;
local_irq_restore(flags);

kfree_skb(skb);
return NET_RX_DROP;
}


vmlinux: file format elf32-i386
Disassembly of section .text:
c01fa270 <netif_rx>:
c01fa270: 56 push %esi
c01fa271: 53 push %ebx
c01fa272: 83 ec 14 sub $0x14,%esp
c01fa275: 8b 5c 24 20 mov 0x20(%esp,1),%ebx
c01fa279: 8b 43 10 mov 0x10(%ebx),%eax
c01fa27c: 85 c0 test %eax,%eax
c01fa27e: 0f 84 a4 01 00 00 je c01fa428 <netif_rx+0x1b8>
c01fa284: 9c pushf
c01fa285: 5e pop %esi
c01fa286: fa cli
c01fa287: 8b 53 24 mov 0x24(%ebx),%edx
*********************Getting oops here******************
c01fa28a: 0f b6 02 movzbl (%edx),%eax
***********************************************************
c01fa28d: c0 e8 04 shr $0x4,%al
c01fa290: 0f b6 c0 movzbl %al,%eax
c01fa293: 89 44 24 08 mov %eax,0x8(%esp,1)
c01fa297: 0f b6 02 movzbl (%edx),%eax
c01fa29a: c7 04 24 20 74 27 c0 movl $0xc0277420,(%esp,1)
c01fa2a1: 24 0f and $0xf,%al
c01fa2a3: 0f b6 c0 movzbl %al,%eax
c01fa2a6: 89 44 24 04 mov %eax,0x4(%esp,1)
c01fa2aa: e8 e1 e4 f1 ff call c0118790 <printk>
c01fa2af: 8b 53 24 mov 0x24(%ebx),%edx
c01fa2b2: 0f b6 42 0f movzbl 0xf(%edx),%eax
c01fa2b6: 89 44 24 10 mov %eax,0x10(%esp,1)
c01fa2ba: 0f b6 42 0e movzbl 0xe(%edx),%eax
c01fa2be: 89 44 24 0c mov %eax,0xc(%esp,1)
c01fa2c2: 0f b6 42 0d movzbl 0xd(%edx),%eax
c01fa2c6: 89 44 24 08 mov %eax,0x8(%esp,1)
c01fa2ca: 0f b6 42 0c movzbl 0xc(%edx),%eax
c01fa2ce: c7 04 24 5f 5b 27 c0 movl $0xc0275b5f,(%esp,1)
c01fa2d5: 89 44 24 04 mov %eax,0x4(%esp,1)
c01fa2d9: e8 b2 e4 f1 ff call c0118790 <printk>
c01fa2de: a1 94 0c 2f c0 mov 0xc02f0c94,%eax
c01fa2e3: ff 05 20 df 32 c0 incl 0xc032df20
c01fa2e9: 3b 05 84 a2 2c c0 cmp 0xc02ca284,%eax
c01fa2ef: 0f 87 11 01 00 00 ja c01fa406 <netif_rx+0x196>
c01fa2f5: 85 c0 test %eax,%eax
c01fa2f7: 74 77 je c01fa370 <netif_rx+0x100>
c01fa2f9: a1 80 0c 2f c0 mov 0xc02f0c80,%eax
c01fa2fe: 85 c0 test %eax,%eax
c01fa300: 75 45 jne c01fa347 <netif_rx+0xd7>
c01fa302: 8b 43 18 mov 0x18(%ebx),%eax
c01fa305: ff 80 ec 00 00 00 incl 0xec(%eax)
c01fa30b: c7 43 08 8c 0c 2f c0 movl $0xc02f0c8c,0x8(%ebx)
c01fa312: a1 90 0c 2f c0 mov 0xc02f0c90,%eax
c01fa317: ff 05 94 0c 2f c0 incl 0xc02f0c94
c01fa31d: c7 03 8c 0c 2f c0 movl $0xc02f0c8c,(%ebx)
c01fa323: 89 43 04 mov %eax,0x4(%ebx)
c01fa326: 89 18 mov %ebx,(%eax)
c01fa328: 89 1d 90 0c 2f c0 mov %ebx,0xc02f0c90
c01fa32e: 56 push %esi
c01fa32f: 9d popf
c01fa330: c7 04 24 00 00 00 00 movl $0x0,(%esp,1)
c01fa337: e8 c4 fe ff ff call c01fa200 <get_sample_stats>
c01fa33c: a1 84 0c 2f c0 mov 0xc02f0c84,%eax
c01fa341: 83 c4 14 add $0x14,%esp
c01fa344: 5b pop %ebx
c01fa345: 5e pop %esi
c01fa346: c3 ret
c01fa347: ff 05 24 df 32 c0 incl 0xc032df24
c01fa34d: 56 push %esi
c01fa34e: 9d popf
c01fa34f: 8b 43 7c mov 0x7c(%ebx),%eax
c01fa352: 48 dec %eax
c01fa353: 74 0a je c01fa35f <netif_rx+0xef>
c01fa355: ff 4b 7c decl 0x7c(%ebx)
c01fa358: 0f 94 c0 sete %al
c01fa35b: 84 c0 test %al,%al
c01fa35d: 74 08 je c01fa367 <netif_rx+0xf7>
c01fa35f: 89 1c 24 mov %ebx,(%esp,1)
c01fa362: e8 19 b6 ff ff call c01f5980 <__kfree_skb>
c01fa367: b8 01 00 00 00 mov $0x1,%eax
c01fa36c: eb d3 jmp c01fa341 <netif_rx+0xd1>
c01fa36e: 89 f6 mov %esi,%esi
c01fa370: a1 80 0c 2f c0 mov 0xc02f0c80,%eax
c01fa375: 85 c0 test %eax,%eax
c01fa377: 74 07 je c01fa380 <netif_rx+0x110>
c01fa379: 31 c0 xor %eax,%eax
c01fa37b: a3 80 0c 2f c0 mov %eax,0xc02f0c80
c01fa380: a1 d4 0c 2f c0 mov 0xc02f0cd4,%eax
c01fa385: 31 d2 xor %edx,%edx
c01fa387: 83 e0 02 and $0x2,%eax
c01fa38a: 74 18 je c01fa3a4 <netif_rx+0x134>
c01fa38c: b8 05 00 00 00 mov $0x5,%eax
c01fa391: 0f ab 05 d4 0c 2f c0 bts %eax,0xc02f0cd4
c01fa398: 19 c0 sbb %eax,%eax
c01fa39a: 85 c0 test %eax,%eax
c01fa39c: b8 01 00 00 00 mov $0x1,%eax
c01fa3a1: 0f 44 d0 cmove %eax,%edx
c01fa3a4: 85 d2 test %edx,%edx
c01fa3a6: 0f 84 56 ff ff ff je c01fa302 <netif_rx+0x92>
c01fa3ac: 9c pushf
c01fa3ad: 5a pop %edx
c01fa3ae: fa cli
c01fa3af: ff 05 94 0d 2f c0 incl 0xc02f0d94
c01fa3b5: b9 6c 0d 2f c0 mov $0xc02f0d6c,%ecx
c01fa3ba: a1 9c 0c 2f c0 mov 0xc02f0c9c,%eax
c01fa3bf: 89 0d 9c 0c 2f c0 mov %ecx,0xc02f0c9c
c01fa3c5: b9 98 0c 2f c0 mov $0xc02f0c98,%ecx
c01fa3ca: 89 0d 6c 0d 2f c0 mov %ecx,0xc02f0d6c
c01fa3d0: c7 00 6c 0d 2f c0 movl $0xc02f0d6c,(%eax)
c01fa3d6: a3 70 0d 2f c0 mov %eax,0xc02f0d70
c01fa3db: a1 74 0d 2f c0 mov 0xc02f0d74,%eax
c01fa3e0: 85 c0 test %eax,%eax
c01fa3e2: 78 18 js c01fa3fc <netif_rx+0x18c>
c01fa3e4: a1 78 0d 2f c0 mov 0xc02f0d78,%eax
c01fa3e9: a3 74 0d 2f c0 mov %eax,0xc02f0d74
c01fa3ee: 83 0d 00 8c 2f c0 04 orl $0x4,0xc02f8c00
c01fa3f5: 52 push %edx
c01fa3f6: 9d popf
c01fa3f7: e9 06 ff ff ff jmp c01fa302 <netif_rx+0x92>
c01fa3fc: 8b 0d 78 0d 2f c0 mov 0xc02f0d78,%ecx
c01fa402: 01 c8 add %ecx,%eax
c01fa404: eb e3 jmp c01fa3e9 <netif_rx+0x179>
c01fa406: a1 80 0c 2f c0 mov 0xc02f0c80,%eax
c01fa40b: 85 c0 test %eax,%eax
c01fa40d: 0f 85 34 ff ff ff jne c01fa347 <netif_rx+0xd7>
c01fa413: ff 05 2c df 32 c0 incl 0xc032df2c
c01fa419: b8 01 00 00 00 mov $0x1,%eax
c01fa41e: a3 80 0c 2f c0 mov %eax,0xc02f0c80
c01fa423: e9 1f ff ff ff jmp c01fa347 <netif_rx+0xd7>
c01fa428: 8d 43 10 lea 0x10(%ebx),%eax
c01fa42b: 89 04 24 mov %eax,(%esp,1)
c01fa42e: e8 ad 3a f1 ff call c010dee0 <do_gettimeofday>
c01fa433: e9 4c fe ff ff jmp c01fa284 <netif_rx+0x14>
c01fa438: 90 nop
c01fa439: 8d b4 26 00 00 00 00 lea 0x0(%esi,1),%esi
Disassembly of section .text.init:
 
J

Jack Klein

Hello,
Help to map C code to assembly code given below. I am
getting oops message in linux kernel. so i take objdump of netif_rx
function given below AND its disassembly of .text section is also
given below. I am getting oops at address c01fa28a. I am unable to
identify the C statement that is causing this
problem Please help me?
regards,
linux_lover.

Sorry, but your post is completely off-topic here. We discuss
standard C, which does not define any such thing as inline assembly
language. You want
 
N

Neil Kurzman

linux.lover said:
Hello,
Help to map C code to assembly code given below. I am
getting oops message in linux kernel. so i take objdump of netif_rx
function given below AND its disassembly of .text section is also
given below. I am getting oops at address c01fa28a. I am unable to
identify the C statement that is causing this
problem Please help me?
regards,
linux_lover.

int netif_rx(struct sk_buff *skb)
{
int this_cpu = smp_processor_id();
struct softnet_data *queue;
unsigned long flags;

if (skb->stamp.tv_sec == 0)
do_gettimeofday(&skb->stamp);

/* The code is rearranged so that the path is the most
short when CPU is congested, but is still operating.
H */
queue = &softnet_data[this_cpu];

local_irq_save(flags);
printk(KERN_DEBUG "In netif_rx skb->nh.iph->ihl = %d &&
skb->nh.iph->version = %d\n",skb->nh.iph->ihl,skb->nh.iph->version);
printk(KERN_DEBUG "SRC=%u.%u.%u.%u\n",NIPQUAD(skb->nh.iph->saddr));
netdev_rx_stat[this_cpu].total++;
if (queue->input_pkt_queue.qlen <= netdev_max_backlog) {
if (queue->input_pkt_queue.qlen) {
if (queue->throttle)
goto drop;

enqueue:
dev_hold(skb->dev);
__skb_queue_tail(&queue->input_pkt_queue,skb);
local_irq_restore(flags);
#ifndef OFFLINE_SAMPLE
get_sample_stats(this_cpu);
#endif
return queue->cng_level;
}

if (queue->throttle) {
queue->throttle = 0;
#ifdef CONFIG_NET_HW_FLOWCONTROL
if (atomic_dec_and_test(&netdev_dropping))
netdev_wakeup();
#endif
}

netif_rx_schedule(&queue->blog_dev);
goto enqueue;
}

if (queue->throttle == 0) {
queue->throttle = 1;
netdev_rx_stat[this_cpu].throttled++;
#ifdef CONFIG_NET_HW_FLOWCONTROL
atomic_inc(&netdev_dropping);
#endif
}

drop:
netdev_rx_stat[this_cpu].dropped++;
local_irq_restore(flags);

kfree_skb(skb);
return NET_RX_DROP;
}

vmlinux: file format elf32-i386
Disassembly of section .text:
c01fa270 <netif_rx>:
c01fa270: 56 push %esi
c01fa271: 53 push %ebx
c01fa272: 83 ec 14 sub $0x14,%esp
c01fa275: 8b 5c 24 20 mov 0x20(%esp,1),%ebx
c01fa279: 8b 43 10 mov 0x10(%ebx),%eax
c01fa27c: 85 c0 test %eax,%eax
c01fa27e: 0f 84 a4 01 00 00 je c01fa428 <netif_rx+0x1b8>
c01fa284: 9c pushf
c01fa285: 5e pop %esi
c01fa286: fa cli
c01fa287: 8b 53 24 mov 0x24(%ebx),%edx
*********************Getting oops here******************
c01fa28a: 0f b6 02 movzbl (%edx),%eax
***********************************************************
c01fa28d: c0 e8 04 shr $0x4,%al
c01fa290: 0f b6 c0 movzbl %al,%eax
c01fa293: 89 44 24 08 mov %eax,0x8(%esp,1)
c01fa297: 0f b6 02 movzbl (%edx),%eax
c01fa29a: c7 04 24 20 74 27 c0 movl $0xc0277420,(%esp,1)
c01fa2a1: 24 0f and $0xf,%al
c01fa2a3: 0f b6 c0 movzbl %al,%eax
c01fa2a6: 89 44 24 04 mov %eax,0x4(%esp,1)
c01fa2aa: e8 e1 e4 f1 ff call c0118790 <printk>
c01fa2af: 8b 53 24 mov 0x24(%ebx),%edx
c01fa2b2: 0f b6 42 0f movzbl 0xf(%edx),%eax
c01fa2b6: 89 44 24 10 mov %eax,0x10(%esp,1)
c01fa2ba: 0f b6 42 0e movzbl 0xe(%edx),%eax
c01fa2be: 89 44 24 0c mov %eax,0xc(%esp,1)
c01fa2c2: 0f b6 42 0d movzbl 0xd(%edx),%eax
c01fa2c6: 89 44 24 08 mov %eax,0x8(%esp,1)
c01fa2ca: 0f b6 42 0c movzbl 0xc(%edx),%eax
c01fa2ce: c7 04 24 5f 5b 27 c0 movl $0xc0275b5f,(%esp,1)
c01fa2d5: 89 44 24 04 mov %eax,0x4(%esp,1)
c01fa2d9: e8 b2 e4 f1 ff call c0118790 <printk>
c01fa2de: a1 94 0c 2f c0 mov 0xc02f0c94,%eax
c01fa2e3: ff 05 20 df 32 c0 incl 0xc032df20
c01fa2e9: 3b 05 84 a2 2c c0 cmp 0xc02ca284,%eax
c01fa2ef: 0f 87 11 01 00 00 ja c01fa406 <netif_rx+0x196>
c01fa2f5: 85 c0 test %eax,%eax
c01fa2f7: 74 77 je c01fa370 <netif_rx+0x100>
c01fa2f9: a1 80 0c 2f c0 mov 0xc02f0c80,%eax
c01fa2fe: 85 c0 test %eax,%eax
c01fa300: 75 45 jne c01fa347 <netif_rx+0xd7>
c01fa302: 8b 43 18 mov 0x18(%ebx),%eax
c01fa305: ff 80 ec 00 00 00 incl 0xec(%eax)
c01fa30b: c7 43 08 8c 0c 2f c0 movl $0xc02f0c8c,0x8(%ebx)
c01fa312: a1 90 0c 2f c0 mov 0xc02f0c90,%eax
c01fa317: ff 05 94 0c 2f c0 incl 0xc02f0c94
c01fa31d: c7 03 8c 0c 2f c0 movl $0xc02f0c8c,(%ebx)
c01fa323: 89 43 04 mov %eax,0x4(%ebx)
c01fa326: 89 18 mov %ebx,(%eax)
c01fa328: 89 1d 90 0c 2f c0 mov %ebx,0xc02f0c90
c01fa32e: 56 push %esi
c01fa32f: 9d popf
c01fa330: c7 04 24 00 00 00 00 movl $0x0,(%esp,1)
c01fa337: e8 c4 fe ff ff call c01fa200 <get_sample_stats>
c01fa33c: a1 84 0c 2f c0 mov 0xc02f0c84,%eax
c01fa341: 83 c4 14 add $0x14,%esp
c01fa344: 5b pop %ebx
c01fa345: 5e pop %esi
c01fa346: c3 ret
c01fa347: ff 05 24 df 32 c0 incl 0xc032df24
c01fa34d: 56 push %esi
c01fa34e: 9d popf
c01fa34f: 8b 43 7c mov 0x7c(%ebx),%eax
c01fa352: 48 dec %eax
c01fa353: 74 0a je c01fa35f <netif_rx+0xef>
c01fa355: ff 4b 7c decl 0x7c(%ebx)
c01fa358: 0f 94 c0 sete %al
c01fa35b: 84 c0 test %al,%al
c01fa35d: 74 08 je c01fa367 <netif_rx+0xf7>
c01fa35f: 89 1c 24 mov %ebx,(%esp,1)
c01fa362: e8 19 b6 ff ff call c01f5980 <__kfree_skb>
c01fa367: b8 01 00 00 00 mov $0x1,%eax
c01fa36c: eb d3 jmp c01fa341 <netif_rx+0xd1>
c01fa36e: 89 f6 mov %esi,%esi
c01fa370: a1 80 0c 2f c0 mov 0xc02f0c80,%eax
c01fa375: 85 c0 test %eax,%eax
c01fa377: 74 07 je c01fa380 <netif_rx+0x110>
c01fa379: 31 c0 xor %eax,%eax
c01fa37b: a3 80 0c 2f c0 mov %eax,0xc02f0c80
c01fa380: a1 d4 0c 2f c0 mov 0xc02f0cd4,%eax
c01fa385: 31 d2 xor %edx,%edx
c01fa387: 83 e0 02 and $0x2,%eax
c01fa38a: 74 18 je c01fa3a4 <netif_rx+0x134>
c01fa38c: b8 05 00 00 00 mov $0x5,%eax
c01fa391: 0f ab 05 d4 0c 2f c0 bts %eax,0xc02f0cd4
c01fa398: 19 c0 sbb %eax,%eax
c01fa39a: 85 c0 test %eax,%eax
c01fa39c: b8 01 00 00 00 mov $0x1,%eax
c01fa3a1: 0f 44 d0 cmove %eax,%edx
c01fa3a4: 85 d2 test %edx,%edx
c01fa3a6: 0f 84 56 ff ff ff je c01fa302 <netif_rx+0x92>
c01fa3ac: 9c pushf
c01fa3ad: 5a pop %edx
c01fa3ae: fa cli
c01fa3af: ff 05 94 0d 2f c0 incl 0xc02f0d94
c01fa3b5: b9 6c 0d 2f c0 mov $0xc02f0d6c,%ecx
c01fa3ba: a1 9c 0c 2f c0 mov 0xc02f0c9c,%eax
c01fa3bf: 89 0d 9c 0c 2f c0 mov %ecx,0xc02f0c9c
c01fa3c5: b9 98 0c 2f c0 mov $0xc02f0c98,%ecx
c01fa3ca: 89 0d 6c 0d 2f c0 mov %ecx,0xc02f0d6c
c01fa3d0: c7 00 6c 0d 2f c0 movl $0xc02f0d6c,(%eax)
c01fa3d6: a3 70 0d 2f c0 mov %eax,0xc02f0d70
c01fa3db: a1 74 0d 2f c0 mov 0xc02f0d74,%eax
c01fa3e0: 85 c0 test %eax,%eax
c01fa3e2: 78 18 js c01fa3fc <netif_rx+0x18c>
c01fa3e4: a1 78 0d 2f c0 mov 0xc02f0d78,%eax
c01fa3e9: a3 74 0d 2f c0 mov %eax,0xc02f0d74
c01fa3ee: 83 0d 00 8c 2f c0 04 orl $0x4,0xc02f8c00
c01fa3f5: 52 push %edx
c01fa3f6: 9d popf
c01fa3f7: e9 06 ff ff ff jmp c01fa302 <netif_rx+0x92>
c01fa3fc: 8b 0d 78 0d 2f c0 mov 0xc02f0d78,%ecx
c01fa402: 01 c8 add %ecx,%eax
c01fa404: eb e3 jmp c01fa3e9 <netif_rx+0x179>
c01fa406: a1 80 0c 2f c0 mov 0xc02f0c80,%eax
c01fa40b: 85 c0 test %eax,%eax
c01fa40d: 0f 85 34 ff ff ff jne c01fa347 <netif_rx+0xd7>
c01fa413: ff 05 2c df 32 c0 incl 0xc032df2c
c01fa419: b8 01 00 00 00 mov $0x1,%eax
c01fa41e: a3 80 0c 2f c0 mov %eax,0xc02f0c80
c01fa423: e9 1f ff ff ff jmp c01fa347 <netif_rx+0xd7>
c01fa428: 8d 43 10 lea 0x10(%ebx),%eax
c01fa42b: 89 04 24 mov %eax,(%esp,1)
c01fa42e: e8 ad 3a f1 ff call c010dee0 <do_gettimeofday>
c01fa433: e9 4c fe ff ff jmp c01fa284 <netif_rx+0x14>
c01fa438: 90 nop
c01fa439: 8d b4 26 00 00 00 00 lea 0x0(%esi,1),%esi
Disassembly of section .text.init:

You can not go from disassembled asm to C
you need to tell the compiler to generate a list file. It will show the line
numbers and asm.
 
C

CBFalconer

.... snip over 200 lines of incomprehensible disassembly ...
You can not go from disassembled asm to C
you need to tell the compiler to generate a list file. It will
show the line numbers and asm.

This answer required quoting 200 useless lines? Most keyboards
have keys suitable for selecting and deleting useless quoted
material, i.e. stuff that is irrelevant to your answer.
 
C

Chris Torek

Help to map C code to assembly code given below. I am
getting oops message in linux kernel. so i take objdump of netif_rx
function given below AND its disassembly of .text section is also
given below. I am getting oops at address c01fa28a. I am unable to
identify the C statement that is causing this
problem Please help me?

As others have noted, that is not what this newsgroup (comp.lang.c)
is about -- here we (mostly) talk about portable C code, not anything
specific to any particular CPU or operating system. You can probably
get a much better answer in a Linux-specific group.

(Also: "I am getting oops message" is not very specific; you might
want to quote the exact text when posting to the linux group.)

All that said, here is what one can say about at least part of this
as standard-conforming, portable C code:
int netif_rx(struct sk_buff *skb)
{
int this_cpu = smp_processor_id();
struct softnet_data *queue;
unsigned long flags;

if (skb->stamp.tv_sec == 0)
do_gettimeofday(&skb->stamp);

This assumes "skb" is not NULL. (I imagine it is not.)
/* The code is rearranged so that the path is the most
short when CPU is congested, but is still operating.
H */
queue = &softnet_data[this_cpu];

local_irq_save(flags);

If "local_irq_save" is not a macro, this passes an uninitialized
argument to the function. (In fact, local_irq_save obviously *is*
a macro, but that is only "obvious" -- to me at least -- for reasons
that have nothing to do with the C language.) It would be better
to write this macro in all-caps, or replace it with a function
that has a return value:

flags = local_irq_save();

so that it does not give the appearance of passing an uninitialized
argument.
printk(KERN_DEBUG "In netif_rx skb->nh.iph->ihl = %d &&
skb->nh.iph->version = %d\n",skb->nh.iph->ihl,skb->nh.iph->version);

This has a newline in a string literal, not a good idea.

This code assumes not only that skb != NULL, but also skb->nh.iph
is valid and non-NULL. I suspect this last is the problem.
printk(KERN_DEBUG "SRC=%u.%u.%u.%u\n",NIPQUAD(skb->nh.iph->saddr));

Assuming printk() is a lot like printf(), this needs four "unsigned
int" parameters, but -- unless NIPQUAD is a rather odd macro -- appears
to pass just one.

[rest of code deleted]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,529
Members
45,001
Latest member
Kendra00E1

Latest Threads

Top