樹莓派 3B+ 筦窺︰ GigaBit ︰ 300MBit !認識工具‧上

派生碼訊

子 鼠

最高樓‧杜甫

城尖徑厭施篩愁,獨立縹緲之飛樓。
峽坼雲霾龍虎臥,江清日抱黿鼉游。
扶桑西枝對斷石,弱水東影隨長流。
杖藜嘆世者誰子?泣血迸空回白頭。

︰老杜倡議拗體詩,誰知拗得拗不得?

今天小企鵝學堂上,吵吵鬧鬧,此時那些小企鵝們正憤愾的議論著禮拜天還『補課』之事的呢 !!

有的主張︰既然是天放假,幹嘛要補課。

有的辯證︰就算今天不補,改天補還不是一樣?

有的議論︰早補早了,有什麼好議論的!!

有的搞笑︰『始』安息日,『終』禮拜天!不就一天嗎??

那你可有說法?

哦!我唱ㄏㄡˇ你ㄗㄞ︰今天不只要補課,……

而且ㄍㄡˋ要實習,但是用的是『咸澤碼訊』

‧高級的

‧沒學過的

‧ㄍㄚˋ伊講不通的

唔是□派○生的呦!!

啞是甲意喝一杯咖啡??

BabyTux

graphics-tux-638974

sonictux

starbucks_tux_linux_art-555px

─── 摘自《M♪o 之學習筆記本《子》開關︰【䷝】狀態編碼

 

補課不易加課難,惟因學堂不好玩。

授業解惑苦失傳,道鎖高樓難復還。

讀書原是本家事,學問方田自耕耘。

─── 《神經網絡【學而堯曰】十

 

欲上最高樓者,焉能不知『登高必自卑,行遠必自邇』之理︰

禮記‧中庸

子曰:射有似乎君子,失諸正鵠,反求諸其身。君子之道,辟如行遠必自邇,辟如登高必自卑。《詩》曰:『妻子好合,如鼓瑟琴;兄弟既翕,和樂且耽。宜爾室家,樂爾妻帑。』 子曰:父母其順矣乎!

─ 《【鼎革‧革鼎】︰ RASPBIAN STRETCH 《六之 K.2-SD.I 》

 

『科技』畢竟非『詩詞』,豈用『拗』?

近日聽聞樹莓派工程師說︰

Re: PoE HAT – USB Ports not working – over-current

  • jamesh
    Raspberry Pi Engineer & Forum Moderator
    Raspberry Pi Engineer & Forum Moderator

Wed Sep 19, 2018 8:59 am

leol wrote:

Tue Sep 18, 2018 3:16 pm

Any news on the promised blog?

We are still investigating the issue – it seems to be a lot more complicated that first thought and we want to make sure we have a decent handle on the situation. We’ve put a hold on sales for the moment, and we are geting some returned here which show up a particular issue we want to get to the bottom of.

 

問題解決前, PoE HAT 暫停銷售!

難到不是之『最高樓』者,所應為乎?故樂於按讚呦!

一位善長『實務』的人,能不善用『工具』耶?!

倘伊止於聲聞,果可得門徑嘛!?

Linux Foundation Wiki

project collaboration site

Trace: net-tools

Overview

A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system. This package includes arp(8), hostname(1), ifconfig(8), ipmaddr, iptunnel, mii-tool(8), nameif(8), netstat(8), plipconfig(8), rarp(8), route(8) and slattach(8).

Please keep in mind that most net-tools programs are obsolete now:

PROGRAM OBSOLETED BY
arp ip neigh
ifconfig ip addr
ipmaddr ip maddr
iptunnel ip tunnel
route ip route
nameif ifrename
mii-tool ethtool

You would probably want to review iproute2 page. See also net-tools future thread.

 

『術』即使早學,有時望洋興嘆哩!★

與時並進者,若陷於

ethtool

ethtool is a utility for Linux kernel-based operating system for displaying and modifying some parameters of network interface controllers (NICs) and their device drivers. ethtool is developed parallel to the Linux kernel.

Usage

The command is useful for

  • Identification and diagnosis of Ethernet devices
  • Extended Ethernet devices statistics
  • Control speed, duplex, auto-negotiation and flow control for Ethernet devices
  • Control checksum offload and other hardware offload features
  • Control DMA ring sizes and interrupt moderation
  • Control receive queue selection for multiqueue devices
  • Upgrade firmware in flash memory

 

手冊

pi@raspberrypi:~ <a style="color: #ff9900;" href="https://linux.die.net/man/8/ethtool">man ethtool</a></span>  <span style="color: #666699;">言簡意賅之大部頭命令裡,實不如</span>  <span style="color: #666699;">隨興而動,自得其樂也?☆</span>  <span style="color: #666699;">就像當『曾行』之事,眼前『水窮處』☻</span> <pre class="lang:default decode:true ">pi@raspberrypi:~ ethtool -p eth0 5
Cannot identify NIC: Operation not permitted
pi@raspberrypi:~ $
 

正好探其原『認識』勒☺

