mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Storm control used meters 0 to 39, the same meters the ACL hands out, so a storm limit and an acl meter could overwrite each other. It now uses 24 + port * 4 + type, meters 24 to 63. parse_storm() is no longer reentrant and uses plain locals, looks the type up in a while loop and returns straight from the one-line cases. storm_show() uses plain locals too. The documentation says how IGMP decides between mcast and umcast, how to get from a meter index to its limit, where the IFG bit of a meter is, and what an ingress bandwidth limit on the same port does to the storm limit.
15 lines
409 B
C
15 lines
409 B
C
#ifndef _RTL837X_STORM_H_
|
|
#define _RTL837X_STORM_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
#define STORM_TYPES 4
|
|
#define STORM_METER_BASE 24
|
|
#define STORM_METER(port, type) (STORM_METER_BASE + (((port) << 2) | (type)))
|
|
|
|
void storm_set(uint8_t port, __xdata uint8_t type, __xdata uint32_t rate, __xdata uint8_t pps) __banked;
|
|
void storm_off(uint8_t port, __xdata uint8_t type) __banked;
|
|
void storm_show(void) __banked;
|
|
|
|
#endif
|