Kernel Packet Processing

How the packets are processed in beaglebone 3.8 kernel from MAC layer to Application layer. ??

If I want to count the number of packets count at MAC layer…What all Kernel files are required.??

Thanks in advance :))

ip -s link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
RX: bytes packets errors dropped overrun mcast
610918 6403 0 0 0 0
TX: bytes packets errors dropped carrier collsns
610918 6403 0 0 0 0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 12:34:56:78:90:12 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
1313119911 1246744 0 0 0 0
TX: bytes packets errors dropped carrier collsns
95697537 731304 0 0 0 0

Thanks Sir, this is using qdisc utility to count the number of packets.

I want to run a counter at MAC layer only, for which I have to write a Kernel Module.

I watched eth.c file in linux 3.14 kernel, but got confused.

Any documentation or help would be appreciable ??

Thanks :slight_smile: