From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753599AbcFBS2i (ORCPT ); Thu, 2 Jun 2016 14:28:38 -0400 Received: from AUSXIPPS310.us.dell.com ([143.166.148.211]:3872 "EHLO ausxipps310.us.dell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751298AbcFBS2f (ORCPT ); Thu, 2 Jun 2016 14:28:35 -0400 DomainKey-Signature: s=smtpout; d=dell.com; c=nofws; q=dns; h=X-LoopCount0:X-IronPort-AV:From:To:CC:Subject: Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language: X-MS-Has-Attach:X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader:x-originating-ip: Content-Type:Content-Transfer-Encoding:MIME-Version: Return-Path; b=BnobTUaTjCh5cgwMQhfPRDhTWYhnORzr3xbefowSKcvgHr2ULGvnqhG5 aTOKwe92i/D1lnAKXdP/4lpMaTgXBaMFzQSoBs17xHl1GaMzk4e/xBwiA D3u9zlC3vrPfBCz/jVR4A5wnNzrTJkSgMeFOingFFSJrozYe5vaJN1zcG k=; X-LoopCount0: from 10.170.28.40 X-IronPort-AV: E=Sophos;i="5.26,407,1459832400"; d="scan'208";a="323100197" From: To: , CC: , , , , , Subject: RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address Thread-Topic: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address Thread-Index: AQHRvPkkMb9mMEf0UUOJaXsVnbGJUp/We6QQ Date: Thu, 2 Jun 2016 18:28:33 +0000 Message-ID: References: <1464817844-27206-1-git-send-email-mario_limonciello@dell.com> <20160601230535.GA29279@kroah.com> <0bdb98b72b884682b936c0587f965629@ausx13mpc124.AMER.DELL.COM> <20160602152244.GA26494@kroah.com> <6d9575fd791c4e25b464b9a1b11daa83@ausx13mpc124.AMER.DELL.COM> <87vb1rwjql.fsf@nemi.mork.no> In-Reply-To: <87vb1rwjql.fsf@nemi.mork.no> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.11.181.4] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u52ISiHj022761 > -----Original Message----- > From: Bjørn Mork [mailto:bjorn@mork.no] > Sent: Thursday, June 2, 2016 1:04 PM > To: Limonciello, Mario > Cc: gregkh@linuxfoundation.org; hayeswang@realtek.com; linux- > kernel@vger.kernel.org; netdev@vger.kernel.org; linux- > usb@vger.kernel.org; pali.rohar@gmail.com; anthony.wong@canonical.com > Subject: Re: [PATCH] r8152: Add support for setting MAC to system's > Auxiliary MAC address > > writes: > > >> > 2) Track whether this is the first or second USB NIC plugged in. Only > offer it > >> on the first NIC detected by r8152. When the second NIC is plugged in > don't > >> match from ACPI. > >> > There would be a question of what to do if the first NIC is removed and > >> added back if it should get the persistent system MAC or not. > >> > I'd say yes, just make sure that only one NIC can have it at a time. > >> > >> You are going to get things very complex very quickly if you try to do this. > > > > It's really not that hard, track a module wide static variable whether > > the feature is in use. Track in each device whether the feature was > > in use. If it in use, don't assign the next device plugged in via the > > ACPI string. If a device is removed that has the feature activated, > > change the module wide static variable. > > Having the mac address jump around in an arbitrary way like this is > going to confuse the hell out of your users. Consider what happens if > the user docks a laptop with an r8152 usb dongle already plugged in... > How are you going to explain that the dock gets some other mac address > in this case? How are you going to explain the difference between using > an r8152 based dongle and some other ethernet usb dongle with your > systems? Yeah I understand the concern. I agree that would be very confusing to a user. This does need to match only on Dell docks then. > > Make it behave consistently if you're going to add this. Which can be > done by specifically matching the Dell dock (doesn't it have an unique > Dell device ID?) and ignoring any other r8152 device. You could also > choose to set the same mac for all r8152 devices. Which is fine, but > will probably confuse many users. Unfortunately there is no Dell specific VID/PID. I checked a no-name dongle that used r8152 and it was the same (0bda:8153). Maybe Hayes Wang can check with his Windows driver colleagues if there was anything else to key off when this was implemented on the Windows Realtek driver. If there is something else to key off of, I'm not aware what it is. I'll check with some of my colleagues too. I do have a way to query if a dock is plugged in via SMM, but I doubt that's what Realtek is using on the Windows side. I'd leave that as a second to last resort (last resort being move back to userspace again). > > What you definitely should not do is to change the mac for some > arbitrary "first" device. Then you are better off with the userspace > proposal where you and your users have some chance to implement a > sensible policy based on e.g. usb port numbers. OK, if I can't come up with a way to key on the device being a Dell dock I'll scrap this entirely kernel approach.