Commit 449da975 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

bnxt_en: Add is_ts_pkt field to struct bnxt_sw_tx_bd

Remove the unused is_gso field and add the is_ts_pkt field to struct
bnxt_sw_tx_bd.  This field will mark the TX BD that has requested
HW TX timestamp.  The field needs to be cleared if the timestamp packet
is later aborted.  This field will be useful when processing the
new TX timestamp completion from the hardware in the next patches.
Reviewed-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: default avatarAndy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be6b7ca3
...@@ -522,6 +522,7 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -522,6 +522,7 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (vlan_tag_flags) if (vlan_tag_flags)
ptp->tx_hdr_off += VLAN_HLEN; ptp->tx_hdr_off += VLAN_HLEN;
lflags |= cpu_to_le32(TX_BD_FLAGS_STAMP); lflags |= cpu_to_le32(TX_BD_FLAGS_STAMP);
tx_buf->is_ts_pkt = 1;
skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
} else { } else {
atomic_inc(&bp->ptp_cfg->tx_avail); atomic_inc(&bp->ptp_cfg->tx_avail);
...@@ -758,6 +759,7 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -758,6 +759,7 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
tx_kick_pending: tx_kick_pending:
if (BNXT_TX_PTP_IS_SET(lflags)) { if (BNXT_TX_PTP_IS_SET(lflags)) {
txr->tx_buf_ring[txr->tx_prod].is_ts_pkt = 0;
atomic64_inc(&bp->ptp_cfg->stats.ts_err); atomic64_inc(&bp->ptp_cfg->stats.ts_err);
atomic_inc(&bp->ptp_cfg->tx_avail); atomic_inc(&bp->ptp_cfg->tx_avail);
} }
...@@ -781,6 +783,7 @@ static void __bnxt_tx_int(struct bnxt *bp, struct bnxt_tx_ring_info *txr, ...@@ -781,6 +783,7 @@ static void __bnxt_tx_int(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
while (RING_TX(bp, cons) != hw_cons) { while (RING_TX(bp, cons) != hw_cons) {
struct bnxt_sw_tx_bd *tx_buf; struct bnxt_sw_tx_bd *tx_buf;
struct sk_buff *skb; struct sk_buff *skb;
bool is_ts_pkt;
int j, last; int j, last;
tx_buf = &txr->tx_buf_ring[RING_TX(bp, cons)]; tx_buf = &txr->tx_buf_ring[RING_TX(bp, cons)];
...@@ -800,6 +803,8 @@ static void __bnxt_tx_int(struct bnxt *bp, struct bnxt_tx_ring_info *txr, ...@@ -800,6 +803,8 @@ static void __bnxt_tx_int(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
tx_buf->is_push = 0; tx_buf->is_push = 0;
goto next_tx_int; goto next_tx_int;
} }
is_ts_pkt = tx_buf->is_ts_pkt;
tx_buf->is_ts_pkt = 0;
dma_unmap_single(&pdev->dev, dma_unmap_addr(tx_buf, mapping), dma_unmap_single(&pdev->dev, dma_unmap_addr(tx_buf, mapping),
skb_headlen(skb), DMA_TO_DEVICE); skb_headlen(skb), DMA_TO_DEVICE);
...@@ -814,7 +819,7 @@ static void __bnxt_tx_int(struct bnxt *bp, struct bnxt_tx_ring_info *txr, ...@@ -814,7 +819,7 @@ static void __bnxt_tx_int(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
skb_frag_size(&skb_shinfo(skb)->frags[j]), skb_frag_size(&skb_shinfo(skb)->frags[j]),
DMA_TO_DEVICE); DMA_TO_DEVICE);
} }
if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS)) { if (unlikely(is_ts_pkt)) {
if (BNXT_CHIP_P5(bp)) { if (BNXT_CHIP_P5(bp)) {
/* PTP worker takes ownership of the skb */ /* PTP worker takes ownership of the skb */
if (!bnxt_get_tx_ts_p5(bp, skb)) { if (!bnxt_get_tx_ts_p5(bp, skb)) {
......
...@@ -874,7 +874,7 @@ struct bnxt_sw_tx_bd { ...@@ -874,7 +874,7 @@ struct bnxt_sw_tx_bd {
DEFINE_DMA_UNMAP_ADDR(mapping); DEFINE_DMA_UNMAP_ADDR(mapping);
DEFINE_DMA_UNMAP_LEN(len); DEFINE_DMA_UNMAP_LEN(len);
struct page *page; struct page *page;
u8 is_gso; u8 is_ts_pkt;
u8 is_push; u8 is_push;
u8 action; u8 action;
unsigned short nr_frags; unsigned short nr_frags;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment