i40e: correctly setup ARQ descriptors
authorMitch Williams <mitch.a.williams@intel.com>
Wed, 18 Dec 2013 13:45:48 +0000 (13:45 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 8 Jan 2014 05:50:16 +0000 (21:50 -0800)
When cleaning descriptors, we must set up ALL fields, not just the DMA
address. The initial setup does this correctly, but not the cleanup
code, so the firmware would process the ring exactly once and then fail.

Change-ID: I2930b83c76194b3016a8ac0fa693f9a573995640
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_adminq.c

index c87dc15..2b32084 100644 (file)
@@ -933,6 +933,11 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw,
         * size
         */
        bi = &hw->aq.arq.r.arq_bi[ntc];
+       memset((void *)desc, 0, sizeof(struct i40e_aq_desc));
+
+       desc->flags = cpu_to_le16(I40E_AQ_FLAG_BUF);
+       if (hw->aq.arq_buf_size > I40E_AQ_LARGE_BUF)
+               desc->flags |= cpu_to_le16(I40E_AQ_FLAG_LB);
        desc->datalen = cpu_to_le16((u16)bi->size);
        desc->params.external.addr_high = cpu_to_le32(upper_32_bits(bi->pa));
        desc->params.external.addr_low = cpu_to_le32(lower_32_bits(bi->pa));