[PATCH net v2 3/6] net:ethernet:aquantia: Workaround for HW checksum bug.

2017-08-28 Thread Pavel Belous
From: Pavel Belous The hardware has the HW Checksum Offload bug when small TCP patckets (with length <= 60 bytes) has wrong "checksum valid" bit. The solution is - ignore checksum valid bit for small packets (with length <= 60 bytes) and mark this as CHECKSUM_NONE to all

[PATCH net v2 2/6] net:ethernet:aquantia: Fix for number of RSS queues.

2017-08-28 Thread Pavel Belous
From: Pavel Belous The number of RSS queues should be not more than numbers of CPU. Its does not make sense to increase perfomance, and also cause problems on some motherboards. Fixes: 94f6c9e4cdf6 ("net: ethernet: aquantia: Support for NIC-specific code") Signed-off-by: Pa

[PATCH net v2 1/6] net:ethernet:aquantia: Extra spinlocks removed.

2017-08-28 Thread Pavel Belous
From: Pavel Belous This patch removes datapath spinlocks which does not perform any useful work. Fixes: 6e70637f9f1e ("net: ethernet: aquantia: Add ring support code") Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 42 +++ d

[PATCH net v2 0/6] net:ethernet:aquantia: Atlantic driver Update 2017-08-23

2017-08-28 Thread Pavel Belous
From: Pavel Belous This series contains updates for aQuantia Atlantic driver. It has bugfixes and some improvements. Changes in v2: - "MCP state change" fix removed (will be sent as a separate fix after further investigation.) Igor Russkikh (1): net:ethernet:aquantia: Fix for

[PATCH net v2 6/6] net:ethernet:aquantia: Show info message if bad firmware version detected.

2017-08-28 Thread Pavel Belous
From: Pavel Belous We should inform user about wrong firmware version by printing message in dmesg. Fixes: 3d2ff7eebe26 ("net: ethernet: aquantia: Atlantic hardware abstraction layer") Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c | 6

[PATCH net v2 5/6] net:ethernet:aquantia: Fix for multicast filter handling.

2017-08-28 Thread Pavel Belous
From: Igor Russkikh Since the HW supports up to 32 multicast filters we should track count of multicast filters to avoid overflow. If we attempt to add >32 multicast filter - just set NETIF_ALLMULTI flag instead. Fixes: 94f6c9e4cdf6 ("net: ethernet: aquantia: Support for NIC-specific code") Sign

[PATCH net v2 4/6] net:ethernet:aquantia: Fix for incorrect speed index.

