Re: Query regarding ARP request on a multi-homed system

2014-06-25 Thread ankur dwivedi
In my guess the eth0 interface will not do anything and drop the packet.

On Thu, Jun 26, 2014 at 11:43 AM, Chaitra Ramaiah  wrote:
> Hi,
>
>   Have a doubt regarding ARP behavior in case of a multi-homed linux box.
>
>   Assume there are two interfaces eth0 and eth1 each configured with
> IPs belonging to differrent
>   subnets. Say IP1 is assigned to eth0 and IP2 to eth1. Now if an ARP
> request comes on eth0
>   for IP2, what is the behavior on Linux?
>
>   Thanks in advance for your answers.
>
> Thanks,
> Chaitra
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



-- 
Thanks

Ankur Dwivedi

You can follow me on twitter @ankurdwi

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Query regarding ARP request on a multi-homed system

2014-06-25 Thread Chaitra Ramaiah
Hi,

  Have a doubt regarding ARP behavior in case of a multi-homed linux box.

  Assume there are two interfaces eth0 and eth1 each configured with
IPs belonging to differrent
  subnets. Say IP1 is assigned to eth0 and IP2 to eth1. Now if an ARP
request comes on eth0
  for IP2, what is the behavior on Linux?

  Thanks in advance for your answers.

Thanks,
Chaitra

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Usb block driver to store file

2014-06-25 Thread Greg KH
On Wed, Jun 25, 2014 at 12:12:57PM +0530, ravi ranjan Mishra wrote:
> HI,
> 
> i want to transfer a file and store in flash of usb from my driver.

Then use the built-in kernel driver that dos this.

> i have already done usb driver register with char
> 
> but i want to store file from my driver.
> 
> how can possible pls help me

USB storage is one of the most complex drivers out there, it's a whole
scsi stack there.  Use the in-kernel driver, don't write your own for no
reason.

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eudyptula Challenge

2014-06-25 Thread Kristofer Hallin
Good. Build yourself another kernel for development and stick with the
working one for work then.
On Jun 25, 2014 10:40 PM, "Javier"  wrote:

> On Wed, Jun 25, 2014 at 4:37 PM, Kristofer Hallin <
> kristofer.hal...@gmail.com> wrote:
>
>> Your boot loader (grub?) can't handle multiple kernels?
>>
> It can.
>
> --
> Javier Pajuelo
>
>
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eudyptula Challenge

2014-06-25 Thread Javier
On Wed, Jun 25, 2014 at 4:37 PM, Kristofer Hallin <
kristofer.hal...@gmail.com> wrote:

> Your boot loader (grub?) can't handle multiple kernels?
>
It can.

-- 
Javier Pajuelo
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eudyptula Challenge

2014-06-25 Thread Kristofer Hallin
Your boot loader (grub?) can't handle multiple kernels?
On Jun 25, 2014 10:32 PM, "Javier"  wrote:

> Hello all,
>
> Is it convenient to work on our main kernel on this projects?
> Or, would  you suggest using a different partition kernel to practice this?
>
> I am afraid of messing up my work computer.
> Thank you.
> --
> Javier Pajuelo
>
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Eudyptula Challenge

2014-06-25 Thread Javier
Hello all,

Is it convenient to work on our main kernel on this projects?
Or, would  you suggest using a different partition kernel to practice this?

I am afraid of messing up my work computer.
Thank you.
-- 
Javier Pajuelo
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Suspend/Resume support for PCI

2014-06-25 Thread AYAN KUMAR HALDER
Hi,

I am using a ARM based custom SOC which has a power management unit to
turn off/on the various power domains. When I execute a suspend
command(echo mem > /sys/power/state), then I turn off the power of the
entire SOC except my PMU( as they are in different power domains).
When ever the PMU receives a certain wake-up interrupt, it powers up
the CPU and SOC and the CPU resumes the kernel as per the Linux power
management framework.

Now I have a PCI controller which has been configured in
"linux/arch/arm//pcie.c". During suspend as the PCI
power(which is part of the SOC power domain) gets turned off, so the
controller loses its register configurations. On resume, the pci
driver's resume functions get called and the system hangs up(when it
tries to read/write to pci configuration space).

As per my understanding, the pci driver has implementation of bus/
device power management. It does not reconfigure the pci controller.
So how should I make the pci controller work fine on system resume.
Is it so that I need to reconfigure the pcie controller's registers
(as it has been done in "linux/arch/arm//pcie.c") from the
resume function of pci driver. Or would that compromise the entire
linux pm framework.

Regards,
Ayan Kumar Halder

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: About bio_endio

2014-06-25 Thread Pranay Srivastava
On Wed, Jun 25, 2014 at 10:31 AM, Alvin Abitria  wrote:
> Hello Pranay,
>
>  Thanks for your very helpful insights! I hope you don’t mind if I continue
> with more questions on block layer :-)

Surely.

>
> On Jun 25, 2014 2:09 AM, "Pranay Srivastava"  wrote:
>>
>> Hello Alvin,
>>
>> On Tue, Jun 24, 2014 at 9:53 PM, Alvin Abitria 
>> wrote:
>> > Hello Pranay!
>> >
>> > Thanks for your reply.  I apologize for my very late reply, I was very
>> > preoccupied earlier at work.
>> >
>> >
>> > On Tue, Jun 24, 2014 at 1:07 PM, Pranay Srivastava 
>> > wrote:
>> >>
>> >> Hello Alvin,
>> >>
>> >> On Mon, Jun 23, 2014 at 10:39 PM, Alvin Abitria
>> >> 
>> >> wrote:
>> >> > Hello,
>> >> >
>> >> > I'm developing a block driver using the make_request method,
>> >> > effectively
>> >> > bypassing existing scsi or request stack in block layer.  So that
>> >> > means
>> >> > im
>> >> > directly working with bios.  As prescribed in linux documentation and
>> >> > from
>> >> > referring to similar drivers in kernel, you close a session with a
>> >> > bio
>> >> > with
>> >> > the bio_endio function.
>> >>
>> >> So it means you are just passing on the bios without the request
>> >> structure if I'm correct?
>> >> I don't know how you are handling blk_finish_plug without having
>> >> request or request queue,
>> >> I maybe wrong in understanding how you are handling it.
>> >>
>> > Yes, I'm working on bio's level.  No struct requests, and I haven't used
>> > blk_finish_plug yet.
>> > The block driver method I'm implementing is somewhat along the same line
>> > with nvme and mtip2xxx
>> > drivers in drivers/block directory (but differing in hardware specific
>> > level
>> > of course).
>>
>> Ok I got it now. But why not use request structures? You can use at
>> least one for chaining bio(s). See below what I mean..
>>
>> >>
>> >> >
>> >> > I usually invoke bio_endio during successful I/O completion, meaning
>> >> > with an
>> >> > error code of zero.  But there are cases that this is not fulfilled
>> >> > or
>> >> > there
>> >> > are error cases.  My question is, what are the valid error codes that
>> >> > can be
>> >> > used with it?  My initial impression is that other than zero as error
>> >> > code,
>> >> -EIO is the one that you should use I think,
>> >> > bio_endio will fail.  I've read somewhere that -EBUSY is not
>> >> > recognized,
>> >> > and
>> >> > I tried -EIO but my driver crashed.  I got a panic in some dio_xxx
>> >> > function
>> >> > leading from bio_endio(bio,-EIO). I would like to block subsequent
>> >> > bios
>> >> > sent
>> >>
>> >> If it's okay for you to post the error then can you do that? I was
>> >> seeing the code for
>> >> dio_end_io but it would be good if you can post the exact crash
>> >> backtrace if you've got that.
>> >
>> >
>> > Here you go:
>> >
>> > BUG: unable to handle kernel NULL pointer dereference at (null)
>> > IP: [] bio_check_pages_dirty+0x50/0xe0
>> > PGD 42e5e4067 PUD 42e6e7067 PMD 0
>> > Oops:  [#1] SMP
>> > last sysfs file:
>> > /sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size
>> > CPU 7
>> > Modules linked in: block_module(U) fuse ip6table_filter ip6_tables
>> > ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4
>> > nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_CHECKSUM
>> > iptable_mangle
>> > iptable_filter ip_tables bridge autofs4 sunrpc 8021q garp stp llc
>> > cpufreq_ondemand freq_table pcc_cpufreq ipv6 vhost_net macvtap macvlan
>> > tun
>> > kvm_intel kvm uinput power_meter hpilo hpwdt sg tg3 microcode serio_raw
>> > iTCO_wdt iTCO_vendor_support ioatdma dca shpchp ext4 mbcache jbd2 sd_mod
>> > crc_t10dif hpsa pata_acpi ata_generic ata_piix dm_mirror dm_region_hash
>> > dm_log dm_mod [last unloaded: scsi_wait_scan]
>> >
>> > Pid: 3740, comm: fio Not tainted 2.6.32-358.el6.x86_64 #1 HP ProLiant
>> > DL380p
>> > Gen8
>> > RIP: 0010:[]  []
>> > bio_check_pages_dirty+0x50/0xe0
>> > RSP: 0018:8804191618c8  EFLAGS: 00010046
>> > RAX: 2000 RBX: 88041909f0c0 RCX: 11ae
>> > RDX:  RSI:  RDI: 
>> > RBP: 8804191618f8 R08: 81c07728 R09: 0040
>> > R10: 0002 R11: 0002 R12: 
>> > R13: 8804191b9b80 R14: 8804191b9b80 R15: 
>> > FS:  7fcd43e2d720() GS:8800366e()
>> > knlGS:
>> > CS:  0010 DS:  ES:  CR0: 80050033
>> > CR2:  CR3: 00041e69f000 CR4: 000407e0
>> > DR0:  DR1:  DR2: 
>> > DR3:  DR6: 0ff0 DR7: 0400
>> > Process fio (pid: 3740, threadinfo 88041916, task
>> > 88043341f500)
>> > Stack:
>> >   88043433f400 88043433f520 88041909f0c0
>> >  88041909f0c0 8804191b9b80 880419161948 811bdc38
>> >  880419161968 34236400 fffb 88043433f400
>

Re: about pr_debug

2014-06-25 Thread lx
Thank you. I fix it

EXTRA_CFLAGS += -DDEBUG


2014-06-25 17:50 GMT+08:00 Varka Bhadram :

>  On 06/25/2014 03:17 PM, lx wrote:
>
> thank you.
> But the Makefile is so simple and Not use "cc".
> #
>  obj-m   := task_01.o
>
>CFLAGS_task_01.o := -DDEBUG
>
>   KDIR:=/lib/modules/`uname -r`/build
> PWD:=$(shell pwd)
>
>  default:
> echo $KDIR
> $(MAKE) -C $(KDIR) M=$(PWD) modules
>  #
>
>  So, how to add "CFLAGS"?
>
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: about pr_debug

2014-06-25 Thread Varka Bhadram

On 06/25/2014 03:17 PM, lx wrote:

thank you.
But the Makefile is so simple and Not use "cc".
#
obj-m   := task_01.o


 CFLAGS_task_01.o := -DDEBUG


KDIR:=/lib/modules/`uname -r`/build
PWD:=$(shell pwd)

default:
echo $KDIR
$(MAKE) -C $(KDIR) M=$(PWD) modules
#

So, how to add "CFLAGS"?

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: about pr_debug

2014-06-25 Thread lx
thank you.
But the Makefile is so simple and Not use "cc".
#
obj-m   := task_01.o

KDIR:=/lib/modules/`uname -r`/build
PWD:=$(shell pwd)

default:
echo $KDIR
$(MAKE) -C $(KDIR) M=$(PWD) modules
#

So, how to add "CFLAGS"?


2014-06-25 16:20 GMT+08:00 Bjørn Mork :

> Varka Bhadram  writes:
>
> > refer this :https://www.kernel.org/doc/local/pr_debug.txt
>
> That seems a little outdated since it doesn't mention the extremely
> useful dynamic debug feature.  So please read
> https://www.kernel.org/doc/Documentation/dynamic-debug-howto.txt
> as well.
>
> The ability to dynamically switch on and off debug messages per callsite
> is extremely useful.  And it also enables you to switch on some extra
> info you often want, like function names, without having to explictly
> put them into every format string.
>
> I recommend setting CONFIG_DYNAMIC_DEBUG and taking a look at
> /sys/kernel/debug/dynamic_debug/control if you ever do any kernel
> development.
>
>
>
> Bjørn
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: code location where memory for page structures is allocated.

2014-06-25 Thread sandeep kumar
Thank you Lamine,
now , i got it


On Tue, Jun 24, 2014 at 6:50 PM, Karaoui mohamed lamine 
wrote:

> mm/page_alloc.c
> AFAICC it's memmap_init_zone that initialize all pfns  of a zone to
> default values (setting the pages as reserved).
>
> Note that for the page structures we don't use the standard memory
> allocators (kmalloc, vmalloc, etc), we simply calculate the amount of
> memory that all the structures will hold in, and then allocate a
> corresponding range of memory.
>
> Hope that help.
> Regards.
>
> 2014-06-24 13:21 GMT+02:00 sandeep kumar :
> > hi Ayan
> >>>sparse_mem_maps_populate_node
> > NO, i want to see where we do allocation of all physical "struct page"
> > pointers.
> >
> > struct page[NR_PAGES]; kind of stuff
> >
> > thanks
> > sandeep
> >
> >
> > On Tue, Jun 24, 2014 at 4:15 PM, AYAN KUMAR HALDER  >
> > wrote:
> >>
> >> On Tue, Jun 24, 2014 at 3:54 PM, sandeep kumar
> >>  wrote:
> >> > Hi All
> >> >
> >> > For each physical page, there will be a corresponding "struct page"
> >> > Can anyone tell me, in ARM architecure the code location where "struct
> >> > page"
> >> > memory allocation happens..
> >> >
> >> >
> >> To give you a small pointer, the page tables are set in paging_init(),
> >> arch/arm/mm/mmu.c.
> >> Is this what you are looking for.
> >>
> >> Regards,
> >> Ayan Kumar Halder
> >
> >
> >
> >
> > --
> > With regards,
> > Sandeep Kumar Anantapalli,
> >
> > ___
> > Kernelnewbies mailing list
> > Kernelnewbies@kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
>



-- 
With regards,
Sandeep Kumar Anantapalli,
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: about pr_debug

2014-06-25 Thread Bjørn Mork
Varka Bhadram  writes:

> refer this :https://www.kernel.org/doc/local/pr_debug.txt

That seems a little outdated since it doesn't mention the extremely
useful dynamic debug feature.  So please read
https://www.kernel.org/doc/Documentation/dynamic-debug-howto.txt
as well.

The ability to dynamically switch on and off debug messages per callsite
is extremely useful.  And it also enables you to switch on some extra
info you often want, like function names, without having to explictly
put them into every format string.

I recommend setting CONFIG_DYNAMIC_DEBUG and taking a look at
/sys/kernel/debug/dynamic_debug/control if you ever do any kernel
development.



Bjørn

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eudyptula Challenge Task 02 Doubt

2014-06-25 Thread Sudip Mukherjee
On Wed, Jun 25, 2014 at 12:24 PM, Nada Saif  wrote:
> Hi,
> When I use "make localmodconfig" in task2 ,it says  "snd_page_alloc
> config not found!!" what is means . it doesn't stop the compilation
> ,but many questions appear! Any way to take all old configuration
> without answering questions ?
>
Have you tried to search in google what that error means ? Or just try
to search for snd_page_alloc ..

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: about pr_debug

2014-06-25 Thread Pranay Srivastava
On Wed, Jun 25, 2014 at 11:39 AM, lx  wrote:
> hi all:
>I'm confused with pr_debug. My codes is:
> ###
> #include 
> #include 
>
> static int __init init_page_dir(void)
> {
> pr_debug("Hello world\n");
> return 0;
> }

Add ccflags-y += -DDEBUG in your Kbuild or Makefile that should work.

>
> static void __exit exit_page_dir(void)
> {
> pr_debug("\nGoodbye now...\n\n");
> }
>
> MODULE_LICENSE("GPL");
> module_init(init_page_dir);
> module_exit(exit_page_dir);
> ###
> I make it, and insmod it. But the messages of "Hello world" don't show.
>
> So, My question is If i want to fix it , I should set the
> DEFAULT_MESSAGE_LOGLEVEL and
> rebuild the kernel ?
>
> My kernel version is:2.6.18
> OS is: centOS
>
> Thank you.
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
---P.K.S

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eudyptula Challenge Task 02 Doubt

2014-06-25 Thread Nada Saif
Hi,
When I use "make localmodconfig" in task2 ,it says  "snd_page_alloc
config not found!!" what is means . it doesn't stop the compilation
,but many questions appear! Any way to take all old configuration
without answering questions ?


Thanks,
N.G

On Sat, May 17, 2014 at 1:26 PM, Pol Eyschen  wrote:
> Anything that shows the name of the kernel should be OK
>
> Pol
>
> On 17/05/14 07:08, me storage wrote:
>> Hai
>> i successfully completed task 2 but i don't what files i have to send
>> for proof.
>> So can any one please tell me how to prove the custom kernel is booting?
>> thanks
>>
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies