From 8361b5aefbbda9d130013df741e24f9c98ceab61 Mon Sep 17 00:00:00 2001 From: np Date: Thu, 19 Apr 2018 18:10:44 +0000 Subject: [PATCH] cxgbe(4): Fix bugs in the handling of COP rules that match on VLAN tag. Retrieve the tag from the correct ifnet and use the provided tag (instead of hardcoded 0xffff, implying no tag) in the routines that process offload policy. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications --- sys/dev/cxgbe/tom/t4_connect.c | 2 +- sys/dev/cxgbe/tom/t4_tom.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_connect.c b/sys/dev/cxgbe/tom/t4_connect.c index 9d1b6add679f..05f658698fd6 100644 --- a/sys/dev/cxgbe/tom/t4_connect.c +++ b/sys/dev/cxgbe/tom/t4_connect.c @@ -405,7 +405,7 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt, struct ifnet *ifp = VLAN_COOKIE(rt_ifp); vi = ifp->if_softc; - VLAN_TAG(ifp, &vid); + VLAN_TAG(rt_ifp, &vid); } else if (rt_ifp->if_type == IFT_IEEE8023ADLAG) DONT_OFFLOAD_ACTIVE_OPEN(ENOSYS); /* XXX: implement lagg+TOE */ else diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index ce714e14e381..ced854ec7f1b 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -1234,7 +1234,7 @@ lookup_offload_policy(struct adapter *sc, int open_type, struct mbuf *m, switch (open_type) { case OPEN_TYPE_ACTIVE: case OPEN_TYPE_LISTEN: - pkt = prepare_pkt(open_type, 0xffff, inp, &pktlen, &buflen); + pkt = prepare_pkt(open_type, vtag, inp, &pktlen, &buflen); break; case OPEN_TYPE_PASSIVE: MPASS(m != NULL);