diff mbox series

[net,1/3] igc: pad preemptible packets before reserving TX timestamps

Message ID 20261026091549.605810-1-p@1g4.org
State Under Review
Headers show
Series [net,1/3] igc: pad preemptible packets before reserving TX timestamps | expand

Commit Message

Paul Moses Oct. 26, 2026, 9:16 a.m. UTC
Preemptible queues require software padding so hardware includes the
padding bytes in the mCRC. Padding currently runs after TX timestamp
reservation takes an extra skb reference. If padding needs to expand
the skb, pskb_expand_head() rejects the shared skb.

Commit c7d8bc3dd511 ("net: skbuff: don't BUG() on bad arguments to
pskb_expand_head()") replaced the BUG_ON() with -EINVAL, exposing the
padding error path. skb_padto() drops one reference on failure, and
out_drop drops another. This can free the skb while the pending TX
timestamp still holds its pointer.

Move padding before TX timestamp reservation and use __skb_put_padto()
with free_on_error set to false so out_drop handles the skb release.
Preserve the VLAN flags in first->tx_flags when adding timestamp flags.

Fixes: 17643482e9ff ("igc: add preemptible queue support in taprio")
Signed-off-by: Paul Moses <p@1g4.org>
---
 drivers/net/ethernet/intel/igc/igc_main.c | 39 +++++++++++------------
 1 file changed, 19 insertions(+), 20 deletions(-)


base-commit: af32da41b0327b9c6a37856ba82b6760d6c8d10e

Comments

netdev-bot+sinfo@kernel.org Oct. 26, 2026, 9:20 a.m. UTC | #1
Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by code inspection). If it was triggered please include
   the symptoms, like the stack trace or error messages.

 - What hardware the change was tested on. For driver fixes please
   mention the device (and if relevant firmware version) used for
   testing, or say that the change was not tested on real hardware.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.

The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
Paul Moses Oct. 26, 2026, 9:40 a.m. UTC | #2
On Monday, October 26th, 2026 at 4:20 AM, netdev-bot+sinfo@kernel.org <netdev-bot+sinfo@kernel.org> wrote:

> Hi!
> 
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
> 
>  - How the issue was discovered, e.g. hit in production, hit during
>    development, syzbot report, manual code inspection, LLM or static
>    analysis tool scan.
> 
>  - Whether the issue was actually triggered, or is only theoretical
>    (e.g. found by code inspection). If it was triggered please include
>    the symptoms, like the stack trace or error messages.
> 
>  - What hardware the change was tested on. For driver fixes please
>    mention the device (and if relevant firmware version) used for
>    testing, or say that the change was not tested on real hardware.
> 
> Please do not repost the series just to address the above. Instead,
> reply to this email with the missing information, so that reviewers
> can take it into account. If the series needs another revision for
> other reasons, please include the information in the commit messages
> then.
> 
> The evaluation is done by an LLM so it may be wrong, if you think
> that is the case please reply and explain.
> 

Originally found during igc development.

