[net-next] net: remove MTU limits for dummy and ifb device

2017-09-22 Thread Zhang Shengju
x_mtu to 0. So that dev_set_mtu() will not check the mtu range, and can be set with any value. CC: Eric Dumazet <eduma...@google.com> CC: Sabrina Dubroca <s...@queasysnail.net> Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/dummy.c | 2 +- drivers/

[net-next 2/2] ifb: add device MTU validation check

2017-09-21 Thread Zhang Shengju
:ff:ff This patch adds device MTU validation check. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/ifb.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index 8870bd2..ce84ad2 100644 --- a/drivers/net/ifb.c +++ b

[net-next 1/2] dummy: add device MTU validation check

2017-09-21 Thread Zhang Shengju
ce brd ff:ff:ff:ff:ff:ff This patch adds device MTU validation check. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/dummy.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index e31ab3b..0276b2b 100644 --- a

[net-next 0/2] add device MTU validation check

2017-09-21 Thread Zhang Shengju
This patch serial add device MTU validation check, so that only valid mtu value can be set when adding new device. Zhang Shengju (2): dummy: add device MTU validation check ifb: add device MTU validation check drivers/net/dummy.c | 8 drivers/net/ifb.c | 8 2 files

[net-next] macvlan: code refine to check data before using

2017-09-20 Thread Zhang Shengju
This patch checks data first at one place, return if it's null. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/macvlan.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index d

[net-next,RESEND] igb: add function to get maximum RSS queues

2017-09-19 Thread Zhang Shengju
This patch adds a new function igb_get_max_rss_queues() to get maximum RSS queues, this will reduce duplicate code and facilitate future maintenance. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/ethernet/intel/igb/igb.h | 1 + drivers/net/et

[net-next] dummy: declare dummy devices as enumerated devices

2017-09-11 Thread Zhang Shengju
Dummy device name is enumerated by the kernel, let user space be aware of the naming scheme used by dummy devices: (visible in /sys/class/net//name_assign_type). Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/dummy.c | 2 +- 1 file changed, 1 insertion

[net-next] be2net: use shift instead of expensive divide

2017-08-28 Thread Zhang Shengju
Replace shift instead of expensive divide. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/ethernet/emulex/benet/be_main.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drive

[net-next] igb: add function to get maximum RSS queues

2017-07-28 Thread Zhang Shengju
This patch adds a new function igb_get_max_rss_queues() to get maximum RSS queues, this will reduce duplicate code and facilitate future maintenance. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/ethernet/intel/igb/igb.h | 1 + drivers/net/et

[net-next] macvlan: propagate the mac address change status for lowerdev

2017-06-13 Thread Zhang Shengju
The macvlan dev should propagate the return value of mac address change for lower device in the passthru mode, instead of always return 0. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/macvlan.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-)

[net-next] fjes: remove duplicate set of flag IFF_BROADCAST

2017-06-13 Thread Zhang Shengju
Remove unnecessary set of flag IFF_BROADCAST, since ether_setup already does this. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/fjes/fjes_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_

[net-next,v2] openvswitch: add macro MODULE_ALIAS_VPORT_TYPE for vport type alias

2017-06-13 Thread Zhang Shengju
Add a new macro MODULE_ALIAS_VPORT_TYPE to unify and simplify the declaration of vport type alias. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/openvswitch/vport-geneve.c | 2 +- net/openvswitch/vport-gre.c| 2 +- net/openvswitch/vport-vxlan.c | 2 +

[net-next] openvswitch: add macro MODULE_ALIAS_VPORT_TYPE for vport type alias

2017-06-03 Thread Zhang Shengju
Add a new macro MODULE_ALIAS_VPORT_TYPE to unify and simplify the declaration of vport type alias, and replace magic numbers with symbolic constants. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/openvswitch/vport-geneve.c | 2 +- net/openvswitch/vport-gre.c

[net-next] team: add macro MODULE_ALIAS_TEAM_MODE for team mode alias

2017-06-01 Thread Zhang Shengju
Add a new macro MODULE_ALIAS_TEAM_MODE to unify and simplify the declaration of team mode alias. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/team/team_mode_activebackup.c | 2 +- drivers/net/team/team_mode_broadcast.c| 2 +- drivers/ne

[net-next] net: remove duplicate add_device_randomness() call

2017-05-17 Thread Zhang Shengju
Since register_netdevice() already call add_device_randomness() and dev_set_mac_address() will call it after mac address change. It's not necessary to call at device UP. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/core/dev.c | 1 - 1 file changed, 1 deletion(-)

[net-next] net: remove duplicate add_device_randomness() call

2017-05-03 Thread Zhang Shengju
Since register_netdevice() already call add_device_randomness() and dev_set_mac_address() will call it after mac address change. It's not necessary to call at device UP. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/core/dev.c | 1 - 1 file changed, 1 deletion(-)

[net-next] net: remove unnecessary carrier status check

2017-04-26 Thread Zhang Shengju
Since netif_carrier_on() will do nothing if device's carrier is already on, so it's unnecessary to do carrier status check. It's the same for netif_carrier_off(). Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/core/dev.c | 11 --- 1 file changed, 4 inse

[iproute2] iplink: add support for IFLA_CARRIER attribute

2017-04-26 Thread Zhang Shengju
Add support to set IFLA_CARRIER attribute. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- ip/iplink.c | 12 1 file changed, 12 insertions(+) diff --git a/ip/iplink.c b/ip/iplink.c index 866ad72..263bfdd 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -72,6

[net-next] net: update comment for netif_dormant() function

2017-04-25 Thread Zhang Shengju
This patch updates the comment for netif_dormant() function to reflect the intended usage. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- include/linux/netdevice.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/netdevice.h b/i

[net-next] macsec: remove first zero and add attribute name in comments

2016-12-07 Thread Zhang Shengju
Remove first zero for add, and use full attribute name in comments. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/macsec.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/net/macsec.c b/drive

[net-next v2] dummy: extend mtu range for dummy device

2016-12-07 Thread Zhang Shengju
After commit 61e84623ace3 ("net: centralize net_device min/max MTU checking"), the mtu range for dummy device becomes [68, 1500]. This patch extends it to [0, 65535]. v2 - fix typo in commit message Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers

[net-next] dummy: expend mtu range for dummy device

2016-12-07 Thread Zhang Shengju
After commit 61e84623ace3 ("net: centralize net_device min/max MTU checking"), the mtu range for dummy device becomes [68, 1500]. This patch expends it to [0, 65535]. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/dummy.c | 3 +++ 1 file chang

[net-next] nlmon: use core MTU range checking in nlmon driver

2016-12-07 Thread Zhang Shengju
Since commit 61e84623ace3 ("net: centralize net_device min/max MTU checking"), mtu range is checked at dev_set_mtu(). This patch adds min_mtu for nlmon device and remove unnecessary ndo_change_mtu() function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com>

[net-next] icmp: correct return value of icmp_rcv()

2016-12-06 Thread Zhang Shengju
Currently, icmp_rcv() always return zero on a packet delivery upcall. To make its behavior more compliant with the way this API should be used, this patch changes this to let it return NET_RX_SUCCESS when the packet is proper handled, and NET_RX_DROP otherwise. Signed-off-by: Zhang Shengju

[net-next 2/5] bnx2x: use reset to set network header

2016-12-01 Thread Zhang Shengju
Since offset is zero, it's not necessary to use set function. Reset function is straightforward, and will remove the unnecessary add operation in set function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 2 +-

[net-next 3/5] mlx4: use reset to set mac header

2016-12-01 Thread Zhang Shengju
Since offset is zero, it's not necessary to use set function. Reset function is straightforward, and will remove the unnecessary add operation in set function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/ethernet/mellanox/mlx4/en_selftest.c | 2 +-

[net-next 1/5] qede: use reset to set network header

2016-12-01 Thread Zhang Shengju
Since offset is zero, it's not necessary to use set function. Reset function is straightforward, and will remove the unnecessary add operation in set function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/ethernet/qlogic/qede/qede_main.c | 2 +- 1 file c

[net-next 0/5] use reset to set headers

2016-12-01 Thread Zhang Shengju
This patch serial replace 'set' function to 'reset', since the offset is zero. It's not necessary to use set, reset function is straightforward, and will remove the unnecessary add operation in set function. Zhang Shengju (5): qede: use reset to set network header bnx2x: use reset to set

[net-next 5/5] staging: wilc1000: use reset to set mac header

2016-12-01 Thread Zhang Shengju
Since offset is zero, it's not necessary to use set function. Reset function is straightforward, and will remove the unnecessary add operation in set function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/staging/wilc1000/linux_mon.c | 4 ++-- 1 file chan

[net-next 4/5] iwlwifi: use reset to set transport header

2016-12-01 Thread Zhang Shengju
Since offset is zero, it's not necessary to use set function. Reset function is straightforward, and will remove the unnecessary add operation in set function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 2 +- 1 file c

[net-next] rtnetlink: return the correct error code

2016-11-30 Thread Zhang Shengju
Before this patch, function ndo_dflt_fdb_dump() will always return code from uc fdb dump. The reture code of mc fdb dump is lost. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/core/rtnetlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ne

[net-next] neigh: remove duplicate check for same neigh

2016-11-29 Thread Zhang Shengju
to be scanned mulitple times. This patch make idx as the absolute index in the list, it will increase no matter whether the neigh is filtered. This will prevent the above problem. And this is in line with other dump functions. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.

[net-next] macvtap: replace printk with netdev_err

2016-11-28 Thread Zhang Shengju
This patch replaces printk() with netdev_err() for macvtap device. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/macvtap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index 5da9861..2

[net,v2] neigh: fix the loop index error in neigh dump

2016-11-27 Thread Zhang Shengju
Loop index in neigh dump function is not updated correctly under some circumstances, this patch will fix it. Fixes: 16660f0bd9 ("net: Add support for filtering neigh dump by device index") Fixes: 21fdd092ac ("net: Add support for filtering neigh dump by master device")

[iproute2] link: add team and team_slave link type

2016-11-25 Thread Zhang Shengju
Add missing team and team_slave link type. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- ip/iplink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ip/iplink.c b/ip/iplink.c index a8b49c5..1e603e7 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@

[net-next] neigh: fix the loop index error in neigh dump

2016-11-23 Thread Zhang Shengju
Loop index in neigh dump function is not updated correctly under some circumstances, this patch will fix it. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/core/neighbour.c | 39 ++- 1 file changed, 18 insertions(+), 21 del

[net] rtnetlink: fix the wrong minimal dump size getting from rtnl_calcit()

2016-11-21 Thread Zhang Shengju
-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/core/rtnetlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index f4b9350..09e115b 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -2734,7 +

[iproute2] libnetlink: reduce size of message sent to kernel

2016-11-19 Thread Zhang Shengju
This patch reduce the size of message sent to kernel space. Before this patch, for command: 'ip link show', we will sent 1056 bytes. With this patch, we only need to send 40 bytes. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- lib/libnetlink.c | 2 +- 1 file chan

[net-next] rtnl: fix the loop index update error in rtnl_dump_ifinfo()

2016-11-19 Thread Zhang Shengju
If the link is filtered out, loop index should also be updated. If not, loop index will not be correct. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/core/rtnetlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/rtnetlink.c b/ne

[iproute2] iproute2: fix the link group name getting error

2016-11-17 Thread Zhang Shengju
CAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 4e:3b:d3:6c:f0:e6 brd ff:ff:ff:ff:ff:ff 12: dummy1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group test qlen 1000 link/ether d6:9c:a4:1f:e7:e5 brd ff:ff:ff:ff:ff:ff Sign

[net-next] ovs: set name assign type of internal port

2016-05-31 Thread Zhang Shengju
Set name_assign_type of internal port to NET_NAME_USER. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/openvswitch/vport-internal_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch

[net-next] bond: set mac address only if necessary

