Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Apr 2017 15:57:03 -0600
From:      Sean Bruno <sbruno@freebsd.org>
To:        Giuseppe Lettieri <g.lettieri@iet.unipi.it>, "Eggert, Lars" <lars@netapp.com>, "freebsd-net@FreeBSD.org" <freebsd-net@FreeBSD.org>
Subject:   Re: netmap error on -CURRENT with em and igb
Message-ID:  <bc05da8f-c06e-86bc-a3e7-97eac802cbff@freebsd.org>
In-Reply-To: <5dc6df40-f5f0-d9c2-ed3e-d543c0dd59e2@iet.unipi.it>
References:  <8F640402-8F0B-407D-AB72-743A9AB50CA3@netapp.com> <5dc6df40-f5f0-d9c2-ed3e-d543c0dd59e2@iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--pE0Jpl0UrGLoq17NGqHJTkHUUUR9pKCdW
Content-Type: multipart/mixed; boundary="9RLCpRcfOMLRwxbuf4d61mg2Mo5QlQeDp";
 protected-headers="v1"
From: Sean Bruno <sbruno@freebsd.org>
To: Giuseppe Lettieri <g.lettieri@iet.unipi.it>,
 "Eggert, Lars" <lars@netapp.com>,
 "freebsd-net@FreeBSD.org" <freebsd-net@FreeBSD.org>
Message-ID: <bc05da8f-c06e-86bc-a3e7-97eac802cbff@freebsd.org>
Subject: Re: netmap error on -CURRENT with em and igb
References: <8F640402-8F0B-407D-AB72-743A9AB50CA3@netapp.com>
 <5dc6df40-f5f0-d9c2-ed3e-d543c0dd59e2@iet.unipi.it>
In-Reply-To: <5dc6df40-f5f0-d9c2-ed3e-d543c0dd59e2@iet.unipi.it>

--9RLCpRcfOMLRwxbuf4d61mg2Mo5QlQeDp
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable



On 02/16/17 02:25, Giuseppe Lettieri wrote:
> Hi all,
>=20
> the "Operation not permitted" is coming from iflib_netmap_register:
>=20
>     ifp->if_drv_flags &=3D ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
>     ...
>     IFDI_INIT(ctx);    // for igb it calls em_if_init()
>     ...
>     return (ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 1);
>=20
> the last line is meant to check that the initialization was successful,=

> but em_if_init() is not setting IFF_DRV_RUNNING.
>=20
> Note that the iflib_netmap_register code, and the other netmap register=

> functions which it mimicks, have other issues:
>=20
> - in case of failure on NIOCREGIF, they leaves the NETMAP_ON flag set
> even if the netmap data structures are deleted;
> - the 1 was intended as a generic indication of failure, but it
> translates to the rather confusing EPERM;
> - they check IFF_DRV_RUNNING flag outside of the lock; I don't know it
> this is safe or not.
>=20
> I can prepare a patch fixing these issues, but I don't know wether
> em_if_init() is supposed to set the IFF_DRV_RUNNING flag or not.
>=20
> Cheers,
> Giuseppe
>=20


With IFLIB, em_if_init() should *not* set IFF_DRV_RUNNING, this should
be done in sys/net/iflib.c

Do you have an idea where you want to put this?

sean


--9RLCpRcfOMLRwxbuf4d61mg2Mo5QlQeDp--

--pE0Jpl0UrGLoq17NGqHJTkHUUUR9pKCdW
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQGTBAEBCgB9FiEEuq1GMucSHejSCZfdEgHvyh5yfmQFAljlaC9fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEJB
QUQ0NjMyRTcxMjFERThEMjA5OTdERDEyMDFFRkNBMUU3MjdFNjQACgkQEgHvyh5y
fmToNQf/a8smuHxF6tOB3FbOgs4/QrXpygrRxGiBJLhmkbtMbyFxfIHfmOZgE/sp
Mj6VoqIbQnS3Uz2/wAR44sIlDUrvW7aLKohBsmTyjWyMQ+5iWog/36NGfxzX3PMl
YYfrQTdvCQK/Vj6pbldAqhTZm+5AxKHhB4Sp30HVYAV0wrGRBvsOcOKn9gEJyl+l
MByYZzFkvxTB/DesOqzY/W8g/AkDmFeB9vMVGxTbTBvzs3UHjHxQ50EXGtu4NyF9
Y4qKPpTX3Lo6QA3EYvDPgQo59RgZglH9IgLcnGYKGCuSE4AyY0c6EQk5xbHN+D6I
OoUs7FgSCEPfYrI1N7I+eAHc4K1/Ug==
=Hegz
-----END PGP SIGNATURE-----

--pE0Jpl0UrGLoq17NGqHJTkHUUUR9pKCdW--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bc05da8f-c06e-86bc-a3e7-97eac802cbff>