aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cxgbe
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2017-02-06 17:48:25 +0000
committerNavdeep Parhar <np@FreeBSD.org>2017-02-06 17:48:25 +0000
commiteaf56694833b9b288820faa48aa5f24693a9f311 (patch)
tree7df9f7d3cdd76a4c1508d97e7ec127d5b2347a00 /sys/dev/cxgbe
parent3b7a388b3e9c19e611f4ff9686fb72bf534cdf79 (diff)
downloadsrc-eaf56694833b9b288820faa48aa5f24693a9f311.tar.gz
src-eaf56694833b9b288820faa48aa5f24693a9f311.zip
cxgbe/t4_tom: Fix CLIP entry refcounting on the passive side. Every
IPv6 connection being handled by the TOE should have a reference on its CLIP entry. Sponsored by: Chelsio Communications
Notes
Notes: svn path=/head/; revision=313346
Diffstat (limited to 'sys/dev/cxgbe')
-rw-r--r--sys/dev/cxgbe/tom/t4_connect.c2
-rw-r--r--sys/dev/cxgbe/tom/t4_listen.c4
-rw-r--r--sys/dev/cxgbe/tom/t4_tom.c6
-rw-r--r--sys/dev/cxgbe/tom/t4_tom.h3
4 files changed, 9 insertions, 6 deletions
diff --git a/sys/dev/cxgbe/tom/t4_connect.c b/sys/dev/cxgbe/tom/t4_connect.c
index ebd5766081c2..f23ba55a24ed 100644
--- a/sys/dev/cxgbe/tom/t4_connect.c
+++ b/sys/dev/cxgbe/tom/t4_connect.c
@@ -402,7 +402,7 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt,
if ((inp->inp_vflag & INP_IPV6) == 0)
DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP);
- toep->ce = hold_lip(td, &inp->in6p_laddr);
+ toep->ce = hold_lip(td, &inp->in6p_laddr, NULL);
if (toep->ce == NULL)
DONT_OFFLOAD_ACTIVE_OPEN(ENOENT);
diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c
index f59d9a0930d9..4eadce96d8d8 100644
--- a/sys/dev/cxgbe/tom/t4_listen.c
+++ b/sys/dev/cxgbe/tom/t4_listen.c
@@ -209,7 +209,7 @@ alloc_lctx(struct adapter *sc, struct inpcb *inp, struct vi_info *vi)
!IN6_ARE_ADDR_EQUAL(&in6addr_any, &inp->in6p_laddr)) {
struct tom_data *td = sc->tom_softc;
- lctx->ce = hold_lip(td, &inp->in6p_laddr);
+ lctx->ce = hold_lip(td, &inp->in6p_laddr, NULL);
if (lctx->ce == NULL) {
free(lctx, M_CXGBE);
return (NULL);
@@ -1584,6 +1584,8 @@ reset:
INP_WLOCK_ASSERT(new_inp);
MPASS(so->so_vnet == lctx->vnet);
toep->vnet = lctx->vnet;
+ if (inc.inc_flags & INC_ISIPV6)
+ toep->ce = hold_lip(sc->tom_softc, &inc.inc6_laddr, lctx->ce);
/*
* This is for the unlikely case where the syncache entry that we added
diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c
index 11558c23bfa5..e66210ec1195 100644
--- a/sys/dev/cxgbe/tom/t4_tom.c
+++ b/sys/dev/cxgbe/tom/t4_tom.c
@@ -730,12 +730,12 @@ search_lip(struct tom_data *td, struct in6_addr *lip)
}
struct clip_entry *
-hold_lip(struct tom_data *td, struct in6_addr *lip)
+hold_lip(struct tom_data *td, struct in6_addr *lip, struct clip_entry *ce)
{
- struct clip_entry *ce;
mtx_lock(&td->clip_table_lock);
- ce = search_lip(td, lip);
+ if (ce == NULL)
+ ce = search_lip(td, lip);
if (ce != NULL)
ce->refcount++;
mtx_unlock(&td->clip_table_lock);
diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h
index 18bc1f291c55..5a774fd824ae 100644
--- a/sys/dev/cxgbe/tom/t4_tom.h
+++ b/sys/dev/cxgbe/tom/t4_tom.h
@@ -321,7 +321,8 @@ uint64_t calc_opt0(struct socket *, struct vi_info *, struct l2t_entry *,
uint64_t select_ntuple(struct vi_info *, struct l2t_entry *);
void set_tcpddp_ulp_mode(struct toepcb *);
int negative_advice(int);
-struct clip_entry *hold_lip(struct tom_data *, struct in6_addr *);
+struct clip_entry *hold_lip(struct tom_data *, struct in6_addr *,
+ struct clip_entry *);
void release_lip(struct tom_data *, struct clip_entry *);
/* t4_connect.c */