• Ido Schimmel's avatar
    drop_monitor: Add support for summary alert mode for hardware drops · d40e1deb
    Ido Schimmel authored
    In summary alert mode a notification is sent with a list of recent drop
    reasons and a count of how many packets were dropped due to this reason.
    
    To avoid expensive operations in the context in which packets are
    dropped, each CPU holds an array whose number of entries is the maximum
    number of drop reasons that can be encoded in the netlink notification.
    Each entry stores the drop reason and a count. When a packet is dropped
    the array is traversed and a new entry is created or the count of an
    existing entry is incremented.
    
    Later, in process context, the array is replaced with a newly allocated
    copy and the old array is encoded in a netlink notification. To avoid
    breaking user space, the notification includes the ancillary header,
    which is 'struct net_dm_alert_msg' with number of entries set to '0'.
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    d40e1deb
drop_monitor.c 36.1 KB