]> asedeno.scripts.mit.edu Git - linux.git/commit
net: dcb: Add priority-to-DSCP map getters
authorPetr Machata <petrm@mellanox.com>
Fri, 27 Jul 2018 12:26:56 +0000 (15:26 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Jul 2018 20:17:50 +0000 (13:17 -0700)
commitb67c540b8a987e365dc548e5b2ddf023946e3d63
tree98470408a7e0a379e016af2bc52ae1e540dd8d8e
parent08193d1a893c802c4b807e4d522865061f4e9f4f
net: dcb: Add priority-to-DSCP map getters

On ingress, a network device such as a switch assigns to packets
priority based on various criteria. Common options include interpreting
PCP and DSCP fields according to user configuration. When a packet
egresses the switch, a reverse process may rewrite PCP and/or DSCP
values according to packet priority.

The following three functions support a) obtaining a DSCP-to-priority
map or vice versa, and b) finding default-priority entries in APP
database.

The DCB subsystem supports for APP entries a very generous M:N mapping
between priorities and protocol identifiers. Understandably,
several (say) DSCP values can map to the same priority. But this
asymmetry holds the other way around as well--one priority can map to
several DSCP values. For this reason, the following functions operate in
terms of bitmaps, with ones in positions that match some APP entry.

- dcb_ieee_getapp_dscp_prio_mask_map() to compute for a given netdevice
  a map of DSCP-to-priority-mask, which gives for each DSCP value a
  bitmap of priorities related to that DSCP value by APP, along the
  lines of dcb_ieee_getapp_mask().

- dcb_ieee_getapp_prio_dscp_mask_map() similarly to compute for a given
  netdevice a map from priorities to a bitmap of DSCPs.

- dcb_ieee_getapp_default_prio_mask() which finds all default-priority
  rules for a given port in APP database, and returns a mask of
  priorities allowed by these default-priority rules.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dcbnl.h
net/dcb/dcbnl.c