From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70084.outbound.protection.outlook.com [40.107.7.84]) by dpdk.org (Postfix) with ESMTP id 67DC62C5 for ; Tue, 21 Aug 2018 17:53:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GrLTcMHJWCVOY10V4rQaS9rG6RhtEwWzbTey1D9p8CQ=; b=P1h80nh8Nv7gokEYrM78AbiFXRKW2vF7UxPYD9+j0N3sNSWY/HfFiYZe5O1BG9G45isxa5HbQJJcgvB5yIx3P+a2R+wXv6OFr2XLpY+ISDRg4mNEjJtK0wPgiZOIX5up6tXf5aKLED1m8L5Hqw6ip36w1g9Qq8LwNUwRh0jn37s= Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com (52.133.41.11) by AM0PR0502MB4066.eurprd05.prod.outlook.com (52.133.41.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.24; Tue, 21 Aug 2018 15:53:34 +0000 Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::88fa:4498:85a5:9e5a]) by AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::88fa:4498:85a5:9e5a%3]) with mapi id 15.20.1080.010; Tue, 21 Aug 2018 15:53:34 +0000 From: Matan Azrad To: Stephen Hemminger CC: "dev@dpdk.org" Thread-Topic: [PATCH v3] ethdev: silence error message on rte_eth_dev_owner_unset Thread-Index: AQHUOWX3i7hePR9JxkKXIMTTc0MsKKTKWj1A Date: Tue, 21 Aug 2018 15:53:34 +0000 Message-ID: References: <20180814001926.19630-1-stephen@networkplumber.org> <20180816224409.5719-1-stephen@networkplumber.org> <20180816224409.5719-2-stephen@networkplumber.org> <20180821084515.2a802429@xeon-e3> In-Reply-To: <20180821084515.2a802429@xeon-e3> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR0502MB4066; 6:q2YzirqK6/eC2qxs+WtYiHCLi6Dh3ebfaZlOOkd3znm/C1m/EwFpf1tp+nHu6YeJvXAmVhzssYWnrL+ppIWOL4eyM+z/jUxf34Nmc+iVs+AfLVTmgYXzlVf4p0f0U3fWHmoF01QfG8d0mnWJUKCqjFRdQfvTAJbJFW/QNhi5hloWsF5Wlg6WEzamuR09m82ztqmInOJO8oZ1feVKHRXpNY/VMcIIQf4YQ/WntVOtu7uxyEDIdxc4y6wm9sKF7BAxVHqOyWO8FIrhSAyvJkp/U3qG3C6ENiCD9RPnYp1CaYKtovElp45raKYAgjKY2ulmotz/VN8ubE2IMB0ko1Z5FRPTyAz2+AX/VY5YbkGi0fqa++PzC496/Z7isL0VKBqd/6rHsFxERg9z23o5ustHhJaV9C96LQ3BaZBV9aVm2o5BvJvNpI+xP5r3rD/RWsrzFMNnHMSPOMj3LdAmOC6tQA==; 5:8I3P5zWKF0rUXNnUnIWOfKPvc3dwxfYJN/imO/fBanTreALXPYZAmBNhM/nmKRcA+1ShUb7p0MiQpYzOCOe0AvRpY/KLKyBKKaFBGVf8TCaNYl2yqHluRQvRjyWv/BpT7jeRc27MXB6IxwEGYy50v/ujsh+QFTZdfxZPfziuk9k=; 7:MT1y6Elybe90o0Pc/aVzXcRBA2uXGPZUkumsXvVvcrE+xqQAuKI8DY9MHNBkDrWL/j7W7yb2kiIe+Dhut4gosM7f7EjXb6C8NJQZMkJ+uPJ3OrD4DqWiNb1TU4I+eC5Q8IV/Zx2+p7LIalv6vva2XLKETgzXUSjUj2oIjewkg2QpO011B8F4run2zFtAQ7wIttQMWeJrV2aKpZYo1LpY9IIjh+50n/eRxA2VZbSvMFkC80GErSNXvttsoWZ8xzUi x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 8e4d101a-ebff-4c16-b2ca-08d6077e405c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0502MB4066; x-ms-traffictypediagnostic: AM0PR0502MB4066: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(60795455431006); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:AM0PR0502MB4066; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0502MB4066; x-forefront-prvs: 0771670921 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(346002)(396003)(376002)(39860400002)(189003)(199004)(3846002)(7736002)(33656002)(316002)(105586002)(106356001)(305945005)(66066001)(74316002)(8936002)(14454004)(5660300001)(68736007)(6116002)(6436002)(8676002)(81156014)(229853002)(25786009)(76176011)(97736004)(186003)(55016002)(7696005)(2906002)(93886005)(6916009)(478600001)(9686003)(81166006)(53936002)(5250100002)(4326008)(102836004)(14444005)(15650500001)(256004)(446003)(2900100001)(6506007)(6246003)(486006)(26005)(476003)(86362001)(53546011)(99286004)(11346002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB4066; H:AM0PR0502MB4019.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Bu5pFA9QFV/5jVNHlNDItM+u6yGWb4ZAR0rRZFyflzFaypjkLtaHKDY4y2p4IK9IHUyA1yVOtPiw/qREz9+7uT4rpLA/1mdpx8pX478mNw1/D+0A/RfIFypn1fwctcvmrNxoUe3/uqHjVcl92JB5vBWnz0IyUGkJ5TAgQWFEXi1OAaHd4x90AKQwjqO1VHWuDQ81yFzPbRJ3tR7d+0lZD5M/9E0g7DP+CeEdiPTEcKK78h2w0XBSWkRTpbmL+3FaXQOXBkTh6w90KG6bGPGjT4U1D6XNYw5Pgule9qYVJzBjxN5eS2UPYF6HP1As8l4EHuRGB2RPwy+3HKvvcotYjvoSAVONlTCr1W0ZMQ0zQuY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e4d101a-ebff-4c16-b2ca-08d6077e405c X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Aug 2018 15:53:34.5657 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB4066 Subject: Re: [dpdk-dev] [PATCH v3] ethdev: silence error message on rte_eth_dev_owner_unset 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: , X-List-Received-Date: Tue, 21 Aug 2018 15:53:36 -0000 Hi From: Stephen Hemminger > From 74ad4c60262b1451a5a2fabf79a2df89c6c5373d Mon Sep 17 00:00:00 2001 > From: Stephen Hemminger > Date: Thu, 16 Aug 2018 15:37:14 -0700 > Subject: [PATCH 1/5] ethdev: silence error message on > rte_eth_dev_owner_unset >=20 > The rte_eth_dev_owner_unset function always generates a log message > because the unset value for owner id is 0. >=20 > Also, when rte_eth_dev_owner_delete is called with a valid owner id, the > log message should be at NOTICE not ERROR severity. >=20 > Fixes: 5b7ba31148a8 ("ethdev: add port ownership") > Signed-off-by: Stephen Hemminger > --- > v3 - handle rte_eth_dev_owner_delete > leave other cleanups to later patch series >=20 > lib/librte_ethdev/rte_ethdev.c | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) >=20 > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethde= v.c > index 4c320250589a..56dd9c2e83d9 100644 > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c > @@ -393,11 +393,8 @@ static int > rte_eth_is_valid_owner_id(uint64_t owner_id) { > if (owner_id =3D=3D RTE_ETH_DEV_NO_OWNER || > - rte_eth_dev_shared_data->next_owner_id <=3D owner_id) { > - RTE_ETHDEV_LOG(ERR, "Invalid owner_id=3D%016"PRIx64"\n", > - owner_id); > + rte_eth_dev_shared_data->next_owner_id <=3D owner_id) > return 0; > - } > return 1; > } >=20 > @@ -444,8 +441,12 @@ _rte_eth_dev_owner_set(const uint16_t port_id, > const uint64_t old_owner_id, > } >=20 > if (!rte_eth_is_valid_owner_id(new_owner->id) && > - !rte_eth_is_valid_owner_id(old_owner_id)) > + !rte_eth_is_valid_owner_id(old_owner_id)) { > + RTE_ETHDEV_LOG(ERR, > + "Invalid owner old_id=3D%016"PRIx64" > new_id=3D%016"PRIx64"\n", > + old_owner_id, new_owner->id); > return -EINVAL; > + } >=20 > port_owner =3D &rte_eth_devices[port_id].data->owner; > if (port_owner->id !=3D old_owner_id) { > @@ -516,9 +517,13 @@ rte_eth_dev_owner_delete(const uint64_t > owner_id) > if (rte_eth_devices[port_id].data->owner.id =3D=3D > owner_id) > memset(&rte_eth_devices[port_id].data- > >owner, 0, > sizeof(struct rte_eth_dev_owner)); > - RTE_ETHDEV_LOG(ERR, > + RTE_ETHDEV_LOG(NOTICE, > "All port owners owned by %016"PRIx64" identifier > have removed\n", > owner_id); > + } else { > + RTE_ETHDEV_LOG(ERR, > + "Invalid owner id=3D%016"PRIx64"\n", > + owner_id); > } >=20 > rte_spinlock_unlock(&rte_eth_dev_shared_data->ownership_lock); > -- > 2.18.0 >=20 I think the title should be: ethdev: fix port ownership logs while adding the fixes commits (at list 2 because of the NOTICE change) and updating stable. Besides that, Acked-by: Matan Azrad