2017-08-28 Thread Pavel Belous
From: Pavel Belous The driver choose the optimal interrupt throttling settings depends of current link speed. Due this bug link_status field from aq_hw is never updated and as result always used same interrupt throttling values. Fixes: 3d2ff7eebe26 ("net: ethernet: aquantia: Atlantic har

[PATCH net 4/7] net:ethernet:aquantia: Fix for MCP state change.

2017-08-23 Thread Pavel Belous
From: Pavel Belous The firmware state is controlled by writing value in to 0x368 register. This value contain MCP state and desired link mode. Because this value was incorrectly formed the firmware does not resetting properly (ethtool -S shows the HW counters which never resetting, even after

[PATCH net 7/7] net:ethernet:aquantia: Show info message if bad firmware version detected.

2017-08-23 Thread Pavel Belous
From: Pavel Belous We should inform user about wrong firmware version by printing message in dmesg. Fixes: 3d2ff7eebe26 ("net: ethernet: aquantia: Atlantic hardware abstraction layer") Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c | 6

[PATCH net 6/7] net:ethernet:aquantia: Fix for multicast filter handling.

2017-08-23 Thread Pavel Belous
From: Igor Russkikh Since the HW supports up to 32 multicast filters we should track count of multicast filters to avoid overflow. If we attempt to add >32 multicast filter - just set NETIF_ALLMULTI flag instead. Fixes: 94f6c9e4cdf6 ("net: ethernet: aquantia: Support for NIC-specific code") Sign

[PATCH net 2/7] net:ethernet:aquantia: Fix for number of RSS queues.

2017-08-23 Thread Pavel Belous
From: Pavel Belous The number of RSS queues should be not more than numbers of CPU. Its does not make sense to increase perfomance, and also cause problems on some motherboards. Fixes: 94f6c9e4cdf6 ("net: ethernet: aquantia: Support for NIC-specific code") Signed-off-by: Pa

[PATCH net 1/7] net:ethernet:aquantia: Extra spinlocks removed.

2017-08-23 Thread Pavel Belous
From: Pavel Belous This patch removes datapath spinlocks which does not perform any useful work. Fixes: 6e70637f9f1e ("net: ethernet: aquantia: Add ring support code") Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 42 +++ d

[PATCH net 0/7] net:ethernet:aquantia: Atlantic driver Update 2017-08-23

2017-08-23 Thread Pavel Belous
From: Pavel Belous This series contains updates for aQuantia Atlantic driver. It has bugfixes and some improvements. Igor Russkikh (1): net:ethernet:aquantia: Fix for multicast filter handling. Pavel Belous (6): net:ethernet:aquantia: Extra spinlocks removed. net:ethernet:aquantia: Fix

[PATCH net 5/7] net:ethernet:aquantia: Fix for incorrect speed index.

2017-08-23 Thread Pavel Belous
From: Pavel Belous The driver choose the optimal interrupt throttling settings depends of current link speed. Due this bug link_status field from aq_hw is never updated and as result always used same interrupt throttling values. Fixes: 3d2ff7eebe26 ("net: ethernet: aquantia: Atlantic har

[PATCH net 3/7] net:ethernet:aquantia: Workaround for HW checksum bug.

2017-08-23 Thread Pavel Belous
From: Pavel Belous The hardware has the HW Checksum Offload bug when small TCP patckets (with length <= 60 bytes) has wrong "checksum valid" bit. The solution is - ignore checksum valid bit for small packets (with length <= 60 bytes) and mark this as CHECKSUM_NONE to all

[PATCH net-next] aquantia: Switch to use napi_gro_receive

2017-08-03 Thread Pavel Belous
From: Pavel Belous Add support for GRO (generic receive offload) for aQuantia Atlantic driver. This results in a perfomance improvement when GRO is enabled. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 7 +-- drivers/net/ethernet/aquantia/atlantic

Re: [PATCH][V2] ethernet: aquantia: remove redundant checks on error status

2017-05-11 Thread Pavel Belous
("Logically dead code") Signed-off-by: Colin Ian King Acked-by: Pavel Belous Regards, Pavel

[PATCH] aquantia: Fix "ethtool -S" crash when adapter down.

2017-05-04 Thread Pavel Belous
From: Pavel Belous This patch fixes the crash that happens when driver tries to collect statistics from already released "aq_vec" object. If adapter is in "down" state we still allow user to see statistics from HW. V2: fixed braces around "aq_vec_free". Fixes

Re: [PATCH] aquantia: Fix "ethtool -S" crash when adapter down.

2017-05-04 Thread Pavel Belous
On 04.05.2017 21:17, Joe Perches wrote: On Thu, 2017-05-04 at 20:08 +0300, Pavel Belous wrote: I will prepare another patch with Lino and David M. comments. I'm not submitting this because it'd just cause merge conflicts, but something you could do one day is remove the AQ_DIMOF

Re: [PATCH] aquantia: Fix "ethtool -S" crash when adapter down.

2017-05-04 Thread Pavel Belous
On 04.05.2017 21:27, David Arcari wrote: On 05/04/2017 01:09 PM, Pavel Belous wrote: On 04.05.2017 19:51, David Miller wrote: From: Lino Sanfilippo Date: Thu, 4 May 2017 18:48:12 +0200 Hi Pavel, On 04.05.2017 18:33, Pavel Belous wrote: From: Pavel Belous This patch fixes the crash

Re: [PATCH] aquantia: Fix "ethtool -S" crash when adapter down.

2017-05-04 Thread Pavel Belous
On 04.05.2017 19:51, David Miller wrote: From: Lino Sanfilippo Date: Thu, 4 May 2017 18:48:12 +0200 Hi Pavel, On 04.05.2017 18:33, Pavel Belous wrote: From: Pavel Belous This patch fixes the crash that happens when driver tries to collect statistics from already released "aq_vec&qu

Re: [PATCH] aquantia: Fix "ethtool -S" crash when adapter down.

2017-05-04 Thread Pavel Belous
On 04.05.2017 20:00, David Arcari wrote: Hi Pavel, On 05/04/2017 12:33 PM, Pavel Belous wrote: From: Pavel Belous This patch fixes the crash that happens when driver tries to collect statistics from already released "aq_vec" object. Fixes: 97bde5c4f909 ("net: ethernet: aq

[PATCH] aquantia: Fix "ethtool -S" crash when adapter down.

2017-05-04 Thread Pavel Belous
From: Pavel Belous This patch fixes the crash that happens when driver tries to collect statistics from already released "aq_vec" object. Fixes: 97bde5c4f909 ("net: ethernet: aquantia: Support for NIC-specific code") Signed-off-by: Pavel Belous --- drivers/net/ethern

Re: [PATCH] net:ethernet:aquantia:atlantic: Switch to use napi_gro_receive

2017-05-04 Thread Pavel Belous
On 04.05.2017 17:42, David Miller wrote: From: Pavel Belous Date: Wed, 3 May 2017 19:57:10 +0300 From: Pavel Belous Add support for GRO (generic receive offload) for aQuantia Atlantic driver. This results in a perfomance improvement when GRO is enabled. Signed-off-by: Pavel Belous

[PATCH v2] aquantia: Fix driver name reported by ethtool

2017-05-03 Thread Pavel Belous
From: Pavel Belous V2: using "aquantia" subsystem tag. The command "ethtool -i ethX" should display driver name (driver: atlantic) instead vendor name (driver: aquantia). Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_cfg.h | 2 +- 1 file change

[PATCH] net:ethernet:aquantia:atlantic: Fix driver name reported by ethtool

2017-05-03 Thread Pavel Belous
From: Pavel Belous The command "ethtool -i ethX" should display driver name (driver: atlantic) instead vendor name (driver: aquantia). Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_cfg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] net:ethernet:aquantia:atlantic: Switch to use napi_gro_receive

2017-05-03 Thread Pavel Belous
From: Pavel Belous Add support for GRO (generic receive offload) for aQuantia Atlantic driver. This results in a perfomance improvement when GRO is enabled. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 7 +-- drivers/net/ethernet/aquantia/atlantic

[PATCH v3 net 5/5] net:ethernet:aquantia: Reset is_gso flag when EOP reached.

2017-03-23 Thread Pavel Belous
From: Pavel Belous We need to reset is_gso flag when EOP reached (entire LSO packet processed). Fixes: bab6de8fd180 ("net: ethernet: aquantia: Atlantic A0 and B0 specific functions.") Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c | 1

[PATCH v3 net 3/5] net:ethernet:aquantia: Missing spinlock initialization.

2017-03-23 Thread Pavel Belous
From: Pavel Belous Fix for missing initialization aq_ring header.lock spinlock. Fixes: 018423e90bee ("net: ethernet: aquantia: Add ring support code") Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v3 net 4/5] net:ethernet:aquantia: Fix for LSO with IPv6.

2017-03-23 Thread Pavel Belous
From: Pavel Belous Fix Context Command bit: L3 type = "0" for IPv4, "1" for IPv6. Fixes: bab6de8fd180 ("net: ethernet: aquantia: Atlantic A0 and B0 specific functions.") Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c

[PATCH v3 net 2/5] net:ethernet:aquantia: Fix packet type detection (TCP/UDP) for IPv6.

2017-03-23 Thread Pavel Belous
From: Pavel Belous In order for the checksum offloads to work correctly we need to set the packet type bit (TCP/UDP) in the TX context buffer. Fixes: 97bde5c4f909 ("net: ethernet: aquantia: Support for NIC-specific code") Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquanti

[PATCH v3 net 1/5] net:ethernet:aquantia: Remove adapter re-opening when MTU changed.

2017-03-23 Thread Pavel Belous
From: Pavel Belous Closing/opening the adapter is not needed at all. The new MTU settings take effect immediately. Fixes: 97bde5c4f909 ("net: ethernet: aquantia: Support for NIC-specific code") Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 5 ---

[PATCH v3 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver.

2017-03-23 Thread Pavel Belous
From: Pavel Belous The following patchset containg several fixes for aQuantia AQtion driver for net tree: A couple fixes for IPv6 and other fixes. v1->v2: Fix compilation error (using HW_ATL_A0_TXD_CTL_CMD_IPV6 instead HW_ATL_B0_TXD_CTL_CMD_IPV6). v2->v3: Added "Fixes&qu

[PATCH v2 net] net:ethernet:aquantia: Fix for RX checksum offload.

2017-03-22 Thread Pavel Belous
From: Pavel Belous Since AQC-100/107/108 chips supports hardware checksums for RX we should indicate this via NETIF_F_RXCSUM flag. v1->v2: 'Signed-off-by' tag added. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0_internal.h | 1 +

Re: [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver.

2017-03-22 Thread Pavel Belous
On 03/23/2017 12:44 AM, Florian Fainelli wrote: On 03/22/2017 02:19 PM, Pavel Belous wrote: From: Pavel Belous The following patchset containg several fixes for aQuantia AQtion driver for net tree: A couple fixes for IPv6 and other fixes. v1->v2: Fix compilation error (us

[PATCH v2 net 4/5] net:ethernet:aquantia: Fix for LSO with IPv6.

2017-03-22 Thread Pavel Belous
From: Pavel Belous Fix Context Command bit: L3 type = "0" for IPv4, "1" for IPv6. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 3 +++ drivers/net/ethernet/aquantia/atlantic/aq_ring.h | 3 ++- drivers/net/ethernet/aqua

[PATCH v2 net 5/5] net:ethernet:aquantia: Reset is_gso flag when EOP reached.

2017-03-22 Thread Pavel Belous
From: Pavel Belous We need to reset is_gso flag when EOP reached (entire LSO packet processed). Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c | 1 + drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 1 + 2 files changed, 2 insertions

[PATCH v2 net 1/5] net:ethernet:aquantia: Remove adapter re-opening when mtu changed.

2017-03-22 Thread Pavel Belous
From: Pavel Belous Closing/opening the adapter is not needed at all. The new mtu settings take effect immediately. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic

[PATCH v2 net 3/5] net:ethernet:aquantia: Missing spinlock initialization.

2017-03-22 Thread Pavel Belous
From: Pavel Belous Fix for missing initialization aq_ring header.lock spinlock. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet

[PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver.

2017-03-22 Thread Pavel Belous
From: Pavel Belous The following patchset containg several fixes for aQuantia AQtion driver for net tree: A couple fixes for IPv6 and other fixes. v1->v2: Fix compilation error (using HW_ATL_A0_TXD_CTL_CMD_IPV6 instead HW_ATL_B0_TXD_CTL_CMD_IPV6). Pavel Belous

[PATCH v2 net 2/5] net:ethernet:aquantia: Fix packet type detection (TCP/UDP) for IPv6.

2017-03-22 Thread Pavel Belous
From: Pavel Belous In order for the checksum offloads to work correctly we need to set the packet type bit (TCP/UDP) in the TX context buffer. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 20 1 file changed, 16 insertions(+), 4

Re: [PATCH net 4/5] net:ethernet:aquantia: Fix for LSO with IPv6.

2017-03-22 Thread Pavel Belous
On 03/22/2017 10:21 PM, David Arcari wrote: Hi, On 03/22/2017 01:06 PM, Pavel Belous wrote: From: Pavel Belous Fix Context Command bit: L3 type = "0" for IPv4, "1" for IPv6. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c

[PATCH net] net:ethernet:aquantia: Fix for RX checksum offload.

2017-03-22 Thread Pavel Belous
From: Pavel Belous Since AQC-100/107/08 chips supports hardware checksums for RX we should indicate this via NETIF_F_RXCSUM flag. --- drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0_internal.h | 1 + drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h | 1 + 2 files

[PATCH net 5/5] net:ethernet:aquantia: Reset is_gso flag when EOP reached.

2017-03-22 Thread Pavel Belous
From: Pavel Belous We need to reset is_gso flag when EOP reached (entire LSO packet processed). Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c | 1 + drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 1 + 2 files changed, 2 insertions

[PATCH net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver.

2017-03-22 Thread Pavel Belous
From: Pavel Belous The following patchset containg several fixes for aQuantia AQtion driver for net tree: A couple fixes for IPv6 and other fixes. Pavel Belous (5): net:ethernet:aquantia: Remove adapter re-opening when mtu changed. net:ethernet:aquantia: Fix packet type detection (TCP/UDP

[PATCH net 3/5] net:ethernet:aquantia: Missing spinlock initialization.

2017-03-22 Thread Pavel Belous
From: Pavel Belous Fix for missing initialization aq_ring header.lock spinlock. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet

[PATCH net 1/5] net:ethernet:aquantia: Remove adapter re-opening when mtu changed.

2017-03-22 Thread Pavel Belous
From: Pavel Belous Closing/opening the adapter is not needed at all. The new mtu settings take effect immediately. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic

[PATCH net 4/5] net:ethernet:aquantia: Fix for LSO with IPv6.

2017-03-22 Thread Pavel Belous
From: Pavel Belous Fix Context Command bit: L3 type = "0" for IPv4, "1" for IPv6. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 3 +++ drivers/net/ethernet/aquantia/atlantic/aq_ring.h | 3 ++- drivers/net/ethernet/aqua

[PATCH net 2/5] net:ethernet:aquantia: Fix packet type detection (TCP/UDP) for IPv6.

2017-03-22 Thread Pavel Belous
From: Pavel Belous In order for the checksum offloads to work correctly we need to set the packet type bit (TCP/UDP) in the TX context buffer. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 23 +-- 1 file changed, 17 insertions(+), 6

Re: [PATCH] net: ethernet: aquantia: set net_device mtu when mtu is changed

2017-03-13 Thread Pavel Belous
mtu = new_mtu; This is not true in the case where the driver has a ndo_change_mtu routine. Fixes: 5513e16421cb ("net: ethernet: aquantia: Fixes for aq_ndev_change_mtu") Cc: Pavel Belous Signed-off-by: David Arcari --- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 1 + 1 fi

Re: [PATCH v2] net: ethernet: aquantia: set net_device mtu when mtu is changed

2017-03-10 Thread Pavel Belous
en net-device after mtu change Cc: Pavel Belous Signed-off-by: David Arcari --- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_main.c b/drivers/net/ethernet/aquantia/atlan

Re: [PATCH v2] net: ethernet: aquantia: set net_device mtu when mtu is changed

2017-03-09 Thread Pavel Belous
mtu = new_mtu; This is not true in the case where the driver has a ndo_change_mtu routine. Fixes: 5513e16421cb ("net: ethernet: aquantia: Fixes for aq_ndev_change_mtu") v2: no longer close/open net-device after mtu change Cc: Pavel Belous Signed-off-by: David Arcari --- drivers/net/ethe

Re: [PATCH] net: ethernet: aquantia: set net_device mtu when mtu is changed

2017-03-09 Thread Pavel Belous
On 09.03.2017 23:28, David Arcari wrote: On 03/09/2017 03:01 PM, David Arcari wrote: On 03/09/2017 02:02 PM, Pavel Belous wrote: On 09.03.2017 00:33, David Arcari wrote: When the aquantia device mtu is changed the net_device structure is not updated. As a result the ip command does not

Re: [PATCH] net: ethernet: aquantia: call set_irq_affinity_hint before free_irq

2017-03-09 Thread Pavel Belous
[atlantic] __dev_close_many+0x99/0x100 __dev_close+0x67/0xb0 Fixes: 36a4a50f4048 ("net: ethernet: aquantia: switch to pci_alloc_irq_vectors") Cc: Christoph Hellwig Cc: Pavel Belous Signed-off-by: David Arcari --- drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | 2 +- 1 file

Re: [PATCH] net: ethernet: aquantia: set net_device mtu when mtu is changed

2017-03-09 Thread Pavel Belous
mtu = new_mtu; This is not true in the case where the driver has a ndo_change_mtu routine. Fixes: 5513e16421cb ("net: ethernet: aquantia: Fixes for aq_ndev_change_mtu") Cc: Pavel Belous Signed-off-by: David Arcari --- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 1 + 1 file changed

[PATCH net-next v4 10/12] net: ethernet: aquantia: Fixed incorrect buff->len calculation.

2017-02-20 Thread Pavel Belous
From: Pavel Belous rxd_wb->pkt_len is the total length of the packet. If we received a large packet (with length > AQ_CFG_RX_FRAME_MAX) then we will get multiple buffers. We need to fix the length of the last buffer. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/at

[PATCH net-next v4 05/12] net: ethernet: aquantia: Superfluous initialization of "err".

2017-02-20 Thread Pavel Belous
From: Pavel Belous Fixed superfluous initialization of err. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic

[PATCH net-next v4 07/12] net: ethernet: aquantia: Using NETDEV_TX_OK instead 0.

2017-02-20 Thread Pavel Belous
From: Pavel Belous Use NETDEV_TX_OK as the return value for successful transmission. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/aquantia

[PATCH net-next v4 04/12] net: ethernet: aquantia: Using module_pci_driver.

2017-02-20 Thread Pavel Belous
From: Pavel Belous Remove boilerplate code by using macro module_pci_driver. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/net

[PATCH net-next v4 12/12] net: ethernet: aquantia: Copying tx buffers is not needed.

2017-02-20 Thread Pavel Belous
From: Pavel Belous This fix removes copying of tx biffers. Now we use ring->buff_fing directly. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 170 +-- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 19 --- drivers/net/ether

[PATCH net-next v4 02/12] net: ethernet: aquantia: Removed busy_count field.

2017-02-20 Thread Pavel Belous
From: Pavel Belous busy_count field and is_busy flag is not needed at all. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 11 --- drivers/net/ethernet/aquantia/atlantic/aq_utils.h | 1 - 2 files changed, 12 deletions

[PATCH net-next v4 06/12] net: ethernet: aquantia: Fixed missing rtnl_unlock.

2017-02-20 Thread Pavel Belous
From: Pavel Belous rtnl_unlock should be called if error occurred. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic

[PATCH net-next v4 11/12] net: ethernet: aquantia: Fixed memory allocation if AQ_CFG_RX_FRAME_MAX > 1 page.

2017-02-20 Thread Pavel Belous
From: Pavel Belous We should allocate the number of pages based on the config parameter AQ_CFG_RX_FRAME_MAX. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/aquantia

[PATCH net-next v4 09/12] net: ethernet: aquantia: Call netdev_register after all initialized.

2017-02-20 Thread Pavel Belous
From: Pavel Belous netdev_register should be called when everything is initialized. Also we should use net_device->reg_state field instead own "is_ndev_registered" flag to avoid any race. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c

[PATCH net-next v4 08/12] net: ethernet: aquantia: Null pointer check for aq_nic_ndev_alloc.

2017-02-20 Thread Pavel Belous
From: Pavel Belous We should check for a null pointer for aq_nic_ndev_alloc instead netdev_priv. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net

[PATCH net-next v4 03/12] net: ethernet: aquantia: Fixes for aq_ndev_change_mtu

2017-02-20 Thread Pavel Belous
From: Pavel Belous 1)Removed unnecessary comparsion "old_mtu == new_mtu". This check is not needed. Function aq_ndev_change_mtu wont be called if mtu has not changed. 2)Removed extra assignment ndev->mtu = new_mtu; This assignment already done inside __dev_set_mtu(). 3)Use core

[PATCH net-next v4 00/12] net: ethernet: aquantia: improvements and fixes

2017-02-20 Thread Pavel Belous
From: Pavel Belous The following patchset contains improvements and fixes for aQuantia AQtion ethernet driver from net-next tree. Most fixes are based on the comments from Lino Sanfilippo. Sanity testing was performed on real HW. No regression found. v1->v2: 1)Removed buffers copy

[PATCH net-next v4 01/12] net: ethernet: aquantia: Removed extra assignment for skb->dev.

2017-02-20 Thread Pavel Belous
From: Pavel Belous This assignment is not needed. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia

Re: [PATCH] net: aquantia: remove function aq_ring_tx_deinit

2017-02-20 Thread Pavel Belous
self->tx_rings > i; ++i, ring = self->ring[i]) { - aq_ring_tx_deinit(&ring[AQ_VEC_TX_ID]); + aq_ring_tx_clean(&ring[AQ_VEC_TX_ID]); aq_ring_rx_deinit(&ring[AQ_VEC_RX_ID]); } err_exit:; Tested-by: Pavel Belous

[PATCH net-next v3 12/12] net: ethernet: aquantia: Copying tx buffers is not needed.

2017-02-20 Thread Pavel Belous
From: Pavel Belous This fix removes copying of tx biffers. Now we use ring->buff_fing directly. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 170 +-- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 19 --- drivers/net/ether

[PATCH net-next v3 05/12] net: ethernet: aquantia: Superfluous initialization of "err".

2017-02-20 Thread Pavel Belous
From: Pavel Belous Fixed superfluous initialization of err. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic

[PATCH net-next v3 11/12] net: ethernet: aquantia: Fixed memory allocation if AQ_CFG_RX_FRAME_MAX > 1 page.

2017-02-20 Thread Pavel Belous
From: Pavel Belous We should allocate the number of pages based on the config parameter AQ_CFG_RX_FRAME_MAX. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 4 ++-- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 4 +++- 2 files changed, 5 insertions

[PATCH net-next v3 10/12] net: ethernet: aquantia: Fixed incorrect buff->len calculation.

2017-02-20 Thread Pavel Belous
From: Pavel Belous rxd_wb->pkt_len is the total length of the packet. If we received a large packet (with length > AQ_CFG_RX_FRAME_MAX) then we will get multiple buffers. We need to fix the length of the last buffer. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/at

[PATCH net-next v3 04/12] net: ethernet: aquantia: Using module_pci_driver.

2017-02-20 Thread Pavel Belous
From: Pavel Belous Remove boilerplate code by using macro module_pci_driver. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/net

[PATCH net-next v3 01/12] net: ethernet: aquantia: Removed extra assignment for skb->dev.

2017-02-20 Thread Pavel Belous
From: Pavel Belous This assignment is not needed. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia

[PATCH net-next v3 07/12] net: ethernet: aquantia: Using NETDEV_TX_OK instead 0.

2017-02-20 Thread Pavel Belous
From: Pavel Belous Use NETDEV_TX_OK as the return value for successful transmission. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/aquantia

[PATCH net-next v3 00/12] net: ethernet: aquantia: improvements and fixes

2017-02-20 Thread Pavel Belous
From: Pavel Belous The following patchset contains improvements and fixes for aQuantia AQtion ethernet driver from net-next tree. Most fixes are based on the comments from Lino Sanfilippo. Sanity testing was performed on real HW. No regression found. v1->v2 :1)Removed buffers copy

[PATCH net-next v3 02/12] net: ethernet: aquantia: Removed busy_count field.

2017-02-20 Thread Pavel Belous
From: Pavel Belous busy_count field and is_busy flag is not needed at all. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 11 --- drivers/net/ethernet/aquantia/atlantic/aq_utils.h | 1 - 2 files changed, 12 deletions

[PATCH net-next v3 03/12] net: ethernet: aquantia: Fixes for aq_ndev_change_mtu

2017-02-20 Thread Pavel Belous
From: Pavel Belous 1)Removed unnecessary comparsion "old_mtu == new_mtu". This check is not needed. Function aq_ndev_change_mtu wont be called if mtu has not changed. 2)Removed extra assignment ndev->mtu = new_mtu; This assignment already done inside __dev_set_mtu(). 3)Use core

[PATCH net-next v3 09/12] net: ethernet: aquantia: Call netdev_register after all initialized.

2017-02-20 Thread Pavel Belous
From: Pavel Belous netdev_register should be called when everything is initialized. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet

[PATCH net-next v3 06/12] net: ethernet: aquantia: Fixed missing rtnl_unlock.

2017-02-20 Thread Pavel Belous
From: Pavel Belous rtnl_unlock should be called if error occurred. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic

[PATCH net-next v3 08/12] net: ethernet: aquantia: Null pointer check for aq_nic_ndev_alloc.

2017-02-20 Thread Pavel Belous
From: Pavel Belous We should check for a null pointer for aq_nic_ndev_alloc instead netdev_priv. Signed-off-by: Pavel Belous Reviewed-by: Lino Sanfilippo --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net

Re: [PATCH net-next v2 11/12] net: ethernet: aquantia: Fixed memory allocation if AQ_CFG_RX_FRAME_MAX > 1 page.

2017-02-18 Thread Pavel Belous
On 02/18/2017 02:50 PM, Lino Sanfilippo wrote: Hi, On 17.02.2017 22:07, Pavel Belous wrote: From: Pavel Belous We should allocate the number of pages based on the config parameter AQ_CFG_RX_FRAME_MAX. Signed-off-by: Pavel Belous do { if (spin_trylock(&

Re: [PATCH net-next v2 00/12] net: ethernet: aquantia: improvements and fixes

2017-02-18 Thread Pavel Belous
On 02/18/2017 02:56 PM, Lino Sanfilippo wrote: Hi, On 17.02.2017 22:07, Pavel Belous wrote: From: Pavel Belous The following patchset contains improvements and fixes for aQuantia AQtion ethernet driver from net-next tree. Most fixes are based on the comments from Lino Sanfilippo. Sanity

Re: [PATCH net-next v2 11/12] net: ethernet: aquantia: Fixed memory allocation if AQ_CFG_RX_FRAME_MAX > 1 page.

2017-02-18 Thread Pavel Belous
On 02/18/2017 01:43 AM, Andrew Lunn wrote: diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c index 4c40644..0877625 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c

[PATCH net-next v2 04/12] net: ethernet: aquantia: Using module_pci_driver.

2017-02-17 Thread Pavel Belous
From: Pavel Belous Remove boilerplate code by using macro module_pci_driver. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic

[PATCH net-next v2 12/12] net: ethernet: aquantia: Copying tx buffers is not needed.

2017-02-17 Thread Pavel Belous
From: Pavel Belous This fix removes copying of tx biffers. Now we use ring->buff_fing directly. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 170 +-- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 19 --- drivers/net/ether

[PATCH net-next v2 10/12] net: ethernet: aquantia: Fixed incorrect buff->len calculation.

2017-02-17 Thread Pavel Belous
From: Pavel Belous rxd_wb->pkt_len is the total length of the packet. If we received a large packet (with length > AQ_CFG_RX_FRAME_MAX) then we will get multiple buffers. We need to fix the length of the last buffer. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/at

[PATCH net-next v2 11/12] net: ethernet: aquantia: Fixed memory allocation if AQ_CFG_RX_FRAME_MAX > 1 page.

2017-02-17 Thread Pavel Belous
From: Pavel Belous We should allocate the number of pages based on the config parameter AQ_CFG_RX_FRAME_MAX. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 4 ++-- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 4 +++- 2 files changed, 5 insertions

[PATCH net-next v2 09/12] net: ethernet: aquantia: Call netdev_register after all initialized.

2017-02-17 Thread Pavel Belous
From: Pavel Belous netdev_register should be called when everything is initialized. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b

[PATCH net-next v2 07/12] net: ethernet: aquantia: Using NETDEV_TX_OK instead 0.

2017-02-17 Thread Pavel Belous
From: Pavel Belous Use NETDEV_TX_OK as the return value for successful transmission. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers

[PATCH net-next v2 08/12] net: ethernet: aquantia: Null pointer check for aq_nic_ndev_alloc.

2017-02-17 Thread Pavel Belous
From: Pavel Belous We should check for a null pointer for aq_nic_ndev_alloc instead netdev_priv. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic

[PATCH net-next v2 00/12] net: ethernet: aquantia: improvements and fixes

2017-02-17 Thread Pavel Belous
From: Pavel Belous The following patchset contains improvements and fixes for aQuantia AQtion ethernet driver from net-next tree. Most fixes are based on the comments from Lino Sanfilippo. Sanity testing was performed on real HW. No regression found. v1->v2 :Removed buffers copy

[PATCH net-next v2 05/12] net: ethernet: aquantia: Superfluous initialization of "err".

2017-02-17 Thread Pavel Belous
From: Pavel Belous Fixed superfluous initialization of err. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_main.c b/drivers/net/ethernet

[PATCH net-next v2 02/12] net: ethernet: aquantia: Removed busy_count field.

2017-02-17 Thread Pavel Belous
From: Pavel Belous busy_count field and is_busy flag is not needed at all. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 11 --- drivers/net/ethernet/aquantia/atlantic/aq_utils.h | 1 - 2 files changed, 12 deletions(-) diff --git a/drivers/net

[PATCH net-next v2 01/12] net: ethernet: aquantia: Removed extra assignment for skb->dev.

2017-02-17 Thread Pavel Belous
From: Pavel Belous This assignment is not needed. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c index

[PATCH net-next v2 06/12] net: ethernet: aquantia: Fixed missing rtnl_unlock.

2017-02-17 Thread Pavel Belous
From: Pavel Belous rtnl_unlock should be called if error occurred. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet

[PATCH net-next v2 03/12] net: ethernet: aquantia: Removed unnecessary comparsion "old_mtu == new_mtu".

2017-02-17 Thread Pavel Belous
From: Pavel Belous This check is not needed. Function aq_ndev_change_mtu wont be called if mtu has not changed. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet

Re: [PATCH net-next 11/13] net: ethernet: aquantia: Refactoring buffers copying.

2017-02-15 Thread Pavel Belous
Thank you. I will think about how to avoid copying.. Regards, Pavel On 16.02.2017 00:31, Lino Sanfilippo wrote: On 15.02.2017 21:01, Pavel Belous wrote: From: Pavel Belous This fix simplified copying data to the ring buffer. Also, there was an error in the code when the second memcpy is

Re: [PATCH net-next 10/13] net: ethernet: aquantia: Checking for success dma_map_single.

2017-02-15 Thread Pavel Belous
Ok, I will fix it in the patch v2. Thank you. Regards, Pavel On 16.02.2017 00:40, Lino Sanfilippo wrote: On 15.02.2017 22:23, Lino Sanfilippo wrote: In case of this error you have to undo all mappings that you have done so far (i.e the complete frag list and the head buffer). And, since

  1   2   >