iavf: Fix the math for valid length for ADq enable
authorAvinash Dayanand <avinash.dayanand@intel.com>
Tue, 14 May 2019 17:37:03 +0000 (10:37 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 17 Jun 2019 22:39:26 +0000 (15:39 -0700)
There was a calculation error in virtchnl regarding the valid
length which was fixed recently and a corresponding change needs
to go into the code while we enable ADq.

Signed-off-by: Avinash Dayanand <avinash.dayanand@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c

index 3eea35c..dd97509 100644 (file)
@@ -983,7 +983,7 @@ void iavf_enable_channels(struct iavf_adapter *adapter)
                return;
        }
 
-       len = (adapter->num_tc * sizeof(struct virtchnl_channel_info)) +
+       len = ((adapter->num_tc - 1) * sizeof(struct virtchnl_channel_info)) +
               sizeof(struct virtchnl_tc_info);
 
        vti = kzalloc(len, GFP_KERNEL);