[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 1/5] net: Add macros for ETH address tracing
From: |
Leonid Bloch |
Subject: |
[Qemu-devel] [RFC PATCH 1/5] net: Add macros for ETH address tracing |
Date: |
Sun, 25 Oct 2015 19:00:04 +0200 |
From: Dmitry Fleytman <address@hidden>
This patch introduces a handful macros
for tracing of Ethernet addresses.
There are 2 reasons for those macros to be added:
1. They will be used by future commits
introducing e1000e device emulation;
2. They fix vmxnet3 build with debug tracing enabled:
When vmxnet3 configuration tracing enabled by uncommenting
VMXNET_DEBUG_CONFIG definition in vmxnet_debug.h, following
compilation error is observed:
hw/net/vmxnet3.c: In function ‘vmxnet3_net_init’:
hw/net/vmxnet3.c:1974:52: error: expected ‘)’ before ‘MAC_FMT’
VMW_CFPRN("Permanent MAC: " MAC_FMT, MAC_ARG(s->perm_mac.a));
^
hw/net/vmxnet3.c:1974:17: error: format ‘%s’ expects a matching ‘char *’
argument [-Werror=format=]
VMW_CFPRN("Permanent MAC: " MAC_FMT, MAC_ARG(s->perm_mac.a));
^
hw/net/vmxnet3.c:1974:17: error: format ‘%s’ expects a matching ‘char *’
argument [-Werror=format=]
cc1: all warnings being treated as errors
Signed-off-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Leonid Bloch <address@hidden>
---
include/net/net.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/net/net.h b/include/net/net.h
index 50ffcb9..fa561ea 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -9,6 +9,11 @@
#include "migration/vmstate.h"
#include "qapi-types.h"
+#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
+#define MAC_ARG(x) ((uint8_t *)(x))[0], ((uint8_t *)(x))[1], \
+ ((uint8_t *)(x))[2], ((uint8_t *)(x))[3], \
+ ((uint8_t *)(x))[4], ((uint8_t *)(x))[5]
+
#define MAX_QUEUE_NUM 1024
/* Maximum GSO packet size (64k) plus plenty of room for
--
2.4.3
- [Qemu-devel] [RFC PATCH 0/5] Introduce Intel 82574 GbE Controller Emulation (e1000e), Leonid Bloch, 2015/10/25
- [Qemu-devel] [RFC PATCH 1/5] net: Add macros for ETH address tracing,
Leonid Bloch <=
- [Qemu-devel] [RFC PATCH 4/5] e1000_regs: Add definitions for Intel 82574-specific bits, Leonid Bloch, 2015/10/25
- [Qemu-devel] [RFC PATCH 3/5] net_pkt: Extend packet abstraction as requied by e1000e functionality, Leonid Bloch, 2015/10/25
- [Qemu-devel] [RFC PATCH 2/5] net_pkt: Name vmxnet3 packet abstractions more generic, Leonid Bloch, 2015/10/25
- [Qemu-devel] [RFC PATCH 5/5] net: Introduce e1000e device emulation, Leonid Bloch, 2015/10/25
- Re: [Qemu-devel] [RFC PATCH 0/5] Introduce Intel 82574 GbE Controller Emulation (e1000e), Jason Wang, 2015/10/28