[PATCH net-next V3 2/3] vhost_net: tx batching

2016-12-29 Thread Jason Wang
This patch tries to utilize tuntap rx batching by peeking the tx virtqueue during transmission, if there's more available buffers in the virtqueue, set MSG_MORE flag for a hint for backend (e.g tuntap) to batch the packets. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 23 +

[PATCH net-next V3 0/3] vhost_net tx batching

2016-12-29 Thread Jason Wang
Hi: This series tries to implement tx batching support for vhost. This was done by using MSG_MORE as a hint for under layer socket. The backend (e.g tap) can then batch the packets temporarily in a list and submit it all once the number of bacthed exceeds a limitation. Tests shows obvious improve

[PATCH net-next V3 3/3] tun: rx batching

2016-12-29 Thread Jason Wang
We can only process 1 packet at one time during sendmsg(). This often lead bad cache utilization under heavy load. So this patch tries to do some batching during rx before submitting them to host network stack. This is done through accepting MSG_MORE as a hint from sendmsg() caller, if it was set,

[PATCH net-next V3 1/3] vhost: better detection of available buffers

2016-12-29 Thread Jason Wang
This patch tries to do several tweaks on vhost_vq_avail_empty() for a better performance: - check cached avail index first which could avoid userspace memory access. - using unlikely() for the failure of userspace access - check vq->last_avail_idx instead of cached avail index as the last step.

Re: [PATCH net-next V2 3/3] tun: rx batching

2016-12-29 Thread Jason Wang
On 2016年12月30日 00:35, David Miller wrote: From: Jason Wang Date: Wed, 28 Dec 2016 16:09:31 +0800 + spin_lock(&queue->lock); + qlen = skb_queue_len(queue); + if (qlen > rx_batched) + goto drop; + __skb_queue_tail(queue, skb); + if (!more || qlen + 1

Re: [PATCH] igmp: Make igmp group member RFC 3376 compliant

2016-12-29 Thread David Miller
From: Michal Tesar Date: Wed, 7 Dec 2016 13:38:57 +0100 > would it be possible to have another look at this patch and reconsider > its behavior? I really believe that current code does not behave > correctly. Please resubmit your patch.

Re: [PATCH net] net: ipv4: dst for local input routes should use l3mdev if relevant

2016-12-29 Thread David Miller
From: David Ahern Date: Thu, 29 Dec 2016 15:29:03 -0800 > IPv4 output routes already use l3mdev device instead of loopback for dst's > if it is applicable. Change local input routes to do the same. > > This fixes icmp responses for unreachable UDP ports which are directed > to the wrong table af

Re: [PATCH net-next] liquidio: optimize reads from Octeon PCI console

2016-12-29 Thread David Miller
From: Felix Manlunas Date: Thu, 29 Dec 2016 17:04:47 -0800 > Reads from Octeon PCI console are inefficient because before each read > operation, a dynamic mapping to Octeon DRAM is set up. This patch replaces > the repeated setup of a dynamic mapping with a one-time setup of a static > mapping.

Re: [PATCH net-next rfc 0/6] convert tc_verd to integer bitfields

2016-12-29 Thread David Miller
From: Willem de Bruijn Date: Wed, 28 Dec 2016 14:13:24 -0500 > The skb tc_verd field takes up two bytes but uses far fewer bits. > Convert the remaining use cases to bitfields that fit in existing > holes (depending on config options) and potentially save the two > bytes in struct sk_buff. I lik

Re: [PATCH net-next] net: dsa: Implement ndo_get_phys_port_id

2016-12-29 Thread David Miller
From: Florian Fainelli Date: Thu, 29 Dec 2016 14:20:56 -0800 > Implement ndo_get_phys_port_id() by returning the physical port number > of the switch this per-port DSA created network interface corresponds > to. > > Signed-off-by: Florian Fainelli Applied, thanks.

Re: [PATCH] sh_eth: fix branch prediction in sh_eth_interrupt()

2016-12-29 Thread David Miller
From: Sergei Shtylyov Date: Fri, 30 Dec 2016 00:07:38 +0300 > IIUC, likely()/unlikely() should apply to the whole *if* statement's > expression, not a part of it -- fix such expression in sh_eth_interrupt() > accordingly... > > Fixes: 283e38db65e7 ("sh_eth: Fix serialisation of interrupt disab

Re: [net-next PATCH 0/6] i40e: Add VF port representator support or SR-IOV VFs

2016-12-29 Thread David Miller
From: Sridhar Samudrala Date: Thu, 29 Dec 2016 22:20:57 -0800 > - Patch 1 introduces devlink interface to get/set the mode of SRIOV switch. > - Patch 2 adds support to create VF port representor(VFPR) netdevs associated > with SR-IOV VFs that can be used to control/configure VFs from PF name >

Re: [net-next PATCH 2/6] i40e: Introduce VF Port Representator(VFPR) netdevs.

2016-12-29 Thread David Miller
From: Sridhar Samudrala Date: Thu, 29 Dec 2016 22:20:59 -0800 > /* VF resources get allocated during reset */ > i40e_reset_vf(&vfs[i], false); > > + if (pf->eswitch_mode == DEVLINK_ESWITCH_MODE_SWITCHDEV) > + i40e_alloc_vfpr_netdev(&vf

[PATCH v4 1/2] net: 3com: typhoon: typhoon_init_one: fix incorrect return values

2016-12-29 Thread Thomas Preisner
In a few cases the err-variable is not set to a negative error code if a function call in typhoon_init_one() fails and thus 0 is returned instead. It may be better to set err to the appropriate negative error code before returning. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188841 Repo

Re: Re: [PATCH v3 2/2] drivers: net: ethernet: 3com: fix return value

2016-12-29 Thread Thomas Preisner
On Tue, 2016-12-27 at 22:17:35 +0100, David Dillow wrote: >On Sun, 2016-12-25 at 01:30 +0100, Thomas Preisner wrote: >> In some cases the return value of a failing function is not being used >> and the function typhoon_init_one() returns another negative error >> code instead. > >I'm not sure these

[PATCH v4 2/2] net: 3com: typhoon: typhoon_init_one: make return values more specific

2016-12-29 Thread Thomas Preisner
In some cases the return value of a failing function is not being used and the function typhoon_init_one() returns another negative error code instead. Signed-off-by: Thomas Preisner Signed-off-by: Milan Stephan --- drivers/net/ethernet/3com/typhoon.c | 16 1 file changed, 8 in

Re: [PATCH net-next] liquidio: optimize reads from Octeon PCI console

2016-12-29 Thread Felix Manlunas
Chickles, Derek wrote on Thu [2016-Dec-29 17:42:34 -0800]: > > #ifdef __BIG_ENDIAN_BITFIELD > > static inline void > > @@ -96,6 +96,25 @@ __octeon_pci_rw_core_mem(struct octeon_device > > *oct, u64 addr, > > u32 copy_len = 0, index_reg_val = 0; > > unsigned long flags; > > u8 __iome

Re: [PATCH 1/1] r8169: fix the typo

2016-12-29 Thread Yanjun Zhu
Hi, Please comment on this patch. Zhu Yanjun On 2016/12/29 11:11, Zhu Yanjun wrote: >From the realtek data sheet, the PID0 should be bit 0. Signed-off-by: Zhu Yanjun --- drivers/net/ethernet/realtek/r8169.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/et

RE: [PATCH net-next] liquidio: optimize reads from Octeon PCI console

2016-12-29 Thread Chickles, Derek
> #ifdef __BIG_ENDIAN_BITFIELD > static inline void > @@ -96,6 +96,25 @@ __octeon_pci_rw_core_mem(struct octeon_device > *oct, u64 addr, > u32 copy_len = 0, index_reg_val = 0; > unsigned long flags; > u8 __iomem *mapped_addr; > + u64 static_mapping_base; > + > + static_m

Re: [PATCH v5] net: dev_weight: TX/RX orthogonality

2016-12-29 Thread David Miller
From: Matthias Tafelmeier Date: Thu, 29 Dec 2016 21:37:21 +0100 > Oftenly, introducing side effects on packet processing on the other half > of the stack by adjusting one of TX/RX via sysctl is not desirable. > There are cases of demand for asymmetric, orthogonal configurability. > > This holds

[PATCH net-next] liquidio: optimize reads from Octeon PCI console

2016-12-29 Thread Felix Manlunas
Reads from Octeon PCI console are inefficient because before each read operation, a dynamic mapping to Octeon DRAM is set up. This patch replaces the repeated setup of a dynamic mapping with a one-time setup of a static mapping. Signed-off-by: Felix Manlunas Signed-off-by: Raghu Vatsavayi Signe

[PATCH net-next] net: Allow IP_MULTICAST_IF to set index to L3 slave

2016-12-29 Thread David Ahern
IP_MULTICAST_IF fails if sk_bound_dev_if is already set and the new index does not match it. e.g., ntpd[15381]: setsockopt IP_MULTICAST_IF 192.168.1.23 fails: Invalid argument Relax the check in setsockopt to allow setting mc_index to an L3 slave if sk_bound_dev_if points to an L3 master. Ma

[PATCH net] net: ipv4: dst for local input routes should use l3mdev if relevant

2016-12-29 Thread David Ahern
IPv4 output routes already use l3mdev device instead of loopback for dst's if it is applicable. Change local input routes to do the same. This fixes icmp responses for unreachable UDP ports which are directed to the wrong table after commit 9d1a6c4ea43e4 because local_input routes use the loopback

[PATCH net-next] net: dsa: Implement ndo_get_phys_port_id

2016-12-29 Thread Florian Fainelli
Implement ndo_get_phys_port_id() by returning the physical port number of the switch this per-port DSA created network interface corresponds to. Signed-off-by: Florian Fainelli --- net/dsa/slave.c | 12 1 file changed, 12 insertions(+) diff --git a/net/dsa/slave.c b/net/dsa/slave.c

[PATCH][V2] [media] gp8psk: fix spelling mistake: "firmare" -> "firmware"

2016-12-29 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in err message. Also change "don't" to "does not". Signed-off-by: Colin Ian King --- drivers/media/usb/dvb-usb/gp8psk.c | 2 +- drivers/net/wireless/realtek/rtlwifi/core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) di

Re: [PATCH] [media] gp8psk: fix spelling mistake: "firmare" -> "firmware"

2016-12-29 Thread Colin Ian King
On 29/12/16 21:23, VDR User wrote: >> - err("firmare chunk size bigger than 64 bytes."); >> + err("firmware chunk size bigger than 64 bytes."); > > Yup. > >> -"HW don't support CMAC encrypiton, use software >> CMAC encrypiton\n"

[net-next PATCH 5/6] i40e: Add TX and RX support in switchdev mode.

2016-12-29 Thread Sridhar Samudrala
In switchdev mode, broadcast filter is not enabled on VFs, The broadcasts and unknown frames from VFs are received by the PF and passed to corresponding VF port representator netdev. A host based switching entity like a linux bridge or OVS redirects these frames to the right VFs via VFPR netdevs. A

[net-next PATCH 6/6] i40e: Add support for exposing VF port statistics via VFPR netdev on the host.

2016-12-29 Thread Sridhar Samudrala
By default stats counted by HW are returned via the original ndo_get_stats64() api. Stats counted in SW are returned via ndo_get_offload_stats() api. Small script to demonstrate vfpr stats in switchdev mode. PF: enp5s0f0, VFs: enp5s2,enp5s2f1 VFPRs:enp5s0f0-vf0, enp5s0f0-vf1 # rmmod i40e; modprob

[net-next PATCH 3/6] i40e: Sync link state between VFs and VFPRs

2016-12-29 Thread Sridhar Samudrala
This patch enables - reflecting the link state of VFPR based on VF admin state & link state of VF based on admin state of VFPR. - bringing up/down the VFPR sends a notification to update VF link state. - bringing up/down the VF will cause the link state update of VFPR. - enable/disable VF link st

[net-next PATCH 2/6] i40e: Introduce VF Port Representator(VFPR) netdevs.

2016-12-29 Thread Sridhar Samudrala
VF Port Representator netdevs are created for each VF if the switch mode is set to 'switchdev'. These netdevs can be used to control and configure VFs from PFs namespace. They enable exposing VF statistics, configure and monitor link state, mtu, filters, fdb/vlan entries etc. of VFs. Broadcast filt

[net-next PATCH 1/6] i40e: Introduce devlink interface.

2016-12-29 Thread Sridhar Samudrala
Add initial devlink support to get/set the mode of SRIOV switch. This patch sets the default mode as 'legacy' and enables getting the mode and and setting it to 'legacy'. The switch mode can be get/set via following 'devlink' commands. # devlink dev eswitch show pci/:05:00.0 pci/:05:00.0:

[net-next PATCH 0/6] i40e: Add VF port representator support or SR-IOV VFs

2016-12-29 Thread Sridhar Samudrala
- Patch 1 introduces devlink interface to get/set the mode of SRIOV switch. - Patch 2 adds support to create VF port representor(VFPR) netdevs associated with SR-IOV VFs that can be used to control/configure VFs from PF name space. - Patch 3 enables syncing link state between VFs and VFPRs. - Pat

Re: [PATCH] [media] gp8psk: fix spelling mistake: "firmare" -> "firmware"

2016-12-29 Thread VDR User
> - err("firmare chunk size bigger than 64 bytes."); > + err("firmware chunk size bigger than 64 bytes."); Yup. > -"HW don't support CMAC encrypiton, use software CMAC > encrypiton\n"); > +"HW don't suppo

[PATCH] sh_eth: fix branch prediction in sh_eth_interrupt()

2016-12-29 Thread Sergei Shtylyov
IIUC, likely()/unlikely() should apply to the whole *if* statement's expression, not a part of it -- fix such expression in sh_eth_interrupt() accordingly... Fixes: 283e38db65e7 ("sh_eth: Fix serialisation of interrupt disable with interrupt & NAPI handlers") Signed-off-by: Sergei Shtylyov --

Re: [PATCH] rtlwifi: fix spelling mistake: "contry" -> "country"

2016-12-29 Thread Larry Finger
On 12/29/2016 10:00 AM, Colin King wrote: From: Colin Ian King trivial fix to spelling mistake in RT_TRACE message Signed-off-by: Colin Ian King Acked-by: Larry Finger Larry --- drivers/net/wireless/realtek/rtlwifi/regd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --gi

[PATCH v5] net: dev_weight: TX/RX orthogonality

2016-12-29 Thread Matthias Tafelmeier
Oftenly, introducing side effects on packet processing on the other half of the stack by adjusting one of TX/RX via sysctl is not desirable. There are cases of demand for asymmetric, orthogonal configurability. This holds true especially for nodes where RPS for RFS usage on top is configured and t

[PATCH] [media] gp8psk: fix spelling mistake: "firmare" -> "firmware"

2016-12-29 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in err message Signed-off-by: Colin Ian King --- drivers/media/usb/dvb-usb/gp8psk.c | 2 +- drivers/net/wireless/realtek/rtlwifi/core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/dvb-usb

[PATCH] wlcore: fix spelling mistake in wl1271_warning

2016-12-29 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake of function name in wl1271_warning, should be dynamic_ps_timeout instead of dyanmic_ps_timeout. Signed-off-by: Colin Ian King --- drivers/net/wireless/ti/wlcore/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dr

Re: [PATCH] stmmac: adding EEE to GMAC4

2016-12-29 Thread David Miller
From: Joao Pinto Date: Thu, 29 Dec 2016 17:10:27 + > This patch adds Energy Efficiency Ethernet to GMAC4. > > Signed-off-by: Joao Pinto Applied, thanks.

Re: [PATCH v4] net: dev_weight: TX/RX orthogonality

2016-12-29 Thread Matthias Tafelmeier
> Actually, reverted, you didn't even build test this: > > net/core/dev.c:3433:35: error: initializer element is not constant > int dev_rx_weight __read_mostly = weight_p; >^~~~ > net/core/dev.c:3434:35: error: initializer element is not constant > int dev

Re: [PATCH v4] net: dev_weight: TX/RX orthogonality

2016-12-29 Thread David Miller
Actually, reverted, you didn't even build test this: net/core/dev.c:3433:35: error: initializer element is not constant int dev_rx_weight __read_mostly = weight_p; ^~~~ net/core/dev.c:3434:35: error: initializer element is not constant int dev_tx_weight __

Re: [PATCH v4] net: dev_weight: TX/RX orthogonality

2016-12-29 Thread David Miller
From: Matthias Tafelmeier Date: Thu, 29 Dec 2016 20:23:18 +0100 > Oftenly, introducing side effects on packet processing on the other half > of the stack by adjusting one of TX/RX via sysctl is not desirable. > There are cases of demand for asymmetric, orthogonal configurability. > > This holds

Re: [PATCH net-next] sctp: refactor sctp_datamsg_from_user

2016-12-29 Thread David Miller
From: Marcelo Ricardo Leitner Date: Thu, 29 Dec 2016 15:53:28 -0200 > This patch refactors sctp_datamsg_from_user() in an attempt to make it > better to read and avoid code duplication for handling the last > fragment. > > It also avoids doing division and remaining operations. Even though, it >

Re: [PATCH net-next 00/14] bnxt_en: updates for net-next.

2016-12-29 Thread David Miller
From: Michael Chan Date: Thu, 29 Dec 2016 12:13:30 -0500 > This patch series for net-next contains cleanups, new features and minor > fixes. The driver specific busy polling code is removed to use busy > polling support in core networking. Hardware RFS support is enhanced with > added ipv6 flow

[PATCH v4] net: dev_weight: TX/RX orthogonality

2016-12-29 Thread Matthias Tafelmeier
Oftenly, introducing side effects on packet processing on the other half of the stack by adjusting one of TX/RX via sysctl is not desirable. There are cases of demand for asymmetric, orthogonal configurability. This holds true especially for nodes where RPS for RFS usage on top is configured and t

Re: [PATCH net 0/5] mlx4 misc fixes

2016-12-29 Thread David Miller
From: Tariq Toukan Date: Thu, 29 Dec 2016 18:37:08 +0200 > This patchset contains several bug fixes from the team to the > mlx4 Eth and Core drivers. > > Series generated against net commit: > 60133867f1f1 'net: wan: slic_ds26522: fix spelling mistake: "configurated" -> > "configured"' Series

Re: [PATCH v4] net: dev_weight: TX/RX orthogonality

2016-12-29 Thread David Miller
From: Matthias Tafelmeier Date: Thu, 29 Dec 2016 10:58:41 +0100 > Oftenly, introducing side effects on packet processing on the other half > of the stack by adjusting one of TX/RX via sysctl is not desirable. > There are cases of demand for asymmetric, orthogonal configurability. > > This holds

Re: [PATCH v2] net: fix incorrect original ingress device index in PKTINFO

2016-12-29 Thread David Miller
From: Wei Zhang Date: Thu, 29 Dec 2016 16:45:04 +0800 > When we send a packet for our own local address on a non-loopback > interface (e.g. eth0), due to the change had been introduced from > commit 0b922b7a829c ("net: original ingress device index in PKTINFO"), the > original ingress device inde

Re: [PATCH net] rtnl: stats - add missing netlink message size checks

2016-12-29 Thread David Miller
From: Mathias Krause Date: Wed, 28 Dec 2016 17:52:15 +0100 > We miss to check if the netlink message is actually big enough to contain > a struct if_stats_msg. > > Add a check to prevent userland from sending us short messages that would > make us access memory beyond the end of the message. >

Re: [PATCH] tc: add missing limits.h header

2016-12-29 Thread Stephen Hemminger
On Thu, 22 Dec 2016 20:52:48 +0200 Baruch Siach wrote: > This fixes under musl build issues like: > > f_matchall.c: In function ‘matchall_parse_opt’: > f_matchall.c:48:12: error: ‘LONG_MIN’ undeclared (first use in this function) >if (h == LONG_MIN || h == LONG_MAX) { > ^ > f_mat

Re: [PATCH iproute2] fix typo in ip-xfrm man page, rmd610 -> rmd160

2016-12-29 Thread Stephen Hemminger
On Fri, 23 Dec 2016 14:03:16 +0300 Alexey Kodanev wrote: > Signed-off-by: Alexey Kodanev Applied.

Re: [PATCH iproute2 net-next] tc: flower: support matching flags

2016-12-29 Thread Stephen Hemminger
On Wed, 28 Dec 2016 15:06:49 +0200 Paul Blakey wrote: > Enhance flower to support matching on flags. > > The 1st flag allows to match on whether the packet is > an IP fragment. > > Example: > > # add a flower filter that will drop fragmented packets > # (bit 0 of control flags) >

[PATCH net-next] sctp: refactor sctp_datamsg_from_user

2016-12-29 Thread Marcelo Ricardo Leitner
This patch refactors sctp_datamsg_from_user() in an attempt to make it better to read and avoid code duplication for handling the last fragment. It also avoids doing division and remaining operations. Even though, it should still operate similarly as before this patch. Signed-off-by: Marcelo Rica

RE: [Open-FCoE] [PATCH RFC net-next 1/5] qed: Add support for hardware offloaded FCoE.

2016-12-29 Thread Mintz, Yuval
> > +struct fcoe_tstorm_fcoe_task_st_ctx_read_write { > > + union fcoe_cleanup_addr_exp_ro_union > cleanup_addr_exp_ro_union; > > + __le16 flags; > > +#define > FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_RX_SGL_MODE_MASK > 0x7 > > +#define > FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_RX_SGL_MODE_SHIF

[PATCH v1 1/2] bpf: add a longest prefix match trie map implementation

2016-12-29 Thread Daniel Mack
This trie implements a longest prefix match algorithm that can be used to match IP addresses to a stored set of ranges. Internally, data is stored in an unbalanced trie of nodes that has a maximum height of n, where n is the prefixlen the trie was created with. Tries may be created with prefix le

[PATCH v1 2/2] bpf: Add tests for the lpm trie map

2016-12-29 Thread Daniel Mack
From: David Herrmann The first part of this program runs randomized tests against the lpm-bpf-map. It implements a "Trivial Longest Prefix Match" (tlpm) based on simple, linear, single linked lists. The implementation should be pretty straightforward. Based on tlpm, this inserts randomized data

[PATCH v1 0/2] bpf: add longest prefix match map

2016-12-29 Thread Daniel Mack
This patch set adds a longest prefix match algorithm that can be used to match IP addresses to a stored set of ranges. It is exposed as a bpf map type. Internally, data is stored in an unbalanced tree of nodes that has a maximum height of n, where n is the prefixlen the trie was created with.

[PATCH net-next 13/14] bnxt_en: Handle no aggregation ring gracefully.

2016-12-29 Thread Michael Chan
The current code assumes that we will always have at least 2 rx rings, 1 will be used as an aggregation ring for TPA and jumbo page placements. However, it is possible, especially on a VF, that there is only 1 rx ring available. In this scenario, the current code will fail to initialize. To handle

[PATCH net-next 12/14] bnxt_en: Set default completion ring for async events.

2016-12-29 Thread Michael Chan
With the added support for the bnxt_re RDMA driver, both drivers can be allocating completion rings in any order. The firmware does not know which completion ring should be receiving async events. Add an extra step to tell firmware the completion ring number for receiving async events after bnxt_

[PATCH net-next 06/14] bnxt_en: Add function to get vnic capability.

2016-12-29 Thread Michael Chan
The new vnic RSS capability will enhance NTUPLE support, to be added in subsequent patches. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 22 + drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h |

[PATCH net-next 04/14] bnxt_en: Fix and clarify link_info->advertising.

2016-12-29 Thread Michael Chan
The advertising field is closely related to the auto_link_speeds field. The former is the user setting while the latter is the firmware setting. Both should be u16. We should use the advertising field in bnxt_get_link_ksettings because the auto_link_speeds field may not be updated with the latest

[PATCH net-next 11/14] bnxt_en: Implement new scheme to reserve tx rings.

2016-12-29 Thread Michael Chan
In order to properly support TX rate limiting in SRIOV VF functions or NPAR functions, firmware needs better control over tx ring allocations. The new scheme requires the driver to reserve the number of tx rings and to query to see if the requested number of tx rings is reserved. The driver will us

[PATCH net-next 07/14] bnxt_en: Refactor code that determines RFS capability.

2016-12-29 Thread Michael Chan
Add function bnxt_rfs_supported() that determines if the chip supports RFS. Refactor the existing function bnxt_rfs_capable() that determines if run-time conditions support RFS. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 38 +++ 1 fil

[PATCH net-next 09/14] bnxt_en: Assign additional vnics to VFs.

2016-12-29 Thread Michael Chan
Assign additional vnics to VFs whenever possible so that NTUPLE can be supported on the VFs. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/

[PATCH net-next 14/14] MAINTAINERS: Add bnxt_en maintainer info.

2016-12-29 Thread Michael Chan
Signed-off-by: Michael Chan --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index cfff2c9..11904a9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2605,6 +2605,12 @@ L: netdev@vger.kernel.org S: Supported F: drivers/net/ethernet/b

[PATCH net-next 03/14] bnxt_en: Improve the IRQ disable sequence during shutdown.

2016-12-29 Thread Michael Chan
The IRQ is disabled by writing to the completion ring doorbell. This should be done before the hardware completion ring is freed for correctness. The current code disables IRQs after all the completion rings are freed. Fix it by calling bnxt_disable_int_sync() before freeing the completion rings.

[PATCH net-next 08/14] bnxt_en: Add new hardware RFS mode.

2016-12-29 Thread Michael Chan
The existing hardware RFS mode uses one hardware RSS context block per ring just to calculate the RSS hash. This is very wasteful and prevents VF functions from using it. The new hardware mode shares the same hardware RSS context for RSS placement and RFS steering. This allows VFs to enable RFS.

[PATCH net-next 01/14] bnxt_en: Remove busy poll logic in the driver.

2016-12-29 Thread Michael Chan
Use native NAPI polling instead. The next patch will complete the work by switching to use napi_complete_done() Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 53 + drivers/net/ethernet/broadcom/bnxt/bnxt.h | 99 --- 2 fil

[PATCH net-next 02/14] bnxt_en: Use napi_complete_done()

2016-12-29 Thread Michael Chan
For better busy polling and GRO support. Do not re-arm IRQ if napi_complete_done() returns false. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drive

[PATCH net-next 10/14] bnxt_en: Add IPV6 hardware RFS support.

2016-12-29 Thread Michael Chan
Accept ipv6 flows in .ndo_rx_flow_steer() and support ETHTOOL_GRXCLSRULE ipv6 flows. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 32 +++--- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 53 +-- 2 files changed, 66 insertio

[PATCH net-next 00/14] bnxt_en: updates for net-next.

2016-12-29 Thread Michael Chan
This patch series for net-next contains cleanups, new features and minor fixes. The driver specific busy polling code is removed to use busy polling support in core networking. Hardware RFS support is enhanced with added ipv6 flows support and VF support. A new scheme to allocate TX rings from t

[PATCH net-next 05/14] bnxt_en: Refactor TPA code path.

2016-12-29 Thread Michael Chan
Call tcp_gro_complete() in the common code path instead of the chip- specific method. The newer 5731x method is missing the call. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/

[PATCH] stmmac: adding EEE to GMAC4

2016-12-29 Thread Joao Pinto
This patch adds Energy Efficiency Ethernet to GMAC4. Signed-off-by: Joao Pinto --- drivers/net/ethernet/stmicro/stmmac/dwmac4.h | 12 + drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 59 +++ 2 files changed, 71 insertions(+) diff --git a/drivers/net/ethernet/st

Re: [PATCH net] net: stmmac: Fix error path after register_netdev move

2016-12-29 Thread David Miller
From: Florian Fainelli Date: Wed, 28 Dec 2016 15:44:41 -0800 > Commit 5701659004d6 ("net: stmmac: Fix race between stmmac_drv_probe and > stmmac_open") re-ordered how the MDIO bus registration and the network > device are registered, but missed to unwind the MDIO bus registration in > case we fai

Re: [PATCH] drivers: atm: eni: rename macro DAUGTHER_ID to fix spelling mistake

2016-12-29 Thread David Miller
From: Colin King Date: Wed, 28 Dec 2016 17:31:20 + > From: Colin Ian King > > Rename DAUGTHER_ID to DAUGHTER_ID to fix spelling mistake > > Signed-off-by: Colin Ian King Applied.

Re: ipv6: remove unnecessary inet6_sk check

2016-12-29 Thread David Miller
From: Dave Jones Date: Wed, 28 Dec 2016 11:53:18 -0500 > np is already assigned in the variable declaration of ping_v6_sendmsg. > At this point, we have already dereferenced np several times, so the > NULL check is also redundant. > > Suggested-by: Eric Dumazet > Signed-off-by: Dave Jones App

Re: [PATCHv2 net-next 00/11] net: mvpp2: misc improvements and preparation patches

2016-12-29 Thread David Miller
From: Thomas Petazzoni Date: Wed, 28 Dec 2016 17:45:56 +0100 > This series contains a number of misc improvements and preparation > patches for an upcoming series that adds support for the new PPv2.2 > network controller to the mvpp2 driver. > > The most significant improvements are: > > - Swi

Re: [PATCH] ipv6: Should use consistent conditional judgement for ip6 fragment between __ip6_append_data and ip6_finish_output

2016-12-29 Thread David Miller
From: Zheng Li Date: Wed, 28 Dec 2016 23:23:46 +0800 > From: Zheng Li > > There is an inconsistent conditional judgement between __ip6_append_data > and ip6_finish_output functions, the variable length in __ip6_append_data > just include the length of application's payload and udp6 header, don'

Re: [PATCH v4] stmmac: enable rx queues

2016-12-29 Thread David Miller
From: Joao Pinto Date: Wed, 28 Dec 2016 12:57:48 + > When the hardware is synthesized with multiple queues, all queues are > disabled for default. This patch adds the rx queues configuration. > This patch was successfully tested in a Synopsys QoS Reference design. > > Signed-off-by: Joao Pin

Re: [PATCH 2/2] ipv4: Namespaceify tcp_max_syn_backlog knob

2016-12-29 Thread David Miller
From: Haishuang Yan Date: Wed, 28 Dec 2016 17:52:33 +0800 > Different namespace application might require different maximal > number of remembered connection requests. > > Signed-off-by: Haishuang Yan Applied.

Re: [PATCH 1/2] ipv4: Namespaceify tcp_tw_recycle and tcp_max_tw_buckets knob

2016-12-29 Thread David Miller
From: Haishuang Yan Date: Wed, 28 Dec 2016 17:52:32 +0800 > Different namespace application might require fast recycling > TIME-WAIT sockets independently of the host. > > Signed-off-by: Haishuang Yan Applied, but: > @@ -111,6 +121,7 @@ struct netns_ipv4 { > int sysctl_tcp_fin_timeout;

[PATCH net 4/5] net/mlx4_en: Fix type mismatch for 32-bit systems

2016-12-29 Thread Tariq Toukan
From: Slava Shwartsman is_power_of_2 expects unsigned long and we pass u64 max_val_cycles, this will be truncated on 32 bit systems, and the result is not what we were expecting. div_u64 expects u32 as a second argument and we pass max_val_cycles_rounded which is u64 hence it will always be trunc

[PATCH net 0/5] mlx4 misc fixes

2016-12-29 Thread Tariq Toukan
Hi Dave, This patchset contains several bug fixes from the team to the mlx4 Eth and Core drivers. Series generated against net commit: 60133867f1f1 'net: wan: slic_ds26522: fix spelling mistake: "configurated" -> "configured"' Thanks, Tariq. Eugenia Emantayev (1): net/mlx4_en: Fix bad WQE is

[PATCH net 5/5] net/mlx4_core: Fix raw qp flow steering rules under SRIOV

2016-12-29 Thread Tariq Toukan
From: Jack Morgenstein Demoting simple flow steering rule priority (for DPDK) was achieved by wrapping FW commands MLX4_QP_FLOW_STEERING_ATTACH/DETACH for the PF as well, and forcing the priority to MLX4_DOMAIN_NIC in the wrapper function for the PF and all VFs. In function mlx4_ib_create_flow()

[PATCH net 3/5] net/mlx4: Remove BUG_ON from ICM allocation routine

2016-12-29 Thread Tariq Toukan
From: Leon Romanovsky This patch removes BUG_ON() macro from mlx4_alloc_icm_coherent() by checking DMA address alignment in advance and performing proper folding in case of error. Fixes: 5b0bf5e25efe ("mlx4_core: Support ICM tables in coherent memory") Reported-by: Ozgur Karatas Signed-off-by:

[PATCH net 1/5] net/mlx4_core: Use-after-free causes a resource leak in flow-steering detach

2016-12-29 Thread Tariq Toukan
From: Jack Morgenstein mlx4_QP_FLOW_STEERING_DETACH_wrapper first removes the steering rule (which results in freeing the rule structure), and then references a field in this struct (the qp number) when releasing the busy-status on the rule's qp. Since this memory was freed, it could reallocated

[PATCH net 2/5] net/mlx4_en: Fix bad WQE issue

2016-12-29 Thread Tariq Toukan
From: Eugenia Emantayev Single send WQE in RX buffer should be stamped with software ownership in order to prevent the flow of QP in error in FW once UPDATE_QP is called. Fixes: 9f519f68cfff ('mlx4_en: Not using Shared Receive Queues') Signed-off-by: Eugenia Emantayev Signed-off-by: Tariq Touk

Re: [PATCH net-next V2 3/3] tun: rx batching

2016-12-29 Thread David Miller
From: Jason Wang Date: Wed, 28 Dec 2016 16:09:31 +0800 > + spin_lock(&queue->lock); > + qlen = skb_queue_len(queue); > + if (qlen > rx_batched) > + goto drop; > + __skb_queue_tail(queue, skb); > + if (!more || qlen + 1 > rx_batched) { > + __skb_queue_he

Re: [PATCH] net: ethernet: ti: davinci_cpdma: fix access to uninitialized variable in cpdma_chan_set_descs()

2016-12-29 Thread Grygorii Strashko
Hi Ivan, On 12/28/2016 07:49 PM, Ivan Khoronzhuk wrote: > On Wed, Dec 28, 2016 at 05:42:13PM -0600, Grygorii Strashko wrote: >> Now below code sequence causes "Unable to handle kernel NULL pointer >> dereference.." exception and system crash during CPSW CPDMA initialization: >> >> cpsw_probe >> |-

[PATCH] rtlwifi: fix spelling mistake: "contry" -> "country"

2016-12-29 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in RT_TRACE message Signed-off-by: Colin Ian King --- drivers/net/wireless/realtek/rtlwifi/regd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/regd.c b/drivers/net/wireless/realtek

Re: [PATCH net] sctp: do not loose window information if in rwnd_over

2016-12-29 Thread Neil Horman
On Fri, Dec 23, 2016 at 02:29:02PM -0200, Marcelo Ricardo Leitner wrote: > It's possible that we receive a packet that is larger than current > window. If it's the first packet in this way, it will cause it to > increase rwnd_over. Then, if we receive another data chunk (specially as > SCTP allows

[PATCH] ipv4: make tcp_notsent_lowat sysctl knob behave as true unsigned int

2016-12-29 Thread Pavel Tikhomirov
> cat /proc/sys/net/ipv4/tcp_notsent_lowat -1 > echo 4294967295 > /proc/sys/net/ipv4/tcp_notsent_lowat -bash: echo: write error: Invalid argument > echo -2147483648 > /proc/sys/net/ipv4/tcp_notsent_lowat > cat /proc/sys/net/ipv4/tcp_notsent_lowat -2147483648 but in documentation we have "tcp_notse

[PATCH v2] scm: fix possible control message header alignment issue

2016-12-29 Thread yuan linyu
From: yuan linyu 1. put_cmsg{_compat}() may copy data to user when buffer free space less than control message header alignment size. 2. scm_detach_fds{_compat}() may calc wrong fdmax if control message header have greater alignment size. Signed-off-by: yuan linyu --- net/compat.c | 10

[PATCH] scm: fix possible control message header alignment issue

2016-12-29 Thread yuan linyu
From: yuan linyu 1. put_cmsg{_compat}() may copy data to user when buffer free space less than control message header alignment size. 2. scm_detach_fds{_compat}() may calc wrong fdmax if control message header have greater alignment size. Signed-off-by: yuan linyu --- net/compat.c | 10

Re: [PATCH] vif queue counters from int to long

2016-12-29 Thread Wei Liu
On Fri, Dec 23, 2016 at 04:09:23PM +0100, Mart van Santen wrote: > > Hello, > > This patch fixes an issue where counters in the queue have type int, > while the counters of the vif itself are specified as long. This can > cause incorrect reporting of tx/rx values of the vif interface. > More exte

[PATCH v4] net: dev_weight: TX/RX orthogonality

2016-12-29 Thread Matthias Tafelmeier
Oftenly, introducing side effects on packet processing on the other half of the stack by adjusting one of TX/RX via sysctl is not desirable. There are cases of demand for asymmetric, orthogonal configurability. This holds true especially for nodes where RPS for RFS usage on top is configured and t

RE: [PATCH net] net: stmmac: Fix error path after register_netdev move

2016-12-29 Thread Kweh, Hock Leong
> -Original Message- > From: Florian Fainelli [mailto:f.faine...@gmail.com] > Sent: Thursday, December 29, 2016 7:45 AM > To: netdev@vger.kernel.org > Cc: Florian Fainelli ; pa...@ucw.cz; > joao.pi...@synopsys.com; seraphin.bonna...@st.com; > alexandre.tor...@gmail.com; manab...@gmail.com;

Re: [PATCH 05/12] Support for NIC-specific code

2016-12-29 Thread David VomLehn
Responses inline. On 12/27/2016 09:21 PM, Rami Rosen wrote: Hi, David, Several nitpicks and comments, from a brief overview: The commented label //err_exit: should be removed +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c @@ -0,0 +1,993 @@ +//err_exit: +//err_exit: Shouldn't aq_nic_r

[PATCH v2] net: fix incorrect original ingress device index in PKTINFO

2016-12-29 Thread Wei Zhang
When we send a packet for our own local address on a non-loopback interface (e.g. eth0), due to the change had been introduced from commit 0b922b7a829c ("net: original ingress device index in PKTINFO"), the original ingress device index would be set as the loopback interface. However, the packet sh