DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] kni: Add set_rx_mode callback to handle multicast groups
@ 2015-06-02  7:21 Simon Kagstrom
  2015-06-02  7:31 ` Zhang, Helin
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Kagstrom @ 2015-06-02  7:21 UTC (permalink / raw)
  To: dev, helin.zhang, stephen

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 <simon.kagstrom@netinsight.net>
Signed-off-by: Johan Faltstrom <johan.faltstrom@netinsight.net>
---
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,
-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v2] kni: Add set_rx_mode callback to handle multicast groups
  2015-06-02  7:21 [dpdk-dev] [PATCH v2] kni: Add set_rx_mode callback to handle multicast groups Simon Kagstrom
@ 2015-06-02  7:31 ` Zhang, Helin
  2015-06-16 15:31   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Helin @ 2015-06-02  7:31 UTC (permalink / raw)
  To: Simon Kagstrom; +Cc: dev



> -----Original Message-----
> From: Simon Kagstrom [mailto:simon.kagstrom@netinsight.net]
> Sent: Tuesday, June 2, 2015 3:22 PM
> To: dev@dpdk.org; Zhang, Helin; stephen@networkplumber.org
> Subject: [PATCH v2] kni: Add set_rx_mode callback to handle multicast groups
> 
> 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 <simon.kagstrom@netinsight.net>
> Signed-off-by: Johan Faltstrom <johan.faltstrom@netinsight.net>
Acked-by: Helin Zhang <helin.zhang@intel.com>

> ---
> 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,
> --
> 1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v2] kni: Add set_rx_mode callback to handle multicast groups
  2015-06-02  7:31 ` Zhang, Helin
@ 2015-06-16 15:31   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2015-06-16 15:31 UTC (permalink / raw)
  To: Simon Kagstrom; +Cc: dev, Johan Faltstrom

> > 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 <simon.kagstrom@netinsight.net>
> > Signed-off-by: Johan Faltstrom <johan.faltstrom@netinsight.net>
> Acked-by: Helin Zhang <helin.zhang@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-16 15:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-02  7:21 [dpdk-dev] [PATCH v2] kni: Add set_rx_mode callback to handle multicast groups Simon Kagstrom
2015-06-02  7:31 ` Zhang, Helin
2015-06-16 15:31   ` Thomas Monjalon

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).