* [dpdk-dev] [memnic PATCH] linux: fix build with kernel >= 3.3
@ 2014-01-24 15:59 Olivier Matz
2014-01-30 11:46 ` Hiroshi Shimamoto
0 siblings, 1 reply; 5+ messages in thread
From: Olivier Matz @ 2014-01-24 15:59 UTC (permalink / raw)
To: dev
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
linux/memnic_net.c | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/linux/memnic_net.c b/linux/memnic_net.c
index 747ae51..b6018fb 100644
--- a/linux/memnic_net.c
+++ b/linux/memnic_net.c
@@ -2,6 +2,7 @@
* BSD LICENSE
*
* Copyright(c) 2013-2014 NEC All rights reserved.
+ * Copyright(c) 2014 6WIND S.A.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,6 +30,7 @@
*/
/* Dual BSD/GPL */
+#include <linux/version.h>
#include <linux/etherdevice.h>
#include <linux/kthread.h>
@@ -259,13 +261,35 @@ static void memnic_tx_timeout(struct net_device *netdev)
{
}
-static void memnic_vlan_rx_add_vid(struct net_device *netdev, unsigned short vid)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+static int memnic_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
+{
+ return 0;
+}
+
+static int memnic_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
+{
+ return 0;
+}
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
+static int memnic_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
+{
+ return 0;
+}
+
+static int memnic_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
+{
+ return 0;
+}
+#else
+static void memnic_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
{
}
-static void memnic_vlan_rx_kill_vid(struct net_device *netdev, unsigned short vid)
+static void memnic_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
{
}
+#endif
static int memnic_ioctl(struct net_device *netdev, struct ifreq *req, int cmd)
{
--
1.8.4.rc3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [memnic PATCH] linux: fix build with kernel >= 3.3
2014-01-24 15:59 [dpdk-dev] [memnic PATCH] linux: fix build with kernel >= 3.3 Olivier Matz
@ 2014-01-30 11:46 ` Hiroshi Shimamoto
2014-02-07 13:04 ` [dpdk-dev] [memnic PATCH v2] linux: fix build with kernel 3.3 Olivier Matz
0 siblings, 1 reply; 5+ messages in thread
From: Hiroshi Shimamoto @ 2014-01-30 11:46 UTC (permalink / raw)
To: Olivier Matz, dev
I never noticed about that and I haven't check compilation with newer kernel.
But I think you have completed to test it.
Fine to me.
thanks,
Hiroshi
> Subject: [dpdk-dev] [memnic PATCH] linux: fix build with kernel >= 3.3
>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> ---
> linux/memnic_net.c | 28 ++++++++++++++++++++++++++--
> 1 file changed, 26 insertions(+), 2 deletions(-)
>
> diff --git a/linux/memnic_net.c b/linux/memnic_net.c
> index 747ae51..b6018fb 100644
> --- a/linux/memnic_net.c
> +++ b/linux/memnic_net.c
> @@ -2,6 +2,7 @@
> * BSD LICENSE
> *
> * Copyright(c) 2013-2014 NEC All rights reserved.
> + * Copyright(c) 2014 6WIND S.A.
> *
> * Redistribution and use in source and binary forms, with or without
> * modification, are permitted provided that the following conditions
> @@ -29,6 +30,7 @@
> */
> /* Dual BSD/GPL */
>
> +#include <linux/version.h>
> #include <linux/etherdevice.h>
> #include <linux/kthread.h>
>
> @@ -259,13 +261,35 @@ static void memnic_tx_timeout(struct net_device *netdev)
> {
> }
>
> -static void memnic_vlan_rx_add_vid(struct net_device *netdev, unsigned short vid)
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
> +static int memnic_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
> +{
> + return 0;
> +}
> +
> +static int memnic_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
> +{
> + return 0;
> +}
> +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
> +static int memnic_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
> +{
> + return 0;
> +}
> +
> +static int memnic_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
> +{
> + return 0;
> +}
> +#else
> +static void memnic_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
> {
> }
>
> -static void memnic_vlan_rx_kill_vid(struct net_device *netdev, unsigned short vid)
> +static void memnic_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
> {
> }
> +#endif
>
> static int memnic_ioctl(struct net_device *netdev, struct ifreq *req, int cmd)
> {
> --
> 1.8.4.rc3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [memnic PATCH v2] linux: fix build with kernel 3.3
2014-01-30 11:46 ` Hiroshi Shimamoto
@ 2014-02-07 13:04 ` Olivier Matz
2014-03-18 23:04 ` Hiroshi Shimamoto
0 siblings, 1 reply; 5+ messages in thread
From: Olivier Matz @ 2014-02-07 13:04 UTC (permalink / raw)
To: dev
Remove unused dev_ops functions.
The API of some functions (memnic_vlan_rx_add_vid,
memnic_vlan_rx_kill_vid) changed starting from 3.3 kernel. Instead of
using a #ifdef to handle the compilation on any kernel, we can just
remove these functions as they are not needed.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
linux/memnic_net.c | 33 ---------------------------------
1 file changed, 33 deletions(-)
Hi Shimamoto-san,
Here is a new version of the patch, I think we don't need the following
functions so we can just remove them instead of keeping several dummy
functions for different kernel versions.
Let me know if you have any comment.
Regards,
Olivier
diff --git a/linux/memnic_net.c b/linux/memnic_net.c
index 747ae51..9019258 100644
--- a/linux/memnic_net.c
+++ b/linux/memnic_net.c
@@ -235,16 +235,6 @@ drop:
return NETDEV_TX_OK;
}
-static u16 memnic_select_queue(struct net_device *netdev,
- struct sk_buff *skb)
-{
- return 0;
-}
-
-static void memnic_set_rx_mode(struct net_device *netdev)
-{
-}
-
static int memnic_set_mac(struct net_device *netdev, void *p)
{
return 0;
@@ -255,23 +245,6 @@ static int memnic_change_mtu(struct net_device *netdev, int new_mtu)
return 0;
}
-static void memnic_tx_timeout(struct net_device *netdev)
-{
-}
-
-static void memnic_vlan_rx_add_vid(struct net_device *netdev, unsigned short vid)
-{
-}
-
-static void memnic_vlan_rx_kill_vid(struct net_device *netdev, unsigned short vid)
-{
-}
-
-static int memnic_ioctl(struct net_device *netdev, struct ifreq *req, int cmd)
-{
- return 0;
-}
-
static struct net_device_stats *memnic_get_stats(struct net_device *netdev)
{
struct memnic_net *memnic = netdev_priv(netdev);
@@ -283,15 +256,9 @@ static const struct net_device_ops memnic_netdev_ops = {
.ndo_open = memnic_open,
.ndo_stop = memnic_close,
.ndo_start_xmit = memnic_start_xmit,
- .ndo_select_queue = memnic_select_queue,
- .ndo_set_rx_mode = memnic_set_rx_mode,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = memnic_set_mac,
.ndo_change_mtu = memnic_change_mtu,
- .ndo_tx_timeout = memnic_tx_timeout,
- .ndo_vlan_rx_add_vid = memnic_vlan_rx_add_vid,
- .ndo_vlan_rx_kill_vid = memnic_vlan_rx_kill_vid,
- .ndo_do_ioctl = memnic_ioctl,
.ndo_get_stats = memnic_get_stats,
};
--
1.8.5.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [memnic PATCH v2] linux: fix build with kernel 3.3
2014-02-07 13:04 ` [dpdk-dev] [memnic PATCH v2] linux: fix build with kernel 3.3 Olivier Matz
@ 2014-03-18 23:04 ` Hiroshi Shimamoto
2014-03-21 14:59 ` Thomas Monjalon
0 siblings, 1 reply; 5+ messages in thread
From: Hiroshi Shimamoto @ 2014-03-18 23:04 UTC (permalink / raw)
To: Olivier Matz, dev
Hi,
I missed it sorry.
> Subject: [memnic PATCH v2] linux: fix build with kernel 3.3
>
> Remove unused dev_ops functions.
>
> The API of some functions (memnic_vlan_rx_add_vid,
> memnic_vlan_rx_kill_vid) changed starting from 3.3 kernel. Instead of
> using a #ifdef to handle the compilation on any kernel, we can just
> remove these functions as they are not needed.
>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
thanks,
Hiroshi
> ---
> linux/memnic_net.c | 33 ---------------------------------
> 1 file changed, 33 deletions(-)
>
> Hi Shimamoto-san,
>
> Here is a new version of the patch, I think we don't need the following
> functions so we can just remove them instead of keeping several dummy
> functions for different kernel versions.
>
> Let me know if you have any comment.
>
> Regards,
> Olivier
>
> diff --git a/linux/memnic_net.c b/linux/memnic_net.c
> index 747ae51..9019258 100644
> --- a/linux/memnic_net.c
> +++ b/linux/memnic_net.c
> @@ -235,16 +235,6 @@ drop:
> return NETDEV_TX_OK;
> }
>
> -static u16 memnic_select_queue(struct net_device *netdev,
> - struct sk_buff *skb)
> -{
> - return 0;
> -}
> -
> -static void memnic_set_rx_mode(struct net_device *netdev)
> -{
> -}
> -
> static int memnic_set_mac(struct net_device *netdev, void *p)
> {
> return 0;
> @@ -255,23 +245,6 @@ static int memnic_change_mtu(struct net_device *netdev, int new_mtu)
> return 0;
> }
>
> -static void memnic_tx_timeout(struct net_device *netdev)
> -{
> -}
> -
> -static void memnic_vlan_rx_add_vid(struct net_device *netdev, unsigned short vid)
> -{
> -}
> -
> -static void memnic_vlan_rx_kill_vid(struct net_device *netdev, unsigned short vid)
> -{
> -}
> -
> -static int memnic_ioctl(struct net_device *netdev, struct ifreq *req, int cmd)
> -{
> - return 0;
> -}
> -
> static struct net_device_stats *memnic_get_stats(struct net_device *netdev)
> {
> struct memnic_net *memnic = netdev_priv(netdev);
> @@ -283,15 +256,9 @@ static const struct net_device_ops memnic_netdev_ops = {
> .ndo_open = memnic_open,
> .ndo_stop = memnic_close,
> .ndo_start_xmit = memnic_start_xmit,
> - .ndo_select_queue = memnic_select_queue,
> - .ndo_set_rx_mode = memnic_set_rx_mode,
> .ndo_validate_addr = eth_validate_addr,
> .ndo_set_mac_address = memnic_set_mac,
> .ndo_change_mtu = memnic_change_mtu,
> - .ndo_tx_timeout = memnic_tx_timeout,
> - .ndo_vlan_rx_add_vid = memnic_vlan_rx_add_vid,
> - .ndo_vlan_rx_kill_vid = memnic_vlan_rx_kill_vid,
> - .ndo_do_ioctl = memnic_ioctl,
> .ndo_get_stats = memnic_get_stats,
> };
>
> --
> 1.8.5.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [memnic PATCH v2] linux: fix build with kernel 3.3
2014-03-18 23:04 ` Hiroshi Shimamoto
@ 2014-03-21 14:59 ` Thomas Monjalon
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2014-03-21 14:59 UTC (permalink / raw)
To: Olivier Matz; +Cc: dev
18/03/2014 23:04, Hiroshi Shimamoto :
> > Remove unused dev_ops functions.
> >
> > The API of some functions (memnic_vlan_rx_add_vid,
> > memnic_vlan_rx_kill_vid) changed starting from 3.3 kernel. Instead of
> > using a #ifdef to handle the compilation on any kernel, we can just
> > remove these functions as they are not needed.
> >
> > Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
>
> Acked-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Applied.
Thank you
--
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-03-21 14:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-24 15:59 [dpdk-dev] [memnic PATCH] linux: fix build with kernel >= 3.3 Olivier Matz
2014-01-30 11:46 ` Hiroshi Shimamoto
2014-02-07 13:04 ` [dpdk-dev] [memnic PATCH v2] linux: fix build with kernel 3.3 Olivier Matz
2014-03-18 23:04 ` Hiroshi Shimamoto
2014-03-21 14:59 ` 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).