From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7BD7FA0093; Sat, 25 Jun 2022 01:13:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24E1E40694; Sat, 25 Jun 2022 01:13:04 +0200 (CEST) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.23]) by mails.dpdk.org (Postfix) with ESMTP id BB40C400EF for ; Sat, 25 Jun 2022 01:13:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1656112382; s=strato-dkim-0002; d=hashmail.org; h=Message-ID:Subject:To:From:Date:Cc:Date:From:Subject:Sender; bh=nNnNNYe6nLvVVohtISwbsCfxYUt6RuTQCLiSOv7b0L4=; b=MDQpdEr6WKREWRT4zkZ4wAv4tMwgfs2UiYg1Bbw7hg0cmSJpBBLeEv5Qjq40aFaDfL ETv0TZIYVcF+1REaKlWABoKkK5LeoaSSDkciVdxlDA+xrsze8DA3wfn3bFGkLKYHI3kz sj9acmearcXDz8GwKsbtnzvv9wXnG1Vup76gfqo9Bd+2F8FRqxK8JiXnvUrmAF5gQafH T4kAHQ5DFfq3WX0ABoWhL0J6+dplE38a21+47ONvjjUQ0c1gE1RXeHzgzDYOLqgf4ri/ E7evnhaZlYyYP9QBzqQERFigdUVi1pmYdf4539svkTX5gb61PfleguqYoMlTSnnpQ0Ps YC2Q== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":O2kGeEG7b/pS1F+/SC3i33Z09cEcHcRBAtqtGgRBDGeSaUqOsX4glAsBpQEeWJJ4c0y8cQ==" X-RZG-CLASS-ID: mo00 Received: from example.com by smtp.strato.de (RZmta 47.46.0 DYNA|AUTH) with ESMTPSA id m794fcy5OND26Qf (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Sat, 25 Jun 2022 01:13:02 +0200 (CEST) Date: Sat, 25 Jun 2022 01:13:01 +0200 From: qcqx-obaq.6cba8489@hashmail.org To: dev@dpdk.org Subject: dpdk-devbind.py ./. bonding interfaces Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org To whom it may concern. usertools/dpdk-devbind.py currently does not recognize interfaces that are part of a bond as active. that can be a nuisance if you are using something like libmoon which proactively rebinds drivers for all "not active" interfaces. yes, i am aware of the dpdk contribution guideline. no, i am not going to jump through linux-kernel level hoops for a trivial 9-sloc-python driveby-contrib. yes, that glorious code is all written by me, i promise i didnt steal it, and whoever takes pity and merges it is free to claim full credits for it. (if you feel bad about claiming credits for something you didnt write, perhaps find more useful names for "f" and "l" and/or add some comment above it...) yes, i promise i will read and respect the contrib guide if i ever want to contrib code that took longer to write than it takes to read the contrib guide. regards, x23 diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py index 4d9c1be666..d02552de33 100755 --- a/usertools/dpdk-devbind.py +++ b/usertools/dpdk-devbind.py @@ -244,6 +244,16 @@ def get_device_details(devices_type): if rt_info[i] == "dev": ssh_if.append(rt_info[i + 1]) + bdir = "/proc/net/bonding" + if os.path.exists(bdir): + for bn in os.listdir(bdir): + f = open(os.path.join(bdir, bn)) + bs = f.read() + f.close() + for l in bs.splitlines(): + if l[:17] == "Slave Interface: ": + ssh_if.append(l[17:]) + # based on the basic info, get extended text details for d in devices.keys(): if not device_type_match(devices[d], devices_type):