lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <09EC9A07-7DA7-4D3E-85EE-F56963B54A66@net-swift.com>
Date: Tue, 11 Feb 2025 19:14:54 +0800
From: "mengyuanlou@...-swift.com" <mengyuanlou@...-swift.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org,
 jiawenwu@...stnetic.com,
 duanqiangwen@...-swift.com
Subject: Re: [PATCH net-next v7 5/6] net: ngbe: add sriov function support



> 2025年2月8日 09:19,Jakub Kicinski <kuba@...nel.org> 写道:
> 
> On Thu,  6 Feb 2025 18:37:49 +0800 mengyuanlou wrote:
>> static irqreturn_t ngbe_msix_other(int __always_unused irq, void *data)
>> {
>> - struct wx *wx = data;
>> + struct wx_q_vector *q_vector;
>> + struct wx *wx  = data;
>> + u32 eicr;
>> 
>> - /* re-enable the original interrupt state, no lsc, no queues */
>> - if (netif_running(wx->netdev))
>> - ngbe_irq_enable(wx, false);
>> + q_vector = wx->q_vector[0];
>> +
>> + eicr = wx_misc_isb(wx, WX_ISB_MISC);
>> +
>> + if (eicr & NGBE_PX_MISC_IC_VF_MBOX)
>> + wx_msg_task(wx);
>> +
>> + if (wx->num_vfs == 7) {
>> + napi_schedule_irqoff(&q_vector->napi);
>> + ngbe_irq_enable(wx, true);
>> + } else {
>> + /* re-enable the original interrupt state, no lsc, no queues */
>> + if (netif_running(wx->netdev))
>> + ngbe_irq_enable(wx, false);
>> + }
>> 
>> return IRQ_HANDLED;
>> }
> 
> You need to explain in the commit message what's happening here.

> 
> IDK why the num_vfs == 7 is special.

Due to hardware design, when 6 vfs are assigned. 
+------------------------------------------------------------+
|        | pf | pf  | vf5 | vf4 | vf3 | vf2 | vf1 | vf0 | pf |
|--------|----|-----|-----|-----|-----|-----|-----|-----|----|
| vector | 0  | 1   | 2   | 3   | 4   | 5   | 6   | 7   | 8  |
+------------------------------------------------------------+

When 7 vfs are assigned. 
+------------------------------------------------------------+
|        | pf | vf6 | vf5 | vf4 | vf3 | vf2 | vf1 | vf0 | pf |
|--------|----|-----|-----|-----|-----|-----|-----|-----|----|
| vector | 0  | 1   | 2   | 3   | 4   | 5   | 6   | 7   | 8  |
+------------------------------------------------------------+

When num_vfs < 7, pf can use 0 for misc and 1 for queue.
But when num_vfs == 7, vector 1 is assigned to vf6.
1. Alloc 9 irq vectors, but only request_irq for 0 and 8. 
2. Reuse interrupt vector 0.


> Also why are you now scheduling NAPI from a misc MSI-X handler?
The code used the second. Misc and queue reuse interrupt vector 0.


> -- 
> pw-bot: cr
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