Print this page
3903 DTrace SCTP Provider

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/sctp/sctp_output.c
          +++ new/usr/src/uts/common/inet/sctp/sctp_output.c
↓ open down ↓ 969 lines elided ↑ open up ↑
 970  970                  SCTP_KSTAT(sctps, sctp_fr_add_hdr);
 971  971                  return;
 972  972          }
 973  973          if ((pktlen > fp->sf_pmss) && fp->sf_isv4) {
 974  974                  ipha_t *iph = (ipha_t *)head->b_rptr;
 975  975  
 976  976                  iph->ipha_fragment_offset_and_flags = 0;
 977  977          }
 978  978  
 979  979          sctp_set_iplen(sctp, head, fp->sf_ixa);
      980 +
      981 +        DTRACE_SCTP5(send, mblk_t *, NULL, ip_xmit_attr_t *, fp->sf_ixa,
      982 +            void_ip_t *, mp->b_rptr, sctp_t *, sctp, sctp_hdr_t *,
      983 +            &mp->b_rptr[fp->sf_ixa->ixa_ip_hdr_length]);
      984 +
 980  985          (void) conn_ip_output(head, fp->sf_ixa);
 981  986          BUMP_LOCAL(sctp->sctp_opkts);
 982  987          sctp->sctp_active = fp->sf_lastactive = ddi_get_lbolt64();
 983  988  }
 984  989  
 985  990  void
 986  991  sctp_output(sctp_t *sctp, uint_t num_pkt)
 987  992  {
 988  993          mblk_t                  *mp = NULL;
 989  994          mblk_t                  *nmp;
↓ open down ↓ 282 lines elided ↑ open up ↑
1272 1277                  }
1273 1278                  /* xmit segment */
1274 1279                  ASSERT(cansend >= seglen - pad - xtralen);
1275 1280                  cansend -= (seglen - pad - xtralen);
1276 1281                  dprint(2, ("sctp_output: Sending packet %d bytes, tsn %x "
1277 1282                      "ssn %d to %p (rwnd %d, cansend %d, lastack_rxd %x)\n",
1278 1283                      seglen - xtralen, ntohl(sdc->sdh_tsn),
1279 1284                      ntohs(sdc->sdh_ssn), (void *)fp, sctp->sctp_frwnd,
1280 1285                      cansend, sctp->sctp_lastack_rxd));
1281 1286                  sctp_set_iplen(sctp, head, fp->sf_ixa);
     1287 +
     1288 +                DTRACE_SCTP5(send, mblk_t *, NULL, ip_xmit_attr_t *, fp->sf_ixa,
     1289 +                    void_ip_t *, head->b_rptr, sctp_t *, sctp, sctp_hdr_t *,
     1290 +                    &head->b_rptr[fp->sf_ixa->ixa_ip_hdr_length]);
     1291 +