[11865.112180] kernel BUG at pskb_expand_head+0x3f3/0x400 [verbose debug info unavailable]
[11865.112206] Oops: invalid opcode: 0000 [#1] SMP NOPTI
[11865.324662] CPU: 7 UID: 0 PID: 91702 Comm: t Not tainted 7.3.0-rc6-nokasan+ #5 PREEMPT
[11865.429202] RIP: 0010:pskb_expand_head+0x3f3/0x400
[11865.486782] Code: 00 48 83 c7 08 e8 dd da ab ff e9 d2 fd ff ff 4c 8b ab c0 00 00 00 44 8b b3 bc 00 00 00 43 0f b6 44 35 00 e9 89 fd ff ff 0f 0b <0f> 0b 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90
[11865.712331] RSP: 0018:ffffaaf3029077e8 EFLAGS: 00010202
[11865.775131] RAX: 0000000000000002 RBX: ffff9e3260c92920 RCX: 0000000000000820
[11865.860902] RDX: 00000000ffffffc6 RSI: 0000000000000000 RDI: ffff9e3260c92920
[11865.946667] RBP: 0000000000000001 R08: 0000000000000003 R09: 0000000000000001
[11866.032435] R10: 0000000000000000 R11: ffffffffc060c8e0 R12: ffff9e3260c92994
[11866.118206] R13: 0000000000000140 R14: 0000000000000005 R15: 000000000000003c
[11866.203979] FS:  00007860e5343e78(0000) GS:ffff9e3770bd5000(0000) knlGS:0000000000000000
[11866.301224] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[11866.370293] CR2: 00007860e531ac90 CR3: 00000005a7e60002 CR4: 0000000000f70ef0
[11866.456051] PKRU: 55555554
[11866.488599] Call Trace:
[11866.518015]  <TASK>
[11866.543266]  __skb_pad+0xbf/0x130
[11866.583116]  igc_xmit_frame+0x428/0xec0 [igc]
[11866.635491]  ? netif_skb_features+0x230/0x330
[11866.687859]  dev_hard_start_xmit+0x9e/0x1b0
[11866.738142]  sch_direct_xmit+0xde/0x260
[11866.784249]  ? __dev_queue_xmit+0x99/0xf20
[11866.833495]  __dev_queue_xmit+0x77d/0xf20
[11866.881698]  ip_finish_output2+0x310/0x390
[11866.930951]  ip_output+0x64/0x100
[11866.970811]  __ip_queue_xmit+0x485/0x4a0
[11867.017973]  ? __skb_clone+0x2a/0x120
[11867.062009]  __tcp_transmit_skb+0xa79/0xc80
[11867.112299]  tcp_write_xmit+0x849/0x1090
[11867.159463]  __tcp_push_pending_frames+0x32/0xc0
[11867.214967]  tcp_sendmsg_locked+0xeb3/0x1110
[11867.266312]  tcp_sendmsg+0x2c/0x50
[11867.307211]  __sock_sendmsg+0x67/0x90
[11867.351251]  __sys_sendto+0x242/0x290
[11867.395277]  __x64_sys_sendto+0x26/0x30
[11867.441393]  do_syscall_64+0xdb/0x310
[11867.485420]  ? do_syscall_64+0x42/0x310
[11867.531533]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
[11867.592248] RIP: 0033:0x7860e532f19d
[11867.635231] Code: c0 0f 85 24 00 00 00 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> e9 1d bb ff ff cc cc cc cc cc cc cc cc cc cc cc cc cc 41 56 53
[11867.860798] RSP: 002b:00007ffdb9a150e8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
[11867.951782] RAX: ffffffffffffffda RBX: 000000000000002c RCX: 00007860e532f19d
[11868.037552] RDX: 0000000000000001 RSI: 00007ffdb9a1514f RDI: 0000000000000003
[11868.123327] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
[11868.209105] R10: 0000000000000000 R11: 0000000000000246 R12: 00007860e5343e78
[11868.294873] R13: 00007ffdb9a151c0 R14: 0000000000000000 R15: 00007860e5343eb4
[11868.380648]  </TASK>

Tested on I210 and I225-V
Eric Dumazet Oct. 27, 2026, 6:41 a.m. UTC | #3
Le lun. 26 oct. 2026 à 10:16, Paul Moses <p@1g4.org> a écrit :
>
> Preemptible queues require software padding so hardware includes the
> padding bytes in the mCRC. Padding currently runs after TX timestamp
> reservation takes an extra skb reference. If padding needs to expand
> the skb, pskb_expand_head() rejects the shared skb.
>
> Commit c7d8bc3dd511 ("net: skbuff: don't BUG() on bad arguments to
> pskb_expand_head()") replaced the BUG_ON() with -EINVAL, exposing the
> padding error path. skb_padto() drops one reference on failure, and
> out_drop drops another. This can free the skb while the pending TX
> timestamp still holds its pointer.
>
> Move padding before TX timestamp reservation and use __skb_put_padto()
> with free_on_error set to false so out_drop handles the skb release.
> Preserve the VLAN flags in first->tx_flags when adding timestamp flags.
>
> Fixes: 17643482e9ff ("igc: add preemptible queue support in taprio")
> Signed-off-by: Paul Moses <p@1g4.org>

Reviewed-by: Eric Dumazet <edumazet@kernel.org>
netdev-bot+sashiko@kernel.org Oct. 27, 2026, 12:17 p.m. UTC | #4
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 0 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] After this patch alone, igc_xmit_frame_ring() still calls
  igc_request_tx_tstamp(), which does skb_get() (line ~1687), before…
- [Low] The commit message describes a failure that cannot happen on the
  tree this patch applies to.

--

igc: pad preemptible packets before reserving TX timestamps

This commit moves the preemptible-queue padding in igc_xmit_frame_ring()
so it runs before the TX timestamp reservation. The extra reference taken
by igc_request_tx_tstamp() is then not yet held when padding may call
pskb_expand_head(). It also switches to __skb_put_padto() with
free_on_error set to false, so out_drop is the only place that frees the
skb.

> Commit c7d8bc3dd511 ("net: skbuff: don't BUG() on bad arguments to
> pskb_expand_head()") replaced the BUG_ON() with -EINVAL, exposing the
> padding error path. skb_padto() drops one reference on failure, and
> out_drop drops another. This can free the skb while the pending TX
> timestamp still holds its pointer.

[Severity: Low]
Does this description match the tree this patch applies to? Here,
pskb_expand_head() in net/core/skbuff.c still has:

	BUG_ON(nhead < 0);

	BUG_ON(skb_shared(skb));

So c7d8bc3dd511 does not appear to be applied. Without it, take a short
frame on a preemptible queue that is cloned or lacks tailroom. Before
this patch it would go through:

igc_xmit_frame_ring()
  igc_request_tx_tstamp()
    tstamp->skb = skb_get(skb);    /* skb now shared */
  skb_padto()
    __skb_pad()
      pskb_expand_head()
        BUG_ON(skb_shared(skb));

That gives a BUG() rather than the -EINVAL and use-after-free described
above. The same holds for stable trees that carry 17643482e9ff but not
c7d8bc3dd511.

The code change covers both cases, since padding now runs before
skb_get(). Could the commit message say that kernels without
c7d8bc3dd511 crash in pskb_expand_head() instead?

> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index 1fb5f3cbe93c5..f1bf4e462a511 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c

[ ... ]

> @@ -1669,10 +1686,10 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
>  		spin_lock_irqsave(&adapter->ptp_tx_lock, flags);
>  		if (igc_request_tx_tstamp(adapter, skb, &tstamp_flags)) {
>  			skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;

[ ... ]

> @@ -1680,24 +1697,6 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
>  		spin_unlock_irqrestore(&adapter->ptp_tx_lock, flags);
>  	}
>  

[ ... ]

> -	if (tx_ring->preemptible && skb->len < ETH_ZLEN) {
> -		if (skb_padto(skb, ETH_ZLEN))
> -			goto out_drop;
> -		skb_put(skb, ETH_ZLEN - skb->len);
> -	}
> -
>  	tso = igc_tso(tx_ring, first, launch_time, first_flag, &hdr_len);
>  	if (tso < 0)
>  		goto out_drop;

[Severity: High]
With this patch applied on its own, igc_request_tx_tstamp() still runs
before igc_tso() and igc_tx_csum(). Can the same shared skb problem come
up here?

When a GSO skb with a cloned header (for example with a packet tap or tc
mirred active) is hardware timestamped:

igc_xmit_frame_ring()
  igc_request_tx_tstamp()
    tstamp->skb = skb_get(skb);
  igc_tso()
    skb_cow_head(skb, 0)
      __skb_cow()
        pskb_expand_head()
          BUG_ON(skb_shared(skb));

igc_tx_csum() can reach pskb_expand_head() the same way, through
skb_checksum_help()->skb_ensure_writable(), on a cloned skb.

The next patch in this series, "igc: prepare TSO and checksum offloads
before TX timestamps", moves igc_tso() and igc_tx_csum() ahead of the
timestamp reservation. That fixes this by the end of the series. Should
the two patches be backported together, since this one alone leaves the
TSO and checksum paths exposed?
Paul Moses Oct. 27, 2026, 4:13 p.m. UTC | #5
> [Severity: Low]
> Does this description match the tree this patch applies to?

It needs to be clear that it is affected by that commit.

> [Severity: High]
> With this patch applied on its own, igc_request_tx_tstamp() still runs
> before igc_tso() and igc_tx_csum(). Can the same shared skb problem come
> up here?
> 
> When a GSO skb with a cloned header (for example with a packet tap or tc
> mirred active) is hardware timestamped:
> 
> igc_xmit_frame_ring()
>   igc_request_tx_tstamp()
>     tstamp->skb = skb_get(skb);
>   igc_tso()
>     skb_cow_head(skb, 0)
>       __skb_cow()
>         pskb_expand_head()
>           BUG_ON(skb_shared(skb));
> 
> igc_tx_csum() can reach pskb_expand_head() the same way, through
> skb_checksum_help()->skb_ensure_writable(), on a cloned skb.
> 
> The next patch in this series, "igc: prepare TSO and checksum offloads
> before TX timestamps", moves igc_tso() and igc_tx_csum() ahead of the
> timestamp reservation. That fixes this by the end of the series. Should
> the two patches be backported together, since this one alone leaves the
> TSO and checksum paths exposed?
> 

Yes, I maybe need to research how to properly denote this
Jacob Keller Oct. 27, 2026, 8:44 p.m. UTC | #6
On 10/27/2026 9:13 AM, Paul Moses wrote:
>> [Severity: Low]
>> Does this description match the tree this patch applies to?
> 
> It needs to be clear that it is affected by that commit.
> 
>> [Severity: High]
>> With this patch applied on its own, igc_request_tx_tstamp() still runs
>> before igc_tso() and igc_tx_csum(). Can the same shared skb problem come
>> up here?
>>
>> When a GSO skb with a cloned header (for example with a packet tap or tc
>> mirred active) is hardware timestamped:
>>
>> igc_xmit_frame_ring()
>>   igc_request_tx_tstamp()
>>     tstamp->skb = skb_get(skb);
>>   igc_tso()
>>     skb_cow_head(skb, 0)
>>       __skb_cow()
>>         pskb_expand_head()
>>           BUG_ON(skb_shared(skb));
>>
>> igc_tx_csum() can reach pskb_expand_head() the same way, through
>> skb_checksum_help()->skb_ensure_writable(), on a cloned skb.
>>
>> The next patch in this series, "igc: prepare TSO and checksum offloads
>> before TX timestamps", moves igc_tso() and igc_tx_csum() ahead of the
>> timestamp reservation. That fixes this by the end of the series. Should
>> the two patches be backported together, since this one alone leaves the
>> TSO and checksum paths exposed?
>>
> 
> Yes, I maybe need to research how to properly denote this

Personally, I think its clear from the series context.

Thanks,
Jake
Maciej Fijalkowski Oct. 28, 2026, 3:31 p.m. UTC | #7
On Mon, Oct 26, 2026 at 09:16:07AM +0000, Paul Moses wrote:
> Preemptible queues require software padding so hardware includes the
> padding bytes in the mCRC. Padding currently runs after TX timestamp
> reservation takes an extra skb reference. If padding needs to expand
> the skb, pskb_expand_head() rejects the shared skb.
> 
> Commit c7d8bc3dd511 ("net: skbuff: don't BUG() on bad arguments to
> pskb_expand_head()") replaced the BUG_ON() with -EINVAL, exposing the
> padding error path. skb_padto() drops one reference on failure, and
> out_drop drops another. This can free the skb while the pending TX
> timestamp still holds its pointer.
> 
> Move padding before TX timestamp reservation and use __skb_put_padto()
> with free_on_error set to false so out_drop handles the skb release.
> Preserve the VLAN flags in first->tx_flags when adding timestamp flags.
> 
> Fixes: 17643482e9ff ("igc: add preemptible queue support in taprio")
> Signed-off-by: Paul Moses <p@1g4.org>

I skimmed thru clashiko output and nothing major stands out to me. For
your future contributions - multiple patches sent as change set require to
have the cover letter.

For the series:
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

> ---
>  drivers/net/ethernet/intel/igc/igc_main.c | 39 +++++++++++------------
>  1 file changed, 19 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index 1fb5f3cbe93c..f1bf4e462a51 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -1661,6 +1661,23 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
>  		goto out_drop;
>  	}
>  
> +	if (skb_vlan_tag_present(skb)) {
> +		tx_flags |= IGC_TX_FLAGS_VLAN;
> +		tx_flags |= (skb_vlan_tag_get(skb) << IGC_TX_FLAGS_VLAN_SHIFT);
> +	}
> +
> +	/* record initial flags and protocol */
> +	first->tx_flags = tx_flags;
> +	first->protocol = protocol;
> +
> +	/* For preemptible queue, manually pad the skb so that HW includes
> +	 * padding bytes in mCRC calculation
> +	 */
> +	if (tx_ring->preemptible && skb->len < ETH_ZLEN) {
> +		if (__skb_put_padto(skb, ETH_ZLEN, false))
> +			goto out_drop;
> +	}
> +
>  	if (unlikely(test_bit(IGC_RING_FLAG_TX_HWTSTAMP, &tx_ring->flags) &&
>  		     skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
>  		unsigned long flags;
> @@ -1669,10 +1686,10 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
>  		spin_lock_irqsave(&adapter->ptp_tx_lock, flags);
>  		if (igc_request_tx_tstamp(adapter, skb, &tstamp_flags)) {
>  			skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
> -			tx_flags |= IGC_TX_FLAGS_TSTAMP | tstamp_flags;
> +			first->tx_flags |= IGC_TX_FLAGS_TSTAMP | tstamp_flags;
>  			if (skb->sk &&
>  			    READ_ONCE(skb->sk->sk_tsflags) & SOF_TIMESTAMPING_BIND_PHC)
> -				tx_flags |= IGC_TX_FLAGS_TSTAMP_TIMER_1;
> +				first->tx_flags |= IGC_TX_FLAGS_TSTAMP_TIMER_1;
>  		} else {
>  			adapter->tx_hwtstamp_skipped++;
>  		}
> @@ -1680,24 +1697,6 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
>  		spin_unlock_irqrestore(&adapter->ptp_tx_lock, flags);
>  	}
>  
> -	if (skb_vlan_tag_present(skb)) {
> -		tx_flags |= IGC_TX_FLAGS_VLAN;
> -		tx_flags |= (skb_vlan_tag_get(skb) << IGC_TX_FLAGS_VLAN_SHIFT);
> -	}
> -
> -	/* record initial flags and protocol */
> -	first->tx_flags = tx_flags;
> -	first->protocol = protocol;
> -
> -	/* For preemptible queue, manually pad the skb so that HW includes
> -	 * padding bytes in mCRC calculation
> -	 */
> -	if (tx_ring->preemptible && skb->len < ETH_ZLEN) {
> -		if (skb_padto(skb, ETH_ZLEN))
> -			goto out_drop;
> -		skb_put(skb, ETH_ZLEN - skb->len);
> -	}
> -
>  	tso = igc_tso(tx_ring, first, launch_time, first_flag, &hdr_len);
>  	if (tso < 0)
>  		goto out_drop;
> 
> base-commit: af32da41b0327b9c6a37856ba82b6760d6c8d10e
> 
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 1fb5f3cbe93c..f1bf4e462a51 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -1661,6 +1661,23 @@  static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
 		goto out_drop;
 	}
 
+	if (skb_vlan_tag_present(skb)) {
+		tx_flags |= IGC_TX_FLAGS_VLAN;
+		tx_flags |= (skb_vlan_tag_get(skb) << IGC_TX_FLAGS_VLAN_SHIFT);
+	}
+
+	/* record initial flags and protocol */
+	first->tx_flags = tx_flags;
+	first->protocol = protocol;
+
+	/* For preemptible queue, manually pad the skb so that HW includes
+	 * padding bytes in mCRC calculation
+	 */
+	if (tx_ring->preemptible && skb->len < ETH_ZLEN) {
+		if (__skb_put_padto(skb, ETH_ZLEN, false))
+			goto out_drop;
+	}
+
 	if (unlikely(test_bit(IGC_RING_FLAG_TX_HWTSTAMP, &tx_ring->flags) &&
 		     skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
 		unsigned long flags;
@@ -1669,10 +1686,10 @@  static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
 		spin_lock_irqsave(&adapter->ptp_tx_lock, flags);
 		if (igc_request_tx_tstamp(adapter, skb, &tstamp_flags)) {
 			skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
-			tx_flags |= IGC_TX_FLAGS_TSTAMP | tstamp_flags;
+			first->tx_flags |= IGC_TX_FLAGS_TSTAMP | tstamp_flags;
 			if (skb->sk &&
 			    READ_ONCE(skb->sk->sk_tsflags) & SOF_TIMESTAMPING_BIND_PHC)
-				tx_flags |= IGC_TX_FLAGS_TSTAMP_TIMER_1;
+				first->tx_flags |= IGC_TX_FLAGS_TSTAMP_TIMER_1;
 		} else {
 			adapter->tx_hwtstamp_skipped++;
 		}
@@ -1680,24 +1697,6 @@  static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
 		spin_unlock_irqrestore(&adapter->ptp_tx_lock, flags);
 	}
 
-	if (skb_vlan_tag_present(skb)) {
-		tx_flags |= IGC_TX_FLAGS_VLAN;
-		tx_flags |= (skb_vlan_tag_get(skb) << IGC_TX_FLAGS_VLAN_SHIFT);
-	}
-
-	/* record initial flags and protocol */
-	first->tx_flags = tx_flags;
-	first->protocol = protocol;
-
-	/* For preemptible queue, manually pad the skb so that HW includes
-	 * padding bytes in mCRC calculation
-	 */
-	if (tx_ring->preemptible && skb->len < ETH_ZLEN) {
-		if (skb_padto(skb, ETH_ZLEN))
-			goto out_drop;
-		skb_put(skb, ETH_ZLEN - skb->len);
-	}
-
 	tso = igc_tso(tx_ring, first, launch_time, first_flag, &hdr_len);
 	if (tso < 0)
 		goto out_drop;