| 数据搜索系统,热门电子元器件搜索 |
|
UM0851 数据表(PDF) 49 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 数据表(HTML) 49 Page - STMicroelectronics |
|
49 / 245 page ![]() UM0851 Communication device drivers Doc ID 16604 Rev 2 49/245 Note: The maximum MTU size for SPEAr600 is 4000 and for SPEAr300 is 9000. ● void (*set_multicast_list)(struct net_device *dev); Method called when the multicast list for the device changes and when the flags change. 4.1.4 Concept of socket buffers Each packet handled by the kernel is contained in a socket buffer structure (struct sk_buff), whose definition is found in <linux/skbuff.h>. The structure gets its name from the Unix abstraction used to represent a network connection, the socket. Even if the interface has nothing to do with sockets, each network packet belongs to a socket in the higher network layers, and the input/output buffers of any socket are lists of struct sk_buff. The same struct sk_buff is used to host network data throughout all the Linux network subsystems, but a socket buffer is just a packet as far as the interface is concerned. A pointer to struct sk_buff is usually called skb. This practice is used both in the sample code and in the text. The skb buffers used for the reception or transmission must guarantee cache coherency. These buffers are allocated in the cached memory regions and therefore there is a possibility that the memory data is not in synch with cache. The driver uses the following calls for cache coherency: dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,enum dma_data_direction dir); /* Depending upon the directions of the data transfer the above function either invalidates or clean the cache contents. If the argument dir in the above function is set as DMA_FROM_DEVICE, this argument may do nothing in the above function but invalidates the cache when used in dma_unmap_single. If the argument dir is set to DMA_TO_DEVICE, it cleans the cache. Cleaning a cache reestablishes coherence between the cached memory and the main memory */ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,enum dma_data_direction dir); /* The call to the above function is made when the packet has been received, to see if a mapped address was really a "safe" buffer and if so, copy the data from the safe buffer back to the unsafe buffer and free up the safe buffer. */ Packet reception Receiving data from the network is trickier than transmitting it, because a struct sk_buff must be allocated and handed off to the upper layers within an atomic context. The mode of packet reception that has been implemented is interrupt driven. There is a common interrupt registered for both reception and transmission. When the packet is received a tasklet is scheduled for handing the packet to the upper stacks, as the packet has been fetched by DMA into the memory buffers. The scheduled tasklet executes not later than the next timer tick. This scheduling allows to handle more packets in a more efficient way. One important thing to note over here is that since the packet handling to the stack is done through tasklet, it keeps the DMA descriptor occupied till the packet is handed over to the stack. In case of heavy Ethernet traffic at high speeds, the number of DMA descriptors |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |