[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 30/48] net/eth: Use void pointers
|
From: |
Akihiko Odaki |
|
Subject: |
[PATCH v5 30/48] net/eth: Use void pointers |
|
Date: |
Tue, 23 May 2023 11:43:21 +0900 |
The uses of uint8_t pointers were misleading as they are never accessed
as an array of octets and it even require more strict alignment to
access as struct eth_header.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/net/eth.h | 4 ++--
net/eth.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/net/eth.h b/include/net/eth.h
index 05f56931e7..95ff24d6b8 100644
--- a/include/net/eth.h
+++ b/include/net/eth.h
@@ -342,12 +342,12 @@ eth_get_pkt_tci(const void *p)
size_t
eth_strip_vlan(const struct iovec *iov, int iovcnt, size_t iovoff,
- uint8_t *new_ehdr_buf,
+ void *new_ehdr_buf,
uint16_t *payload_offset, uint16_t *tci);
size_t
eth_strip_vlan_ex(const struct iovec *iov, int iovcnt, size_t iovoff,
- uint16_t vet, uint8_t *new_ehdr_buf,
+ uint16_t vet, void *new_ehdr_buf,
uint16_t *payload_offset, uint16_t *tci);
uint16_t
diff --git a/net/eth.c b/net/eth.c
index b6ff89c460..f7ffbda600 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -226,11 +226,11 @@ void eth_get_protocols(const struct iovec *iov, size_t
iovcnt, size_t iovoff,
size_t
eth_strip_vlan(const struct iovec *iov, int iovcnt, size_t iovoff,
- uint8_t *new_ehdr_buf,
+ void *new_ehdr_buf,
uint16_t *payload_offset, uint16_t *tci)
{
struct vlan_header vlan_hdr;
- struct eth_header *new_ehdr = (struct eth_header *) new_ehdr_buf;
+ struct eth_header *new_ehdr = new_ehdr_buf;
size_t copied = iov_to_buf(iov, iovcnt, iovoff,
new_ehdr, sizeof(*new_ehdr));
@@ -276,7 +276,7 @@ eth_strip_vlan(const struct iovec *iov, int iovcnt, size_t
iovoff,
size_t
eth_strip_vlan_ex(const struct iovec *iov, int iovcnt, size_t iovoff,
- uint16_t vet, uint8_t *new_ehdr_buf,
+ uint16_t vet, void *new_ehdr_buf,
uint16_t *payload_offset, uint16_t *tci)
{
struct vlan_header vlan_hdr;
--
2.40.1
- [PATCH v5 16/48] e1000x: Take CRC into consideration for size check, (continued)
- [PATCH v5 16/48] e1000x: Take CRC into consideration for size check, Akihiko Odaki, 2023/05/22
- [PATCH v5 17/48] e1000x: Rename TcpIpv6 into TcpIpv6Ex, Akihiko Odaki, 2023/05/22
- [PATCH v5 18/48] e1000e: Always log status after building rx metadata, Akihiko Odaki, 2023/05/22
- [PATCH v5 19/48] igb: Always log status after building rx metadata, Akihiko Odaki, 2023/05/22
- [PATCH v5 20/48] igb: Remove goto, Akihiko Odaki, 2023/05/22
- [PATCH v5 22/48] e1000e: Reset packet state after emptying Tx queue, Akihiko Odaki, 2023/05/22
- [PATCH v5 21/48] igb: Read DCMD.VLE of the first Tx descriptor, Akihiko Odaki, 2023/05/22
- [PATCH v5 26/48] igb: Fix igb_mac_reg_init coding style alignment, Akihiko Odaki, 2023/05/22
- [PATCH v5 31/48] net/eth: Always add VLAN tag, Akihiko Odaki, 2023/05/22
- [PATCH v5 23/48] vmxnet3: Reset packet state after emptying Tx queue, Akihiko Odaki, 2023/05/22
- [PATCH v5 30/48] net/eth: Use void pointers,
Akihiko Odaki <=
- [PATCH v5 24/48] igb: Add more definitions for Tx descriptor, Akihiko Odaki, 2023/05/22
- [PATCH v5 27/48] igb: Clear EICR bits for delayed MSI-X interrupts, Akihiko Odaki, 2023/05/22
- [PATCH v5 28/48] e1000e: Rename a variable in e1000e_receive_internal(), Akihiko Odaki, 2023/05/22
- [PATCH v5 29/48] igb: Rename a variable in igb_receive_internal(), Akihiko Odaki, 2023/05/22
- [PATCH v5 25/48] igb: Share common VF constants, Akihiko Odaki, 2023/05/22
- [PATCH v5 33/48] tests/qtest/libqos/igb: Set GPIE.Multiple_MSIX, Akihiko Odaki, 2023/05/22
- [PATCH v5 34/48] igb: Implement MSI-X single vector mode, Akihiko Odaki, 2023/05/22
- [PATCH v5 32/48] hw/net/net_rx_pkt: Enforce alignment for eth_header, Akihiko Odaki, 2023/05/22
- [PATCH v5 35/48] igb: Use UDP for RSS hash, Akihiko Odaki, 2023/05/22
- [PATCH v5 36/48] igb: Implement Rx SCTP CSO, Akihiko Odaki, 2023/05/22