* [PATCH] hw/net/rocker: Report unimplemented feature with qemu_log_mask(UNIMP)
@ 2020-02-17 10:16 Philippe Mathieu-Daudé
2020-02-18 10:56 ` Stefan Hajnoczi
2020-02-18 19:19 ` Laurent Vivier
0 siblings, 2 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-17 10:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-trivial, Philippe Mathieu-Daudé,
Jason Wang, Jiri Pirko, Stefan Hajnoczi
Fix warnings reported by Clang static code analyzer:
CC hw/net/rocker/rocker.o
hw/net/rocker/rocker.c:213:9: warning: Value stored to 'tx_tso_mss' is never read
tx_tso_mss = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_MSS]);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hw/net/rocker/rocker.c:217:9: warning: Value stored to 'tx_tso_hdr_len' is never read
tx_tso_hdr_len = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hw/net/rocker/rocker.c:255:9: warning: Value stored to 'tx_l3_csum_off' is never read
tx_l3_csum_off += tx_tso_mss = tx_tso_hdr_len = 0;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes: dc488f888
Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/net/rocker/rocker.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
index 81dd3b5f14..15d66f6cbc 100644
--- a/hw/net/rocker/rocker.c
+++ b/hw/net/rocker/rocker.c
@@ -27,6 +27,7 @@
#include "qemu/iov.h"
#include "qemu/module.h"
#include "qemu/bitops.h"
+#include "qemu/log.h"
#include "rocker.h"
#include "rocker_hw.h"
@@ -207,14 +208,22 @@ static int tx_consume(Rocker *r, DescInfo *info)
if (tlvs[ROCKER_TLV_TX_L3_CSUM_OFF]) {
tx_l3_csum_off = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_L3_CSUM_OFF]);
+ qemu_log_mask(LOG_UNIMP, "rocker %s: L3 not implemented"
+ " (cksum off: %u)\n",
+ __func__, tx_l3_csum_off);
}
if (tlvs[ROCKER_TLV_TX_TSO_MSS]) {
tx_tso_mss = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_MSS]);
+ qemu_log_mask(LOG_UNIMP, "rocker %s: TSO not implemented (MSS: %u)\n",
+ __func__, tx_tso_mss);
}
if (tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]) {
tx_tso_hdr_len = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]);
+ qemu_log_mask(LOG_UNIMP, "rocker %s: TSO not implemented"
+ " (hdr length: %u)\n",
+ __func__, tx_tso_hdr_len);
}
rocker_tlv_for_each_nested(tlv_frag, tlvs[ROCKER_TLV_TX_FRAGS], rem) {
@@ -249,12 +258,6 @@ static int tx_consume(Rocker *r, DescInfo *info)
iovcnt++;
}
- if (iovcnt) {
- /* XXX perform Tx offloads */
- /* XXX silence compiler for now */
- tx_l3_csum_off += tx_tso_mss = tx_tso_hdr_len = 0;
- }
-
err = fp_port_eg(r->fp_port[port], iov, iovcnt);
err_too_many_frags:
--
2.21.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/net/rocker: Report unimplemented feature with qemu_log_mask(UNIMP)
2020-02-17 10:16 [PATCH] hw/net/rocker: Report unimplemented feature with qemu_log_mask(UNIMP) Philippe Mathieu-Daudé
@ 2020-02-18 10:56 ` Stefan Hajnoczi
2020-02-18 19:19 ` Laurent Vivier
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2020-02-18 10:56 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-trivial, Jason Wang, Jiri Pirko, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1169 bytes --]
On Mon, Feb 17, 2020 at 11:16:37AM +0100, Philippe Mathieu-Daudé wrote:
> Fix warnings reported by Clang static code analyzer:
>
> CC hw/net/rocker/rocker.o
> hw/net/rocker/rocker.c:213:9: warning: Value stored to 'tx_tso_mss' is never read
> tx_tso_mss = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_MSS]);
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> hw/net/rocker/rocker.c:217:9: warning: Value stored to 'tx_tso_hdr_len' is never read
> tx_tso_hdr_len = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]);
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> hw/net/rocker/rocker.c:255:9: warning: Value stored to 'tx_l3_csum_off' is never read
> tx_l3_csum_off += tx_tso_mss = tx_tso_hdr_len = 0;
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fixes: dc488f888
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> hw/net/rocker/rocker.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/net/rocker: Report unimplemented feature with qemu_log_mask(UNIMP)
2020-02-17 10:16 [PATCH] hw/net/rocker: Report unimplemented feature with qemu_log_mask(UNIMP) Philippe Mathieu-Daudé
2020-02-18 10:56 ` Stefan Hajnoczi
@ 2020-02-18 19:19 ` Laurent Vivier
1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2020-02-18 19:19 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: qemu-trivial, Jason Wang, Jiri Pirko, Stefan Hajnoczi
Le 17/02/2020 à 11:16, Philippe Mathieu-Daudé a écrit :
> Fix warnings reported by Clang static code analyzer:
>
> CC hw/net/rocker/rocker.o
> hw/net/rocker/rocker.c:213:9: warning: Value stored to 'tx_tso_mss' is never read
> tx_tso_mss = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_MSS]);
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> hw/net/rocker/rocker.c:217:9: warning: Value stored to 'tx_tso_hdr_len' is never read
> tx_tso_hdr_len = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]);
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> hw/net/rocker/rocker.c:255:9: warning: Value stored to 'tx_l3_csum_off' is never read
> tx_l3_csum_off += tx_tso_mss = tx_tso_hdr_len = 0;
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fixes: dc488f888
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> hw/net/rocker/rocker.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
> index 81dd3b5f14..15d66f6cbc 100644
> --- a/hw/net/rocker/rocker.c
> +++ b/hw/net/rocker/rocker.c
> @@ -27,6 +27,7 @@
> #include "qemu/iov.h"
> #include "qemu/module.h"
> #include "qemu/bitops.h"
> +#include "qemu/log.h"
>
> #include "rocker.h"
> #include "rocker_hw.h"
> @@ -207,14 +208,22 @@ static int tx_consume(Rocker *r, DescInfo *info)
>
> if (tlvs[ROCKER_TLV_TX_L3_CSUM_OFF]) {
> tx_l3_csum_off = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_L3_CSUM_OFF]);
> + qemu_log_mask(LOG_UNIMP, "rocker %s: L3 not implemented"
> + " (cksum off: %u)\n",
> + __func__, tx_l3_csum_off);
> }
>
> if (tlvs[ROCKER_TLV_TX_TSO_MSS]) {
> tx_tso_mss = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_MSS]);
> + qemu_log_mask(LOG_UNIMP, "rocker %s: TSO not implemented (MSS: %u)\n",
> + __func__, tx_tso_mss);
> }
>
> if (tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]) {
> tx_tso_hdr_len = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]);
> + qemu_log_mask(LOG_UNIMP, "rocker %s: TSO not implemented"
> + " (hdr length: %u)\n",
> + __func__, tx_tso_hdr_len);
> }
>
> rocker_tlv_for_each_nested(tlv_frag, tlvs[ROCKER_TLV_TX_FRAGS], rem) {
> @@ -249,12 +258,6 @@ static int tx_consume(Rocker *r, DescInfo *info)
> iovcnt++;
> }
>
> - if (iovcnt) {
> - /* XXX perform Tx offloads */
> - /* XXX silence compiler for now */
> - tx_l3_csum_off += tx_tso_mss = tx_tso_hdr_len = 0;
> - }
> -
> err = fp_port_eg(r->fp_port[port], iov, iovcnt);
>
> err_too_many_frags:
>
Applied to my trivial-patches branch.
Thanks,
Laurent
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-02-18 19:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-17 10:16 [PATCH] hw/net/rocker: Report unimplemented feature with qemu_log_mask(UNIMP) Philippe Mathieu-Daudé
2020-02-18 10:56 ` Stefan Hajnoczi
2020-02-18 19:19 ` Laurent Vivier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).