ethtool – utility for controlling network drivers and hardware

Introduction

ethtool is the standard Linux utility for controlling network drivers and hardware, particularly for wired Ethernet devices. It can be used to:

  • Get identification and diagnostic information
  • Get extended device statistics
  • Control speed, duplex, autonegotiation and flow control for Ethernet devices
  • Control checksum offload and other hardware offload features
  • Control DMA ring sizes and interrupt moderation
  • Control receive queue selection for multiqueue devices
  • Upgrade firmware in flash memory

Most features are dependent on support in the specific driver. See the manual page for full information.

 

ethtool-4.18.tar.xz

/*
* ethtool.c: Linux ethernet device configuration tool.
*
* Copyright (C) 1998 David S. Miller (davem@dm.cobaltmicro.com)
* Portions Copyright 2001 Sun Microsystems
* Kernel 2.4 update Copyright 2001 Jeff Garzik <jgarzik@mandrakesoft.com>
* Wake-on-LAN,natsemi,misc support by Tim Hockin <thockin@sun.com>
* Portions Copyright 2002 Intel
* Portions Copyright (C) Sun Microsystems 2008
* do_test support by Eli Kupermann <eli.kupermann@intel.com>
* ETHTOOL_PHYS_ID support by Chris Leech <christopher.leech@intel.com>
* e1000 support by Scott Feldman <scott.feldman@intel.com>
* e100 support by Wen Tao <wen-hwa.tao@intel.com>
* ixgb support by Nicholas Nunley <Nicholas.d.nunley@intel.com>
* amd8111e support by Reeja John <reeja.john@amd.com>
* long arguments by Andi Kleen.
* SMSC LAN911x support by Steve Glendinning <steve.glendinning@smsc.com>
* Rx Network Flow Control configuration support <santwona.behera@sun.com>
* Various features by Ben Hutchings <bhutchings@solarflare.com>;
* Copyright 2009, 2010 Solarflare Communications
* MDI-X set support by Jesse Brandeburg <jesse.brandeburg@intel.com>
* Copyright 2012 Intel Corporation
* vmxnet3 support by Shrikrishna Khare <skhare@vmware.com>
* Various features by Ben Hutchings <ben@decadent.org.uk>;
* Copyright 2008-2010, 2013-2016 Ben Hutchings
* QSFP+/QSFP28 DOM support by Vidya Sagar Ravipati <vidya@cumulusnetworks.com>
*
* TODO:
* * show settings for all devices
*/

 

static int do_phys_id(struct cmd_context *ctx)
{
	int err;
	struct ethtool_value edata;
	int phys_id_time;

	if (ctx->argc > 1)
		exit_bad_args();
	if (ctx->argc == 1)
		phys_id_time = get_int(*ctx->argp, 0);
	else
		phys_id_time = 0;

	edata.cmd = ETHTOOL_PHYS_ID;
	edata.data = phys_id_time;
	err = send_ioctl(ctx, &edata);
	if (err < 0)
		perror("Cannot identify NIC");

	return err;
}

 

……

linux/net/core/ethtool.c

/*
* net/core/ethtool.c – Ethtool ioctl handler
* Copyright (c) 2003 Matthew Wilcox <matthew@wil.cx>
*
* This file is where we call all the ethtool_ops commands to get
* the information ethtool needs.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/

 

static int ethtool_phys_id(struct net_device *dev, void __user *useraddr)
{
	struct ethtool_value id;
	static bool busy;
	const struct ethtool_ops *ops = dev->ethtool_ops;
	int rc;

	if (!ops->set_phys_id)
		return -EOPNOTSUPP;

	if (busy)
		return -EBUSY;

	if (copy_from_user(&id, useraddr, sizeof(id)))
		return -EFAULT;

	rc = ops->set_phys_id(dev, ETHTOOL_ID_ACTIVE);
	if (rc < 0)
		return rc;

	/* Drop the RTNL lock while waiting, but prevent reentry or
	 * removal of the device.
	 */
	busy = true;
	dev_hold(dev);
	rtnl_unlock();

	if (rc == 0) {
		/* Driver will handle this itself */
		schedule_timeout_interruptible(
			id.data ? (id.data * HZ) : MAX_SCHEDULE_TIMEOUT);
	} else {
		/* Driver expects to be called at twice the frequency in rc */
		int n = rc * 2, i, interval = HZ / n;

		/* Count down seconds */
		do {
			/* Count down iterations per second */
			i = n;
			do {
				rtnl_lock();
				rc = ops->set_phys_id(dev,
				    (i & 1) ? ETHTOOL_ID_OFF : ETHTOOL_ID_ON);
				rtnl_unlock();
				if (rc)
					break;
				schedule_timeout_interruptible(interval);
			} while (!signal_pending(current) && --i != 0);
		} while (!signal_pending(current) &&
			 (id.data == 0 || --id.data != 0));
	}

	rtnl_lock();
	dev_put(dev);
	busy = false;

	(void) ops->set_phys_id(dev, ETHTOOL_ID_INACTIVE);
	return rc;
}