Re: cxgbe's native netmap support broken since r307394

2016-12-30 Thread Adrian Chadd
Hi, I'll do it in a sec. -a On 30 December 2016 at 01:11, Vincenzo Maffione wrote: > Ok! Can anyone commit this? > Luigi seems to be ok with the change. > > Thanks, > Vincenzo > > 2016-12-29 19:16 GMT+01:00 John Baldwin : >> On Thursday, December 29, 2016 10:02:32 AM Vincenzo Maffione wrote

Re: cxgbe's native netmap support broken since r307394

2016-12-30 Thread Vincenzo Maffione
Ok! Can anyone commit this? Luigi seems to be ok with the change. Thanks, Vincenzo 2016-12-29 19:16 GMT+01:00 John Baldwin : > On Thursday, December 29, 2016 10:02:32 AM Vincenzo Maffione wrote: >> Ok, thanks for the clarification. I change the lock type to MTX_DEF >> (and did a test). I attach

Re: cxgbe's native netmap support broken since r307394

2016-12-29 Thread John Baldwin
On Thursday, December 29, 2016 10:02:32 AM Vincenzo Maffione wrote: > Ok, thanks for the clarification. I change the lock type to MTX_DEF > (and did a test). I attached the new patch. Looks good to me, thanks! > Cheers, > Vincenzo > > 2016-12-29 2:06 GMT+01:00 John Baldwin : > > On Wednesday,

Re: cxgbe's native netmap support broken since r307394

2016-12-29 Thread Vincenzo Maffione
Ok, thanks for the clarification. I change the lock type to MTX_DEF (and did a test). I attached the new patch. Cheers, Vincenzo 2016-12-29 2:06 GMT+01:00 John Baldwin : > On Wednesday, December 28, 2016 07:25:22 PM Vincenzo Maffione wrote: >> Hi, >> The "worker_lock" is taken by nm_os_kthrea

Re: cxgbe's native netmap support broken since r307394

2016-12-28 Thread John Baldwin
On Wednesday, December 28, 2016 07:25:22 PM Vincenzo Maffione wrote: > Hi, > The "worker_lock" is taken by nm_os_kthread_wakeup_worker(), which > in turn is called by nm_pt_host_notify(). The latter function is a > callback that may be called by a driver interrupt service routine; > more precisel

Re: cxgbe's native netmap support broken since r307394

2016-12-28 Thread Vincenzo Maffione
Hi, The "worker_lock" is taken by nm_os_kthread_wakeup_worker(), which in turn is called by nm_pt_host_notify(). The latter function is a callback that may be called by a driver interrupt service routine; more precisely this happens when the driver calls netmap_tx_irq() or netmap_rx_irq(). As far

Re: cxgbe's native netmap support broken since r307394

2016-12-28 Thread John Baldwin
Why are you using MTX_SPIN? Changing the lock type to MTX_DEF would seem to be a smaller patch and probably more correct for FreeBSD. On Thursday, December 22, 2016 05:29:41 PM Luigi Rizzo wrote: > sure go ahead and thank you! > > On Thu, Dec 22, 2016 at 5:15 PM, Adrian Chadd wrote: > > ok, doe

Re: cxgbe's native netmap support broken since r307394

2016-12-22 Thread Luigi Rizzo
sure go ahead and thank you! On Thu, Dec 22, 2016 at 5:15 PM, Adrian Chadd wrote: > ok, does anyone mind if I commit it as-is? > > > -a > > > On 21 December 2016 at 13:37, Vincenzo Maffione wrote: >> Hi Luigi, >> I attached a minimal change containing two fixes: >> >> - change IFNET_WLOCK into

Re: cxgbe's native netmap support broken since r307394

2016-12-22 Thread Adrian Chadd
ok, does anyone mind if I commit it as-is? -a On 21 December 2016 at 13:37, Vincenzo Maffione wrote: > Hi Luigi, > I attached a minimal change containing two fixes: > > - change IFNET_WLOCK into IFNET_RLOCK, to fix the cxgbe issue related > to this thread > - use the proper locking functions

Re: cxgbe's native netmap support broken since r307394

2016-12-21 Thread Vincenzo Maffione
Hi Luigi, I attached a minimal change containing two fixes: - change IFNET_WLOCK into IFNET_RLOCK, to fix the cxgbe issue related to this thread - use the proper locking functions for the "worker_lock", unrelated but needed to avoid the O.S. to trap because of a mismatch between MTX_SPIN and MTX

Re: cxgbe's native netmap support broken since r307394

2016-12-21 Thread Luigi Rizzo
On Wed, Dec 21, 2016 at 11:15 AM, Vincenzo Maffione wrote: > Hi, > There is no commit related to that in the FreeBSD svn or git. > > The fix has been published to the github netmap repository here > (branch master): https://github.com/luigirizzo/netmap > > What we should do is to import all the

Re: cxgbe's native netmap support broken since r307394

2016-12-21 Thread Vincenzo Maffione
Hi, There is no commit related to that in the FreeBSD svn or git. The fix has been published to the github netmap repository here (branch master): https://github.com/luigirizzo/netmap What we should do is to import all the recent updates from the github into HEAD. I can prepare a patch for HEAD

Re: cxgbe's native netmap support broken since r307394

2016-12-20 Thread Adrian Chadd
hi, What's the commit? We should get it into -HEAD asap. -adrian On 20 December 2016 at 01:25, Vincenzo Maffione wrote: > Ok, applied to the netmap github repo. > This fix will be published when Luigi does the next commit on FreeBSD. > > Cheers, > Vincenzo > > 2016-12-19 20:05 GMT+01:00 Nav

Re: cxgbe's native netmap support broken since r307394

2016-12-20 Thread Vincenzo Maffione
Ok, applied to the netmap github repo. This fix will be published when Luigi does the next commit on FreeBSD. Cheers, Vincenzo 2016-12-19 20:05 GMT+01:00 Navdeep Parhar : > IFNET_RLOCK will work, thanks. > > Navdeep > > On Mon, Dec 19, 2016 at 3:21 AM, Vincenzo Maffione > wrote: >> Hi Navdeep

Re: cxgbe's native netmap support broken since r307394

2016-12-19 Thread Navdeep Parhar
IFNET_RLOCK will work, thanks. Navdeep On Mon, Dec 19, 2016 at 3:21 AM, Vincenzo Maffione wrote: > Hi Navdeep, > > Indeed, we have reviewed the code, and we think it is ok to > implement nm_os_ifnet_lock() with IFNET_RLOCK(), instead of using > IFNET_WLOCK(). > Since IFNET_RLOCK() results into

Re: cxgbe's native netmap support broken since r307394

2016-12-19 Thread Vincenzo Maffione
Hi Navdeep, Indeed, we have reviewed the code, and we think it is ok to implement nm_os_ifnet_lock() with IFNET_RLOCK(), instead of using IFNET_WLOCK(). Since IFNET_RLOCK() results into sx_slock(), this should fix the issue. On FreeBSD, this locking is needed to protect a flag read by nm_iszomb

cxgbe's native netmap support broken since r307394

2016-12-17 Thread Navdeep Parhar
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 pani