PERFORCE change 129529 for review
Kip Macy
kmacy at FreeBSD.org
Sun Nov 25 16:00:27 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=129529
Change 129529 by kmacy at kmacy:storage:toestack on 2007/11/26 00:00:25
unhook toepcb from its tcpcb
use cxgb malloc type
Affected files ...
.. //depot/projects/toestack/sys/dev/cxgb/ulp/tom/cxgb_tom.c#13 edit
Differences ...
==== //depot/projects/toestack/sys/dev/cxgb/ulp/tom/cxgb_tom.c#13 (text+ko) ====
@@ -144,8 +144,6 @@
return (NULL);
toepcb_init(toep);
- toepcb_hold(toep);
-
return (toep);
}
@@ -153,6 +151,7 @@
toepcb_init(struct toepcb *toep)
{
bzero(toep, sizeof(*toep));
+ toep->tp_refcount = 1;
}
void
@@ -164,11 +163,20 @@
void
toepcb_release(struct toepcb *toep)
{
+ struct tcpcb *tp;
+
+
if (toep->tp_refcount == 1) {
/*
* XXX clear our reference on the inpcb
*/
cxgb_remove_tid(TOM_DATA(toep->tp_toedev)->cdev, NULL, toep->tp_tid);
+ if ((tp = toep->tp_tp) != NULL) {
+ INP_LOCK(tp->t_inpcb);
+ tp->t_flags &= ~TF_TOE;
+ tp->t_toe = NULL;
+ INP_UNLOCK(tp->t_inpcb);
+ }
free(toep, M_DEVBUF);
return;
}
@@ -200,7 +208,7 @@
struct toedev *tdev;
struct adap_ports *port_info;
- t = malloc(sizeof(*t), M_DEVBUF, M_NOWAIT|M_ZERO);
+ t = malloc(sizeof(*t), M_CXGB, M_NOWAIT|M_ZERO);
if (!t)
return;
@@ -208,7 +216,7 @@
if (cdev->ctl(cdev, GET_WR_LEN, &wr_len) < 0)
goto out_free_tom;
- port_info = malloc(sizeof(*port_info), M_DEVBUF, M_NOWAIT|M_ZERO);
+ port_info = malloc(sizeof(*port_info), M_CXGB, M_NOWAIT|M_ZERO);
if (!port_info)
goto out_free_tom;
@@ -247,9 +255,9 @@
return;
out_free_all:
- free(port_info, M_DEVBUF);
+ free(port_info, M_CXGB);
out_free_tom:
- free(t, M_DEVBUF);
+ free(t, M_CXGB);
return;
}
More information about the p4-projects
mailing list