From owner-svn-src-stable@FreeBSD.ORG Wed Mar 25 13:05:34 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13265AA; Wed, 25 Mar 2015 13:05:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 F061CE53; Wed, 25 Mar 2015 13:05:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PD5XFe064647; Wed, 25 Mar 2015 13:05:33 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PD5XTr064646; Wed, 25 Mar 2015 13:05:33 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251305.t2PD5XTr064646@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280584 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2015 13:05:34 -0000 Author: arybchik Date: Wed Mar 25 13:05:33 2015 New Revision: 280584 URL: https://svnweb.freebsd.org/changeset/base/280584 Log: MFC: 279178 sfxge: do no allow EFSYS_MEM_ALLOC sleep It solves locking problem when EFSYS_MEM_ALLOC is called in the context holding a mutex (not allowed to sleep). E.g. on interface bring up or multicast addresses addition. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efsys.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efsys.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 13:05:17 2015 (r280583) +++ stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 13:05:33 2015 (r280584) @@ -941,7 +941,11 @@ typedef clock_t efsys_timestamp_t; #define EFSYS_KMEM_ALLOC(_esip, _size, _p) \ do { \ (_esip) = (_esip); \ - (_p) = malloc((_size), M_SFXGE, M_WAITOK|M_ZERO); \ + /* \ + * The macro is used in non-sleepable contexts, for \ + * example, holding a mutex. \ + */ \ + (_p) = malloc((_size), M_SFXGE, M_NOWAIT|M_ZERO); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE)