aboutsummaryrefslogtreecommitdiffstats
path: root/xenolinux-2.4.26-sparse
diff options
context:
space:
mode:
authormwilli2@equilibrium.research.intel-research.net <mwilli2@equilibrium.research.intel-research.net>2004-06-03 16:57:49 +0000
committermwilli2@equilibrium.research.intel-research.net <mwilli2@equilibrium.research.intel-research.net>2004-06-03 16:57:49 +0000
commite77c8ec1ec2184476607e09e927cd45bdaa69afc (patch)
treefe1e47ce34a29c02e55abab2b36f802a8ff9f479 /xenolinux-2.4.26-sparse
parentb377dcdfc01d2b59058358957c616eaacc815980 (diff)
downloadxen-e77c8ec1ec2184476607e09e927cd45bdaa69afc.tar.gz
xen-e77c8ec1ec2184476607e09e927cd45bdaa69afc.tar.bz2
xen-e77c8ec1ec2184476607e09e927cd45bdaa69afc.zip
bitkeeper revision 1.934 (40bf588ddomhTq7ECMnz9Besla7qeg)
More minor tweaks.
Diffstat (limited to 'xenolinux-2.4.26-sparse')
-rw-r--r--xenolinux-2.4.26-sparse/arch/xen/drivers/netif/backend/main.c4
-rw-r--r--xenolinux-2.4.26-sparse/arch/xen/drivers/netif/frontend/main.c31
2 files changed, 22 insertions, 13 deletions
diff --git a/xenolinux-2.4.26-sparse/arch/xen/drivers/netif/backend/main.c b/xenolinux-2.4.26-sparse/arch/xen/drivers/netif/backend/main.c
index c42a8e6f31..2c4e5cb211 100644
--- a/xenolinux-2.4.26-sparse/arch/xen/drivers/netif/backend/main.c
+++ b/xenolinux-2.4.26-sparse/arch/xen/drivers/netif/backend/main.c
@@ -733,10 +733,10 @@ static int __init init_module(void)
int i;
if ( !(start_info.flags & SIF_NET_BE_DOMAIN) &&
- !(start_info.flags & SIF_INIT_DOMAIN) )
+ !(start_info.flags & SIF_INITDOMAIN) )
return 0;
- printk("Initialising Xen virtual ethernet backend driver\n");
+ printk("Initialising Xen netif backend\n");
skb_queue_head_init(&rx_queue);
skb_queue_head_init(&tx_queue);
diff --git a/xenolinux-2.4.26-sparse/arch/xen/drivers/netif/frontend/main.c b/xenolinux-2.4.26-sparse/arch/xen/drivers/netif/frontend/main.c
index 986c079b15..4d4c579703 100644
--- a/xenolinux-2.4.26-sparse/arch/xen/drivers/netif/frontend/main.c
+++ b/xenolinux-2.4.26-sparse/arch/xen/drivers/netif/frontend/main.c
@@ -520,6 +520,14 @@ static void netif_status_change(netif_fe_interface_status_changed_t *status)
printk(KERN_INFO "Attempting to reconnect network interface\n");
/* Begin interface recovery.
+ *
+ * NB. Whilst we're recovering, we turn the carrier state off. We
+ * take measures to ensure that this device isn't used for
+ * anything. We also stop the queue for this device. Various
+ * different approaches (e.g. continuing to buffer packets) have
+ * been tested but don't appear to improve the overall impact on
+ * TCP connections.
+ *
* TODO: (MAW) Change the Xend<->Guest protocol so that a recovery
* is initiated by a special "RESET" message - disconnect could
* just mean we're not allowed to use this interface any more.
@@ -527,17 +535,16 @@ static void netif_status_change(netif_fe_interface_status_changed_t *status)
/* Stop old i/f to prevent errors whilst we rebuild the state. */
spin_lock_irq(&np->tx_lock);
- spin_lock_irq(&np->rx_lock);
+ spin_lock(&np->rx_lock);
netif_stop_queue(dev);
netif_carrier_off(dev);
np->state = NETIF_STATE_DISCONNECTED;
- spin_unlock_irq(&np->rx_lock);
+ spin_unlock(&np->rx_lock);
spin_unlock_irq(&np->tx_lock);
/* Free resources. */
free_irq(np->irq, dev);
unbind_evtchn_from_irq(np->evtchn);
-
free_page((unsigned long)np->tx);
free_page((unsigned long)np->rx);
}
@@ -589,17 +596,18 @@ static void netif_status_change(netif_fe_interface_status_changed_t *status)
np->rx->event = 1;
/* Step 2: Rebuild the RX and TX ring contents.
- * NB. We could just throw away the queued TX packets but we hope
+ * NB. We could just free the queued TX packets now but we hope
* that sending them out might do some good. We have to rebuild
* the RX ring because some of our pages are currently flipped out
* so we can't just free the RX skbs.
* NB2. Freelist index entries are always going to be less than
* __PAGE_OFFSET, whereas pointers to skbs will always be equal or
- * greater than __PAGE_OFFSET, so we use this to distinguish them.
+ * greater than __PAGE_OFFSET: we use this property to distinguish
+ * them.
*/
/* Rebuild the TX buffer freelist and the TX ring itself.
- * NB. This reorders packets :-( We could keep more private state
+ * NB. This reorders packets. We could keep more private state
* to avoid this but maybe it doesn't matter so much given the
* interface has been down.
*/
@@ -609,7 +617,7 @@ static void netif_status_change(netif_fe_interface_status_changed_t *status)
{
struct sk_buff *skb = np->tx_skbs[i];
- tx = &np->tx->ring[MASK_NET_TX_IDX(requeue_idx++)].req;
+ tx = &np->tx->ring[requeue_idx++].req;
tx->id = i;
tx->addr = virt_to_machine(skb->data);
@@ -629,10 +637,11 @@ static void netif_status_change(netif_fe_interface_status_changed_t *status)
wmb();
np->rx->req_prod = requeue_idx;
- /* Step 3: All public and private state should now be sane. Start
- * sending and receiving packets again and give the driver domain a
- * kick because we've probably just requeued some packets. */
-
+ /* Step 3: All public and private state should now be sane. Get
+ * ready to start sending and receiving packets and give the driver
+ * domain a kick because we've probably just requeued some
+ * packets.
+ */
netif_carrier_on(dev);
netif_start_queue(dev);
np->state = NETIF_STATE_ACTIVE;