[PATCH V1 net 3/3] net: ena: update driver version from 2.0.1 to 2.0.2

2018-11-19 Thread akiyano
From: Arthur Kiyanovski Update driver version due to critical bug fixes. Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_netdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.h

[PATCH V1 net 0/3] net: ena: hibernation and rmmod bug fixes

2018-11-19 Thread akiyano
From: Arthur Kiyanovski This patchset includes 2 bug fixes: 1. A fix to a crash during resume from hibernation. 2. A fix to an illegal memory access during driver removal (e.g. during rmmod) which might cause a crash in certain systems. The subminor number in the driver version is also

[PATCH V1 net 1/3] net: ena: fix crash during failed resume from hibernation

2018-11-19 Thread akiyano
From: Arthur Kiyanovski During resume from hibernation if ena_restore_device fails, ena_com_dev_reset() is called, and uses the readless read mechanism, which was already destroyed by the call to ena_com_mmio_reg_read_request_destroy(). This causes a NULL pointer reference. In this commit we

[PATCH V1 net 2/3] net: ena: fix crash during ena_remove()

2018-11-19 Thread akiyano
From: Arthur Kiyanovski In ena_remove() we have the following stack call: ena_remove() unregister_netdev() ena_destroy_device() netif_carrier_off() Calling netif_carrier_off() causes linkwatch to try to handle the link change event on the already unregistered netdev, which leads to a

[PATCH V1 net-next] net: ena: fix compilation error in xtensa architecture

2018-10-21 Thread akiyano
From: Arthur Kiyanovski linux/prefetch.h is never explicitly included in ena_com, although functions from it, such as prefetchw(), are used throughout ena_com. This is an inclusion bug, and we fix it here by explicitly including linux/prefetch.h. The bug was exposed when the driver was compiled

[PATCH V1 net-next] net: ena: enable Low Latency Queues

2018-10-17 Thread akiyano
From: Arthur Kiyanovski Use the new API to enable usage of LLQ. Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c

[PATCH V2 net-next 11/12] net: ena: update driver version to 2.0.1

2018-10-11 Thread akiyano
From: Arthur Kiyanovski Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_netdev.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.h b/drivers/net/ethernet/amazon/ena/ena_netdev.h index

[PATCH V2 net-next 10/12] net: ena: remove redundant parameter in ena_com_admin_init()

2018-10-11 Thread akiyano
From: Arthur Kiyanovski Remove redundant spinlock acquire parameter from ena_com_admin_init() Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_com.c| 6 ++ drivers/net/ethernet/amazon/ena/ena_com.h| 5 + drivers/net/ethernet/amazon/ena/ena_netdev.c | 2

[PATCH V2 net-next 09/12] net: ena: change rx copybreak default to reduce kernel memory pressure

2018-10-11 Thread akiyano
From: Arthur Kiyanovski Improves socket memory utilization when receiving packets larger than 128 bytes (the previous rx copybreak) and smaller than 256 bytes. Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_netdev.h | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH V2 net-next 07/12] net: ena: explicit casting and initialization, and clearer error handling

2018-10-11 Thread akiyano
From: Arthur Kiyanovski Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_com.c| 39 drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 ++-- drivers/net/ethernet/amazon/ena/ena_netdev.h | 22 3 files changed, 36

[PATCH V2 net-next 12/12] net: ena: fix indentations in ena_defs for better readability

2018-10-11 Thread akiyano
From: Arthur Kiyanovski Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_admin_defs.h | 334 +- drivers/net/ethernet/amazon/ena/ena_eth_io_defs.h | 223 +++ drivers/net/ethernet/amazon/ena/ena_regs_defs.h | 206 +++-- 3 files

[PATCH V2 net-next 08/12] net: ena: limit refill Rx threshold to 256 to avoid latency issues

2018-10-11 Thread akiyano
From: Arthur Kiyanovski Currently Rx refill is done when the number of required descriptors is above 1/8 queue size. With a default of 1024 entries per queue the threshold is 128 descriptors. There is intention to increase the queue size to 8196 entries. In this case threshold of 1024

[PATCH V2 net-next 03/12] net: ena: introduce Low Latency Queues data structures according to ENA spec

2018-10-11 Thread akiyano
From: Arthur Kiyanovski Low Latency Queues(LLQ) allow usage of device's memory for descriptors and headers. Such queues decrease processing time since data is already located on the device when driver rings the doorbell. Signed-off-by: Arthur Kiyanovski ---

[PATCH V2 net-next 00/12] Improving performance and reducing latencies, by using latest capabilities exposed in ENA device

2018-10-11 Thread akiyano
From: Arthur Kiyanovski This patchset introduces the following: 1. A new placement policy of Tx headers and descriptors, which takes advantage of an option to place headers + descriptors in device memory space. This is sometimes referred to as LLQ - low latency queue. The patch set defines the

[PATCH V2 net-next 06/12] net: ena: use CSUM_CHECKED device indication to report skb's checksum status

2018-10-11 Thread akiyano
From: Arthur Kiyanovski Set skb->ip_summed to the correct value as reported by the device. Add counter for the case where rx csum offload is enabled but device didn't check it. Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_eth_com.c | 3 +++

[PATCH V2 net-next 01/12] net: ena: minor performance improvement

2018-10-11 Thread akiyano
From: Arthur Kiyanovski Reduce fastpath overhead by making ena_com_tx_comp_req_id_get() inline. Also move it to ena_eth_com.h file with its dependency function ena_com_cq_inc_head(). Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_eth_com.c | 43

[PATCH V2 net-next 02/12] net: ena: complete host info to match latest ENA spec

2018-10-11 Thread akiyano
From: Arthur Kiyanovski Add new fields and definitions to host info and fill them according to the latest ENA spec version. Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_admin_defs.h | 31 ++- drivers/net/ethernet/amazon/ena/ena_com.c |

[PATCH V2 net-next 05/12] net: ena: add functions for handling Low Latency Queues in ena_netdev

2018-10-11 Thread akiyano
From: Arthur Kiyanovski This patch includes all code changes necessary in ena_netdev to enable packet sending via the LLQ placemnt mode. Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_ethtool.c | 1 + drivers/net/ethernet/amazon/ena/ena_netdev.c | 387

[PATCH V2 net-next 04/12] net: ena: add functions for handling Low Latency Queues in ena_com

2018-10-11 Thread akiyano
From: Arthur Kiyanovski This patch introduces APIs for detection, initialization, configuration and actual usage of low latency queues(LLQ). It extends transmit API with creation of LLQ descriptors in device memory (which include host buffers descriptors as well as packet header) Signed-off-by:

[PATCH V1 net-next 12/12] net: ena: fix indentations in ena_defs for better readability

2018-10-09 Thread akiyano
From: Arthur Kiyanovski Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_admin_defs.h | 334 +- drivers/net/ethernet/amazon/ena/ena_eth_io_defs.h | 223 +++ drivers/net/ethernet/amazon/ena/ena_regs_defs.h | 206 +++-- 3 files

[PATCH V1 net-next 11/12] net: ena: update driver version to 2.0.1

2018-10-09 Thread akiyano
From: Arthur Kiyanovski Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_netdev.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.h b/drivers/net/ethernet/amazon/ena/ena_netdev.h index

[PATCH V1 net-next 08/12] net: ena: limit refill Rx threshold to 256 to avoid latency issues

2018-10-09 Thread akiyano
From: Arthur Kiyanovski Currently Rx refill is done when the number of required descriptors is above 1/8 queue size. With a default of 1024 entries per queue the threshold is 128 descriptors. There is intention to increase the queue size to 8196 entries. In this case threshold of 1024

[PATCH V1 net-next 10/12] net: ena: remove redundant parameter in ena_com_admin_init()

2018-10-09 Thread akiyano
From: Arthur Kiyanovski Remove redundant spinlock acquire parameter from ena_com_admin_init() Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_com.c| 6 ++ drivers/net/ethernet/amazon/ena/ena_com.h| 5 + drivers/net/ethernet/amazon/ena/ena_netdev.c | 2

[PATCH V1 net-next 09/12] net: ena: change rx copybreak default to reduce kernel memory pressure

2018-10-09 Thread akiyano
From: Arthur Kiyanovski Improves socket memory utilization when receiving packets larger than 128 bytes (the previous rx copybreak) and smaller than 256 bytes. Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_netdev.h | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH V1 net-next 04/12] net: ena: add functions for handling Low Latency Queues in ena_com

2018-10-09 Thread akiyano
From: Arthur Kiyanovski This patch introduces APIs for detection, initialization, configuration and actual usage of low latency queues(LLQ). It extends transmit API with creation of LLQ descriptors in device memory (which include host buffers descriptors as well as packet header) Signed-off-by:

[PATCH V1 net-next 05/12] net: ena: add functions for handling Low Latency Queues in ena_netdev

2018-10-09 Thread akiyano
From: Arthur Kiyanovski This patch includes all code changes necessary in ena_netdev to enable packet sending via the LLQ placemnt mode. Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_ethtool.c | 1 + drivers/net/ethernet/amazon/ena/ena_netdev.c | 387

[PATCH V1 net-next 06/12] net: ena: use CSUM_CHECKED device indication to report skb's checksum status

2018-10-09 Thread akiyano
From: Arthur Kiyanovski Set skb->ip_summed to the correct value as reported by the device. Add counter for the case where rx csum offload is enabled but device didn't check it. Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_eth_com.c | 3 +++

[PATCH V1 net-next 07/12] net: ena: explicit casting and initialization, and clearer error handling

2018-10-09 Thread akiyano
From: Arthur Kiyanovski Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_com.c| 39 drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 ++-- drivers/net/ethernet/amazon/ena/ena_netdev.h | 22 3 files changed, 36

[PATCH V1 net-next 00/12] Improving performance and reducing latencies, by using latest capabilities exposed in ENA device

2018-10-09 Thread akiyano
From: Arthur Kiyanovski This patchset introduces the following: 1. A new placement policy of Tx headers and descriptors, which takes advantage of an option to place headers + descriptors in device memory space. This is sometimes referred to as LLQ - low latency queue. The patch set defines the

[PATCH V1 net-next 03/12] net: ena: introduce Low Latency Queues data structures according to ENA spec

2018-10-09 Thread akiyano
From: Arthur Kiyanovski Low Latency Queues(LLQ) allow usage of device's memory for descriptors and headers. Such queues decrease processing time since data is already located on the device when driver rings the doorbell. Signed-off-by: Arthur Kiyanovski ---

[PATCH V1 net-next 02/12] net: ena: complete host info to match latest ENA spec

2018-10-09 Thread akiyano
From: Arthur Kiyanovski Add new fields and definitions to host info and fill them according to the latest ENA spec version. Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_admin_defs.h | 31 ++- drivers/net/ethernet/amazon/ena/ena_com.c |

[PATCH V1 net-next 01/12] net: ena: minor performance improvement

2018-10-09 Thread akiyano
From: Arthur Kiyanovski Reduce fastpath overhead by making ena_com_tx_comp_req_id_get() inline. Also move it to ena_eth_com.h file with its dependency function ena_com_cq_inc_head(). Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_eth_com.c | 43

[PATCH V2 net 3/4] net: ena: fix NULL dereference due to untimely napi initialization

2018-10-09 Thread akiyano
From: Arthur Kiyanovski napi poll functions should be initialized before running request_irq(), to handle a rare condition where there is a pending interrupt, causing the ISR to fire immediately while the poll function wasn't set yet, causing a NULL dereference. Fixes: 1738cd3ed342 ("net: ena:

[PATCH V2 net 1/4] net: ena: fix warning in rmmod caused by double iounmap

2018-10-09 Thread akiyano
From: Arthur Kiyanovski Memory mapped with devm_ioremap is automatically freed when the driver is disconnected from the device. Therefore there is no need to explicitly call devm_iounmap. Fixes: 0857d92f71b6 ("net: ena: add missing unmap bars on device removal") Fixes: 411838e7b41c ("net: ena:

[PATCH V2 net 2/4] net: ena: fix rare bug when failed restart/resume is followed by driver removal

2018-10-09 Thread akiyano
From: Arthur Kiyanovski In a rare scenario when ena_device_restore() fails, followed by device remove, an FLR will not be issued. In this case, the device will keep sending asynchronous AENQ keep-alive events, even after driver removal, leading to memory corruption. Fixes: 8c5c7abdeb2d ("net:

[PATCH V2 net 4/4] net: ena: fix auto casting to boolean

2018-10-09 Thread akiyano
From: Arthur Kiyanovski Eliminate potential auto casting compilation error. Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_eth_com.c | 8 1 file changed, 4

[PATCH V2 net 0/4] minor bug fixes for ENA Ethernet driver

2018-10-09 Thread akiyano
From: Arthur Kiyanovski Arthur Kiyanovski (4): net: ena: fix warning in rmmod caused by double iounmap net: ena: fix rare bug when failed restart/resume is followed by driver removal net: ena: fix NULL dereference due to untimely napi initialization net: ena: fix auto casting to

[PATCH V1 net 4/5] net: ena: fix NULL dereference due to untimely napi initialization

2018-10-08 Thread akiyano
From: Arthur Kiyanovski napi poll functions should be initialized before running request_irq(), to handle a rare condition where there is a pending interrupt, causing the ISR to fire immediately while the poll function wasn't set yet, causing a NULL dereference. Signed-off-by: Arthur Kiyanovski

[PATCH V1 net 3/5] net: ena: fix rare bug when failed restart/resume is followed by driver removal

2018-10-08 Thread akiyano
From: Arthur Kiyanovski In a rare scenario when ena_device_restore() fails, followed by device remove, an FLR will not be issued. In this case, the device will keep sending asynchronous AENQ keep-alive events, even after driver removal, leading to memory corruption. Signed-off-by: Arthur

[PATCH V1 net 5/5] net: ena: fix auto casting to boolean

2018-10-08 Thread akiyano
From: Arthur Kiyanovski Eliminate potential auto casting compilation error. Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_eth_com.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_eth_com.c

[PATCH V1 net 0/5] minor bug fixes for ENA Ethernet driver

2018-10-08 Thread akiyano
From: Arthur Kiyanovski Arthur Kiyanovski (5): net: ena: fix indentations in ena_defs for better readability net: ena: fix warning in rmmod caused by double iounmap net: ena: fix rare bug when failed restart/resume is followed by driver removal net: ena: fix NULL dereference due to

[PATCH V1 net 2/5] net: ena: fix warning in rmmod caused by double iounmap

2018-10-08 Thread akiyano
From: Arthur Kiyanovski Memory mapped with devm_ioremap is automatically freed when the driver is disconnected from the device. Therefore there is no need to explicitly call devm_iounmap. Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 10 +- 1 file

[PATCH V1 net 1/5] net: ena: fix indentations in ena_defs for better readability

2018-10-08 Thread akiyano
From: Arthur Kiyanovski Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_admin_defs.h | 308 +- drivers/net/ethernet/amazon/ena/ena_eth_io_defs.h | 219 --- drivers/net/ethernet/amazon/ena/ena_regs_defs.h | 206 +++ 3 files