From owner-freebsd-net@freebsd.org Sat Dec 17 22:28:37 2016 Return-Path: Delivered-To: freebsd-net@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 DF0A8C8510D for ; Sat, 17 Dec 2016 22:28:37 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA5B681; Sat, 17 Dec 2016 22:28:37 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id p66so13807135pga.2; Sat, 17 Dec 2016 14:28:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:mail-followup-to :mime-version:content-disposition:user-agent; bh=o7tLOHVIUxgKyfp3vxVaZ0iw556Mx6ZcspncPYdv9UY=; b=AETSmp1rBFFi3HHFYGdzt/NuEEWY0Fyt9JiD25/TDgBjm7TEWRJk7rbkzm6y9zd65m z6szglXRKDgJSKja6lYi1emxd9CHsmcU8yLFR8DxeNxHB8RgKdEtUCzQVgbOUiocZYxP njjeQFs68yes35fXVyFutlY3EJM90vf/Mg7X5YyslXFVArRN0Bjj4IaY9adw6ssiRWuT S+ZasixbiBFz3rGHZgbxYR3kw2GWx/vHBZAGWAU8VxdJh4dkXcYhTIorrFsfslJpbUFu 0629Laxs32kTT3pmfDUiIiOWp0kW8rZltbfld1hdo2GZ6bukbOMa1c320ksajl6hmOgI k3uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :mail-followup-to:mime-version:content-disposition:user-agent; bh=o7tLOHVIUxgKyfp3vxVaZ0iw556Mx6ZcspncPYdv9UY=; b=ie1xJruUy8N6BMUr0kldroO9HVQBsVEplHnjw9vWm9BltMdsSu+6tBH3Pl73KuptPH e82gh/SpG37+zeXYC3L9bP0/7WDDtcsSJ7H0+y/rZnMNSPKmoOHJ2fcTAFyRawQS/p/5 kU2HDfPvJwK0ZeWL15/WvX2V/2LZnYdjsGGJ95lsany4hgAnipYzY8muZnnYl+j8nG73 IUJ8LWQpAYOK95G+BCROUAOLsZQ8cT9iDZPaDkza/zeX5ZpkkTBgH3gLWKCph3uIH9xq awdHQ+decM21ubHd4bFbMZAkyOu7jzRyLh6XV4t8lWKr7zkEijEzKOcrLswNidz6Onl0 Iaaw== X-Gm-Message-State: AKaTC01meI3He0Ep02z2h1nfch6OwmXkHzHwPnwYt/Uph/+9hgZ625o5+1zTJVKIPJOJvQ== X-Received: by 10.84.135.34 with SMTP id 31mr20531904pli.50.1482013717357; Sat, 17 Dec 2016 14:28:37 -0800 (PST) Received: from ox (c-73-93-112-83.hsd1.ca.comcast.net. [73.93.112.83]) by smtp.gmail.com with ESMTPSA id t20sm21002893pfk.48.2016.12.17.14.28.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Dec 2016 14:28:35 -0800 (PST) Sender: Navdeep Parhar Date: Sat, 17 Dec 2016 14:28:27 -0800 From: Navdeep Parhar To: v.maffione@gmail.com, luigi@FreeBSD.org, freebsd-net@FreeBSD.org Subject: cxgbe's native netmap support broken since r307394 Message-ID: <20161217222812.GA4979@ox> Mail-Followup-To: v.maffione@gmail.com, luigi@FreeBSD.org, freebsd-net@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Dec 2016 22:28:38 -0000 Luigi, Vincenzo, The last major update to netmap (r307394 and followups) broke cxgbe's native netmap support. The problem is that netmap_hw_reg now holds an rw_lock around the driver's netmap_on/off routines. It has always been safe for the driver to sleep during these operations but now it panics instead. Why is IFNET_WLOCK needed here? It seems like a regression to disallow sleep on the control path. Regards, Navdeep begin_synchronized_op with the following non-sleepable locks held: exclusive rw ifnet_rw (ifnet_rw) r = 0 (0xffffffff8271d680) locked @ /root/ws/head/sys/dev/netmap/netmap_freebsd.c:95 stack backtrace: #0 0xffffffff810837a5 at witness_debugger+0xe5 #1 0xffffffff81084d88 at witness_warn+0x3b8 #2 0xffffffff83ef2bcc at begin_synchronized_op+0x6c #3 0xffffffff83f14beb at cxgbe_netmap_reg+0x5b #4 0xffffffff809846f1 at netmap_hw_reg+0x81 #5 0xffffffff809806de at netmap_do_regif+0x19e #6 0xffffffff8098121d at netmap_ioctl+0x7ad #7 0xffffffff8098682f at freebsd_netmap_ioctl+0x5f