1282 1292                  (void) conn_ip_output(head, fp->sf_ixa);
1283 1293                  BUMP_LOCAL(sctp->sctp_opkts);
1284 1294                  /* arm rto timer (if not set) */
1285 1295                  if (!fp->sf_timer_running)
1286 1296                          SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto);
1287 1297                  notsent = B_FALSE;
1288 1298          }
1289 1299          sctp->sctp_active = now;
1290 1300          return;
1291 1301  unsent_data:
↓ open down ↓ 504 lines elided ↑ open up ↑
1796 1806                   * Get the Zero Win Probe for retrasmission, sctp_rxt_nxttsn
1797 1807                   * and sctp_rxt_maxtsn will specify the ZWP packet.
1798 1808                   */
1799 1809                  fp = oldfp;
1800 1810                  if (oldfp->sf_state != SCTP_FADDRS_ALIVE)
1801 1811                          fp = sctp_rotate_faddr(sctp, oldfp);
1802 1812                  pkt = sctp_rexmit_packet(sctp, &meta, &mp, fp, &pkt_len);
1803 1813                  if (pkt != NULL) {
1804 1814                          ASSERT(pkt_len <= fp->sf_pmss);
1805 1815                          sctp_set_iplen(sctp, pkt, fp->sf_ixa);
     1816 +
     1817 +                        DTRACE_SCTP5(send, mblk_t *, NULL,
     1818 +                            ip_xmit_attr_t *, fp->sf_ixa,
     1819 +                            void_ip_t *, mp->b_rptr, sctp_t *, sctp, sctp_hdr_t *,
     1820 +                            &mp->b_rptr[fp->sf_ixa->ixa_ip_hdr_length]);
     1821 +
1806 1822                          (void) conn_ip_output(pkt, fp->sf_ixa);
1807 1823                          BUMP_LOCAL(sctp->sctp_opkts);
1808 1824                  } else {
1809 1825                          SCTP_KSTAT(sctps, sctp_ss_rexmit_failed);
1810 1826                  }
1811 1827  
1812 1828                  /*
1813 1829                   * The strikes will be clear by sctp_faddr_alive() when the
1814 1830                   * other side sends us an ack.
1815 1831                   */
↓ open down ↓ 200 lines elided ↑ open up ↑
2016 2032  
2017 2033          dprint(2, ("sctp_rexmit: Sending packet %d bytes, tsn %x "
2018 2034              "ssn %d to %p (rwnd %d, lastack_rxd %x)\n",
2019 2035              seglen, ntohl(sdc->sdh_tsn), ntohs(sdc->sdh_ssn),
2020 2036              (void *)fp, sctp->sctp_frwnd, sctp->sctp_lastack_rxd));
2021 2037  
2022 2038          sctp->sctp_rexmitting = B_TRUE;
2023 2039          sctp->sctp_rxt_nxttsn = first_ua_tsn;
2024 2040          sctp->sctp_rxt_maxtsn = sctp->sctp_ltsn - 1;
2025 2041          sctp_set_iplen(sctp, head, fp->sf_ixa);
     2042 +
     2043 +        DTRACE_SCTP5(send, mblk_t *, NULL, ip_xmit_attr_t *, fp->sf_ixa,
     2044 +            void_ip_t *, mp->b_rptr, sctp_t *, sctp, sctp_hdr_t *,
     2045 +            &mp->b_rptr[fp->sf_ixa->ixa_ip_hdr_length]);
     2046 +
2026 2047          (void) conn_ip_output(head, fp->sf_ixa);
2027 2048          BUMP_LOCAL(sctp->sctp_opkts);
2028 2049  
2029 2050          /*
2030 2051           * Restart the oldfp timer with exponential backoff and
2031 2052           * the new fp timer for the retransmitted chunks.
2032 2053           */
2033 2054  restart_timer:
2034 2055          oldfp->sf_strikes++;
2035 2056          sctp->sctp_strikes++;
↓ open down ↓ 264 lines elided ↑ open up ↑
2300 2321                  ipha_t  *iph = (ipha_t *)pkt->b_rptr;
2301 2322  
2302 2323                  /*
2303 2324                   * Path MTU is different from path we thought it would
2304 2325                   * be when we created chunks, or IP headers have grown.
2305 2326                   *  Need to clear the DF bit.
2306 2327                   */
2307 2328                  iph->ipha_fragment_offset_and_flags = 0;
2308 2329          }
2309 2330          sctp_set_iplen(sctp, pkt, fp->sf_ixa);
     2331 +
     2332 +        DTRACE_SCTP5(send, mblk_t *, NULL, ip_xmit_attr_t *, fp->sf_ixa,
     2333 +            void_ip_t *, mp->b_rptr, sctp_t *, sctp, sctp_hdr_t *,
     2334 +            &mp->b_rptr[fp->sf_ixa->ixa_ip_hdr_length]);
     2335 +
2310 2336          (void) conn_ip_output(pkt, fp->sf_ixa);
2311 2337          BUMP_LOCAL(sctp->sctp_opkts);
2312 2338  
2313 2339          /* Check and see if there is more chunk to be retransmitted. */
2314 2340          if (tot_wnd <= pkt_len || tot_wnd - pkt_len < fp->sf_pmss ||
2315 2341              meta == NULL)
2316 2342                  return;
2317 2343          if (mp == NULL)
2318 2344                  meta = meta->b_next;
2319 2345          if (meta == NULL)
↓ open down ↓ 16 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX