Skip to content

Commit 9ab0ac0

Browse files
Subbaraya SundeepPaolo Abeni
Subbaraya Sundeep
authored and
Paolo Abeni
committed
octeontx2-pf: Add tracepoint for NIX_PARSE_S
The NIX_PARSE_S structure populated by hardware in the NIX RX CQE has parsing information for the received packet. A tracepoint to dump the all words of NIX_PARSE_S is helpful in debugging packet parser. Signed-off-by: Subbaraya Sundeep <[email protected]> Signed-off-by: Ratheesh Kannoth <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 31be641 commit 9ab0ac0

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ EXPORT_TRACEPOINT_SYMBOL(otx2_msg_alloc);
1212
EXPORT_TRACEPOINT_SYMBOL(otx2_msg_interrupt);
1313
EXPORT_TRACEPOINT_SYMBOL(otx2_msg_process);
1414
EXPORT_TRACEPOINT_SYMBOL(otx2_msg_status);
15+
EXPORT_TRACEPOINT_SYMBOL(otx2_parse_dump);

drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,32 @@ TRACE_EVENT(otx2_msg_status,
133133
__get_str(str), __entry->num_msgs)
134134
);
135135

136+
TRACE_EVENT(otx2_parse_dump,
137+
TP_PROTO(const struct pci_dev *pdev, char *msg, u64 *word),
138+
TP_ARGS(pdev, msg, word),
139+
TP_STRUCT__entry(__string(dev, pci_name(pdev))
140+
__string(str, msg)
141+
__field(u64, w0)
142+
__field(u64, w1)
143+
__field(u64, w2)
144+
__field(u64, w3)
145+
__field(u64, w4)
146+
__field(u64, w5)
147+
),
148+
TP_fast_assign(__assign_str(dev);
149+
__assign_str(str);
150+
__entry->w0 = *(word + 0);
151+
__entry->w1 = *(word + 1);
152+
__entry->w2 = *(word + 2);
153+
__entry->w3 = *(word + 3);
154+
__entry->w4 = *(word + 4);
155+
__entry->w5 = *(word + 5);
156+
),
157+
TP_printk("[%s] nix parse %s W0:%#llx W1:%#llx W2:%#llx W3:%#llx W4:%#llx W5:%#llx\n",
158+
__get_str(dev), __get_str(str), __entry->w0, __entry->w1, __entry->w2,
159+
__entry->w3, __entry->w4, __entry->w5)
160+
);
161+
136162
#endif /* __RVU_TRACE_H */
137163

138164
#undef TRACE_INCLUDE_PATH

drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,16 +335,20 @@ static void otx2_rcv_pkt_handler(struct otx2_nic *pfvf,
335335
struct nix_rx_parse_s *parse = &cqe->parse;
336336
struct nix_rx_sg_s *sg = &cqe->sg;
337337
struct sk_buff *skb = NULL;
338+
u64 *word = (u64 *)parse;
338339
void *end, *start;
339340
u32 metasize = 0;
340341
u64 *seg_addr;
341342
u16 *seg_size;
342343
int seg;
343344

344345
if (unlikely(parse->errlev || parse->errcode)) {
345-
if (otx2_check_rcv_errors(pfvf, cqe, cq->cq_idx))
346+
if (otx2_check_rcv_errors(pfvf, cqe, cq->cq_idx)) {
347+
trace_otx2_parse_dump(pfvf->pdev, "Err:", word);
346348
return;
349+
}
347350
}
351+
trace_otx2_parse_dump(pfvf->pdev, "", word);
348352

349353
if (pfvf->xdp_prog)
350354
if (otx2_xdp_rcv_pkt_handler(pfvf, pfvf->xdp_prog, cqe, cq,

0 commit comments

Comments
 (0)