[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.1.5 20/24] migration/rdma: define htonll/ntohll only if not pr
From: |
Michael Tokarev |
Subject: |
[Stable-8.1.5 20/24] migration/rdma: define htonll/ntohll only if not predefined |
Date: |
Tue, 23 Jan 2024 13:28:34 +0300 |
From: Nick Briggs <nicholas.h.briggs@gmail.com>
Solaris has #defines for htonll and ntohll which cause syntax errors
when compiling code that attempts to (re)define these functions..
Signed-off-by: Nick Briggs <nicholas.h.briggs@gmail.com>
Link: 65a04a7d.497ab3.3e7bef1f@gateway.sonic.net">https://lore.kernel.org/r/65a04a7d.497ab3.3e7bef1f@gateway.sonic.net
Signed-off-by: Peter Xu <peterx@redhat.com>
(cherry picked from commit 44ce1b5d2fc77343f6a318cb3de613336a240048)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/migration/rdma.c b/migration/rdma.c
index ca430d319d..8212fa6a5a 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -268,6 +268,7 @@ static const char *control_desc(unsigned int rdma_control)
return strs[rdma_control];
}
+#if !defined(htonll)
static uint64_t htonll(uint64_t v)
{
union { uint32_t lv[2]; uint64_t llv; } u;
@@ -275,13 +276,16 @@ static uint64_t htonll(uint64_t v)
u.lv[1] = htonl(v & 0xFFFFFFFFULL);
return u.llv;
}
+#endif
+#if !defined(ntohll)
static uint64_t ntohll(uint64_t v)
{
union { uint32_t lv[2]; uint64_t llv; } u;
u.llv = v;
return ((uint64_t)ntohl(u.lv[0]) << 32) | (uint64_t) ntohl(u.lv[1]);
}
+#endif
static void dest_block_to_network(RDMADestBlock *db)
{
--
2.39.2
- [Stable-8.1.5 v2 00/24] Patch Round-up for stable 8.1.5, freeze on 2024-01-27, Michael Tokarev, 2024/01/23
- [Stable-8.1.5 12/24] load_elf: fix iterator's type for elf file processing, Michael Tokarev, 2024/01/23
- [Stable-8.1.5 13/24] target/i386: Do not re-compute new pc with CF_PCREL, Michael Tokarev, 2024/01/23
- [Stable-8.1.5 14/24] target/i386: fix incorrect EIP in PC-relative translation blocks, Michael Tokarev, 2024/01/23
- [Stable-8.1.5 15/24] target/i386: pcrel: store low bits of physical address in data[0], Michael Tokarev, 2024/01/23
- [Stable-8.1.5 16/24] backends/cryptodev: Do not ignore throttle/backends Errors, Michael Tokarev, 2024/01/23
- [Stable-8.1.5 17/24] hw/pflash: refactor pflash_data_write(), Michael Tokarev, 2024/01/23
- [Stable-8.1.5 18/24] hw/pflash: use ldn_{be,le}_p and stn_{be,le}_p, Michael Tokarev, 2024/01/23
- [Stable-8.1.5 19/24] hw/pflash: implement update buffer for block writes, Michael Tokarev, 2024/01/23
- [Stable-8.1.5 20/24] migration/rdma: define htonll/ntohll only if not predefined,
Michael Tokarev <=
- [Stable-8.1.5 21/24] hw/scsi/esp-pci: use correct address register for PCI DMA transfers, Michael Tokarev, 2024/01/23
- [Stable-8.1.5 23/24] hw/scsi/esp-pci: synchronise setting of DMA_STAT_DONE with ESP completion interrupt, Michael Tokarev, 2024/01/23
- [Stable-8.1.5 22/24] hw/scsi/esp-pci: generate PCI interrupt from separate ESP and PCI sources, Michael Tokarev, 2024/01/23
- [Stable-8.1.5 24/24] hw/scsi/esp-pci: set DMA_STAT_BCMBLT when BLAST command issued, Michael Tokarev, 2024/01/23