]> git.baikalelectronics.ru Git - kernel.git/commit
i40e: check for and deal with non-contiguous TCs
authorDave Ertman <david.m.ertman@intel.com>
Fri, 12 Aug 2016 16:56:32 +0000 (09:56 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 16 Aug 2016 20:23:13 +0000 (13:23 -0700)
commita4fd0184220c7f7ca4f9cbaaead0ea83a91f497c
treea12280873f34b4d3b72d350ae7fde0d9e1d95d79
parent05f45e0252fa2ca9fc011626c2887c1de272d580
i40e: check for and deal with non-contiguous TCs

The i40e driver was causing a kernel panic when
non-contiguous Traffic Classes, or Traffic Classes not
starting with TC0, were configured on a link partner switch.
i40e does not support non-contiguous TCs.

To fix this, the patch changes the logic when determining
the total number of TCs enabled.  Before, this would use the
highest TC number enabled and assume that all TCs below it were
also enabled.  Now, we create a bitmask of enabled TCs and scan
it to determine not only the number of TCs, but also if the set
of enabled TCs starts at zero and is contiguous.  If not, then
DCB is disabled by only returning one TC.

Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c