Skip to content

Commit

Permalink
net/e1000: fix saving of stripped VLAN TCI
Browse files Browse the repository at this point in the history
[ upstream commit 8d57c9fcfcda3122aa38fba08a029ec248eeb52d ]

When receiving a scattered packet, save the stripped VLAN TCI
in the first mbuf segment where users expect to find it.

Fixes: 8058034 ("e1000: support EM devices (also known as e1000/e1000e)")

Signed-off-by: Visa Hankala <visa@hankala.org>
Acked-by: Wenjun Wu <wenjun1.wu@intel.com>
  • Loading branch information
vhankala authored and kevintraynor committed Mar 21, 2023
1 parent ac111b8 commit acfff39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .mailmap
Expand Up @@ -1414,6 +1414,7 @@ Vincent Li <vincent.mc.li@gmail.com>
Vincent S. Cojot <vcojot@redhat.com>
Vipin Varghese <vipin.varghese@amd.com> <vipin.varghese@intel.com>
Vipul Ashri <vipul.ashri@oracle.com>
Visa Hankala <visa@hankala.org>
Vishal Kulkarni <vishal@chelsio.com>
Vishwas Danivas <vishwas@pensando.io>
Vitaliy Mysak <vitaliy.mysak@intel.com>
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/e1000/em_rxtx.c
Expand Up @@ -1030,6 +1030,7 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
* - RX port identifier,
* - hardware offload data, if any:
* - IP checksum flag,
* - VLAN TCI, if any,
* - error flags.
*/
first_seg->port = rxq->port_id;
Expand All @@ -1039,7 +1040,7 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
rx_desc_error_to_pkt_flags(rxd.errors);

/* Only valid if RTE_MBUF_F_RX_VLAN set in pkt_flags */
rxm->vlan_tci = rte_le_to_cpu_16(rxd.special);
first_seg->vlan_tci = rte_le_to_cpu_16(rxd.special);

/* Prefetch data of first segment, if configured to do so. */
rte_packet_prefetch((char *)first_seg->buf_addr +
Expand Down

0 comments on commit acfff39

Please sign in to comment.