Print this page
11490 SRS ring polling disabled for VLANs
11491 Want DLS bypass for VLAN traffic
11492 add VLVF bypass to ixgbe core
2869 duplicate packets with vnics over aggrs
11489 DLS stat delete and aggr kstat can deadlock
Portions contributed by: Theo Schlossnagle <jesus@omniti.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/mac/mac_soft_ring.c
          +++ new/usr/src/uts/common/io/mac/mac_soft_ring.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24      - * Copyright 2017 Joyent, Inc.
       24 + * Copyright 2018 Joyent, Inc.
  25   25   */
  26   26  
  27   27  /*
  28   28   * General Soft rings - Simulating Rx rings in S/W.
  29   29   *
  30   30   * Soft ring is a data abstraction containing a queue and a worker
  31   31   * thread and represents a hardware Rx ring in software. Each soft
  32   32   * ring set can have a collection of soft rings for separating
  33   33   * L3/L4 specific traffic (IPv4 from IPv6 or TCP from UDP) or for
  34   34   * allowing a higher degree of parallelism by sending traffic to
↓ open down ↓ 165 lines elided ↑ open up ↑
 200  200          ringp->s_ring_worker = thread_create(NULL, 0,
 201  201              mac_soft_ring_worker, ringp, 0, &p0, TS_RUN, pri);
 202  202          if (type & ST_RING_TX) {
 203  203                  ringp->s_ring_drain_func = mac_tx_soft_ring_drain;
 204  204                  ringp->s_ring_tx_arg1 = x_arg1;
 205  205                  ringp->s_ring_tx_arg2 = x_arg2;
 206  206                  ringp->s_ring_tx_max_q_cnt = mac_tx_soft_ring_max_q_cnt;
 207  207                  ringp->s_ring_tx_hiwat =
 208  208                      (mac_tx_soft_ring_hiwat > mac_tx_soft_ring_max_q_cnt) ?
 209  209                      mac_tx_soft_ring_max_q_cnt : mac_tx_soft_ring_hiwat;
 210      -                if (mcip->mci_state_flags & MCIS_IS_AGGR) {
      210 +                if (mcip->mci_state_flags & MCIS_IS_AGGR_CLIENT) {
 211  211                          mac_srs_tx_t *tx = &mac_srs->srs_tx;
 212  212  
 213  213                          ASSERT(tx->st_soft_rings[
 214  214                              ((mac_ring_t *)x_arg2)->mr_index] == NULL);
 215  215                          tx->st_soft_rings[((mac_ring_t *)x_arg2)->mr_index] =
 216  216                              ringp;
 217  217                  }
 218  218          } else {
 219  219                  ringp->s_ring_drain_func = mac_rx_soft_ring_drain;
 220  220                  ringp->s_ring_rx_func = rx_func;
↓ open down ↓ 111 lines elided ↑ open up ↑
 332  332  
 333  333          ringp->s_ring_tid = NULL;
 334  334  
 335  335          if (!(ringp->s_ring_state & S_RING_PROC)) {
 336  336                  cv_signal(&ringp->s_ring_async);
 337  337          }
 338  338          mutex_exit(&ringp->s_ring_lock);
 339  339  }
 340  340  
 341  341  /*
 342      - * mac_rx_soft_ring_drain
      342 + * Drain the soft ring pointed to by ringp.
 343  343   *
 344      - * Called when worker thread model (ST_RING_WORKER_ONLY) of processing
 345      - * incoming packets is used. s_ring_first contain the queued packets.
 346      - * s_ring_rx_func contains the upper level (client) routine where the
 347      - * packets are destined and s_ring_rx_arg1/s_ring_rx_arg2 are the
 348      - * cookie meant for the client.
      344 + *    o s_ring_first: pointer to the queued packet chain.
      345 + *
      346 + *    o s_ring_rx_func: pointer to to the client's Rx routine.
      347 + *
      348 + *    o s_ring_rx_{arg1,arg2}: opaque values specific to the client.
 349  349   */
 350      -/* ARGSUSED */
 351  350  static void
 352  351  mac_rx_soft_ring_drain(mac_soft_ring_t *ringp)
 353  352  {
 354  353          mblk_t          *mp;
 355  354          void            *arg1;
 356  355          mac_resource_handle_t arg2;
 357  356          timeout_id_t    tid;
 358  357          mac_direct_rx_t proc;
 359  358          size_t          sz;
 360  359          int             cnt;
↓ open down ↓ 24 lines elided ↑ open up ↑
 385  384                  mutex_exit(&ringp->s_ring_lock);
 386  385  
 387  386                  if (tid != NULL) {
 388  387                          (void) untimeout(tid);
 389  388                          tid = NULL;
 390  389                  }
 391  390  
 392  391                  (*proc)(arg1, arg2, mp, NULL);
 393  392  
 394  393                  /*
 395      -                 * If we have a soft ring set which is doing
 396      -                 * bandwidth control, we need to decrement its
 397      -                 * srs_size so it can have a accurate idea of
 398      -                 * what is the real data queued between SRS and
 399      -                 * its soft rings. We decrement the size for a
 400      -                 * packet only when it gets processed by both
 401      -                 * SRS and the soft ring.
      394 +                 * If we have an SRS performing bandwidth control, then
      395 +                 * we need to decrement the size and count so the SRS
      396 +                 * has an accurate measure of the data queued between
      397 +                 * the SRS and its soft rings. We decrement the
      398 +                 * counters only when the packet is processed by both
      399 +                 * the SRS and the soft ring.
 402  400                   */
 403  401                  mutex_enter(&mac_srs->srs_lock);
 404  402                  MAC_UPDATE_SRS_COUNT_LOCKED(mac_srs, cnt);
 405  403                  MAC_UPDATE_SRS_SIZE_LOCKED(mac_srs, sz);
 406  404                  mutex_exit(&mac_srs->srs_lock);
 407  405  
 408  406                  mutex_enter(&ringp->s_ring_lock);
 409  407          }
 410  408          ringp->s_ring_state &= ~S_RING_PROC;
 411  409          if (ringp->s_ring_state & S_RING_CLIENT_WAIT)
 412  410                  cv_signal(&ringp->s_ring_client_cv);
 413  411          ringp->s_ring_run = NULL;
 414  412  }
 415  413  
 416  414  /*
 417      - * mac_soft_ring_worker
 418      - *
 419  415   * The soft ring worker routine to process any queued packets. In
 420      - * normal case, the worker thread is bound to a CPU. It the soft
 421      - * ring is dealing with TCP packets, then the worker thread will
 422      - * be bound to the same CPU as the TCP squeue.
      416 + * normal case, the worker thread is bound to a CPU. If the soft ring
      417 + * handles TCP packets then the worker thread is bound to the same CPU
      418 + * as the TCP squeue.
 423  419   */
 424  420  static void
 425  421  mac_soft_ring_worker(mac_soft_ring_t *ringp)
 426  422  {
 427  423          kmutex_t *lock = &ringp->s_ring_lock;
 428  424          kcondvar_t *async = &ringp->s_ring_async;
 429  425          mac_soft_ring_set_t *srs = ringp->s_ring_set;
 430  426          callb_cpr_t cprinfo;
 431  427  
 432  428          CALLB_CPR_INIT(&cprinfo, lock, callb_generic_cpr, "mac_soft_ring");
↓ open down ↓ 165 lines elided ↑ open up ↑
 598  594   *
 599  595   * Enable direct client (IP) callback function from the softrings.
 600  596   * Callers need to make sure they don't need any DLS layer processing
 601  597   */
 602  598  void
 603  599  mac_soft_ring_dls_bypass(void *arg, mac_direct_rx_t rx_func, void *rx_arg1)
 604  600  {
 605  601          mac_soft_ring_t         *softring = arg;
 606  602          mac_soft_ring_set_t     *srs;
 607  603  
 608      -        ASSERT(rx_func != NULL);
      604 +        VERIFY3P(rx_func, !=, NULL);
 609  605  
 610  606          mutex_enter(&softring->s_ring_lock);
 611  607          softring->s_ring_rx_func = rx_func;
 612  608          softring->s_ring_rx_arg1 = rx_arg1;
 613  609          mutex_exit(&softring->s_ring_lock);
 614  610  
 615  611          srs = softring->s_ring_set;
 616  612          mutex_enter(&srs->srs_lock);
 617  613          srs->srs_type |= SRST_DLS_BYPASS;
 618  614          mutex_exit(&srs->srs_lock);
↓ open down ↓ 118 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX