From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by dpdk.org (Postfix) with ESMTP id 7E0DC106B for ; Mon, 15 Jun 2015 10:22:17 +0200 (CEST) Received: by pdjn11 with SMTP id n11so67881013pdj.0 for ; Mon, 15 Jun 2015 01:22:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2NSrBZ2eE2YEfdB592Jg3KNiz1EgI0dx33xHWXseT8M=; b=YOSrPk4ngTCm9ciWrLyiB80ayA1GZ7hLWF2pUlGmCtW1X1KL8C9OJmcf9fFjWwzOmF NthcBXubwURBY/OY4+rmUTDjl1xA+J+HRf0J7jDhWYNy6NClBUvu3JOLN7NXy23CH/wV /8ekwQ77r18aBh7dHfl1dx2K4v4lfY2iqQtbPZjnxKlCwCXl9T2WB81Z00noSeKWHZ/n byOSNoh/3GdsJzmZ/JWY9Tgnl30D0fjkV85DKwusx9uSaTie8PHRWcMhsRs7ROE005w/ Cj25HBGSmh2wwmbhmWbTBrMZJdztpPbBQFLKKkOFars6Yi0GBsLDg4EbvxMY6Qhr3sd1 q21g== X-Received: by 10.70.133.230 with SMTP id pf6mr46636608pdb.56.1434356536918; Mon, 15 Jun 2015 01:22:16 -0700 (PDT) Received: from localhost.localdomain.com ([144.49.130.148]) by mx.google.com with ESMTPSA id nl10sm4778949pdb.38.2015.06.15.01.22.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 01:22:16 -0700 (PDT) From: Vijayakumar Muthuvel Manickam To: dev@dpdk.org Date: Mon, 15 Jun 2015 04:21:43 -0400 Message-Id: <1434356503-7747-1-git-send-email-mmvijay@gmail.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: References: Subject: [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 08:22:17 -0000 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 -- 1.8.1.4