The branch stable/15 has been updated by bz:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ca1e0f9d60c9328164c7018592fa9de513e65b08

commit ca1e0f9d60c9328164c7018592fa9de513e65b08
Author:     Bjoern A. Zeeb <[email protected]>
AuthorDate: 2026-02-19 23:12:29 +0000
Commit:     Bjoern A. Zeeb <[email protected]>
CommitDate: 2026-02-26 23:09:17 +0000

    ofed: reduce usage of struct dma_attrs *dma_attrs
    
    ib_verbs.h still uses struct dma_attrs *dma_attrs everywhere.
    It is beyond my knowledge when that struct got deprecated upstream but
    it is still supported by our LinuxKPI.  The problem is that the
    functions called with that argument (dma_map_single_attrs,
    dma_unmap_single_attrs, dma_map_sg_attrs, dma_unmap_sg_attrs) so far
    are #defines in LinuxKPI and drop the last argument (attrs) so it was
    never a problem.
    
    In preparation to pass the attrs to the actual implementation in LinuxKPI,
    which has gained support for them, we now pass dma_sttrs->flags which
    is the expected unsigned long bit field.
    
    If anyone has serious interest in updating our ofed implementation they
    could look into this some more and remove the usage of struct dma_attrs
    entirely.
    
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    kib
    Differential Revision: https://reviews.freebsd.org/D55390
    
    (cherry picked from commit 5edf24aac1d0978d37d62594f42d87c9f118622b)
---
 sys/ofed/include/rdma/ib_verbs.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/ofed/include/rdma/ib_verbs.h b/sys/ofed/include/rdma/ib_verbs.h
index 78aa0af4fa2b..0c40a6f18f7c 100644
--- a/sys/ofed/include/rdma/ib_verbs.h
+++ b/sys/ofed/include/rdma/ib_verbs.h
@@ -3539,7 +3539,7 @@ static inline u64 ib_dma_map_single_attrs(struct 
ib_device *dev,
                                          struct dma_attrs *dma_attrs)
 {
        return dma_map_single_attrs(dev->dma_device, cpu_addr, size,
-                                   direction, dma_attrs);
+                                   direction, dma_attrs->flags);
 }
 
 static inline void ib_dma_unmap_single_attrs(struct ib_device *dev,
@@ -3548,7 +3548,7 @@ static inline void ib_dma_unmap_single_attrs(struct 
ib_device *dev,
                                             struct dma_attrs *dma_attrs)
 {
        return dma_unmap_single_attrs(dev->dma_device, addr, size,
-                                     direction, dma_attrs);
+                                     direction, dma_attrs->flags);
 }
 
 /**
@@ -3630,7 +3630,7 @@ static inline int ib_dma_map_sg_attrs(struct ib_device 
*dev,
                                                  dma_attrs);
        else
                return dma_map_sg_attrs(dev->dma_device, sg, nents, direction,
-                                       dma_attrs);
+                                       dma_attrs->flags);
 }
 
 static inline void ib_dma_unmap_sg_attrs(struct ib_device *dev,
@@ -3643,7 +3643,7 @@ static inline void ib_dma_unmap_sg_attrs(struct ib_device 
*dev,
                                                  dma_attrs);
        else
                dma_unmap_sg_attrs(dev->dma_device, sg, nents, direction,
-                                  dma_attrs);
+                                  dma_attrs->flags);
 }
 /**
  * ib_sg_dma_address - Return the DMA address from a scatter/gather entry

Reply via email to