# HG changeset patch # User root@vmi06.sky.yk.fujitsu.co.jp # Date 1168940841 -32400 # Node ID 64ceac593b7a1a65e33726e6d4beba686633ff30 # Parent c6b683ba68f5417a5b397d8530edd9df14ad586c fix short_message of UDP error Signed-off-by: Tomonari Horikoshi Signed-off-by: Hirofumi Tsujimura diff -r c6b683ba68f5 -r 64ceac593b7a linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Sun Jan 14 22:18:38 2007 -0700 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Tue Jan 16 18:47:21 2007 +0900 @@ -82,9 +82,15 @@ static int MODPARM_rx_flip = 0; static int MODPARM_rx_flip = 0; module_param_named(rx_flip, MODPARM_rx_flip, bool, 0); MODULE_PARM_DESC(rx_flip, "Flip packets from network card (rather than copy)"); +static int MODPARM_tx_queue_len = 256; +module_param_named(tx_queue_len, MODPARM_tx_queue_len, int, 0); +MODULE_PARM_DESC(tx_queue_len, "Tx limit queue size."); #else static const int MODPARM_rx_copy = 1; static const int MODPARM_rx_flip = 0; +static int MODPARM_tx_queue_len = 256; +module_param_named(tx_queue_len, MODPARM_tx_queue_len, int, 0); +MODULE_PARM_DESC(tx_queue_len, "Tx limit queue size."); #endif #define RX_COPY_THRESHOLD 256 @@ -613,7 +619,7 @@ static int network_open(struct net_devic static inline int netfront_tx_slot_available(struct netfront_info *np) { - return RING_FREE_REQUESTS(&np->tx) >= MAX_SKB_FRAGS + 2; + return MODPARM_tx_queue_len >= (np->tx.sring->req_event - np->tx.req_prod_pvt); } static inline void network_maybe_wake_tx(struct net_device *dev) @@ -1695,6 +1701,7 @@ static int network_connect(struct net_de IPRINTK("device %s has %sing receive path.\n", dev->name, np->copying_receiver ? "copy" : "flipp"); + IPRINTK("tx queue len of device %s is %d.\n", dev->name, MODPARM_tx_queue_len); spin_lock_irq(&np->tx_lock); spin_lock(&np->rx_lock); @@ -1983,6 +1990,7 @@ static struct net_device * __devinit cre netdev->uninit = netif_uninit; netdev->change_mtu = xennet_change_mtu; netdev->weight = 64; + netdev->tx_queue_len = MODPARM_tx_queue_len; netdev->features = NETIF_F_IP_CSUM; SET_ETHTOOL_OPS(netdev, &network_ethtool_ops);