From owner-p4-projects@FreeBSD.ORG Fri Mar 7 00:28:36 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 32805106567C; Fri, 7 Mar 2008 00:28:36 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E39CC106566B for ; Fri, 7 Mar 2008 00:28:35 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D2F508FC1B for ; Fri, 7 Mar 2008 00:28:35 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m270SZwa061977 for ; Fri, 7 Mar 2008 00:28:35 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m270SZ0A061975 for perforce@freebsd.org; Fri, 7 Mar 2008 00:28:35 GMT (envelope-from kmacy@freebsd.org) Date: Fri, 7 Mar 2008 00:28:35 GMT Message-Id: <200803070028.m270SZ0A061975@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 137039 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2008 00:28:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=137039 Change 137039 by kmacy@pandemonium:kmacy:iwarp on 2008/03/07 00:28:21 make changes to help identify use after free Affected files ... .. //depot/projects/iwarp/sys/dev/cxgb/ulp/tom/cxgb_t3_ddp.h#8 edit .. //depot/projects/iwarp/sys/dev/cxgb/ulp/tom/cxgb_toepcb.h#5 edit .. //depot/projects/iwarp/sys/dev/cxgb/ulp/tom/cxgb_tom.c#14 edit Differences ... ==== //depot/projects/iwarp/sys/dev/cxgb/ulp/tom/cxgb_t3_ddp.h#8 (text+ko) ==== @@ -109,13 +109,13 @@ unsigned short kbuf_noinval; unsigned short kbuf_idx; /* which HW buffer is used for kbuf */ struct ddp_gather_list *ubuf; + int user_ddp_pending; unsigned int ubuf_nppods; /* # of page pods for buffer 1 */ unsigned int ubuf_tag; unsigned int ubuf_ddp_ready; + int cancel_ubuf; int get_tcb_count; unsigned int kbuf_posted; - int cancel_ubuf; - int user_ddp_pending; unsigned int kbuf_nppods[NUM_DDP_KBUF]; unsigned int kbuf_tag[NUM_DDP_KBUF]; struct ddp_gather_list *kbuf[NUM_DDP_KBUF]; /* kernel buffer for DDP prefetch */ ==== //depot/projects/iwarp/sys/dev/cxgb/ulp/tom/cxgb_toepcb.h#5 (text+ko) ==== @@ -36,8 +36,8 @@ struct toepcb { struct toedev *tp_toedev; struct l2t_entry *tp_l2t; - pr_ctloutput_t *tp_ctloutput; unsigned int tp_tid; + int tp_wr_max; int tp_wr_avail; int tp_wr_unacked; @@ -66,7 +66,7 @@ bus_dma_tag_t tp_tx_dmat; bus_dma_tag_t tp_rx_dmat; bus_dmamap_t tp_dmamap; - + LIST_ENTRY(toepcb) synq_entry; struct mbuf_head wr_list; struct mbuf_head out_of_order_queue; ==== //depot/projects/iwarp/sys/dev/cxgb/ulp/tom/cxgb_tom.c#14 (text+ko) ==== @@ -162,7 +162,7 @@ { struct toepcb *toep; - toep = malloc(sizeof(struct toepcb), M_DEVBUF, M_NOWAIT|M_ZERO); + toep = malloc(sizeof(struct toepcb), M_CXGB, M_NOWAIT|M_ZERO); if (toep == NULL) return (NULL); @@ -188,7 +188,7 @@ toepcb_release(struct toepcb *toep) { if (toep->tp_refcount == 1) { - free(toep, M_DEVBUF); + free(toep, M_CXGB); return; } atomic_add_acq_int(&toep->tp_refcount, -1); @@ -1057,8 +1057,8 @@ { struct t3c_data *td = T3C_DATA (tdev); struct toe_tid_entry *p = &td->tid_maps.tid_tab[tid]; - - printf("queuing tid release\n"); + + CTR0(KTR_TOM, "queuing tid release\n"); mtx_lock(&td->tid_release_lock); p->ctx = td->tid_release_list;