Welcome to the Linux Foundation Forum!

Issue with unregister & registering same netdev without doing free netdev

Hi Guys,

I have some requirement in driver in which do below operation but facing some bug_on from kernel

-> Depending on application input i have to unregister & register the same netdev without freeing

I am facing the bug_on from kernel during registration as below

BUG_ON(dev->reg_state != NETREG_UNINITIALIZED);

-> If we forcefully reset the state in our driver, then this works fine but kernel warns already registered device & some thing seriously wrong here

Then i have tried to initialize the device after unregistration by calling ether_setup & then again registering BUT same bug_on appeared.

My requirement is quiet simple,

-> Whenever user application want to "delete the netdev interface" then i have to make the interface disappeared for ifconfig/iwconfig, so that user can't play with that

-> Whenever user application want to "Add the netdev interface" then i have to make the interface appearing for ifconfig/iwconfig, so that user can use those

The problem is i don't want to call Alloc_netdev/free_netdev based on application input (dynamically creating/destroying), i just want to register/unregister statically created interfaces accordingly.

If you guys have any idea on this then please reply. Thanks in advance

Thanks,

Manoj

Comments

  • May I know which version of kernel so that I may give you a tip about the same ?
  • I am using ubuntu-9.10 with kernel version 2.6.31-14. In other kernel versions also (2.6.32.X) i saw the same.
  • Hi Manoj,
    Have you found any solution to your problem? I am also facing exactly same problem. Please let me know.

    Thanks,
    Ankita

Categories

Upcoming Training