bnxt_en: Add doorbell information to bnxt_en_dev struct.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 4 May 2020 08:50:38 +0000 (04:50 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 May 2020 17:44:11 +0000 (10:44 -0700)
The purpose of this is to inform the RDMA driver the size of the doorbell
BAR that the L2 driver has mapped and the portion that is mapped
uncacheable.  The unchaeable portion is shared with the RoCE driver.
Any remaining unmapped doorbell BAR can be used by the RDMA driver for
its own purpose.  Currently, the entire L2 portion is mapped uncacheable.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h

index 4b40778ac8ddb4d8bd8dbcc27ebbc25a8859268d..8c8368c2f335cb3671dda19e7e58af64d5061ad5 100644 (file)
@@ -481,6 +481,8 @@ struct bnxt_en_dev *bnxt_ulp_probe(struct net_device *dev)
                        edev->flags |= BNXT_EN_FLAG_ROCEV2_CAP;
                edev->net = dev;
                edev->pdev = bp->pdev;
+               edev->l2_db_size = bp->db_size;
+               edev->l2_db_size_nc = bp->db_size;
                bp->edev = edev;
        }
        return bp->edev;
index 9895406b9830810583db87b0507225fda03a1386..6b4d2556a6df682485a67549f88c94d9c043a639 100644 (file)
@@ -67,6 +67,14 @@ struct bnxt_en_dev {
        #define BNXT_EN_FLAG_ULP_STOPPED        0x8
        const struct bnxt_en_ops        *en_ops;
        struct bnxt_ulp                 ulp_tbl[BNXT_MAX_ULP];
+       int                             l2_db_size;     /* Doorbell BAR size in
+                                                        * bytes mapped by L2
+                                                        * driver.
+                                                        */
+       int                             l2_db_size_nc;  /* Doorbell BAR size in
+                                                        * bytes mapped as non-
+                                                        * cacheable.
+                                                        */
 };
 
 struct bnxt_en_ops {