xen-netback: making the bandwidth limiter runtime settable
Subsystems (3)
PATCH v2 1/1 xen-netback: making the bandwidth limiter runtime settable
From: "Palik, Imre" <[email protected]>
With the current netback, the bandwidth limiter's parameters are only settable during vif setup time. This patch register a watch on them, and thus makes them runtime changeable.
When the watch fires, the timer is reset. The timer's mutex is used for fencing the change.
--- drivers/net/xen-netback/common.h | 4 +++ drivers/net/xen-netback/interface.c | 1 + drivers/net/xen-netback/netback.c | 4 +-- drivers/net/xen-netback/xenbus.c | 57 +++++++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 3 deletions(-)
drivers/net/xen-netback/common.h +4 -0
@@ -238,6 +238,8 @@ struct xenvif {unsigned int num_queues;/* active queues, resource allocated */ unsigned int stalled_queues; +struct xenbus_watch credit_watch; +spinlock_t lock;#ifdef CONFIG_DEBUG_FS
@@ -260,6 +262,8 @@ static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif)return to_xenbus_device (vif->dev->dev.parent); } +void xenvif_tx_credit_callback (unsigned long data); +struct xenvif *xenvif_alloc (struct device *parent,domid_t domid,unsigned int handle);
drivers/net/xen-netback/interface.c +1 -0
@@ -463,6 +463,7 @@ int xenvif_init_queue(struct xenvif_queue *queue) queue->credit_bytes = queue->remaining_credit = ~0UL ; queue->credit_usec =0UL ;init_timer (&queue->credit_timeout); + queue->credit_timeout.function = xenvif_tx_credit_callback; queue->credit_window_start =get_jiffies_64 (); queue->rx_queue_max =XENVIF_RX_QUEUE_BYTES ;
drivers/net/xen-netback/netback.c +1 -3
@@ -641,7 +641,7 @@ static void tx_add_credit(struct xenvif_queue *queue) queue->remaining_credit =min (max_credit, max_burst); } -static void tx_credit_callback (unsigned long data) +void xenvif_tx_credit_callback (unsigned long data) {struct xenvif_queue *queue = (struct xenvif_queue *)data;tx_add_credit (queue);
@@ -1169,8 +1169,6 @@ static bool tx_credit_exceeded(struct xenvif_queue *queue, unsigned size)if (size > queue->remaining_credit) { queue->credit_timeout.data = (unsigned long )queue; - queue->credit_timeout.function = - tx_credit_callback;mod_timer (&queue->credit_timeout, next_credit); queue->credit_window_start = next_credit;
drivers/net/xen-netback/xenbus.c +57 -0
87 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Quoted 11 lines · Imre Palik
From: "Palik, Imre" <[email protected]>
With the current netback, the bandwidth limiter's parameters are only settable during vif setup time. This patch register a watch on them, and thus makes them runtime changeable.
When the watch fires, the timer is reset. The timer's mutex is used for fencing the change.
Cc Anthony Liguori <[email protected]>Signed-off-by Imre Palik <[email protected]>
Quoted 11 lines · Imre Palik
From: "Palik, Imre" <[email protected]>
With the current netback, the bandwidth limiter's parameters are only settable during vif setup time. This patch register a watch on them, and thus makes them runtime changeable.
When the watch fires, the timer is reset. The timer's mutex is used for fencing the change.
Cc Anthony Liguori <[email protected]>Signed-off-by Imre Palik <[email protected]>
From: Imre Palik <[email protected]>
Date: Thu, 19 Mar 2015 11:05:42 +0100
Quoted 11 lines
From: "Palik, Imre" <[email protected]>
With the current netback, the bandwidth limiter's parameters are only settable during vif setup time. This patch register a watch on them, and thus makes them runtime changeable.
When the watch fires, the timer is reset. The timer's mutex is used for fencing the change.
Cc Anthony Liguori <[email protected]>Signed-off-by Imre Palik <[email protected]>
Applied to net-next, thanks.
From: Imre Palik <[email protected]>
Date: Thu, 19 Mar 2015 11:05:42 +0100
Quoted 11 lines
From: "Palik, Imre" <[email protected]>
With the current netback, the bandwidth limiter's parameters are only settable during vif setup time. This patch register a watch on them, and thus makes them runtime changeable.
When the watch fires, the timer is reset. The timer's mutex is used for fencing the change.
Cc Anthony Liguori <[email protected]>Signed-off-by Imre Palik <[email protected]>
Applied to net-next, thanks.