Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Zhou Furong <furong.zhou@linux.intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH net-next v5 09/11] igc: Add support for Frame Preemption verification
Date: Fri, 27 May 2022 17:08:18 +0800	[thread overview]
Message-ID: <e6cb8b03-4d3d-b64b-0aca-642fe53ecb90@linux.intel.com> (raw)
In-Reply-To: <20220520011538.1098888-10-vinicius.gomes@intel.com>

> +
> +	struct delayed_work fp_verification_work;
> +	unsigned long fp_start;
> +	bool fp_received_smd_v;
> +	bool fp_received_smd_r;
> +	unsigned int fp_verify_cnt;
> +	enum frame_preemption_state fp_tx_state;
> +	bool fp_disable_verify;

struct size would be smaller if add member to right place


> +	if (!netif_running(adapter->netdev))
> +		return -ENOTCONN;
> +
> +	/* FIXME: rename this function to something less specific, as
> +	 * it can be used outside XDP.
> +	 */
> +	ring = igc_xdp_get_tx_ring(adapter, cpu);
> +	nq = txring_txq(ring);
> +
> +	skb = alloc_skb(IGC_FP_SMD_FRAME_SIZE, GFP_KERNEL);
> +	if (!skb)
> +		return -ENOMEM;
> +
if there is chance of NOMEM, move this before
ring = igc_xdp_get_tx_ring(adapter, cpu);


> +static void igc_fp_verification_work(struct work_struct *work)
> +{
> +	struct delayed_work *dwork = to_delayed_work(work);
> +	struct igc_adapter *adapter;
> +	int err;
> +
> +	adapter = container_of(dwork, struct igc_adapter, fp_verification_work);
> +
please remove blank

> +	if (adapter->fp_disable_verify)
> +		goto done;
> +
> +	switch (adapter->fp_tx_state) {
> +	case FRAME_PREEMPTION_STATE_START:
> +		adapter->fp_received_smd_r = false;
> +		err = igc_xmit_smd_frame(adapter, IGC_SMD_TYPE_SMD_V);
> +		if (err < 0)
> +			netdev_err(adapter->netdev, "Error sending SMD-V frame\n");
> +
> +		adapter->fp_tx_state = FRAME_PREEMPTION_STATE_SENT;
state is SENT when send error?

> +		adapter->fp_start = jiffies;
> +		schedule_delayed_work(&adapter->fp_verification_work, IGC_FP_TIMEOUT);
> +		break;
> +





> +
> +			if (adapter->fp_verify_cnt > IGC_MAX_VERIFY_CNT) {
> +				adapter->fp_verify_cnt = 0;
> +				adapter->fp_tx_state = FRAME_PREEMPTION_STATE_FAILED;
> +				netdev_err(adapter->netdev,
> +					   "Exceeded number of attempts for frame preemption verification\n");
> +			} else {
> +				adapter->fp_tx_state = FRAME_PREEMPTION_STATE_START;
> +			}
> +			schedule_delayed_work(&adapter->fp_verification_work, IGC_FP_TIMEOUT);
> +		}
> +
> +		break;
> +
> +	case FRAME_PREEMPTION_STATE_FAILED:
> +	case FRAME_PREEMPTION_STATE_DONE:
miss default?

> +		break;
> +	}
> +

  parent reply	other threads:[~2022-05-27  9:08 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20  1:15 [Intel-wired-lan] [PATCH net-next v5 00/11] ethtool: Add support for frame preemption Vinicius Costa Gomes
2022-05-20  1:15 ` [Intel-wired-lan] [PATCH net-next v5 01/11] ethtool: Add support for configuring " Vinicius Costa Gomes
2022-05-20  9:06   ` Vladimir Oltean
2022-05-20  1:15 ` [Intel-wired-lan] [PATCH net-next v5 02/11] ethtool: Add support for Frame Preemption verification Vinicius Costa Gomes
2022-05-20  9:16   ` Vladimir Oltean
2022-05-20  1:15 ` [Intel-wired-lan] [PATCH net-next v5 03/11] igc: Add support for receiving frames with all zeroes address Vinicius Costa Gomes
2022-05-20  1:15 ` [Intel-wired-lan] [PATCH net-next v5 04/11] igc: Set the RX packet buffer size for TSN mode Vinicius Costa Gomes
2022-05-20  1:15 ` [Intel-wired-lan] [PATCH net-next v5 05/11] igc: Optimze TX buffer sizes for TSN Vinicius Costa Gomes
2022-05-20  9:33   ` Vladimir Oltean
2022-05-20  1:15 ` [Intel-wired-lan] [PATCH net-next v5 06/11] igc: Add support for receiving errored frames Vinicius Costa Gomes
2022-05-20  9:19   ` Vladimir Oltean
2022-05-20  1:15 ` [Intel-wired-lan] [PATCH net-next v5 07/11] igc: Add support for enabling frame preemption via ethtool Vinicius Costa Gomes
2022-05-20  1:15 ` [Intel-wired-lan] [PATCH net-next v5 08/11] igc: Add support for setting frame preemption configuration Vinicius Costa Gomes
2022-05-20  9:22   ` Vladimir Oltean
2022-05-20  1:15 ` [Intel-wired-lan] [PATCH net-next v5 09/11] igc: Add support for Frame Preemption verification Vinicius Costa Gomes
2022-05-20 10:43   ` Vladimir Oltean
2022-05-27  9:08   ` Zhou Furong [this message]
2022-05-20  1:15 ` [Intel-wired-lan] [PATCH net-next v5 10/11] igc: Check incompatible configs for Frame Preemption Vinicius Costa Gomes
2022-05-20  6:11   ` kernel test robot
2022-05-20 11:06   ` Vladimir Oltean
2022-05-20  1:15 ` [Intel-wired-lan] [PATCH net-next v5 11/11] igc: Add support for exposing frame preemption stats registers Vinicius Costa Gomes
2022-05-20 12:13   ` Vladimir Oltean
2022-05-20 22:34 ` [Intel-wired-lan] [PATCH net-next v5 00/11] ethtool: Add support for frame preemption Jakub Kicinski
2022-05-21 15:03   ` Vladimir Oltean
2022-05-23 19:52     ` Jakub Kicinski
2022-05-23 20:32       ` Vladimir Oltean
2022-05-23 21:31         ` Jakub Kicinski
2022-05-23 22:49           ` Vladimir Oltean
2022-05-23 23:33       ` Vladimir Oltean

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=e6cb8b03-4d3d-b64b-0aca-642fe53ecb90@linux.intel.com \
    --to=furong.zhou@linux.intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /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