public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: davem@davemloft.net, Shannon Nelson <shannon.nelson@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com
Subject: Re: [net-next 14/14] i40e: always print aqtx answer
Date: Thu, 24 Jul 2014 11:42:30 -0700	[thread overview]
Message-ID: <1406227350.27221.63.camel@joe-AO725> (raw)
In-Reply-To: <1406207604-31653-15-git-send-email-jeffrey.t.kirsher@intel.com>

On Thu, 2014-07-24 at 06:13 -0700, Jeff Kirsher wrote:
> From: Shannon Nelson <shannon.nelson@intel.com>
> 
> Sometimes the AQTX answer comes back with no data, but we still want to print
> the descriptor that got written back.

Maybe this does some reads from buffer beyond its size
in i40e_debug_aq?  Is that always safe?

> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
[]
> @@ -889,11 +889,9 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
>  		hw->aq.asq_last_status = (enum i40e_admin_queue_err)retval;
>  	}
>  
> -	if (le16_to_cpu(desc->datalen) == buff_size) {
> -		i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
> -			   "AQTX: desc and buffer writeback:\n");
> -		i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff);
> -	}
> +	i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
> +		   "AQTX: desc and buffer writeback:\n");
> +	i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff);


void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc,
		   void *buffer)
{
	struct i40e_aq_desc *aq_desc = (struct i40e_aq_desc *)desc;
	u8 *aq_buffer = (u8 *)buffer;
[]
		for (i = 0; i < le16_to_cpu(aq_desc->datalen); i++) {
			data[((i % 16) / 4)] |=
				((u32)aq_buffer[i]) << (8 * (i % 4));
			if ((i % 16) == 15) {
				i40e_debug(hw, mask,
					   "\t0x%04X  %08X %08X %08X %08X\n",
					   i - 15, data[0], data[1], data[2],
					   data[3]);
				memset(data, 0, sizeof(data));
			}

  reply	other threads:[~2014-07-24 18:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-24 13:13 [net-next 00/14][pull request] Intel Wired LAN Driver Updates 2014-07-24 Jeff Kirsher
2014-07-24 13:13 ` [net-next 01/14] ixgbe: Fix possible null-dereference in error path Jeff Kirsher
2014-07-24 13:13 ` [net-next 02/14] ixgbe: Change some uses of strncpy to strlcpy Jeff Kirsher
2014-07-24 13:13 ` [net-next 03/14] ixgbe: fix use of list_for_each in ixgbe_enumerate_functions Jeff Kirsher
2014-07-24 16:48   ` Keller, Jacob E
2014-07-24 13:13 ` [net-next 04/14] ixgbe: don't check minimum link when direct assigned to virtual machine Jeff Kirsher
2014-07-24 13:13 ` [net-next 05/14] igb: Add message when malformed packets detected by hw Jeff Kirsher
2014-07-24 13:13 ` [net-next 06/14] igb: bump igb version to 5.2.13 Jeff Kirsher
2014-07-24 13:13 ` [net-next 07/14] i40e: fix format mismatch in drivers/net/ethernet/intel/i40e/i40e_debugfs.c Jeff Kirsher
2014-07-24 13:13 ` [net-next 08/14] i40e/i40evf: Add nvmupdate support Jeff Kirsher
2014-07-24 13:13 ` [net-next 09/14] i40e/i40evf: fix extension header csum logic Jeff Kirsher
2014-07-24 13:13 ` [net-next 10/14] i40evf: don't wait so long Jeff Kirsher
2014-07-24 13:13 ` [net-next 11/14] i40e/i40evf: ARQ copy desc data even for failed commands Jeff Kirsher
2014-07-24 13:13 ` [net-next 12/14] i40e: Fix firmware API version errors Jeff Kirsher
2014-07-24 13:13 ` [net-next 13/14] i40e: Give link more time after setting flow control Jeff Kirsher
2014-07-24 13:13 ` [net-next 14/14] i40e: always print aqtx answer Jeff Kirsher
2014-07-24 18:42   ` Joe Perches [this message]
2014-07-24 19:20     ` Nelson, Shannon
2014-07-24 19:56       ` Joe Perches
2014-07-24 20:13         ` Nelson, Shannon
2014-07-25  6:08 ` [net-next 00/14][pull request] Intel Wired LAN Driver Updates 2014-07-24 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1406227350.27221.63.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    --cc=shannon.nelson@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox