From patchwork Tue Jun 2 07:21:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Kagstrom X-Patchwork-Id: 5074 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 31A07C338; Tue, 2 Jun 2015 09:22:08 +0200 (CEST) Received: from ernst.netinsight.se (ernst.netinsight.se [194.16.221.21]) by dpdk.org (Postfix) with SMTP id BD225C332 for ; Tue, 2 Jun 2015 09:22:06 +0200 (CEST) Received: from miho (unverified [10.100.1.152]) by ernst.netinsight.se (EMWAC SMTPRS 0.83) with SMTP id ; Tue, 02 Jun 2015 09:21:55 +0200 Date: Tue, 2 Jun 2015 09:21:55 +0200 From: Simon Kagstrom To: dev@dpdk.org, helin.zhang@intel.com, stephen@networkplumber.org Message-ID: <20150602092155.588bbb2e@miho> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.27; x86_64-pc-linux-gnu) MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2] kni: Add set_rx_mode callback to handle multicast groups 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" We did some (very basic) tests with IGMP, which involves adding multicast addresses to ETH interfaces. This is done via the ip tool, an example can be found on e.g., http://superuser.com/questions/324824/linux-built-in-or-open-source-program-to-join-multicast-group and this will fail on KNI interfaces because of an unimplemented ioctl SIOCADDMULTI. The patch simply adds an empty callback for set_rx_mode (typically used for setting up hardware) so that the ioctl succeeds. This is the same thing as the Linux tap interface does. Signed-off-by: Simon Kagstrom Signed-off-by: Johan Faltstrom Acked-by: Helin Zhang --- ChangeLog: v2: Improve motivation for the patch lib/librte_eal/linuxapp/kni/kni_net.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c index dd95db5..cf93c4b 100644 --- a/lib/librte_eal/linuxapp/kni/kni_net.c +++ b/lib/librte_eal/linuxapp/kni/kni_net.c @@ -495,6 +495,11 @@ kni_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) return 0; } +static void +kni_net_set_rx_mode(struct net_device *dev) +{ +} + static int kni_net_change_mtu(struct net_device *dev, int new_mtu) { @@ -645,6 +650,7 @@ static const struct net_device_ops kni_net_netdev_ops = { .ndo_start_xmit = kni_net_tx, .ndo_change_mtu = kni_net_change_mtu, .ndo_do_ioctl = kni_net_ioctl, + .ndo_set_rx_mode = kni_net_set_rx_mode, .ndo_get_stats = kni_net_stats, .ndo_tx_timeout = kni_net_tx_timeout, .ndo_set_mac_address = kni_net_set_mac,