Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to identify kernel driver of virtual network device
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
salam
Apprentice
Apprentice


Joined: 29 Sep 2005
Posts: 226

PostPosted: Sun Aug 07, 2022 1:33 pm    Post subject: How to identify kernel driver of virtual network device Reply with quote

I'm trying to find out which kernel driver controls a network device. For physical and even virtual machine adapters, there exists a symlink
/sys/class/net/eth0/device/driver

But for virtual adapters like bridge or GRE, no such symlink is present.
Is there a way how to find out the driver name?
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Sun Aug 07, 2022 1:58 pm    Post subject: Reply with quote

Quote:

Is there a way how to find out the driver name?


it uses the driver of the slave ethernet device.
It might need additional .config in the kernel to enable bridge functionality but the driver is same.
In my case
Code:

ls  -l /sys/class/net/br0/lower_eth0/device/driver

_________________
:)
Back to top
View user's profile Send private message
salam
Apprentice
Apprentice


Joined: 29 Sep 2005
Posts: 226

PostPosted: Mon Aug 08, 2022 7:11 pm    Post subject: Reply with quote

Some of them don't have lower device entry. The closest I found so far was to use /sys/class/net/*/type to get at least something useful.

I'm trying to find how to assign a device to its config entry in kernel like:
br0 -> Symbol: BRIDGE
gre1 -> Symbol: NET_IPGRE

The device name can be anything, so on an unknown system, I cannot rely on typical naming
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Mon Aug 08, 2022 7:14 pm    Post subject: Reply with quote

You just use Gentoo wiki.If there is an entry there will be kernel config instructions.Look at the ebuilds.
Sometimes you can find kernel config in them too.
If not get yourself a full sample config from
https://github.com/archlinux/svntogit-packages/blob/packages/linux/trunk/config
and start grepping items.
For example if i run
Code:

grep -i gre <some-full-.config>

i get
Code:

CONFIG_ACPI_PROCESSOR_AGGREGATOR=m
CONFIG_NET_INGRESS=y
CONFIG_NET_EGRESS=y
CONFIG_NET_IPGRE_DEMUX=m
CONFIG_NET_IPGRE=m
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IPV6_GRE=m
CONFIG_NETFILTER_INGRESS=y
CONFIG_NETFILTER_EGRESS=y
CONFIG_NETFILTER_SKIP_EGRESS=y
CONFIG_NF_CT_PROTO_GRE=y
CONFIG_NET_SCH_GRED=m
CONFIG_NET_SCH_INGRESS=m
CONFIG_OPENVSWITCH_GRE=m
CONFIG_GPIO_AGGREGATOR=m
CONFIG_HID_GREENASIA=m
CONFIG_GREENASIA_FF=y
# Surface System Aggregator Module HID support
# end of Surface System Aggregator Module HID support
# CONFIG_GREYBUS is not set
CONFIG_SURFACE_AGGREGATOR_CDEV=m
CONFIG_SURFACE_AGGREGATOR_REGISTRY=m
CONFIG_SURFACE_AGGREGATOR=m
CONFIG_SURFACE_AGGREGATOR_BUS=y
# CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION is not set
CONFIG_NLS_MAC_GREEK=m


filter out the junk and i have
Code:


CONFIG_NET_IPGRE_DEMUX=m
CONFIG_NET_IPGRE=m
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IPV6_GRE=m
CONFIG_NF_CT_PROTO_GRE=y
CONFIG_OPENVSWITCH_GRE=m



You get thus a rough idea of namings.
Then go to "make menuconfig" and try to find these settings.
_________________
:)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum