* RE: [PATCH V1 net-next 05/15] net: ena: add prints to failed commands
@ 2020-05-22 9:09 Kiyanovski, Arthur
0 siblings, 0 replies; 3+ messages in thread
From: Kiyanovski, Arthur @ 2020-05-22 9:09 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, Woodhouse, David, Machulsky, Zorik, Matushevsky,
Alexander, Bshara, Saeed, Wilson, Matt, Liguori, Anthony, Bshara,
Nafea, Tzalik, Guy, Belgazal, Netanel, Saidi, Ali, Herrenschmidt,
Benjamin, Dagan, Noam, Agroskin, Shay, Jubran, Samih
> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Friday, May 22, 2020 1:00 AM
> To: Kiyanovski, Arthur <akiyano@amazon.com>
> Cc: davem@davemloft.net; netdev@vger.kernel.org; Woodhouse, David
> <dwmw@amazon.co.uk>; Machulsky, Zorik <zorik@amazon.com>;
> Matushevsky, Alexander <matua@amazon.com>; Bshara, Saeed
> <saeedb@amazon.com>; Wilson, Matt <msw@amazon.com>; Liguori, Anthony
> <aliguori@amazon.com>; Bshara, Nafea <nafea@amazon.com>; Tzalik, Guy
> <gtzalik@amazon.com>; Belgazal, Netanel <netanel@amazon.com>; Saidi, Ali
> <alisaidi@amazon.com>; Herrenschmidt, Benjamin <benh@amazon.com>;
> Dagan, Noam <ndagan@amazon.com>; Agroskin, Shay
> <shayagr@amazon.com>; Jubran, Samih <sameehj@amazon.com>
> Subject: RE: [PATCH V1 net-next 05/15] net: ena: add prints to
> failed commands
>
>
>
> On Thu, 21 May 2020 22:08:24 +0300 akiyano@amazon.com wrote:
> > diff --git a/drivers/net/ethernet/amazon/ena/ena_eth_com.c
> > b/drivers/net/ethernet/amazon/ena/ena_eth_com.c
> > index a014f514c069..f0b90e1551a3 100644
> > --- a/drivers/net/ethernet/amazon/ena/ena_eth_com.c
> > +++ b/drivers/net/ethernet/amazon/ena/ena_eth_com.c
> > @@ -175,8 +175,10 @@ static int ena_com_close_bounce_buffer(struct
> ena_com_io_sq *io_sq)
> > if (pkt_ctrl->idx) {
> > rc = ena_com_write_bounce_buffer_to_dev(io_sq,
> > pkt_ctrl->curr_bounce_buf);
> > - if (unlikely(rc))
> > + if (unlikely(rc)) {
> > + pr_err("failed to write bounce buffer to
> > + device\n");
>
> Could you use dev_err() or even better netdev_err() to give users an idea which
> device is misbehaving?
>
> > return rc;
> > + }
> >
> > pkt_ctrl->curr_bounce_buf =
> >
> > ena_com_get_next_bounce_buffer(&io_sq->bounce_buf_ctrl);
Yes, you're right, that would be better.
I'll remove this patch from the patchset, rework it, and submit it again in a future patchset.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH V1 net-next 05/15] net: ena: add prints to failed commands
2020-05-21 19:08 ` [PATCH V1 net-next 05/15] net: ena: add prints to failed commands akiyano
@ 2020-05-21 22:00 ` Jakub Kicinski
0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2020-05-21 22:00 UTC (permalink / raw)
To: akiyano
Cc: davem, netdev, dwmw, zorik, matua, saeedb, msw, aliguori, nafea,
gtzalik, netanel, alisaidi, benh, ndagan, shayagr, sameehj
On Thu, 21 May 2020 22:08:24 +0300 akiyano@amazon.com wrote:
> diff --git a/drivers/net/ethernet/amazon/ena/ena_eth_com.c b/drivers/net/ethernet/amazon/ena/ena_eth_com.c
> index a014f514c069..f0b90e1551a3 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_eth_com.c
> +++ b/drivers/net/ethernet/amazon/ena/ena_eth_com.c
> @@ -175,8 +175,10 @@ static int ena_com_close_bounce_buffer(struct ena_com_io_sq *io_sq)
> if (pkt_ctrl->idx) {
> rc = ena_com_write_bounce_buffer_to_dev(io_sq,
> pkt_ctrl->curr_bounce_buf);
> - if (unlikely(rc))
> + if (unlikely(rc)) {
> + pr_err("failed to write bounce buffer to device\n");
Could you use dev_err() or even better netdev_err() to give users an
idea which device is misbehaving?
> return rc;
> + }
>
> pkt_ctrl->curr_bounce_buf =
> ena_com_get_next_bounce_buffer(&io_sq->bounce_buf_ctrl);
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH V1 net-next 05/15] net: ena: add prints to failed commands
2020-05-21 19:08 [PATCH V1 net-next 00/15] ENA features and cosmetic changes akiyano
@ 2020-05-21 19:08 ` akiyano
2020-05-21 22:00 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: akiyano @ 2020-05-21 19:08 UTC (permalink / raw)
To: davem, netdev
Cc: Arthur Kiyanovski, dwmw, zorik, matua, saeedb, msw, aliguori,
nafea, gtzalik, netanel, alisaidi, benh, ndagan, shayagr,
sameehj
From: Arthur Kiyanovski <akiyano@amazon.com>
Error prints were added to provide some context to
what the driver did when receiving this error (e.g.
trying to update metadata when receiving a PCI write error).
The prints were only added to places where the connection
between the failed function, and the requested operation is
not clear.
Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
---
drivers/net/ethernet/amazon/ena/ena_eth_com.c | 24 +++++++++++++++----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/amazon/ena/ena_eth_com.c b/drivers/net/ethernet/amazon/ena/ena_eth_com.c
index a014f514c069..f0b90e1551a3 100644
--- a/drivers/net/ethernet/amazon/ena/ena_eth_com.c
+++ b/drivers/net/ethernet/amazon/ena/ena_eth_com.c
@@ -175,8 +175,10 @@ static int ena_com_close_bounce_buffer(struct ena_com_io_sq *io_sq)
if (pkt_ctrl->idx) {
rc = ena_com_write_bounce_buffer_to_dev(io_sq,
pkt_ctrl->curr_bounce_buf);
- if (unlikely(rc))
+ if (unlikely(rc)) {
+ pr_err("failed to write bounce buffer to device\n");
return rc;
+ }
pkt_ctrl->curr_bounce_buf =
ena_com_get_next_bounce_buffer(&io_sq->bounce_buf_ctrl);
@@ -206,8 +208,10 @@ static int ena_com_sq_update_llq_tail(struct ena_com_io_sq *io_sq)
if (!pkt_ctrl->descs_left_in_line) {
rc = ena_com_write_bounce_buffer_to_dev(io_sq,
pkt_ctrl->curr_bounce_buf);
- if (unlikely(rc))
+ if (unlikely(rc)) {
+ pr_err("failed to write bounce buffer to device\n");
return rc;
+ }
pkt_ctrl->curr_bounce_buf =
ena_com_get_next_bounce_buffer(&io_sq->bounce_buf_ctrl);
@@ -395,8 +399,10 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq,
}
if (unlikely(io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV &&
- !buffer_to_push))
+ !buffer_to_push)) {
+ pr_err("push header wasn't provided on LLQ mode\n");
return -EINVAL;
+ }
rc = ena_com_write_header_to_bounce(io_sq, buffer_to_push, header_len);
if (unlikely(rc))
@@ -413,6 +419,8 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq,
/* If the caller doesn't want to send packets */
if (unlikely(!num_bufs && !header_len)) {
rc = ena_com_close_bounce_buffer(io_sq);
+ if (rc)
+ pr_err("failed to write buffers to LLQ\n");
*nb_hw_desc = io_sq->tail - start_tail;
return rc;
}
@@ -472,8 +480,10 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq,
/* The first desc share the same desc as the header */
if (likely(i != 0)) {
rc = ena_com_sq_update_tail(io_sq);
- if (unlikely(rc))
+ if (unlikely(rc)) {
+ pr_err("failed to update sq tail\n");
return rc;
+ }
desc = get_sq_desc(io_sq);
if (unlikely(!desc))
@@ -502,10 +512,14 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq,
desc->len_ctrl |= ENA_ETH_IO_TX_DESC_LAST_MASK;
rc = ena_com_sq_update_tail(io_sq);
- if (unlikely(rc))
+ if (unlikely(rc)) {
+ pr_err("failed to update sq tail of the last descriptor\n");
return rc;
+ }
rc = ena_com_close_bounce_buffer(io_sq);
+ if (unlikely(rc))
+ pr_err("failed when closing bounce buffer\n");
*nb_hw_desc = io_sq->tail - start_tail;
return rc;
--
2.23.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-22 9:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22 9:09 [PATCH V1 net-next 05/15] net: ena: add prints to failed commands Kiyanovski, Arthur
-- strict thread matches above, loose matches on Subject: below --
2020-05-21 19:08 [PATCH V1 net-next 00/15] ENA features and cosmetic changes akiyano
2020-05-21 19:08 ` [PATCH V1 net-next 05/15] net: ena: add prints to failed commands akiyano
2020-05-21 22:00 ` Jakub Kicinski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.