Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\test_bpf.c Create Date:2022-07-28 06:27:58
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:build_test_skb

Proto:static __init struct sk_buff *build_test_skb(void)

Type:struct sk_buff

Parameter:Nothing

6805  headroom = The networking layer reserves some headroom in skb data (via* dev_alloc_skb) + We handle most unaligned accesses in hardware. On the other hand* unaligned DMA can be quite expensive on some Nehalem processors.* Based on this we disable the IP header alignment in network drivers. + Total octets in header.
6808  data_size = 8
6810  When i < 2 cycle
6811  page[i] = alloc_page(GFP_KERNEL)
6812  If Not page[i] Then
6813  If i == 0 Then Go to err_page0
6815  Else Go to err_page1
6820  skb[i] = allocate an skbuff for sending
6821  If Not skb[i] Then
6822  If i == 0 Then Go to err_skb0
6824  Else Go to err_skb1
6828  skb_reserve - adjust headroom*@skb: buffer to alter*@len: bytes to move* Increase the headroom of an empty &sk_buff by reducing the tail* room. This is only allowed for an empty buffer.
6829  add data to a buffer
6830  protocol = htons(Internet Protocol packet )
6831  skb_reset_network_header(skb[i])
6832  skb_set_mac_header(skb[i], - Total octets in header. )
6834  skb_add_rx_frag(skb[i], 0, page[i], 0, 64, 64)
6839  gso_size = 1448
6840  gso_type = SKB_GSO_TCPV4
6841  gso_type |= SKB_GSO_DODGY
6842  Warning: this field is not always filled in (UFO)! = 0
6843  frag_list = skb[1]
6846  len += len
6847  data_len += data_len
6848  truesize += truesize
6850  Return skb[0]
6852  err_skb1 :
6853  __free_page(page[1])
6854  err_page1 :
6855  free an sk_buff
6856  err_skb0 :
6857  __free_page(page[0])
6858  err_page0 :
6859  Return NULL