From: Jakub Kicinski <kuba@kernel.org>
To: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Cc: intel-wired-lan@osuosl.org, vinicius.gomes@intel.com,
naamax.meir@linux.intel.com, anthony.l.nguyen@intel.com,
leon@kernel.org, davem@davemloft.net, pabeni@redhat.com,
edumazet@google.com, tee.min.tan@linux.intel.com,
netdev@vger.kernel.org, sasha.neftin@intel.com
Subject: Re: [PATCH net-next v3] igc: offload queue max SDU from tc-taprio
Date: Wed, 8 Feb 2023 21:30:19 -0800 [thread overview]
Message-ID: <20230208213019.460d7163@kernel.org> (raw)
In-Reply-To: <20230208003327.29538-1-muhammad.husaini.zulkifli@intel.com>
On Wed, 8 Feb 2023 08:33:27 +0800 Muhammad Husaini Zulkifli wrote:
> From: Tan Tee Min <tee.min.tan@linux.intel.com>
>
> Add support for configuring the max SDU for each Tx queue.
> If not specified, keep the default.
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index 0cc327294dfb5..38ad437957ada 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -1508,6 +1508,7 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
> __le32 launch_time = 0;
> u32 tx_flags = 0;
> unsigned short f;
> + u32 max_sdu = 0;
This variable can be moved to the scope of the if() ?
> ktime_t txtime;
> u8 hdr_len = 0;
> int tso = 0;
> @@ -1527,6 +1528,14 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
> return NETDEV_TX_BUSY;
> }
>
> + if (tx_ring->max_sdu > 0) {
> + max_sdu = tx_ring->max_sdu +
> + (skb_vlan_tagged(skb) ? VLAN_HLEN : 0);
> +
> + if (skb->len > max_sdu)
You should increment some counter here. Otherwise it's a silent discard.
> + goto skb_drop;
> + }
> +
> if (!tx_ring->launchtime_enable)
> goto done;
>
> @@ -1606,6 +1615,11 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
> dev_kfree_skb_any(first->skb);
first->skb is skb, as far as I can tell, you can reshuffle this code to
avoid adding the new return flow.
> first->skb = NULL;
>
> + return NETDEV_TX_OK;
> +
> +skb_drop:
> + dev_kfree_skb_any(skb);
> +
> return NETDEV_TX_OK;
> }
> @@ -6122,6 +6137,16 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
> }
> }
>
> + for (i = 0; i < adapter->num_tx_queues; i++) {
> + struct igc_ring *ring = adapter->tx_ring[i];
> + struct net_device *dev = adapter->netdev;
> +
> + if (qopt->max_sdu[i])
> + ring->max_sdu = qopt->max_sdu[i] + dev->hard_header_len;
why hard_header_len? Isn't it always ETH_HLEN?
> + else
> + ring->max_sdu = 0;
next prev parent reply other threads:[~2023-02-09 5:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 0:33 [PATCH net-next v3] igc: offload queue max SDU from tc-taprio Muhammad Husaini Zulkifli
2023-02-09 5:30 ` Jakub Kicinski [this message]
2023-02-14 6:27 ` Zulkifli, Muhammad Husaini
2023-02-14 6:40 ` Jakub Kicinski
2023-02-14 6:49 ` Zulkifli, Muhammad Husaini
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=20230208213019.460d7163@kernel.org \
--to=kuba@kernel.org \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@osuosl.org \
--cc=leon@kernel.org \
--cc=muhammad.husaini.zulkifli@intel.com \
--cc=naamax.meir@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sasha.neftin@intel.com \
--cc=tee.min.tan@linux.intel.com \
--cc=vinicius.gomes@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;
as well as URLs for NNTP newsgroup(s).