Skip to content

Commit c52e9c6

Browse files
tlendackydavem330
authored andcommitted
amd-xgbe: VLAN Rx tag stripping fix
When receiving a VLAN packet check to be sure that VLAN RX CTAG stripping is enabled before indicating that the tag has been stripped in the packet information data structure. Signed-off-by: Tom Lendacky <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6e5eed0 commit c52e9c6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/amd/xgbe/xgbe-dev.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,7 @@ static int xgbe_dev_read(struct xgbe_channel *channel)
11131113
struct xgbe_ring_data *rdata;
11141114
struct xgbe_ring_desc *rdesc;
11151115
struct xgbe_packet_data *packet = &ring->packet_data;
1116+
struct net_device *netdev = channel->pdata->netdev;
11161117
unsigned int err, etlt;
11171118

11181119
DBGPR("-->xgbe_dev_read: cur = %d\n", ring->cur);
@@ -1153,7 +1154,8 @@ static int xgbe_dev_read(struct xgbe_channel *channel)
11531154
DBGPR(" err=%u, etlt=%#x\n", err, etlt);
11541155

11551156
if (!err || (err && !etlt)) {
1156-
if (etlt == 0x09) {
1157+
if ((etlt == 0x09) &&
1158+
(netdev->features & NETIF_F_HW_VLAN_CTAG_RX)) {
11571159
XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES,
11581160
VLAN_CTAG, 1);
11591161
packet->vlan_ctag = XGMAC_GET_BITS_LE(rdesc->desc0,

0 commit comments

Comments
 (0)