From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by dpdk.org (Postfix) with ESMTP id 295C35A65 for ; Mon, 15 Jun 2015 18:09:02 +0200 (CEST) Received: by pdbnf5 with SMTP id nf5so76172272pdb.2 for ; Mon, 15 Jun 2015 09:09:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=BzHCINe+67NfETZ8N5HopUSXrZza5dsKLYOQcBLsLYs=; b=CoW2m03TtB9TnwfK4sbaId2jrYR1PURxWc9hTGf8cF2x+dZQcTHwGhYBlfdFttGQQp yr8H85QxUn4KYu9VLcANRqiaN9PtEuVJFb+wtHHOWF0NybYT5v2VgM0RPoNT+bK8zaBC xDH83MHqOSwIjeSNi8pNSmwDhJY2j+ui5c9gefGsGwT2HEIGkwSJykSsocMTrKhyytEA X009tfgs+uW4TLAZm3yjxAATwLEAkbetlARDEOGMOJDJSc0Aiesq+BWXSBdsF6zKua+l 7BKcfVJlwgan1MO9c11tDm0jng6FksG6CAh3tXFkZ0euSySUf4EGh3Dz+z17KqklOy2t Y3Eg== X-Gm-Message-State: ALoCoQlataJr7dw2h6JiDNO7lNcx6po95pW0YhdoakN3G2dxmsButHGBj38yLWQpJK6YIbG783XJ X-Received: by 10.68.102.1 with SMTP id fk1mr50354721pbb.56.1434384541572; Mon, 15 Jun 2015 09:09:01 -0700 (PDT) Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id nl10sm6105821pdb.38.2015.06.15.09.09.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 09:09:01 -0700 (PDT) Date: Mon, 15 Jun 2015 09:09:04 -0700 From: Stephen Hemminger To: Vijayakumar Muthuvel Manickam Message-ID: <20150615090904.4b4d45a5@urahara> In-Reply-To: <1434356503-7747-1-git-send-email-mmvijay@gmail.com> References: <1434356503-7747-1-git-send-email-mmvijay@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] kni: Add link status update X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 16:09:02 -0000 On Mon, 15 Jun 2015 04:21:43 -0400 Vijayakumar Muthuvel Manickam wrote: > Implement .ndo_change_carrier to enable > DPDK applications to propagate link state changes to > kni virtual interfaces through sysfs > > Signed-off-by: Vijayakumar Muthuvel Manickam > --- > Implemented .ndo_change_carrier instead of adding a new ioctl > > lib/librte_eal/linuxapp/kni/kni_net.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c > index dd95db5..10c94ce 100644 > --- a/lib/librte_eal/linuxapp/kni/kni_net.c > +++ b/lib/librte_eal/linuxapp/kni/kni_net.c > @@ -632,6 +632,15 @@ static int kni_net_set_mac(struct net_device *netdev, void *p) > return 0; > } > > +static int kni_net_change_carrier(struct net_device *dev, bool new_carrier) > +{ > + if (new_carrier) > + netif_carrier_on(dev); > + else > + netif_carrier_off(dev); > + return 0; > +} > + > static const struct header_ops kni_net_header_ops = { > .create = kni_net_header, > .rebuild = kni_net_rebuild_header, > @@ -648,6 +657,7 @@ static const struct net_device_ops kni_net_netdev_ops = { > .ndo_get_stats = kni_net_stats, > .ndo_tx_timeout = kni_net_tx_timeout, > .ndo_set_mac_address = kni_net_set_mac, > + .ndo_change_carrier = kni_net_change_carrier, > }; > > void Acked-by: Stephen Hemminger You might need to have a kernel version test?? since carrier change was introduced in 3.9 kernel