Print this page
11493 aggr needs support for multiple pseudo rx groups
Portions contributed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/mac_provider.h
          +++ new/usr/src/uts/common/sys/mac_provider.h
↓ open down ↓ 234 lines elided ↑ open up ↑
 235  235  #define MC_OPEN         0x0008
 236  236  #define MC_CLOSE        0x0010
 237  237  #define MC_SETPROP      0x0020
 238  238  #define MC_GETPROP      0x0040
 239  239  #define MC_PROPINFO     0x0080
 240  240  #define MC_PROPERTIES   (MC_SETPROP | MC_GETPROP | MC_PROPINFO)
 241  241  
 242  242  /*
 243  243   * Virtualization Capabilities
 244  244   */
      245 +
 245  246  /*
 246      - * The ordering of entries below is important. MAC_HW_CLASSIFIER
 247      - * is the cutoff below which are entries which don't depend on
 248      - * H/W. MAC_HW_CLASSIFIER and entries after that are cases where
 249      - * H/W has been updated through add/modify/delete APIs.
      247 + * The type of ring classification. This is used by MAC to determine
      248 + * what, if any, processing it has to do upon receiving traffic on a
      249 + * particular Rx ring.
      250 + *
      251 + * MAC_NO_CLASSIFIER
      252 + *
      253 + *      No classification has been set. No traffic should cross an Rx
      254 + *      ring in this state.
      255 + *
      256 + * MAC_SW_CLASSIFIER
      257 + *
      258 + *      The driver delivers traffic for multiple clients to this ring.
      259 + *      All traffic must be software classified by MAC to guarantee
      260 + *      delivery to the correct client. This classification type may
      261 + *      be chosen for several reasons.
      262 + *
      263 + *      o The driver provides only one group and there are multiple
      264 + *        clients using the MAC.
      265 + *
      266 + *      o The driver provides some hardware filtering but not enough
      267 + *        to fully classify the traffic. E.g., a VLAN VNIC requires L2
      268 + *        unicast address filtering as well as VLAN filtering, but
      269 + *        some drivers may only support the former.
      270 + *
      271 + *      o The ring belongs to the default group. The default group
      272 + *        acts as a spillover for all clients that can't reserve an
      273 + *        exclusive group. It also handles multicast traffic for all
      274 + *        clients. For these reasons, the default group's rings are
      275 + *        always software classified.
      276 + *
      277 + * MAC_HW_CLASSIFIER
      278 + *
      279 + *      The driver delivers traffic for a single MAC client across
      280 + *      this ring. With this guarantee, MAC can simply pass the
      281 + *      traffic up the stack or even allow polling of the ring.
      282 + *
      283 + * MAC_PASSTHRU_CLASSIFIER
      284 + *
      285 + *      The ring is in "passthru" mode. In this mode we bypass all of
      286 + *      the typical MAC processing and pass the traffic directly to
      287 + *      the mr_pt_fn callback, see mac_rx_common(). This is used in
      288 + *      cases where there is another module acting as MAC provider on
      289 + *      behalf of the driver. E.g., link aggregations use this mode to
      290 + *      take full control of the port's rings; allowing it to enforce
      291 + *      LACP protocols and aggregate rings across discrete drivers.
 250  292   */
 251  293  typedef enum {
 252  294          MAC_NO_CLASSIFIER = 0,
 253  295          MAC_SW_CLASSIFIER,
 254      -        MAC_HW_CLASSIFIER
      296 +        MAC_HW_CLASSIFIER,
      297 +        MAC_PASSTHRU_CLASSIFIER
 255  298  } mac_classify_type_t;
 256  299  
 257  300  typedef void    (*mac_rx_func_t)(void *, mac_resource_handle_t, mblk_t *,
 258  301      boolean_t);
 259  302  
 260  303  /*
 261  304   * The virtualization level conveys the extent of the NIC hardware assistance
 262  305   * for traffic steering employed for virtualization:
 263  306   *
 264  307   * MAC_VIRT_NONE:       No assist for v12n.
↓ open down ↓ 92 lines elided ↑ open up ↑
 357  400  typedef struct mac_ring_info_s {
 358  401          mac_ring_driver_t       mri_driver;
 359  402          mac_ring_start_t        mri_start;
 360  403          mac_ring_stop_t         mri_stop;
 361  404          mac_intr_t              mri_intr;
 362  405          union {
 363  406                  mac_ring_send_t send;
 364  407                  mac_ring_poll_t poll;
 365  408          } mrfunion;
 366  409          mac_ring_stat_t         mri_stat;
      410 +
 367  411          /*
 368  412           * mri_flags will have some bits set to indicate some special
 369  413           * property/feature of a ring like serialization needed for a
 370  414           * Tx ring or packets should always need enqueuing on Rx side,
 371  415           * etc.
 372  416           */
 373  417          uint_t                  mri_flags;
 374  418  } mac_ring_info_s;
 375  419  
 376  420  #define mri_tx                  mrfunion.send
↓ open down ↓ 234 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX