mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-19 07:14:22 +01:00
rate-limiter: add getRateLimiter/setRateLimiter in endpoint
We use tc-based or built-in rate limiter to shape network I/O traffic and they all must be tied to one specific interface/endpoint. In order to tell whether we've ever added rate limiter to this interface/endpoint, we create get/set func to reveal/store such info. Fixes: #250 Signed-off-by: Penny Zheng <penny.zheng@arm.com>
This commit is contained in:
@@ -169,3 +169,21 @@ func (endpoint *VhostUserEndpoint) load(s persistapi.NetworkEndpoint) {
|
||||
endpoint.PCIAddr = s.VhostUser.PCIAddr
|
||||
}
|
||||
}
|
||||
|
||||
// unsupported
|
||||
func (endpoint *VhostUserEndpoint) GetRxRateLimiter() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (endpoint *VhostUserEndpoint) SetRxRateLimiter() error {
|
||||
return fmt.Errorf("rx rate limiter is unsupported for vhost user endpoint")
|
||||
}
|
||||
|
||||
// unsupported
|
||||
func (endpoint *VhostUserEndpoint) GetTxRateLimiter() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (endpoint *VhostUserEndpoint) SetTxRateLimiter() error {
|
||||
return fmt.Errorf("tx rate limiter is unsupported for vhost user endpoint")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user