From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E67D0A04F5; Thu, 12 Dec 2019 12:16:20 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C021B1BECF; Thu, 12 Dec 2019 12:16:20 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id EA37F1F5; Thu, 12 Dec 2019 12:16:17 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2019 03:16:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,305,1571727600"; d="scan'208";a="388272332" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 12 Dec 2019 03:16:16 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 12 Dec 2019 03:16:16 -0800 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 12 Dec 2019 03:16:15 -0800 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 12 Dec 2019 03:16:15 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 12 Dec 2019 03:16:15 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fJ3Hws+Ab4CIPXPbLyocGIdh/eMU4ODQPTWjqGAhfPZpj9qsHIWC7yJKUTC12YgrmLW1v5cg6w1WrYZGrCNG3i0JheUREC03Lb8X9dCTUSK2a1qoCGy9pzafW8W1ekXsC3jX5TSiRBZAfHO6PRlXV13luGMkfko3zr/rpPci2KMrYIWrhAqEURbMFVjtRpMHYaKpVw2zMIubL/Xw4imO/3fVLmuSzVPPGrrJGrDcvVMJC3Cnu9be8gsiBlt+gAxhQFyuCv4UFHMM2pQrL+t/MqQ8rgV+NAAvD8Xb+PQFxY2XrSxxtm3FPWX2qqw/L9ATf8r4pYKtvdDJUKFsgYt6rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RajFxWP+/u11YofG2DZ0b6aBU6CM9UWS2Js2EpJ1Qe4=; b=lJGUitSVB76VKky0kiE+KG8MNEcTLyi/B1Wt4E0rKPm3cCqOm79mi+LurizLJnYbShwcPDpcu+pQnzMFkRrLS1eVAZfnaUJENHcNTvxTgLcfsxqOhCXBLG3OF67JV1TfcDdGRq/EBX4ngOdiLx1JUcOSkRIhNhXNm5Gd4A0pUusqQRiSYgVyAVIExsv0I2itNJ1SOvMCaBJTBj/bu6lueBn04iGbGgFBtuKsLa8LQUKC1F/xk8kOqhRE8mUfJhyYgwysyVfajxaS4ewozaT0UMKK+RpdbBgl/u2jZLFWq9oUj1uTGnG0H8nvw2nbrkv1fpo2AkQdMY3pQKyvIV+SWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RajFxWP+/u11YofG2DZ0b6aBU6CM9UWS2Js2EpJ1Qe4=; b=JSAVK2AYBPBowaHWexk1lSeSpQfxIICzp6BqkBdkfe6P5VEtPJzSZjqs7C5ndQav7qENpsYPFBjTg7zJy7gsbCORJEWhajIeUq4Ep5zCyMJpkXYgm1ZAPV7KNdmfpJbnbdkC8HGxZdPBp3Ol7Pz1Bqq6mhT3f6i9io4JPsEO+fI= Received: from DM6PR11MB2556.namprd11.prod.outlook.com (20.176.99.10) by DM6PR11MB4138.namprd11.prod.outlook.com (20.176.126.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Thu, 12 Dec 2019 11:15:59 +0000 Received: from DM6PR11MB2556.namprd11.prod.outlook.com ([fe80::1b6:fe4f:c09a:a893]) by DM6PR11MB2556.namprd11.prod.outlook.com ([fe80::1b6:fe4f:c09a:a893%6]) with mapi id 15.20.2538.016; Thu, 12 Dec 2019 11:15:59 +0000 From: "Ananyev, Konstantin" To: "Cui, LunyuanX" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Yang, Qiming" , "Cui, LunyuanX" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/ixgbe: fixed port can not link up in FreeBSD Thread-Index: AQHVsJs5XZkXTS6idkWnW9htZzNbWKe2WWYg Date: Thu, 12 Dec 2019 11:15:59 +0000 Message-ID: References: <20191212111714.533-1-lunyuanx.cui@intel.com> In-Reply-To: <20191212111714.533-1-lunyuanx.cui@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGNiMmJhZDgtOGMzZS00YjRmLWE1Y2UtMzcyMWIwMTg3NjI3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNGxJYVo4ZjFsSVhBK3ozWm05VU81ZGRQdXVEbTNvbXB5eEl4cEN4a29rYXd5c1J3TEQwUzY3V1BWN1E3Z29YRiJ9 dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 x-ctpclassification: CTP_NT authentication-results: spf=none (sender IP is ) smtp.mailfrom=konstantin.ananyev@intel.com; x-originating-ip: [192.198.151.184] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8093db57-2f35-431c-33e4-08d77ef4aa95 x-ms-traffictypediagnostic: DM6PR11MB4138: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 0249EFCB0B x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(136003)(396003)(376002)(39860400002)(346002)(199004)(189003)(33656002)(316002)(2906002)(450100002)(86362001)(110136005)(54906003)(4326008)(66556008)(52536014)(66946007)(55016002)(66446008)(64756008)(66476007)(9686003)(8676002)(76116006)(81166006)(26005)(5660300002)(71200400001)(8936002)(81156014)(6506007)(7696005)(186003)(478600001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR11MB4138; H:DM6PR11MB2556.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: omW92xz5iy/1sXzdgJUgsQ35AMkC/4gYEjA0H6WsiE9dFAJ1qegUh56i0MYABnlAP6tN6JdHsUvTedu4524rsxMXswEEo7RKmSsdwxkQIzHRB2KJVt5ZFYHkPnzfromgYGvxX83jF9udFDxBmdWBOw8IWixX2+PXYBKtH1DUFe6YAFd1Tjsk1gUyUD4CiQWxHm4VcgCoc7cxkUWQPsZsrzm/Ja6w7LF28qSJSlkHCqKn6o6aiqbSIHU0jMt5Qd83JcrXU6fS/4Qsn4EkC/nGFklUkAYZrBjJ5UFanUKlat/hVsjij4hdxALVvTNmE4yROZyKQsLNfCQJnaCePOkSgZ4USxXLV6aT4ua6qRoZSjX1Td+g7pNabWiCVh57c0PCxHGELHHPQNc9sbMLoXfx2h19G5U6M7JlNpQA9sbiI3TJL7gt3GlqovTJHcAV7Bgx Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 8093db57-2f35-431c-33e4-08d77ef4aa95 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Dec 2019 11:15:59.3540 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cpV9l49cdGJcrI4yqT2UvIDjpbtANtYiAm/Xpi7wdX0R0CXeWKn7luZ26bbItwdGiJ7Z5w3bjIugAAwvM8gaPT8eaEcHSlLN2VffghVbduc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4138 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fixed port can not link up in FreeBSD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, >=20 > In FreeBSD environment, nic_uio drivers do not support interrupts, > rte_intr_callback_register() will fail to register interrupts. > We can not make link status to change from down to up by interrupt > callback. So we need to wait for the controller to acquire link > when ports start. Through multiple tests, 5s should be enough. >=20 > Fixes: b9bd0f09fa15 ("ethdev: fix link status query") > Cc: stable@dpdk.org >=20 > Signed-off-by: Lunyuan Cui > --- > drivers/net/ixgbe/ixgbe_ethdev.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_e= thdev.c > index 2c6fd0f13..e33b5483c 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -2555,6 +2555,9 @@ ixgbe_dev_start(struct rte_eth_dev *dev) > IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private); > struct ixgbe_macsec_setting *macsec_setting =3D > IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private); > +#ifdef RTE_EXEC_ENV_FREEBSD > + int i; > +#endif >=20 > PMD_INIT_FUNC_TRACE(); >=20 > @@ -2801,6 +2804,25 @@ ixgbe_dev_start(struct rte_eth_dev *dev) > "please call hierarchy_commit() " > "before starting the port"); >=20 > +#ifdef RTE_EXEC_ENV_FREEBSD > + /* > + * In freebsd environment, nic_uio drivers do not support interrupts, > + * rte_intr_callback_register() will fail to register interrupts. > + * We can not make link status to change from down to up by interrupt > + * callback. So we need to wait for the controller to acquire link > + * when ports start. > + */ > + for (i =3D 0; i < 25; i++) { > + /* If link up, just jump out */ > + err =3D ixgbe_check_link(hw, &speed, &link_up, 0); > + if (err) > + goto error; > + if (link_up) > + break; > + msec_delay(200); > + } > +#endif Might be better to put it into a separate function to keep start() code cle= an. Konstantin > + > /* > * Update link status right before return, because it may > * start link configuration process in a separate thread. > -- > 2.17.1