stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
To: "stephen@networkplumber.org" <stephen@networkplumber.org>
Cc: "stable@vger.kernel.org" <stable@vger.kernel.org>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] net-sysfs: allow changing sysfs carrier when interface is down
Date: Thu, 2 Jun 2022 18:38:15 +0000	[thread overview]
Message-ID: <86a5400b2765f1cb97899ec91c5e9036fbdaf5b2.camel@infinera.com> (raw)
In-Reply-To: <2390a40206f0f822569e6f55b8b7ae636eef7d05.camel@infinera.com>

On Thu, 2022-06-02 at 20:09 +0200, Joakim Tjernlund wrote:
> On Thu, 2022-06-02 at 10:56 -0700, Stephen Hemminger wrote:
> > On Thu, 2 Jun 2022 17:15:13 +0000
> > Joakim Tjernlund <Joakim.Tjernlund@infinera.com> wrote:
> > 
> > > On Thu, 2022-06-02 at 09:57 -0700, Jakub Kicinski wrote:
> > > > On Thu, 2 Jun 2022 16:26:18 +0000 Joakim Tjernlund wrote:  
> > > > > On Thu, 2022-06-02 at 08:56 -0700, Stephen Hemminger wrote:  
> > > > > > > Sure, our HW has config/state changes that makes it impossible for net driver
> > > > > > > to touch and registers or TX pkgs(can result in System Error exception in worst case.  
> > > > 
> > > > What is "our HW", what kernel driver does it use and why can't the
> > > > kernel driver take care of making sure the device is not accessed
> > > > when it'd crash the system?  
> > > 
> > > It is a custom asic with some homegrown controller. The full config path is too complex for kernel too
> > > know and depends on user input. The cashing/TX TMO part was not part of the design plans and
> > > I have been down this route with the HW designers without success.
> > 
> > Changing upstream code to support out of tree code?
> > The risk of breaking current users for something that no one else uses
> > is a bad idea.
> 
> There are in tree users too, see fixed_phy_change_carrier(), I am not asking for adding
> a new feature, just making an existing one more usable.
> 
> > 
> > > >   
> > > > > Maybe so but it seems to me that this limitation was put in place without much thought.  
> > > > 
> > > > Don't make unnecessary disparaging statements about someone else's work.
> > > > Whoever that person was.  
> > > 
> > > That was not meant the way you read it, sorry for being unclear.
> > > The commit from 2012 simply says:
> > > net: allow to change carrier via sysfs
> > >     
> > >     Make carrier writable
> > > 
> > 
> > Setting carrier from userspace was added to support VPN's etc;
> > in general it was not meant as hardware workaround.
> > 
> > Often using operstate is better with complex hardware did you look at that?
> 
> You mean?
> ls -l /sys/class/net/sgmii/operstate  
> -r--r--r--    1 root     root          4096 Mar  9 12:46 /sys/class/net/sgmii/operstate
> 
> I did, but operstate here is not writeable.
> Did you perhaps mean some other operstate ?
> 

Looked a little deeper and found:
  ip link set eth0 carrier off/on
which works regardless of eth0 UP/DOWN state for me.

Exactly what I am asking net-sysfs to allow as well.
if net-sysfs carrier and ip link set eth0 carrier are the same function it makes sense
they have the same privs, right?

 Jocke

      reply	other threads:[~2022-06-02 18:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02  0:35 [PATCH] net-sysfs: allow changing sysfs carrier when interface is down Joakim Tjernlund
2022-06-02  1:01 ` Jakub Kicinski
2022-06-02  9:22   ` Joakim Tjernlund
2022-06-02 15:56     ` Stephen Hemminger
2022-06-02 16:26       ` Joakim Tjernlund
2022-06-02 16:57         ` Jakub Kicinski
2022-06-02 17:15           ` Joakim Tjernlund
2022-06-02 17:52             ` Jakub Kicinski
2022-06-02 18:01               ` Joakim Tjernlund
2022-06-05 18:50                 ` Andrew Lunn
2022-06-07 11:52                   ` Joakim Tjernlund
2022-06-02 18:14               ` Stephen Hemminger
2022-06-02 17:56             ` Stephen Hemminger
2022-06-02 18:09               ` Joakim Tjernlund
2022-06-02 18:38                 ` Joakim Tjernlund [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86a5400b2765f1cb97899ec91c5e9036fbdaf5b2.camel@infinera.com \
    --to=joakim.tjernlund@infinera.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).