Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1535665 > unrolled thread
| Started by | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| First post | 2016-12-04 14:30 +0100 |
| Last post | 2016-12-05 04:40 +0100 |
| Articles | 20 on this page of 41 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH V2 net 00/20] Increase ENA driver version to 1.1.2 Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
[PATCH V2 net 05/20] net/ena: fix RSS default hash configuration Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
Re: [PATCH V2 net 05/20] net/ena: fix RSS default hash configuration Matt Wilson <msw@amzn.com> - 2016-12-05 05:30 +0100
Re: [PATCH V2 net 05/20] net/ena: fix RSS default hash configuration Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-05 19:40 +0100
[PATCH V2 net 13/20] net/ena: change driver's default timeouts Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
Re: [PATCH V2 net 13/20] net/ena: change driver's default timeouts Matt Wilson <msw@amzn.com> - 2016-12-05 05:40 +0100
Re: [PATCH V2 net 13/20] net/ena: change driver's default timeouts Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-05 19:30 +0100
[PATCH V2 net 08/20] net/ena: add hardware hints capability to the driver Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
Re: [PATCH V2 net 08/20] net/ena: add hardware hints capability to the driver Matt Wilson <msw@amzn.com> - 2016-12-05 05:40 +0100
Re: [PATCH V2 net 08/20] net/ena: add hardware hints capability to the driver Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-05 19:40 +0100
[PATCH V2 net 17/20] net/ena: add IPv6 extended protocols to ena_admin_flow_hash_proto Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
[PATCH V2 net 09/20] net/ena: fix potential access to freed memory during device reset Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
[PATCH V2 net 07/20] net/ena: refactor ena_get_stats64 to be atomic context safe Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
Re: [PATCH V2 net 07/20] net/ena: refactor ena_get_stats64 to be atomic context safe Matt Wilson <msw@amzn.com> - 2016-12-05 05:30 +0100
Re: [PATCH V2 net 07/20] net/ena: refactor ena_get_stats64 to be atomic context safe Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-05 19:40 +0100
[PATCH V2 net 12/20] net/ena: reduce the severity of ena printouts Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
[PATCH V2 net 16/20] net/ena: use napi_schedule_irqoff when possible Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
[PATCH V2 net 11/20] net/ena: use READ_ONCE to access completion descriptors Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
[PATCH V2 net 06/20] net/ena: fix NULL dereference when removing the driver after device reset faild Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
Re: [PATCH V2 net 06/20] net/ena: fix NULL dereference when removing the driver after device reset faild Matt Wilson <msw@amzn.com> - 2016-12-05 05:40 +0100
Re: [PATCH V2 net 06/20] net/ena: fix NULL dereference when removing the driver after device reset faild Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-05 19:40 +0100
[PATCH V2 net 14/20] net/ena: change condition for host attribute configuration Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
[PATCH V2 net 04/20] net/ena: fix ethtool RSS flow configuration Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
Re: [PATCH V2 net 04/20] net/ena: fix ethtool RSS flow configuration Matt Wilson <msw@amzn.com> - 2016-12-05 05:20 +0100
Re: [PATCH V2 net 04/20] net/ena: fix ethtool RSS flow configuration Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-05 19:30 +0100
[PATCH V2 net 02/20] net/ena: fix error handling when probe fails Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
Re: [PATCH V2 net 02/20] net/ena: fix error handling when probe fails Matt Wilson <msw@amzn.com> - 2016-12-05 05:20 +0100
Re: [PATCH V2 net 02/20] net/ena: fix error handling when probe fails Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-05 19:30 +0100
[PATCH V2 net 10/20] net/ena: remove redundant logic in napi callback for busy poll mode Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
Re: [PATCH V2 net 10/20] net/ena: remove redundant logic in napi callback for busy poll mode Eric Dumazet <eric.dumazet@gmail.com> - 2016-12-05 07:00 +0100
Re: [PATCH V2 net 10/20] net/ena: remove redundant logic in napi callback for busy poll mode Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-05 19:30 +0100
Re: [PATCH V2 net 10/20] net/ena: remove redundant logic in napi callback for busy poll mode Eric Dumazet <eric.dumazet@gmail.com> - 2016-12-05 20:00 +0100
[PATCH V2 net 15/20] net/ena: change sizeof() argument to be the type pointer Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
[PATCH V2 net 01/20] net/ena: remove ntuple filter support from device feature list Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
Re: [PATCH V2 net 01/20] net/ena: remove ntuple filter support from device feature list Matt Wilson <msw@amzn.com> - 2016-12-05 05:10 +0100
[PATCH V2 net 19/20] net/ena: restructure skb allocation Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
[PATCH V2 net 03/20] net/ena: fix queues number calculation Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-04 14:30 +0100
Re: [PATCH V2 net 03/20] net/ena: fix queues number calculation Matt Wilson <msw@amzn.com> - 2016-12-05 05:20 +0100
Re: [PATCH V2 net 03/20] net/ena: fix queues number calculation Netanel Belgazal <netanel@annapurnalabs.com> - 2016-12-05 19:30 +0100
Re: [PATCH V2 net 00/20] Increase ENA driver version to 1.1.2 David Miller <davem@davemloft.net> - 2016-12-05 03:50 +0100
Re: [PATCH V2 net 00/20] Increase ENA driver version to 1.1.2 Matt Wilson <msw@amzn.com> - 2016-12-05 04:40 +0100
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
| From | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| Date | 2016-12-05 19:40 +0100 |
| Subject | Re: [PATCH V2 net 06/20] net/ena: fix NULL dereference when removing the driver after device reset faild |
| Message-ID | <sL6lb-87B-9@gated-at.bofh.it> |
| In reply to | #1535808 |
On 12/05/2016 06:29 AM, Matt Wilson wrote: > On Sun, Dec 04, 2016 at 03:19:24PM +0200, Netanel Belgazal wrote: >> If for some reason the device stop responding and the device reset failed >> to recover the device, the mmio register read datastructure will not be >> reinitialized. > If for some reason the device stops responding, and the device reset > fails to recover the device, the MMIO register read data structure > will not be reinitialized. OK > >> On driver removal, the driver will also tries to reset the device >> but this time the mmio data structure will be NULL. > On driver removal, the driver will also try to reset the device, but > this time the MMIO data structure will be NULL. OK >> To solve this issue perform the device reset in the remove function only if >> the device is runnig. > To solve this issue, perform the device reset in the remove function > only if the device is running. > > Do you have an example of the NULL pointer dereference that you can > paste in? It can be helpful for those searching for a fix for a bug > they've experienced. I'll add a crash dump. > --msw > >> Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> >> --- >> drivers/net/ethernet/amazon/ena/ena_netdev.c | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c >> index 224302c..ad5f78f 100644 >> --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c >> +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c >> @@ -2516,6 +2516,8 @@ static void ena_fw_reset_device(struct work_struct *work) >> err: >> rtnl_unlock(); >> >> + clear_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags); >> + >> dev_err(&pdev->dev, >> "Reset attempt failed. Can not reset the device\n"); >> } >> @@ -3126,7 +3128,9 @@ static void ena_remove(struct pci_dev *pdev) >> >> cancel_work_sync(&adapter->resume_io_task); >> >> - ena_com_dev_reset(ena_dev); >> + /* Reset the device only if the device is running. */ >> + if (test_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags)) >> + ena_com_dev_reset(ena_dev); >> >> ena_free_mgmnt_irq(adapter); >>
[toc] | [prev] | [next] | [standalone]
| From | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| Date | 2016-12-04 14:30 +0100 |
| Subject | [PATCH V2 net 14/20] net/ena: change condition for host attribute configuration |
| Message-ID | <sKF1E-7FZ-27@gated-at.bofh.it> |
| In reply to | #1535665 |
Move the host info config to be the first admin command that is executed.
This change require the driver to remove the 'feature check'
from host info configuration flow.
The check is removed since the supported features bitmask field
is retrieved only after calling ENA_ADMIN_DEVICE_ATTRIBUTES admin command.
If set host info is not supported an error will be returned by the device.
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
---
drivers/net/ethernet/amazon/ena/ena_com.c | 8 +++-----
drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 +++--
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c
index a550c8a..9deb0dd 100644
--- a/drivers/net/ethernet/amazon/ena/ena_com.c
+++ b/drivers/net/ethernet/amazon/ena/ena_com.c
@@ -2474,11 +2474,9 @@ int ena_com_set_host_attributes(struct ena_com_dev *ena_dev)
int ret;
- if (!ena_com_check_supported_feature_id(ena_dev,
- ENA_ADMIN_HOST_ATTR_CONFIG)) {
- pr_warn("Set host attribute isn't supported\n");
- return -EPERM;
- }
+ /* Host attribute config is called before ena_com_get_dev_attr_feat
+ * so ena_com can't check if the feature is supported.
+ */
memset(&cmd, 0x0, sizeof(cmd));
admin_queue = &ena_dev->admin_queue;
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 7ae1fce..8c1e14b 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -2426,6 +2426,8 @@ static int ena_device_init(struct ena_com_dev *ena_dev, struct pci_dev *pdev,
*/
ena_com_set_admin_polling_mode(ena_dev, true);
+ ena_config_host_info(ena_dev);
+
/* Get Device Attributes*/
rc = ena_com_get_dev_attr_feat(ena_dev, get_feat_ctx);
if (rc) {
@@ -2450,11 +2452,10 @@ static int ena_device_init(struct ena_com_dev *ena_dev, struct pci_dev *pdev,
*wd_state = !!(aenq_groups & BIT(ENA_ADMIN_KEEP_ALIVE));
- ena_config_host_info(ena_dev);
-
return 0;
err_admin_init:
+ ena_com_delete_host_info(ena_dev);
ena_com_admin_destroy(ena_dev);
err_mmio_read_less:
ena_com_mmio_reg_read_request_destroy(ena_dev);
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| Date | 2016-12-04 14:30 +0100 |
| Subject | [PATCH V2 net 04/20] net/ena: fix ethtool RSS flow configuration |
| Message-ID | <sKF1E-7FZ-31@gated-at.bofh.it> |
| In reply to | #1535665 |
ena_flow_data_to_flow_hash and ena_flow_hash_to_flow_type
treat the ena_flow_hash_to_flow_type enum as power of two values.
Change the values of ena_admin_flow_hash_fields to be power of two values.
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
---
drivers/net/ethernet/amazon/ena/ena_admin_defs.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/amazon/ena/ena_admin_defs.h b/drivers/net/ethernet/amazon/ena/ena_admin_defs.h
index a46e749..f48c886 100644
--- a/drivers/net/ethernet/amazon/ena/ena_admin_defs.h
+++ b/drivers/net/ethernet/amazon/ena/ena_admin_defs.h
@@ -631,22 +631,22 @@ enum ena_admin_flow_hash_proto {
/* RSS flow hash fields */
enum ena_admin_flow_hash_fields {
/* Ethernet Dest Addr */
- ENA_ADMIN_RSS_L2_DA = 0,
+ ENA_ADMIN_RSS_L2_DA = 0x1,
/* Ethernet Src Addr */
- ENA_ADMIN_RSS_L2_SA = 1,
+ ENA_ADMIN_RSS_L2_SA = 0x2,
/* ipv4/6 Dest Addr */
- ENA_ADMIN_RSS_L3_DA = 2,
+ ENA_ADMIN_RSS_L3_DA = 0x4,
/* ipv4/6 Src Addr */
- ENA_ADMIN_RSS_L3_SA = 5,
+ ENA_ADMIN_RSS_L3_SA = 0x8,
/* tcp/udp Dest Port */
- ENA_ADMIN_RSS_L4_DP = 6,
+ ENA_ADMIN_RSS_L4_DP = 0x10,
/* tcp/udp Src Port */
- ENA_ADMIN_RSS_L4_SP = 7,
+ ENA_ADMIN_RSS_L4_SP = 0x20,
};
struct ena_admin_proto_input {
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Matt Wilson <msw@amzn.com> |
|---|---|
| Date | 2016-12-05 05:20 +0100 |
| Subject | Re: [PATCH V2 net 04/20] net/ena: fix ethtool RSS flow configuration |
| Message-ID | <sKSUW-82v-7@gated-at.bofh.it> |
| In reply to | #1535677 |
On Sun, Dec 04, 2016 at 03:19:22PM +0200, Netanel Belgazal wrote:
> ena_flow_data_to_flow_hash and ena_flow_hash_to_flow_type
> treat the ena_flow_hash_to_flow_type enum as power of two values.
>
> Change the values of ena_admin_flow_hash_fields to be power of two values.
Then I generally prefer BIT(0), BIT(1), BIT(2), etc.
Also it would be helpful to include some comments about the
consequences of the current state of the code.
--msw
> Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
> ---
> drivers/net/ethernet/amazon/ena/ena_admin_defs.h | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/amazon/ena/ena_admin_defs.h b/drivers/net/ethernet/amazon/ena/ena_admin_defs.h
> index a46e749..f48c886 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_admin_defs.h
> +++ b/drivers/net/ethernet/amazon/ena/ena_admin_defs.h
> @@ -631,22 +631,22 @@ enum ena_admin_flow_hash_proto {
> /* RSS flow hash fields */
> enum ena_admin_flow_hash_fields {
> /* Ethernet Dest Addr */
> - ENA_ADMIN_RSS_L2_DA = 0,
> + ENA_ADMIN_RSS_L2_DA = 0x1,
>
> /* Ethernet Src Addr */
> - ENA_ADMIN_RSS_L2_SA = 1,
> + ENA_ADMIN_RSS_L2_SA = 0x2,
>
> /* ipv4/6 Dest Addr */
> - ENA_ADMIN_RSS_L3_DA = 2,
> + ENA_ADMIN_RSS_L3_DA = 0x4,
>
> /* ipv4/6 Src Addr */
> - ENA_ADMIN_RSS_L3_SA = 5,
> + ENA_ADMIN_RSS_L3_SA = 0x8,
>
> /* tcp/udp Dest Port */
> - ENA_ADMIN_RSS_L4_DP = 6,
> + ENA_ADMIN_RSS_L4_DP = 0x10,
>
> /* tcp/udp Src Port */
> - ENA_ADMIN_RSS_L4_SP = 7,
> + ENA_ADMIN_RSS_L4_SP = 0x20,
> };
>
> struct ena_admin_proto_input {
[toc] | [prev] | [next] | [standalone]
| From | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| Date | 2016-12-05 19:30 +0100 |
| Subject | Re: [PATCH V2 net 04/20] net/ena: fix ethtool RSS flow configuration |
| Message-ID | <sL6bv-84q-11@gated-at.bofh.it> |
| In reply to | #1535796 |
On 12/05/2016 06:18 AM, Matt Wilson wrote:
> On Sun, Dec 04, 2016 at 03:19:22PM +0200, Netanel Belgazal wrote:
>> ena_flow_data_to_flow_hash and ena_flow_hash_to_flow_type
>> treat the ena_flow_hash_to_flow_type enum as power of two values.
>>
>> Change the values of ena_admin_flow_hash_fields to be power of two values.
> Then I generally prefer BIT(0), BIT(1), BIT(2), etc.
I'll use BIT(x)
>
> Also it would be helpful to include some comments about the
> consequences of the current state of the code.
I'll add explanation.
>
> --msw
>
>> Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
>> ---
>> drivers/net/ethernet/amazon/ena/ena_admin_defs.h | 12 ++++++------
>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/amazon/ena/ena_admin_defs.h b/drivers/net/ethernet/amazon/ena/ena_admin_defs.h
>> index a46e749..f48c886 100644
>> --- a/drivers/net/ethernet/amazon/ena/ena_admin_defs.h
>> +++ b/drivers/net/ethernet/amazon/ena/ena_admin_defs.h
>> @@ -631,22 +631,22 @@ enum ena_admin_flow_hash_proto {
>> /* RSS flow hash fields */
>> enum ena_admin_flow_hash_fields {
>> /* Ethernet Dest Addr */
>> - ENA_ADMIN_RSS_L2_DA = 0,
>> + ENA_ADMIN_RSS_L2_DA = 0x1,
>>
>> /* Ethernet Src Addr */
>> - ENA_ADMIN_RSS_L2_SA = 1,
>> + ENA_ADMIN_RSS_L2_SA = 0x2,
>>
>> /* ipv4/6 Dest Addr */
>> - ENA_ADMIN_RSS_L3_DA = 2,
>> + ENA_ADMIN_RSS_L3_DA = 0x4,
>>
>> /* ipv4/6 Src Addr */
>> - ENA_ADMIN_RSS_L3_SA = 5,
>> + ENA_ADMIN_RSS_L3_SA = 0x8,
>>
>> /* tcp/udp Dest Port */
>> - ENA_ADMIN_RSS_L4_DP = 6,
>> + ENA_ADMIN_RSS_L4_DP = 0x10,
>>
>> /* tcp/udp Src Port */
>> - ENA_ADMIN_RSS_L4_SP = 7,
>> + ENA_ADMIN_RSS_L4_SP = 0x20,
>> };
>>
>> struct ena_admin_proto_input {
[toc] | [prev] | [next] | [standalone]
| From | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| Date | 2016-12-04 14:30 +0100 |
| Subject | [PATCH V2 net 02/20] net/ena: fix error handling when probe fails |
| Message-ID | <sKF1E-7FZ-29@gated-at.bofh.it> |
| In reply to | #1535665 |
When driver fails in probe, it will release all resources, including adapter. In case of probe failure, ena_remove should not try to free the adapter resources. Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index 33a760e..397c9bc 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -3054,6 +3054,7 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) err_free_region: ena_release_bars(ena_dev, pdev); err_free_ena_dev: + pci_set_drvdata(pdev, NULL); vfree(ena_dev); err_disable_device: pci_disable_device(pdev); -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Matt Wilson <msw@amzn.com> |
|---|---|
| Date | 2016-12-05 05:20 +0100 |
| Subject | Re: [PATCH V2 net 02/20] net/ena: fix error handling when probe fails |
| Message-ID | <sKSUV-82v-3@gated-at.bofh.it> |
| In reply to | #1535678 |
On Sun, Dec 04, 2016 at 03:19:20PM +0200, Netanel Belgazal wrote: > When driver fails in probe, it will release all resources, including > adapter. > In case of probe failure, ena_remove should not try to free the adapter > resources. Please word wrap your commit message around 75 columns. > Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Reviewed-by: Matt Wilson <msw@amazon.com> > --- > drivers/net/ethernet/amazon/ena/ena_netdev.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c > index 33a760e..397c9bc 100644 > --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c > +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c > @@ -3054,6 +3054,7 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) > err_free_region: > ena_release_bars(ena_dev, pdev); > err_free_ena_dev: > + pci_set_drvdata(pdev, NULL); > vfree(ena_dev); > err_disable_device: > pci_disable_device(pdev);
[toc] | [prev] | [next] | [standalone]
| From | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| Date | 2016-12-05 19:30 +0100 |
| Subject | Re: [PATCH V2 net 02/20] net/ena: fix error handling when probe fails |
| Message-ID | <sL6bv-84q-21@gated-at.bofh.it> |
| In reply to | #1535798 |
On 12/05/2016 06:09 AM, Matt Wilson wrote: > On Sun, Dec 04, 2016 at 03:19:20PM +0200, Netanel Belgazal wrote: >> When driver fails in probe, it will release all resources, including >> adapter. >> In case of probe failure, ena_remove should not try to free the adapter >> resources. > Please word wrap your commit message around 75 columns. OK > >> Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> > Reviewed-by: Matt Wilson <msw@amazon.com> > >> --- >> drivers/net/ethernet/amazon/ena/ena_netdev.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c >> index 33a760e..397c9bc 100644 >> --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c >> +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c >> @@ -3054,6 +3054,7 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) >> err_free_region: >> ena_release_bars(ena_dev, pdev); >> err_free_ena_dev: >> + pci_set_drvdata(pdev, NULL); >> vfree(ena_dev); >> err_disable_device: >> pci_disable_device(pdev);
[toc] | [prev] | [next] | [standalone]
| From | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| Date | 2016-12-04 14:30 +0100 |
| Subject | [PATCH V2 net 10/20] net/ena: remove redundant logic in napi callback for busy poll mode |
| Message-ID | <sKF1F-7FZ-43@gated-at.bofh.it> |
| In reply to | #1535665 |
sk_busy_loop can call the napi callback few million times a sec.
For each call there is unmask interrupt.
We want to reduce the number of unmasks.
Add an atomic variable that will tell the napi handler if
it was called from irq context or not.
Unmask the interrupt only from irq context.
A schenario where the driver left with missed unmask isn't feasible.
when ena_intr_msix_io is called the driver have 2 options:
1)Before napi completes and call napi_complete_done
2)After calling napi_complete_done
In the former case the napi will unmask the interrupt as needed.
In the latter case napi_complete_done will remove napi from the schedule
list so napi will be rescheduled (by ena_intr_msix_io) and interrupt
will be unmasked as desire in the 2nd napi call.
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
---
drivers/net/ethernet/amazon/ena/ena_netdev.c | 46 +++++++++++++++++++---------
drivers/net/ethernet/amazon/ena/ena_netdev.h | 1 +
2 files changed, 32 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index bb7eeea..5625007 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -1129,26 +1129,41 @@ static int ena_io_poll(struct napi_struct *napi, int budget)
tx_work_done = ena_clean_tx_irq(tx_ring, tx_budget);
rx_work_done = ena_clean_rx_irq(rx_ring, napi, budget);
- if ((budget > rx_work_done) && (tx_budget > tx_work_done)) {
+ /* If the device is about to reset or down, avoid unmask
+ * the interrupt and return 0 so NAPI won't reschedule
+ */
+ if (unlikely(!test_bit(ENA_FLAG_DEV_UP, &tx_ring->adapter->flags) ||
+ test_bit(ENA_FLAG_TRIGGER_RESET, &tx_ring->adapter->flags))) {
+ napi_complete_done(napi, 0);
+ ret = 0;
+
+ } else if ((budget > rx_work_done) && (tx_budget > tx_work_done)) {
napi_complete_done(napi, rx_work_done);
napi_comp_call = 1;
- /* Tx and Rx share the same interrupt vector */
- if (ena_com_get_adaptive_moderation_enabled(rx_ring->ena_dev))
- ena_adjust_intr_moderation(rx_ring, tx_ring);
-
- /* Update intr register: rx intr delay, tx intr delay and
- * interrupt unmask
+ /* Update numa and unmask the interrupt only when schedule
+ * from the interrupt context (vs from sk_busy_loop)
*/
- ena_com_update_intr_reg(&intr_reg,
- rx_ring->smoothed_interval,
- tx_ring->smoothed_interval,
- true);
+ if (atomic_cmpxchg(&ena_napi->unmask_interrupt, 1, 0)) {
+ /* Tx and Rx share the same interrupt vector */
+ if (ena_com_get_adaptive_moderation_enabled(rx_ring->ena_dev))
+ ena_adjust_intr_moderation(rx_ring, tx_ring);
+
+ /* Update intr register: rx intr delay,
+ * tx intr delay and interrupt unmask
+ */
+ ena_com_update_intr_reg(&intr_reg,
+ rx_ring->smoothed_interval,
+ tx_ring->smoothed_interval,
+ true);
+
+ /* It is a shared MSI-X.
+ * Tx and Rx CQ have pointer to it.
+ * So we use one of them to reach the intr reg
+ */
+ ena_com_unmask_intr(rx_ring->ena_com_io_cq, &intr_reg);
+ }
- /* It is a shared MSI-X. Tx and Rx CQ have pointer to it.
- * So we use one of them to reach the intr reg
- */
- ena_com_unmask_intr(rx_ring->ena_com_io_cq, &intr_reg);
ena_update_ring_numa_node(tx_ring, rx_ring);
@@ -1186,6 +1201,7 @@ static irqreturn_t ena_intr_msix_io(int irq, void *data)
{
struct ena_napi *ena_napi = data;
+ atomic_set(&ena_napi->unmask_interrupt, 1);
napi_schedule(&ena_napi->napi);
return IRQ_HANDLED;
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.h b/drivers/net/ethernet/amazon/ena/ena_netdev.h
index 2897fab..c081fd3 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.h
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.h
@@ -135,6 +135,7 @@ struct ena_napi {
struct napi_struct napi ____cacheline_aligned;
struct ena_ring *tx_ring;
struct ena_ring *rx_ring;
+ atomic_t unmask_interrupt;
u32 qid;
};
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Eric Dumazet <eric.dumazet@gmail.com> |
|---|---|
| Date | 2016-12-05 07:00 +0100 |
| Subject | Re: [PATCH V2 net 10/20] net/ena: remove redundant logic in napi callback for busy poll mode |
| Message-ID | <sKUtH-qx-3@gated-at.bofh.it> |
| In reply to | #1535679 |
On Sun, 2016-12-04 at 15:19 +0200, Netanel Belgazal wrote:
> sk_busy_loop can call the napi callback few million times a sec.
> For each call there is unmask interrupt.
> We want to reduce the number of unmasks.
>
> Add an atomic variable that will tell the napi handler if
> it was called from irq context or not.
> Unmask the interrupt only from irq context.
>
> A schenario where the driver left with missed unmask isn't feasible.
> when ena_intr_msix_io is called the driver have 2 options:
> 1)Before napi completes and call napi_complete_done
> 2)After calling napi_complete_done
>
> In the former case the napi will unmask the interrupt as needed.
> In the latter case napi_complete_done will remove napi from the schedule
> list so napi will be rescheduled (by ena_intr_msix_io) and interrupt
> will be unmasked as desire in the 2nd napi call.
>
> Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
> ---
This looks very complicated to me.
I guess you missed the recent patches that happened on net-next ?
2e713283751f494596655d9125c168aeb913f71d net/mlx4_en: use napi_complete_done() return value
364b6055738b4c752c30ccaaf25c624e69d76195 net: busy-poll: return busypolling status to drivers
21cb84c48ca0619181106f0f44f3802a989de024 net: busy-poll: remove need_resched() from sk_can_busy_loop()
217f6974368188fd8bd7804bf5a036aa5762c5e4 net: busy-poll: allow preemption in sk_busy_loop()
napi_complete_done() return code can be used by a driver,
no need to add yet another atomic operation in fast path.
Anyway, this looks wrong :
@@ -1186,6 +1201,7 @@ static irqreturn_t ena_intr_msix_io(int irq, void *data)
{
struct ena_napi *ena_napi = data;
+ atomic_set(&ena_napi->unmask_interrupt, 1);
napi_schedule(&ena_napi->napi);
You probably wanted :
if (napi_schedule_prep(n)) {
atomic_set(&ena_napi->unmask_interrupt, 1);
__napi_schedule(n);
}
Please rework this napi poll using core infrastructure.
busypoll logic should be centralized, not reimplemented in different ways in a driver.
Thanks.
[toc] | [prev] | [next] | [standalone]
| From | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| Date | 2016-12-05 19:30 +0100 |
| Subject | Re: [PATCH V2 net 10/20] net/ena: remove redundant logic in napi callback for busy poll mode |
| Message-ID | <sL6bv-84q-7@gated-at.bofh.it> |
| In reply to | #1535820 |
On 12/05/2016 07:45 AM, Eric Dumazet wrote:
> On Sun, 2016-12-04 at 15:19 +0200, Netanel Belgazal wrote:
>> sk_busy_loop can call the napi callback few million times a sec.
>> For each call there is unmask interrupt.
>> We want to reduce the number of unmasks.
>>
>> Add an atomic variable that will tell the napi handler if
>> it was called from irq context or not.
>> Unmask the interrupt only from irq context.
>>
>> A schenario where the driver left with missed unmask isn't feasible.
>> when ena_intr_msix_io is called the driver have 2 options:
>> 1)Before napi completes and call napi_complete_done
>> 2)After calling napi_complete_done
>>
>> In the former case the napi will unmask the interrupt as needed.
>> In the latter case napi_complete_done will remove napi from the schedule
>> list so napi will be rescheduled (by ena_intr_msix_io) and interrupt
>> will be unmasked as desire in the 2nd napi call.
>>
>> Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
>> ---
>
> This looks very complicated to me.
>
> I guess you missed the recent patches that happened on net-next ?
You are correct.
I didn't see the patches.
It is much better to use the napi_complete_done() return value.
I'll rework my patch.
>
> 2e713283751f494596655d9125c168aeb913f71d net/mlx4_en: use napi_complete_done() return value
> 364b6055738b4c752c30ccaaf25c624e69d76195 net: busy-poll: return busypolling status to drivers
> 21cb84c48ca0619181106f0f44f3802a989de024 net: busy-poll: remove need_resched() from sk_can_busy_loop()
> 217f6974368188fd8bd7804bf5a036aa5762c5e4 net: busy-poll: allow preemption in sk_busy_loop()
>
> napi_complete_done() return code can be used by a driver,
> no need to add yet another atomic operation in fast path.
>
> Anyway, this looks wrong :
>
> @@ -1186,6 +1201,7 @@ static irqreturn_t ena_intr_msix_io(int irq, void *data)
> {
> struct ena_napi *ena_napi = data;
>
> + atomic_set(&ena_napi->unmask_interrupt, 1);
> napi_schedule(&ena_napi->napi);
>
> You probably wanted :
>
> if (napi_schedule_prep(n)) {
> atomic_set(&ena_napi->unmask_interrupt, 1);
> __napi_schedule(n);
> }
>
>
>
> Please rework this napi poll using core infrastructure.
>
> busypoll logic should be centralized, not reimplemented in different ways in a driver.
>
> Thanks.
>
>
>
[toc] | [prev] | [next] | [standalone]
| From | Eric Dumazet <eric.dumazet@gmail.com> |
|---|---|
| Date | 2016-12-05 20:00 +0100 |
| Subject | Re: [PATCH V2 net 10/20] net/ena: remove redundant logic in napi callback for busy poll mode |
| Message-ID | <sL6Ex-8e2-3@gated-at.bofh.it> |
| In reply to | #1536300 |
On Mon, 2016-12-05 at 20:29 +0200, Netanel Belgazal wrote: > You are correct. > I didn't see the patches. > It is much better to use the napi_complete_done() return value. > I'll rework my patch. Excellent, please CC me on this particular work on the future. Thanks.
[toc] | [prev] | [next] | [standalone]
| From | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| Date | 2016-12-04 14:30 +0100 |
| Subject | [PATCH V2 net 15/20] net/ena: change sizeof() argument to be the type pointer |
| Message-ID | <sKF1E-7FZ-41@gated-at.bofh.it> |
| In reply to | #1535665 |
Instead of using: memset(ptr, 0x0, sizeof(struct ...)) use: memset(ptr, 0x0, sizeor(*ptr)) Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> --- drivers/net/ethernet/amazon/ena/ena_com.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index 9deb0dd..f2e167b 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -329,7 +329,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev, size_t size; int dev_node = 0; - memset(&io_sq->desc_addr, 0x0, sizeof(struct ena_com_io_desc_addr)); + memset(&io_sq->desc_addr, 0x0, sizeof(io_sq->desc_addr)); io_sq->desc_entry_size = (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) ? @@ -383,7 +383,7 @@ static int ena_com_init_io_cq(struct ena_com_dev *ena_dev, size_t size; int prev_node = 0; - memset(&io_cq->cdesc_addr, 0x0, sizeof(struct ena_com_io_desc_addr)); + memset(&io_cq->cdesc_addr, 0x0, sizeof(io_cq->cdesc_addr)); /* Use the basic completion descriptor for Rx */ io_cq->cdesc_entry_size_in_bytes = @@ -681,7 +681,7 @@ static int ena_com_destroy_io_sq(struct ena_com_dev *ena_dev, u8 direction; int ret; - memset(&destroy_cmd, 0x0, sizeof(struct ena_admin_aq_destroy_sq_cmd)); + memset(&destroy_cmd, 0x0, sizeof(destroy_cmd)); if (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) direction = ENA_ADMIN_SQ_DIRECTION_TX; @@ -963,7 +963,7 @@ static int ena_com_create_io_sq(struct ena_com_dev *ena_dev, u8 direction; int ret; - memset(&create_cmd, 0x0, sizeof(struct ena_admin_aq_create_sq_cmd)); + memset(&create_cmd, 0x0, sizeof(create_cmd)); create_cmd.aq_common_descriptor.opcode = ENA_ADMIN_CREATE_SQ; @@ -1155,7 +1155,7 @@ int ena_com_create_io_cq(struct ena_com_dev *ena_dev, struct ena_admin_acq_create_cq_resp_desc cmd_completion; int ret; - memset(&create_cmd, 0x0, sizeof(struct ena_admin_aq_create_cq_cmd)); + memset(&create_cmd, 0x0, sizeof(create_cmd)); create_cmd.aq_common_descriptor.opcode = ENA_ADMIN_CREATE_CQ; @@ -1263,7 +1263,7 @@ int ena_com_destroy_io_cq(struct ena_com_dev *ena_dev, struct ena_admin_acq_destroy_cq_resp_desc destroy_resp; int ret; - memset(&destroy_cmd, 0x0, sizeof(struct ena_admin_aq_destroy_sq_cmd)); + memset(&destroy_cmd, 0x0, sizeof(destroy_cmd)); destroy_cmd.cq_idx = io_cq->idx; destroy_cmd.aq_common_descriptor.opcode = ENA_ADMIN_DESTROY_CQ; @@ -1613,8 +1613,8 @@ int ena_com_create_io_queue(struct ena_com_dev *ena_dev, io_sq = &ena_dev->io_sq_queues[ctx->qid]; io_cq = &ena_dev->io_cq_queues[ctx->qid]; - memset(io_sq, 0x0, sizeof(struct ena_com_io_sq)); - memset(io_cq, 0x0, sizeof(struct ena_com_io_cq)); + memset(io_sq, 0x0, sizeof(*io_sq)); + memset(io_cq, 0x0, sizeof(*io_cq)); /* Init CQ */ io_cq->q_depth = ctx->queue_size; -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| Date | 2016-12-04 14:30 +0100 |
| Subject | [PATCH V2 net 01/20] net/ena: remove ntuple filter support from device feature list |
| Message-ID | <sKF1E-7FZ-37@gated-at.bofh.it> |
| In reply to | #1535665 |
Remove NETIF_F_NTUPLE from netdev->features. The ENA device driver does not support ntuple filtering. Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index bfeaec5..33a760e 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -2729,7 +2729,6 @@ static void ena_set_dev_offloads(struct ena_com_dev_get_features_ctx *feat, netdev->features = dev_features | NETIF_F_SG | - NETIF_F_NTUPLE | NETIF_F_RXHASH | NETIF_F_HIGHDMA; -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Matt Wilson <msw@amzn.com> |
|---|---|
| Date | 2016-12-05 05:10 +0100 |
| Subject | Re: [PATCH V2 net 01/20] net/ena: remove ntuple filter support from device feature list |
| Message-ID | <sKSLf-7WE-1@gated-at.bofh.it> |
| In reply to | #1535681 |
On Sun, Dec 04, 2016 at 03:19:19PM +0200, Netanel Belgazal wrote: > Remove NETIF_F_NTUPLE from netdev->features. > The ENA device driver does not support ntuple filtering. > > Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Reviewed-by: Matt Wilson <msw@amazon.com> > --- > drivers/net/ethernet/amazon/ena/ena_netdev.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c > index bfeaec5..33a760e 100644 > --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c > +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c > @@ -2729,7 +2729,6 @@ static void ena_set_dev_offloads(struct ena_com_dev_get_features_ctx *feat, > netdev->features = > dev_features | > NETIF_F_SG | > - NETIF_F_NTUPLE | > NETIF_F_RXHASH | > NETIF_F_HIGHDMA; >
[toc] | [prev] | [next] | [standalone]
| From | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| Date | 2016-12-04 14:30 +0100 |
| Subject | [PATCH V2 net 19/20] net/ena: restructure skb allocation |
| Message-ID | <sKF1F-7FZ-45@gated-at.bofh.it> |
| In reply to | #1535665 |
To increase readability, refactor skb allocation to dedicated function
This change does not impact the performance since the compiler optimize
the code and elimitate the if condition.
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
---
drivers/net/ethernet/amazon/ena/ena_netdev.c | 46 ++++++++++++++++------------
1 file changed, 27 insertions(+), 19 deletions(-)
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index ee80472..8d42960 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -787,6 +787,28 @@ static int ena_clean_tx_irq(struct ena_ring *tx_ring, u32 budget)
return tx_pkts;
}
+static struct sk_buff *ena_alloc_skb(struct ena_ring *rx_ring, bool frags)
+{
+ struct sk_buff *skb;
+
+ if (frags)
+ skb = napi_get_frags(rx_ring->napi);
+ else
+ skb = netdev_alloc_skb_ip_align(rx_ring->netdev,
+ rx_ring->rx_copybreak);
+
+ if (unlikely(!skb)) {
+ u64_stats_update_begin(&rx_ring->syncp);
+ rx_ring->rx_stats.skb_alloc_fail++;
+ u64_stats_update_end(&rx_ring->syncp);
+ netif_err(rx_ring->adapter, rx_err, rx_ring->netdev,
+ "Failed to allocate skb. frags: %d\n", frags);
+ return NULL;
+ }
+
+ return skb;
+}
+
static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
struct ena_com_rx_buf_info *ena_bufs,
u32 descs,
@@ -795,8 +817,7 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
struct sk_buff *skb;
struct ena_rx_buffer *rx_info =
&rx_ring->rx_buffer_info[*next_to_clean];
- u32 len;
- u32 buf = 0;
+ u32 len, buf = 0;
void *va;
len = ena_bufs[0].len;
@@ -815,16 +836,9 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
prefetch(va + NET_IP_ALIGN);
if (len <= rx_ring->rx_copybreak) {
- skb = netdev_alloc_skb_ip_align(rx_ring->netdev,
- rx_ring->rx_copybreak);
- if (unlikely(!skb)) {
- u64_stats_update_begin(&rx_ring->syncp);
- rx_ring->rx_stats.skb_alloc_fail++;
- u64_stats_update_end(&rx_ring->syncp);
- netif_err(rx_ring->adapter, rx_err, rx_ring->netdev,
- "Failed to allocate skb\n");
+ skb = ena_alloc_skb(rx_ring, false);
+ if (unlikely(!skb))
return NULL;
- }
netif_dbg(rx_ring->adapter, rx_status, rx_ring->netdev,
"rx allocated small packet. len %d. data_len %d\n",
@@ -848,15 +862,9 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
return skb;
}
- skb = napi_get_frags(rx_ring->napi);
- if (unlikely(!skb)) {
- netif_dbg(rx_ring->adapter, rx_status, rx_ring->netdev,
- "Failed allocating skb\n");
- u64_stats_update_begin(&rx_ring->syncp);
- rx_ring->rx_stats.skb_alloc_fail++;
- u64_stats_update_end(&rx_ring->syncp);
+ skb = ena_alloc_skb(rx_ring, true);
+ if (unlikely(!skb))
return NULL;
- }
do {
dma_unmap_page(rx_ring->dev,
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| Date | 2016-12-04 14:30 +0100 |
| Subject | [PATCH V2 net 03/20] net/ena: fix queues number calculation |
| Message-ID | <sKF1F-7FZ-47@gated-at.bofh.it> |
| In reply to | #1535665 |
The ENA driver tries to open a queue per vCPU. To determine how many vCPUs the instance have it uses num_possible_cpus while it should have use num_online_cpus instead. Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index 397c9bc..224302c 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -2667,7 +2667,7 @@ static int ena_calc_io_queue_num(struct pci_dev *pdev, io_sq_num = get_feat_ctx->max_queues.max_sq_num; } - io_queue_num = min_t(int, num_possible_cpus(), ENA_MAX_NUM_IO_QUEUES); + io_queue_num = min_t(int, num_online_cpus(), ENA_MAX_NUM_IO_QUEUES); io_queue_num = min_t(int, io_queue_num, io_sq_num); io_queue_num = min_t(int, io_queue_num, get_feat_ctx->max_queues.max_cq_num); -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Matt Wilson <msw@amzn.com> |
|---|---|
| Date | 2016-12-05 05:20 +0100 |
| Subject | Re: [PATCH V2 net 03/20] net/ena: fix queues number calculation |
| Message-ID | <sKSUW-82v-13@gated-at.bofh.it> |
| In reply to | #1535683 |
On Sun, Dec 04, 2016 at 03:19:21PM +0200, Netanel Belgazal wrote: > The ENA driver tries to open a queue per vCPU. > To determine how many vCPUs the instance have it uses num_possible_cpus > while it should have use num_online_cpus instead. use () when referring to functions: num_possible_cpus(), num_online_cpus(). > Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Reviewed-by: Matt Wilson <msw@amazon.com> > --- > drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c > index 397c9bc..224302c 100644 > --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c > +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c > @@ -2667,7 +2667,7 @@ static int ena_calc_io_queue_num(struct pci_dev *pdev, > io_sq_num = get_feat_ctx->max_queues.max_sq_num; > } > > - io_queue_num = min_t(int, num_possible_cpus(), ENA_MAX_NUM_IO_QUEUES); > + io_queue_num = min_t(int, num_online_cpus(), ENA_MAX_NUM_IO_QUEUES); > io_queue_num = min_t(int, io_queue_num, io_sq_num); > io_queue_num = min_t(int, io_queue_num, > get_feat_ctx->max_queues.max_cq_num);
[toc] | [prev] | [next] | [standalone]
| From | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| Date | 2016-12-05 19:30 +0100 |
| Subject | Re: [PATCH V2 net 03/20] net/ena: fix queues number calculation |
| Message-ID | <sL6bw-84q-37@gated-at.bofh.it> |
| In reply to | #1535800 |
On 12/05/2016 06:11 AM, Matt Wilson wrote: > On Sun, Dec 04, 2016 at 03:19:21PM +0200, Netanel Belgazal wrote: >> The ENA driver tries to open a queue per vCPU. >> To determine how many vCPUs the instance have it uses num_possible_cpus >> while it should have use num_online_cpus instead. > use () when referring to functions: num_possible_cpus(), num_online_cpus(). Ack > >> Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> > Reviewed-by: Matt Wilson <msw@amazon.com> > >> --- >> drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c >> index 397c9bc..224302c 100644 >> --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c >> +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c >> @@ -2667,7 +2667,7 @@ static int ena_calc_io_queue_num(struct pci_dev *pdev, >> io_sq_num = get_feat_ctx->max_queues.max_sq_num; >> } >> >> - io_queue_num = min_t(int, num_possible_cpus(), ENA_MAX_NUM_IO_QUEUES); >> + io_queue_num = min_t(int, num_online_cpus(), ENA_MAX_NUM_IO_QUEUES); >> io_queue_num = min_t(int, io_queue_num, io_sq_num); >> io_queue_num = min_t(int, io_queue_num, >> get_feat_ctx->max_queues.max_cq_num);
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2016-12-05 03:50 +0100 |
| Message-ID | <sKRvQ-6VS-9@gated-at.bofh.it> |
| In reply to | #1535665 |
It is not appropriate to submit so many patches at one time. Please keep your patch series to no more than about a dozen at a time. Also, group your changes logically and tie an appropriately descriptive cover letter. "Increase driver version to X.Y.Z" tells the reader absolutely nothing. Someone reading that Subject line in the GIT logs will have no idea what the overall purpose of the patch series is and what it accomplishes. You really need to describe the high level purpose of the patch set. Is it adding a new feature? What is that feature? Why are you adding that feature? How is that feature implemented? Why is it implemented that way?
[toc] | [prev] | [next] | [standalone]
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
Back to top | Article view | linux.kernel
csiph-web