2016-03-29 Thread Zhang Shengju
Bond device gets it's mac address from the first slave device, it's not necessary to set slave device's mac address to bond if equal. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/bonding/bond_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 del

[net-next] bond: output message before setting slave to inactive

2016-03-29 Thread Zhang Shengju
This patch moves output message before setting slave to inactive, this will print the correct status of slave device. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/bonding/bond_main.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff

[net-next 0/2] remove duplicate set of flag IFF_MULTICAST

2016-03-16 Thread Zhang Shengju
This patch series remove duplicate set of flag IFF_MULTICAST. Zhang Shengju (2): bonding: remove duplicate set of flag IFF_MULTICAST team: remove duplicate set of flag IFF_MULTICAST drivers/net/bonding/bond_main.c | 2 +- drivers/net/team/team.c | 1 - 2 files changed, 1 insertion

[net-next 2/2] team: remove duplicate set of flag IFF_MULTICAST

2016-03-16 Thread Zhang Shengju
Remove unnecessary set of flag IFF_MULTICAST, since ether_setup already does this. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/team/team.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 2

[net-next 1/2] bonding: remove duplicate set of flag IFF_MULTICAST

2016-03-16 Thread Zhang Shengju
Remove unnecessary set of flag IFF_MULTICAST, since ether_setup already does this. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/bonding/bond_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_main.c b/d

[net-next] net: fix a comment typo

2016-03-16 Thread Zhang Shengju
Fix a comment typo. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- include/uapi/linux/if.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h index 9cf2394..f802775 100644 --- a/include/uapi/linux/if.h

[net-next iproute2 v2 2/2] man: update netconf manual for new attributes

2016-03-14 Thread Zhang Shengju
Update this manual to add attributes proxy_neigh and ignore_routes_with_linkdown. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- man/man8/ip-netconf.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/man8/ip-netconf.8 b/man/man8/ip-netconf.8

[net-next iproute2 v2 0/2]netconf: add support for ignore route attribute

2016-03-14 Thread Zhang Shengju
This patch series add support for ignore route attribute. v1->v2: - update manual - use rta_getattr_* instead of RTA_DATA - fix code styles Zhang Shengju (2): netconf: add support for ignore route attribute man: update netconf manual for new attributes ip/ipnetconf.c|

[net-next iproute2 v2 1/2] netconf: add support for ignore route attribute

2016-03-14 Thread Zhang Shengju
Add support for ignore route attribute, and refine the code to use rta_getattr_* function to get attribute value. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- ip/ipnetconf.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --gi

[net-next,iproute2] netconf: add support for ignore route attribute

2016-03-13 Thread Zhang Shengju
Add support for ignore_routes_with_linkdown attribute. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- ip/ipnetconf.c | 4 1 file changed, 4 insertions(+) diff --git a/ip/ipnetconf.c b/ip/ipnetconf.c index eca6eee..6fec818 100644 --- a/ip/ipnetconf.c ++

[net-next] netconf: add macro to represent all attributes

2016-03-10 Thread Zhang Shengju
This patch adds macro NETCONFA_ALL to represent all type of netconf attributes for IPv4 and IPv6. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- include/uapi/linux/netconf.h | 1 + net/ipv4/devinet.c | 40 +++- ne

[net-next] arp: add macro to get drop_gratuitous_arp setting

2016-03-07 Thread Zhang Shengju
Add macro IN_DEV_DROP_GRATUITOUS_ARP to facilitate getting drop_gratuitous_arp value. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- include/linux/inetdevice.h | 3 +++ net/ipv4/arp.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/i

[net-next v2] arp: correct return value of arp_rcv

2016-03-04 Thread Zhang Shengju
led, call kfree_skb() instead of consume_skb(), then return the correct return value. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/ipv4/arp.c | 35 --- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/net/ipv4/arp.c b

[net-next v2 4/4] wireless: use reset to set mac header

2016-03-02 Thread Zhang Shengju
Since offset is zero, it's not necessary to use set function. Reset function is straightforward, and will remove the unnecessary add operation in set function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/wireless/util.c | 2 +- 1 file changed, 1 insertion

[net-next v2 2/4] mac80211_hwsim: use reset to set mac header

2016-03-02 Thread Zhang Shengju
Since offset is zero, it's not necessary to use set function. Reset function is straightforward, and will remove the unnecessary add operation in set function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/wireless/mac80211_hwsim.c | 4 ++-- 1 file chan

[net-next v2 0/4] use reset to set header pointers

2016-03-02 Thread Zhang Shengju
This patch series replace set function with reset when offset is zero. Changes since v1: - fix typo in commit message Zhang Shengju (4): vxlan: use reset to set header pointers mac80211_hwsim: use reset to set mac header mac80211: use reset to set header pointer wireless: use reset

[net-next v2 1/4] vxlan: use reset to set header pointers

2016-03-02 Thread Zhang Shengju
Since offset is zero, it's not necessary to use set function. Reset function is straightforward, and will remove the unnecessary add operation in set function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/vxlan.c | 6 +++--- 1 file changed, 3 insertions

[net-next v2 3/4] mac80211: use reset to set header pointer

2016-03-02 Thread Zhang Shengju
Since offset is zero, it's not necessary to use set function. Reset function is straightforward, and will remove the unnecessary add operation in set function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/mac80211/mesh_hwmp.c | 6 +++--- net/mac80211/rx.c

[net-next 0/4] use reset to set header pointers

2016-03-01 Thread Zhang Shengju
This patch series replace set function with reset when offset is zero. Zhang Shengju (4): vxlan: use reset to set header pointers mac80211_hwsim: use reset to set mac header mac80211: use reset to set header pointer wireless: use reset to set mac header drivers/net/vxlan.c

[net-next 2/4] mac80211_hwsim: use reset to set mac header

2016-03-01 Thread Zhang Shengju
Since offset is zeor, it's not necessary to use set function. Reset function is straightforward, and will remove the unnecessary add operation in set function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/wireless/mac80211_hwsim.c | 4 ++-- 1 file chan

[net-next 3/4] mac80211: use reset to set header pointer

2016-03-01 Thread Zhang Shengju
Since offset is zeor, it's not necessary to use set function. Reset function is straightforward, and will remove the unnecessary add operation in set function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/mac80211/mesh_hwmp.c | 6 +++--- net/mac80211/rx.c

[net-next 1/4] vxlan: use reset to set header pointers

2016-03-01 Thread Zhang Shengju
Since offset is zeor, it's not necessary to use set function. Reset function is straightforward, and will remove the unnecessary add operation in set function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/vxlan.c | 6 +++--- 1 file changed, 3 insertions

[net-next 4/4] wireless: use reset to set mac header

2016-03-01 Thread Zhang Shengju
Since offset is zeor, it's not necessary to use set function. Reset function is straightforward, and will remove the unnecessary add operation in set function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/wireless/util.c | 2 +- 1 file changed, 1 insertion

[net-next] arp: correct return value of arp_rcv

2016-02-29 Thread Zhang Shengju
Currently, arp_rcv() always return zero on a packet delivery upcall. To make its behavior more compliant with the way this API should be used, this patch changes this to let it return NET_RX_SUCCESS when the packet is proper handled, and NET_RX_DROP otherwise. Signed-off-by: Zhang Shengju

[net v2] net: fix double free issue of skbuff

2016-02-29 Thread Zhang Shengju
If skb_reorder_vlan_header() failed, skb is freed and NULL is returned. Then at skb_vlan_untag(), it will free skbuff again which cause double free. This patch removes kfree_skb() call in function skb_reorder_vlan_header(). Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.

[net] net: fix double free issue of skbuff

2016-02-29 Thread Zhang Shengju
If skb_reorder_vlan_header() failed, skb is freed and NULL is returned. Then at skb_vlan_untag(), it will free skbuff again which cause double free. This patch removes kfree_skb() call in function skb_reorder_vlan_header(). Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.

[net-next] net: pktgen: use reset to set mac header

2016-02-29 Thread Zhang Shengju
Since offset is zero, it's not necessary to use set function. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/core/pktgen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 1474cfd..20999aa

[net-next] vlan: turn on unicast filtering on vlan device

2016-02-18 Thread Zhang Shengju
needlessly. If underlying device does not support unicast filtering, that device will enter promiscuous mode. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/8021q/vlan.c | 1 - net/8021q/vlan_dev.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff

[net-next v2] vlan: change return type of vlan_proc_rem_dev

2016-02-17 Thread Zhang Shengju
Since function vlan_proc_rem_dev() will only return 0, it's better to return void instead of int. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/8021q/vlanproc.c | 3 +-- net/8021q/vlanproc.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git

[net-next] vlan: change return type of vlan_proc_rem_dev

2016-02-17 Thread Zhang Shengju
Since function vlan_proc_rem_dev() will only return 0, it's better to return void instead of int. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- net/8021q/vlanproc.c | 3 +-- net/8021q/vlanproc.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git

[net-next] macvlan: convert to use IFF_NO_QUEUE

2016-02-14 Thread Zhang Shengju
Use IFF_NO_QUEUE to indicate that a device can run without a qdisc. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/macvlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 94e6888..4

[net-next v2] bonding: use return instead of goto

2016-02-09 Thread Zhang Shengju
for the following three places, they changed neither bond mac address nor type. It's straightforward to return directly. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/bonding/bond_main.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff

[net] bonding: use return instead of goto

2016-02-02 Thread Zhang Shengju
Replace 'goto' with 'return' to remove unnecessary check at label: err_undo_flags. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/bonding/bond_main.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/bonding/bond_ma

[PATCH] bonding: add slave device name for debug

2016-02-02 Thread Zhang Shengju
netdev_dbg() will add bond device name, it will be helpful if we print slave device name. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/bonding/bond_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/bond_ma

[net] bonding: trivial: style fixes

2016-02-02 Thread Zhang Shengju
remove some redudant brackets, use sizeof(*) instead of sizeof(struct x). Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/bonding/bond_main.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/d

[PATCH] i40e: fix build warnings

2016-01-21 Thread Zhang Shengju
: 'i40e_add_geneve_port' defined but not used [-Wunused-function] drivers/net/ethernet/intel/i40e/i40e_main.c:8651:13: warning: 'i40e_del_geneve_port' defined but not used [-Wunused-function] Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- drivers/net/ethernet/intel/i40e/i40e_main.

[PATCH iproute2] ip-link: remove warning message

2016-01-20 Thread Zhang Shengju
the warning was: iproute.c:301:12: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized] features &= ~RTAX_FEATURE_ECN; ^ iproute.c:575:10: note: 'val' was declared here __u32 val; ^ Signed-off-by: Zhang Shengju <zh

[PATCH iproute2] ip-link: remove unnecessary return

2015-08-13 Thread Zhang Shengju
Remove unnecessary retrun, because invarg() exit. Signed-off-by: Zhang Shengju zhangshen...@cmss.chinamobile.com --- ip/iplink_bridge.c | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c index e704e29

[PATCH iproute2] ip-link: enhance prompt message

2015-08-13 Thread Zhang Shengju
Enhance promtp message for 'spoofchk' and 'query_rss' flag, and fix a typo. Signed-off-by: Zhang Shengju zhangshen...@cmss.chinamobile.com --- ip/iplink.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ip/iplink.c b/ip/iplink.c index 1836889..520f750 100644 --- a/ip

[PATCH iproute2] utils: add missing return value

2015-08-13 Thread Zhang Shengju
Add missing return value to fix warnings Signed-off-by: Zhang Shengju zhangshen...@cmss.chinamobile.com --- include/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/utils.h b/include/utils.h index 95d162c..0c57ccd 100644 --- a/include/utils.h +++ b/include

[PATCH iproute2 2/2] netns: add missing file close

2015-08-13 Thread Zhang Shengju
Add missing file close. Signed-off-by: Zhang Shengju zhangshen...@cmss.chinamobile.com --- ip/ipnetns.c | 5 + 1 file changed, 5 insertions(+) diff --git a/ip/ipnetns.c b/ip/ipnetns.c index 088096f..d1af0c6 100644 --- a/ip/ipnetns.c +++ b/ip/ipnetns.c @@ -462,8 +462,10 @@ static int

[PATCH iproute2 0/2] Add missing file close

2015-08-13 Thread Zhang Shengju
This patch set adds some missing close() calls. Zhang Shengju (2): libs: close file in netns_switch() netns: add missing file close ip/ipnetns.c| 5 + lib/namespace.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) -- 1.8.3.1 -- To unsubscribe from this list: send

[PATCH iproute2 1/2] libs: close file in netns_switch()

2015-08-13 Thread Zhang Shengju
Add mising close() calls. Signed-off-by: Zhang Shengju zhangshen...@cmss.chinamobile.com --- lib/namespace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/namespace.c b/lib/namespace.c index 8197165..025ed47 100644 --- a/lib/namespace.c +++ b/lib/namespace.c

[PATCH iproute2] ip-link: cut one level indentation

2015-08-13 Thread Zhang Shengju
Cut one level indentation to make things easier to read. Signed-off-by: Zhang Shengju zhangshen...@cmss.chinamobile.com --- ip/iplink.c | 65 +++-- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/ip/iplink.c b/ip/iplink.c

[PATCH iproute2 0/3] iplink: shortify printing the usage of bridge

2015-08-12 Thread Zhang Shengju
This patch set enables bridge related links to print usage with short format. Or else it is needed to use the following way: ip link { add | del | set } type TYPE help Zhang Shengju (3): iplink: add missing link type iplink: use the short format to print help info iplink

[PATCH iproute2 2/3] iplink: use the short format to print help info

2015-08-12 Thread Zhang Shengju
Allow to print link type usage by: ip link help bridge Signed-off-by: Zhang Shengju zhangshen...@cmss.chinamobile.com --- ip/iplink_bridge.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c index 297160c..1e69960 100644

[PATCH iproute2] ip-link: fix a typo in help message

2015-08-12 Thread Zhang Shengju
fix a typo: noarp - arp Signed-off-by: Zhang Shengju zhangshen...@cmss.chinamobile.com --- ip/iplink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip/iplink.c b/ip/iplink.c index 7e5c466..fa8aa47 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -507,7 +507,7 @@ int

[PATCH iproute2] ip: replace exit with return

2015-08-11 Thread Zhang Shengju
In our manual, we have this description of 'EXIT STATUS': Exit status is 0 if command was successful, and 1 if there is a syntax error. But we exit in command functions with code -1 when there is a syntax error. It's better to use return. Signed-off-by: Zhang Shengju zhangshen

[PATCH iproute2] xfrm: remove duplicated include

2015-07-25 Thread Zhang Shengju
Remove dupldated include for linux/xfrm.h, since it's already included by 'xfrm.h'. Signed-off-by: Zhang Shengju zhangshen...@cmss.chinamobile.com --- ip/ipxfrm.c | 1 - ip/xfrm_monitor.c | 1 - ip/xfrm_policy.c | 1 - ip/xfrm_state.c | 1 - 4 files changed, 4 deletions(-) diff --git

[PATCH iproute2] ip: replace white-spaces with tabs

2015-07-25 Thread Zhang Shengju
Replace white-spaces with tabs Signed-off-by: Zhang Shengju zhangshen...@cmss.chinamobile.com --- ip/ip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ip/ip.c b/ip/ip.c index c23de74..78134f9 100644 --- a/ip/ip.c +++ b/ip/ip.c @@ -64,7 +64,7 @@ static void usage(void

[PATCH] ip/ip6tunnel: fix missing return value check

2015-07-24 Thread Zhang Shengju
Make sure that return value of each socket() call is properly checked and do not continue processing if the call failed. Signed-off-by: Zhang Shengju zhangshen...@cmss.chinamobile.com --- ip/tunnel.c | 24 1 file changed, 24 insertions(+) diff --git a/ip/tunnel.c b/ip