Permalink
Browse files

USB: Performance improvements

Added SKB bitmap allocator, use Nic::Packet_allocator in packet stream, use slab
allocators on top of back-end AVL allocator, split allocators in cached/uncached
for general purpose/DMA allocation, added patch to original code to distinguish
cached or uncached memory requests, take advantage of and implement TX bursts
(or SKB batching), call interrupt handlers until they return unhandled.
  • Loading branch information...
1 parent 8734eab commit 3207b4eed0b3085df112594e38413a0fbfd24338 @ssumpf ssumpf committed with nfeske Aug 3, 2012
Oops, something went wrong.
@@ -0,0 +1,121 @@
+assert_spec foc
+assert_spec platform_panda
+
+#
+# Build
+#
+build {
+ core
+ init
+ drivers/timer
+ drivers/framebuffer
+ drivers/sd_card
+ drivers/usb
+ server/nic_bridge
+ server/part_blk
+ l4linux
+}
+
+create_boot_directory
+
+#
+# Config
+#
+set config {
+<config prio_levels="2">
+ <parent-provides>
+ <service name="ROM"/>
+ <service name="RAM"/>
+ <service name="IRQ"/>
+ <service name="IO_MEM"/>
+ <service name="IO_PORT"/>
+ <service name="CAP"/>
+ <service name="PD"/>
+ <service name="RM"/>
+ <service name="CPU"/>
+ <service name="LOG"/>
+ <service name="SIGNAL"/>
+ </parent-provides>
+ <default-route>
+ <any-service> <parent/> <any-child/> </any-service>
+ </default-route>
+ <start name="timer">
+ <resource name="RAM" quantum="1M"/>
+ <provides><service name="Timer"/></provides>
+ </start>
+ <start name="fb_drv">
+ <binary name="omap4_fb_drv"/>
+ <resource name="RAM" quantum="4M"/>
+ <provides><service name="Framebuffer"/></provides>
+ </start>
+ <start name="sd_card_drv" priority="-1">
+ <resource name="RAM" quantum="4M"/>
+ <provides><service name="Block"/></provides>
+ </start>
+ <start name="usb_drv">
+ <resource name="RAM" quantum="6M"/>
+ <provides>
+ <service name="Input"/>
+ <service name="Nic"/>
+ </provides>
+ <config>
+ <hid/>
+ <nic mac="2e:60:90:0c:4e:01" />
+ </config>
+ </start>
+ <start name="part_blk" priority="-1">
+ <resource name="RAM" quantum="2M"/>
+ <provides><service name="Block"/></provides>
+ <config>
+ <policy label="vmlinux.1 -> sda" partition="1" />
+ <policy label="vmlinux.2 -> sda" partition="2" />
+ <policy label="test-libc_ffat" partition="3" />
+ </config>
+ <route>
+ <service name="Block"> <child name="sd_card_drv"/> </service>
+ <any-service> <parent/> <any-child/> </any-service>
+ </route>
+ </start>
+ <start name="vmlinux.1">
+ <binary name="l4linux"/>
+ <resource name="RAM" quantum="96M"/>
+ <config args="mem=54M l4x_rd=initrd.gz">
+ <block label="sda" />
+ </config>
+ <route>
+ <service name="Input"> <child name="usb_drv"/> </service>
+ <service name="Framebuffer"> <child name="fb_drv"/> </service>
+ <service name="Block"> <child name="part_blk"/> </service>
+ <service name="Nic"> <child name="usb_drv"/> </service>
+ <service name="Timer"> <child name="timer"/> </service>
+ <any-service> <parent/> </any-service>
+ </route>
+ </start>
+</config>}
+
+install_config $config
+
+#
+# Boot modules
+#
+set boot_modules {
+ core
+ init
+ timer
+ part_blk
+ l4linux
+ initrd.gz
+ omap4_fb_drv
+ sd_card_drv
+ usb_drv
+}
+
+set uri "https://github.com/downloads/skalk/genode/busybox-initrd-arm-20120710.gz"
+
+if {![file exists bin/initrd.gz]} {
+ puts "Download initramfs ..."
+ exec >& /dev/null wget -c -O bin/initrd.gz $uri
+}
+
+build_boot_image [join $boot_modules " "]
+
@@ -45,7 +45,7 @@ append config {
<provides><service name="Timer"/></provides>
</start>
<start name="usb_drv">
- <resource name="RAM" quantum="3M"/>
+ <resource name="RAM" quantum="6M"/>
<provides><service name="Input"/></provides>
<config>
<hid/>
@@ -45,7 +45,7 @@ set config {
<provides> <service name="Timer"/> </provides>
</start>
<start name="usb_drv">
- <resource name="RAM" quantum="3M"/>
+ <resource name="RAM" quantum="6M"/>
<provides> <service name="Block"/> </provides>
<config><storage /></config>
</start>
@@ -68,49 +68,7 @@ struct ehci_hcd_omap_platform_data
};
struct regulator;
-/*********************************************
- ** arch/arm/plat-omap/include/plat/board.h **
- *********************************************/
-struct omap_usb_config;
-
-
-/************************************************
- ** arch/arm/plat-omap/include/plat/omap34xx.h **
- ************************************************/
-
-#define OMAP34XX_UHH_CONFIG_BASE 0
-#define OMAP34XX_EHCI_BASE 0
-#define OMAP34XX_USBTLL_BASE 0
-#define INT_34XX_EHCI_IRQ 0
-#define OMAP34XX_OHCI_BASE 0
-#define INT_34XX_OHCI_IRQ 0
-#define OMAP3430_REV_ES2_1 0
-
-
-static inline int cpu_is_omap34xx(void) { return 0; }
-static inline int cpu_is_omap3430(void) { return 0; }
-
-/***************************************************
- ** platform definition os for OMAP44xx all under **
- ** 'arch/arm/plat-omap/include **
- ***************************************************/
-
-enum {
- OMAP44XX_IRQ_GIC_START = 32,
- OMAP44XX_IRQ_EHCI = 77 + OMAP44XX_IRQ_GIC_START,
- OMAP44XX_IRQ_OHCI =76 + OMAP44XX_IRQ_GIC_START,
-};
-
-enum {
- L4_44XX_BASE = 0x4a000000,
- OMAP44XX_USBTLL_BASE = L4_44XX_BASE + 0x62000,
- OMAP44XX_UHH_CONFIG_BASE = L4_44XX_BASE + 0x64000,
- OMAP44XX_HSUSB_OHCI_BASE = L4_44XX_BASE + 0x64800,
- OMAP44XX_HSUSB_EHCI_BASE = L4_44XX_BASE + 0x64C00,
-};
-
-static inline int cpu_is_omap44xx(void) { return 1; }
/*****************************
** linux/platform_device.h **
@@ -132,6 +90,7 @@ int platform_get_irq_byname(struct platform_device *, const char *);
int platform_driver_register(struct platform_driver *);
int platform_device_register(struct platform_device *);
+
/**********************
** asm/generic/io.h **
**********************/
@@ -61,8 +61,6 @@ static struct ehci_hcd_omap_platform_data _ehci_data
};
-
-
/**
* Enables USB clocks
*/
@@ -89,11 +87,8 @@ struct Clocks : Genode::Mmio
void dump()
{
Usb_host_clk::access_t a1 = read<Usb_host_clk>();
- PDBG("Host clock %x", a1);
Usb_tll_clk::access_t a3 = read<Usb_tll_clk>();
- PDBG("TLL: %x", a3);
Usb_phy_clk::access_t a4 = read<Usb_phy_clk>();
- PDBG("Phy: %x", a4);
}
};
@@ -1,93 +0,0 @@
-/*
- * \brief DMA memory pool
- * \author Sebastian Sumpf
- * \date 2012-06-18
- */
-
-/*
- * Copyright (C) 2012 Genode Labs GmbH
- *
- * This file is part of the Genode OS framework, which is distributed
- * under the terms of the GNU General Public License version 2.
- */
-
-#ifndef _DMA_H_
-#define _DMA_H_
-
-#include <base/allocator_avl.h>
-#include <dataspace/client.h>
-#include <lx_emul.h>
-
-/*********************
- ** linux/dmapool.h **
- *********************/
-
-namespace Genode {
-
- /**
- * Dma-pool manager
- */
- class Dma
- {
- private:
-
- enum { SIZE = 1024 * 1024 };
-
- addr_t _base; /* virt base of pool */
- addr_t _base_phys; /* phys base of pool */
- Allocator_avl _range; /* range allocator for pool */
-
- Dma() : _range(env()->heap())
- {
- Ram_dataspace_capability cap = env()->ram_session()->alloc(SIZE, false);
- _base_phys = Dataspace_client(cap).phys_addr();
- _base = (addr_t)env()->rm_session()->attach(cap);
- dde_kit_log(DEBUG_DMA, "New DMA range [%lx-%lx)", _base, _base + SIZE);
- _range.add_range(_base, SIZE);
- }
-
- public:
-
- static Dma* pool()
- {
- static Dma _p;
- return &_p;
- }
-
- addr_t base() const { return _base; };
- addr_t end() const { return _base + SIZE - 1; }
-
- /**
- * Alloc 'size' bytes of DMA memory
- */
- void *alloc(size_t size, int align = 12)
- {
- void *addr;
- if (!_range.alloc_aligned(size, &addr, align)) {
- PERR("DMA of %zu bytes allocation failed", size);
- return 0;
- }
- return addr;
- }
-
- /**
- * Free DMA memory
- */
- void free(void *addr) { _range.free(addr); }
-
- /**
- * Get phys for virt address
- */
- addr_t phys_addr(void *addr)
- {
- addr_t a = (addr_t)addr;
- if (a < _base || a >= _base + SIZE) {
- PERR("No DMA phys addr for %lx", a);
- return 0;
- }
- return (a - _base) + _base_phys;
- }
- };
-}
-
-#endif /* _DMA_H_ */
@@ -812,8 +812,6 @@ void skb_queue_purge(struct sk_buff_head *list) { TRACE; }
void skb_tx_timestamp(struct sk_buff *skb) { TRACE; }
bool skb_defer_rx_timestamp(struct sk_buff *skb) { TRACE; return 0; }
-void dev_kfree_skb_any(struct sk_buff *skb) { TRACE; }
-
/*********************
** linux/ethtool.h **
Oops, something went wrong.

0 comments on commit 3207b4e

Please sign in to comment.