From owner-svn-src-all@freebsd.org Fri Jun 24 23:43:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7D52B80C61; Fri, 24 Jun 2016 23:43:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99FDB13DA; Fri, 24 Jun 2016 23:43:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5ONhJww041703; Fri, 24 Jun 2016 23:43:19 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ONhJRq041702; Fri, 24 Jun 2016 23:43:19 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606242343.u5ONhJRq041702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 24 Jun 2016 23:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302186 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 23:43:20 -0000 Author: avos Date: Fri Jun 24 23:43:19 2016 New Revision: 302186 URL: https://svnweb.freebsd.org/changeset/base/302186 Log: urtwn: use m_get2() in Rx path. Replace m_getcl() with m_get2(); this fixes 'frame too long' messages for frames, which are longer than MCLBYTES (can be easily triggered when A-MSDU is used). Tested with RTL8188CUS (AP) and RTL8188EU (STA). Approved by: re (marius) Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Fri Jun 24 23:42:33 2016 (r302185) +++ head/sys/dev/urtwn/if_urtwn.c Fri Jun 24 23:43:19 2016 (r302186) @@ -895,14 +895,7 @@ urtwn_rx_copy_to_mbuf(struct urtwn_softc goto fail; } - if (__predict_false(totlen > MCLBYTES)) { - /* convert to m_getjcl if this happens */ - device_printf(sc->sc_dev, "%s: frame too long: %d (%d)\n", - __func__, pktlen, totlen); - goto fail; - } - - m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + m = m_get2(totlen, M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) { device_printf(sc->sc_dev, "%s: could not allocate RX mbuf\n", __func__);