diff mbox series

[1/2,SRU,B] i40e: Do not allow use more TC queue pairs than MSI-X vectors exist

Message ID 20190326083049.6273-2-nivedita.singhvi@canonical.com
State New
Headers show
Series i40e: xps management broken when > 64 queues/cpus | expand

Commit Message

Nivedita Singhvi March 26, 2019, 8:30 a.m. UTC
From: Paweł Jabłoński <pawel.jablonski@intel.com>

BugLink: https://bugs.launchpad.net/bugs/1820948

This patch suppresses the message about invalid TC mapping and wrong
selected TX queue. The root cause of this bug was setting too many
TC queue pairs on huge multiprocessor machines. When quantity of the
TC queue pairs is exceeding MSI-X vectors count then TX queue number
can be selected beyond actual TX queues amount.

Signed-off-by: Paweł Jabłoński <pawel.jablonski@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry-picked from commit 1563f2d2e01242f05dd523ffd56fe104bc1afd58)
Signed-off-by: Nivedita Singhvi <nivedita.singhvi@canonical.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Juerg Haefliger March 26, 2019, 10:34 a.m. UTC | #1
On Tue, 26 Mar 2019 14:00:47 +0530
Nivedita Singhvi <nivedita.singhvi@canonical.com> wrote:

> From: Paweł Jabłoński <pawel.jablonski@intel.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1820948
> 
> This patch suppresses the message about invalid TC mapping and wrong
> selected TX queue. The root cause of this bug was setting too many
> TC queue pairs on huge multiprocessor machines. When quantity of the
> TC queue pairs is exceeding MSI-X vectors count then TX queue number
> can be selected beyond actual TX queues amount.
> 
> Signed-off-by: Paweł Jabłoński <pawel.jablonski@intel.com>
> Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> (cherry-picked from commit 1563f2d2e01242f05dd523ffd56fe104bc1afd58)


Should be 'cherry picked from ...' (no dash) as added by 'git cherry-pick -x'

...Juerg


> Signed-off-by: Nivedita Singhvi <nivedita.singhvi@canonical.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index 08f7bd9001bc..8ad1710804f6 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -1818,6 +1818,10 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
>  	num_tc_qps = qcount / numtc;
>  	num_tc_qps = min_t(int, num_tc_qps, i40e_pf_get_max_q_per_tc(pf));
>  
> +	/* Do not allow use more TC queue pairs than MSI-X vectors exist */
> +	if (pf->flags & I40E_FLAG_MSIX_ENABLED)
> +		num_tc_qps = min_t(int, num_tc_qps, pf->num_lan_msix);
> +
>  	/* Setup queue offset/count for all TCs for given VSI */
>  	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
>  		/* See if the given TC is enabled for the given VSI */
Nivedita Singhvi March 26, 2019, 11:28 a.m. UTC | #2
On 3/26/19 4:04 PM, Juerg Haefliger wrote:
> On Tue, 26 Mar 2019 14:00:47 +0530
> Nivedita Singhvi <nivedita.singhvi@canonical.com> wrote:
> 
>> From: Paweł Jabłoński <pawel.jablonski@intel.com>
>>
>> BugLink: https://bugs.launchpad.net/bugs/1820948
>>
>> This patch suppresses the message about invalid TC mapping and wrong
>> selected TX queue. The root cause of this bug was setting too many
>> TC queue pairs on huge multiprocessor machines. When quantity of the
>> TC queue pairs is exceeding MSI-X vectors count then TX queue number
>> can be selected beyond actual TX queues amount.
>>
>> Signed-off-by: Paweł Jabłoński <pawel.jablonski@intel.com>
>> Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>> (cherry-picked from commit 1563f2d2e01242f05dd523ffd56fe104bc1afd58)
> 
> 
> Should be 'cherry picked from ...' (no dash) as added by 'git cherry-pick -x'
>

Is that embedded in your tooling? It's grammatically offensive,
but I'll bow to the needs of software ;). Apologies.


thanks,
Nivedita
Khalid Elmously March 27, 2019, 4:26 a.m. UTC | #3
On 2019-03-26 16:58:47 , Nivedita Singhvi wrote:
> On 3/26/19 4:04 PM, Juerg Haefliger wrote:
> > On Tue, 26 Mar 2019 14:00:47 +0530
> > Nivedita Singhvi <nivedita.singhvi@canonical.com> wrote:
> > 
> >> From: Paweł Jabłoński <pawel.jablonski@intel.com>
> >>
> >> BugLink: https://bugs.launchpad.net/bugs/1820948
> >>
> >> This patch suppresses the message about invalid TC mapping and wrong
> >> selected TX queue. The root cause of this bug was setting too many
> >> TC queue pairs on huge multiprocessor machines. When quantity of the
> >> TC queue pairs is exceeding MSI-X vectors count then TX queue number
> >> can be selected beyond actual TX queues amount.
> >>
> >> Signed-off-by: Paweł Jabłoński <pawel.jablonski@intel.com>
> >> Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
> >> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> >> (cherry-picked from commit 1563f2d2e01242f05dd523ffd56fe104bc1afd58)
> > 
> > 
> > Should be 'cherry picked from ...' (no dash) as added by 'git cherry-pick -x'
> >
> 
> Is that embedded in your tooling? It's grammatically offensive,
> but I'll bow to the needs of software ;). Apologies.
>

Yes, actually. It's the syntax 'git -x' produces.

> 
> thanks,
> Nivedita
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Khalid Elmously March 27, 2019, 6:03 a.m. UTC | #4
On 2019-03-27 00:26:18 , Khaled Elmously wrote:
> On 2019-03-26 16:58:47 , Nivedita Singhvi wrote:
> > On 3/26/19 4:04 PM, Juerg Haefliger wrote:
> > > On Tue, 26 Mar 2019 14:00:47 +0530
> > > Nivedita Singhvi <nivedita.singhvi@canonical.com> wrote:
> > > 
> > >> From: Paweł Jabłoński <pawel.jablonski@intel.com>
> > >>
> > >> BugLink: https://bugs.launchpad.net/bugs/1820948
> > >>
> > >> This patch suppresses the message about invalid TC mapping and wrong
> > >> selected TX queue. The root cause of this bug was setting too many
> > >> TC queue pairs on huge multiprocessor machines. When quantity of the
> > >> TC queue pairs is exceeding MSI-X vectors count then TX queue number
> > >> can be selected beyond actual TX queues amount.
> > >>
> > >> Signed-off-by: Paweł Jabłoński <pawel.jablonski@intel.com>
> > >> Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
> > >> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > >> (cherry-picked from commit 1563f2d2e01242f05dd523ffd56fe104bc1afd58)
> > > 
> > > 
> > > Should be 'cherry picked from ...' (no dash) as added by 'git cherry-pick -x'
> > >
> > 
> > Is that embedded in your tooling? It's grammatically offensive,
> > but I'll bow to the needs of software ;). Apologies.
> >
> 
> Yes, actually. It's the syntax 'git -x' produces.

Sorry Nivedita I didn't realize that I'm repeating what Juerg and Kleber already said here and in the other i40e thread. I'm sure you get it by now :)




> 
> > 
> > thanks,
> > Nivedita
> > 
> > 
> > -- 
> > kernel-team mailing list
> > kernel-team@lists.ubuntu.com
> > https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 08f7bd9001bc..8ad1710804f6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -1818,6 +1818,10 @@  static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
 	num_tc_qps = qcount / numtc;
 	num_tc_qps = min_t(int, num_tc_qps, i40e_pf_get_max_q_per_tc(pf));
 
+	/* Do not allow use more TC queue pairs than MSI-X vectors exist */
+	if (pf->flags & I40E_FLAG_MSIX_ENABLED)
+		num_tc_qps = min_t(int, num_tc_qps, pf->num_lan_msix);
+
 	/* Setup queue offset/count for all TCs for given VSI */
 	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
 		/* See if the given TC is enabled for the given VSI */