Skip to content

Instantly share code, notes, and snippets.

View danish-rehman's full-sized avatar

danish-rehman

View GitHub Profile
@danish-rehman
danish-rehman / List of files needed for new boot
Last active August 29, 2015 14:13
List of files needed for new boot
# List of all the files stored
>> ls quick_boot_kernel
bzImage
System.map
config-3.16.0
3.16.0
@danish-rehman
danish-rehman / setup_host
Created January 8, 2015 06:04
Copy the files at appropriate location of the destination host.
# Copy the files at appropriate location of the destination host.
>> cp -R quick_boot_kernel/3.16.0 /lib/modules/
>> cp quick_boot_kernel/config-3.16.0 /boot/
>> cd quick_boot_kernel
>> /sbin/installkernel 3.16.0 bzImage System.map "/boot"
@danish-rehman
danish-rehman / compile_install_module
Last active August 29, 2015 14:13
Compile and install a linux kernel module
# Go to linux kernel source code
# This kernel is already compiled and installed
# on the given host
>> cd /mnt/local/linux-3.16
# Edit the network driver code
>> vim drivers/net/ethernet/intel/igb/igb_main.c
# Compile the module
>> make -C /lib/modules/`uname -r`/build M=drivers/net/ethernet/intel/igb
# Install the module
>> make -C /lib/modules/`uname -r`/build INSTALL_MOD_DIR=kernel/drivers/net/ethernet/intel/igb M=drivers/net/ethernet/intel/igb modules_install
@danish-rehman
danish-rehman / path_compiled_module
Created January 8, 2015 06:50
Compiled module path
>> ls /lib/modules/3.16.0/kernel/drivers/net/ethernet/intel/igb/igb.ko
@danish-rehman
danish-rehman / nic_command
Last active August 29, 2015 14:13
Check your NIC card
# Check your NIC card
>> lspci | awk '/net/ {print $1}' | xargs -i% lspci -ks %
>> lspci | grep -i net
>> sudo lshw -c network
# Determine which driver is currently running
>> ls -l /sys/class/net/<devname>/device/driver/module
../../../../module/e1000e
>> ls -l /sys/class/net/<devname>/device/driver
../../../../../bus/pci/drivers/e1000e
@danish-rehman
danish-rehman / ethtool_commands
Created January 8, 2015 07:59
Ethtool Commands
# Download the ethtool
>> wget https://www.kernel.org/pub/software/network/ethtool/ethtool-3.16.tar.gz
# Get attributes of the NIC
>> ethtool -t eth0
@danish-rehman
danish-rehman / ls_offloading_values
Created January 8, 2015 08:05
Check the offloading values
Check the offloading values
>> ethtool --show-offload eth0
Offload parameters for eth1:
rx-checksumming: on
tx-checksumming: on
scatter-gather: on
tcp-segmentation-offload: on
udp-fragmentation-offload: off
generic-segmentation-offload: on
generic-receive-offload: on
@danish-rehman
danish-rehman / stop_offloading
Created January 8, 2015 08:07
Remove the offloading
>> sudo ethtool --offload eth1 rx off tx off
>> sudo ethtool -K eth1 gso off
@danish-rehman
danish-rehman / change_queue_size
Created January 8, 2015 08:10
Change NIC queue size
>> sudo ethtool -G eth1 tx 64