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/io/mac/mac_client.c
          +++ new/usr/src/uts/common/io/mac/mac_client.c
↓ open down ↓ 1428 lines elided ↑ open up ↑
1429 1429          /* Create an initial flow */
1430 1430  
1431 1431          err = mac_flow_create(NULL, NULL, mcip->mci_name, NULL,
1432 1432              mcip->mci_state_flags & MCIS_IS_VNIC ? FLOW_VNIC_MAC :
1433 1433              FLOW_PRIMARY_MAC, &flent);
1434 1434          if (err != 0)
1435 1435                  goto done;
1436 1436          mcip->mci_flent = flent;
1437 1437          FLOW_MARK(flent, FE_MC_NO_DATAPATH);
1438 1438          flent->fe_mcip = mcip;
     1439 +
1439 1440          /*
1440 1441           * Place initial creation reference on the flow. This reference
1441 1442           * is released in the corresponding delete action viz.
1442 1443           * mac_unicast_remove after waiting for all transient refs to
1443 1444           * to go away. The wait happens in mac_flow_wait.
1444 1445           */
1445 1446          FLOW_REFHOLD(flent);
1446 1447  
1447 1448          /*
1448 1449           * Do this ahead of the mac_bcast_add() below so that the mi_nclients
↓ open down ↓ 981 lines elided ↑ open up ↑
2430 2431           * Now that the setup is complete, clear the INCIPIENT flag.
2431 2432           * The flag was set to avoid incoming packets seeing inconsistent
2432 2433           * structures while the setup was in progress. Clear the mci_tx_flag
2433 2434           * by calling mac_tx_client_block. It is possible that
2434 2435           * mac_unicast_remove was called prior to this mac_unicast_add which
2435 2436           * could have set the MCI_TX_QUIESCE flag.
2436 2437           */
2437 2438          if (flent->fe_rx_ring_group != NULL)
2438 2439                  mac_rx_group_unmark(flent->fe_rx_ring_group, MR_INCIPIENT);
2439 2440          FLOW_UNMARK(flent, FE_INCIPIENT);
2440      -        FLOW_UNMARK(flent, FE_MC_NO_DATAPATH);
     2441 +
     2442 +        /*
     2443 +         * If this is an aggr port client, don't enable the flow's
     2444 +         * datapath at this stage. Otherwise, bcast traffic could
     2445 +         * arrive while the aggr port is in the process of
     2446 +         * initializing. Instead, the flow's datapath is started later
     2447 +         * when mac_client_set_flow_cb() is called.
     2448 +         */
     2449 +        if ((mcip->mci_state_flags & MCIS_IS_AGGR_PORT) == 0)
     2450 +                FLOW_UNMARK(flent, FE_MC_NO_DATAPATH);
     2451 +
2441 2452          mac_tx_client_unblock(mcip);
2442 2453          return (0);
2443 2454  bail:
2444 2455          if (bcast_added)
2445 2456                  mac_bcast_delete(mcip, mip->mi_type->mt_brdcst_addr, vid);
2446 2457  
2447 2458          if (nactiveclients_added)
2448 2459                  mip->mi_nactiveclients--;
2449 2460  
2450 2461          if (mac_started)
↓ open down ↓ 3169 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX