diff options
author | Wei Liu <wei.liu2@citrix.com> | 2013-05-22 02:34:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-23 21:40:37 -0400 |
commit | e1f00a69ec26e3eb9847c61c665b8fb3f0c6b477 (patch) | |
tree | 5958617283d231a3a58229e0e78a4d4623a569a5 /drivers/net/xen-netback/netback.c | |
parent | 8892475386e819aa50856947948c546ccc964d96 (diff) |
xen-netback: split event channels support for Xen backend driver
Netback and netfront only use one event channel to do TX / RX notification,
which may cause unnecessary wake-up of processing routines. This patch adds a
new feature called feature-split-event-channels to netback, enabling it to
handle TX and RX events separately.
Netback will use tx_irq to notify guest for TX completion, rx_irq for RX
notification.
If frontend doesn't support this feature, tx_irq equals to rx_irq.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netback/netback.c')
-rw-r--r-- | drivers/net/xen-netback/netback.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index 2d9477fd900f..82576fffb452 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c | |||
@@ -47,6 +47,13 @@ | |||
47 | #include <asm/xen/hypercall.h> | 47 | #include <asm/xen/hypercall.h> |
48 | #include <asm/xen/page.h> | 48 | #include <asm/xen/page.h> |
49 | 49 | ||
50 | /* Provide an option to disable split event channels at load time as | ||
51 | * event channels are limited resource. Split event channels are | ||
52 | * enabled by default. | ||
53 | */ | ||
54 | bool separate_tx_rx_irq = 1; | ||
55 | module_param(separate_tx_rx_irq, bool, 0644); | ||
56 | |||
50 | /* | 57 | /* |
51 | * This is the maximum slots a skb can have. If a guest sends a skb | 58 | * This is the maximum slots a skb can have. If a guest sends a skb |
52 | * which exceeds this limit it is considered malicious. | 59 | * which exceeds this limit it is considered malicious. |
@@ -662,7 +669,7 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk) | |||
662 | { | 669 | { |
663 | struct xenvif *vif = NULL, *tmp; | 670 | struct xenvif *vif = NULL, *tmp; |
664 | s8 status; | 671 | s8 status; |
665 | u16 irq, flags; | 672 | u16 flags; |
666 | struct xen_netif_rx_response *resp; | 673 | struct xen_netif_rx_response *resp; |
667 | struct sk_buff_head rxq; | 674 | struct sk_buff_head rxq; |
668 | struct sk_buff *skb; | 675 | struct sk_buff *skb; |
@@ -771,7 +778,6 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk) | |||
771 | sco->meta_slots_used); | 778 | sco->meta_slots_used); |
772 | 779 | ||
773 | RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&vif->rx, ret); | 780 | RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&vif->rx, ret); |
774 | irq = vif->irq; | ||
775 | if (ret && list_empty(&vif->notify_list)) | 781 | if (ret && list_empty(&vif->notify_list)) |
776 | list_add_tail(&vif->notify_list, ¬ify); | 782 | list_add_tail(&vif->notify_list, ¬ify); |
777 | 783 | ||
@@ -783,7 +789,7 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk) | |||
783 | } | 789 | } |
784 | 790 | ||
785 | list_for_each_entry_safe(vif, tmp, ¬ify, notify_list) { | 791 | list_for_each_entry_safe(vif, tmp, ¬ify, notify_list) { |
786 | notify_remote_via_irq(vif->irq); | 792 | notify_remote_via_irq(vif->rx_irq); |
787 | list_del_init(&vif->notify_list); | 793 | list_del_init(&vif->notify_list); |
788 | } | 794 | } |
789 | 795 | ||
@@ -1762,7 +1768,7 @@ static void make_tx_response(struct xenvif *vif, | |||
1762 | vif->tx.rsp_prod_pvt = ++i; | 1768 | vif->tx.rsp_prod_pvt = ++i; |
1763 | RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&vif->tx, notify); | 1769 | RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&vif->tx, notify); |
1764 | if (notify) | 1770 | if (notify) |
1765 | notify_remote_via_irq(vif->irq); | 1771 | notify_remote_via_irq(vif->tx_irq); |
1766 | } | 1772 | } |
1767 | 1773 | ||
1768 | static struct xen_netif_rx_response *make_rx_response(struct xenvif *vif, | 1774 | static struct xen_netif_rx_response *make_rx_response(struct xenvif *vif, |