depends on XEN_NETCHANNEL2
default y
+config XEN_NETDEV2_RATELIMITER
+ bool "Net channel 2 rate limiter"
+ depends on XEN_NETCHANNEL2
+ default y
+
config XEN_NETDEV2_VMQ
bool "Net channel 2 support for multi-queue devices"
depends on XEN_NETDEV2_BACKEND
obj-$(CONFIG_XEN_NETCHANNEL2) += netchannel2.o
netchannel2-objs := chan.o netchan2.o rscb.o util.o \
- posted_buffers.o limiter.o xmit_packet.o offload.o recv_packet.o \
+ posted_buffers.o xmit_packet.o offload.o recv_packet.o \
poll.o
+ifeq ($(CONFIG_XEN_NETDEV2_RATELIMITER),y)
+netchannel2-objs += limiter.o
+endif
+
ifeq ($(CONFIG_XEN_NETDEV2_BYPASSABLE),y)
netchannel2-objs += bypassee.o
endif
}
+#ifdef CONFIG_XEN_NETDEV2_RATELIMITER
struct nc2_rate_limiter {
unsigned max_tokens;
unsigned tokens_per_tick_ord;
unsigned nr_tokens);
int nc2_rate_limiter_debit(struct nc2_rate_limiter *nrl,
unsigned nr_tokens);
+#else
+struct nc2_rate_limiter {
+};
+
+static inline void nc2_init_rate_limiter(struct nc2_rate_limiter *nrl,
+ unsigned tokens_per_tick_ord,
+ unsigned max_tokens,
+ unsigned fill_granularity_tokens,
+ void (*stop)(void *),
+ void (*start)(void *),
+ void *ctxt)
+{
+}
+static inline void nc2_cleanup_rate_limiter(struct nc2_rate_limiter *nrl)
+{
+}
+static inline void nc2_rate_limiter_credit(struct nc2_rate_limiter *nrl,
+ unsigned nr_tokens)
+{
+}
+static inline int nc2_rate_limiter_debit(struct nc2_rate_limiter *nrl,
+ unsigned nr_tokens)
+{
+ return 1;
+}
+#endif
+
struct nc2_alternate_ring;