cxgb4: Support for user mode bar2 mappings with T4
authorHariprasad S <hariprasad@chelsio.com>
Tue, 9 Jun 2015 12:53:11 +0000 (18:23 +0530)
committerDoug Ledford <dledford@redhat.com>
Thu, 11 Jun 2015 16:22:21 +0000 (12:22 -0400)
Enhance cxgb4_t4_bar2_sge_qregs() and cxgb4_bar2_sge_qregs() to support T4
user mode mappings.  Update all the current users as well.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h
drivers/net/ethernet/chelsio/cxgb4/sge.c
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

index 524d11098c566d178d132fe0b3a05be557036440..e052f05558c7f511d9f0b0c8c2a9e24f9a54ae15 100644 (file)
@@ -1185,6 +1185,7 @@ enum t4_bar2_qtype { T4_BAR2_QTYPE_EGRESS, T4_BAR2_QTYPE_INGRESS };
 int cxgb4_t4_bar2_sge_qregs(struct adapter *adapter,
                      unsigned int qid,
                      enum t4_bar2_qtype qtype,
+                     int user,
                      u64 *pbar2_qoffset,
                      unsigned int *pbar2_qid);
 
index 803d91beec6f43b7a94c3378ff14d8623bc001a9..a9355593e65e8272c2346dc1dc59620e05381121 100644 (file)
@@ -2145,6 +2145,7 @@ EXPORT_SYMBOL(cxgb4_read_sge_timestamp);
 int cxgb4_bar2_sge_qregs(struct net_device *dev,
                         unsigned int qid,
                         enum cxgb4_bar2_qtype qtype,
+                        int user,
                         u64 *pbar2_qoffset,
                         unsigned int *pbar2_qid)
 {
@@ -2153,6 +2154,7 @@ int cxgb4_bar2_sge_qregs(struct net_device *dev,
                                 (qtype == CXGB4_BAR2_QTYPE_EGRESS
                                  ? T4_BAR2_QTYPE_EGRESS
                                  : T4_BAR2_QTYPE_INGRESS),
+                                user,
                                 pbar2_qoffset,
                                 pbar2_qid);
 }
@@ -2351,7 +2353,7 @@ static void process_db_drop(struct work_struct *work)
                int ret;
 
                ret = cxgb4_t4_bar2_sge_qregs(adap, qid, T4_BAR2_QTYPE_EGRESS,
-                                       &bar2_qoffset, &bar2_qid);
+                                             0, &bar2_qoffset, &bar2_qid);
                if (ret)
                        dev_err(adap->pdev_dev, "doorbell drop recovery: "
                                "qid=%d, pidx_inc=%d\n", qid, pidx_inc);
index 78ab4d406ce277509eb6da61780903129596e7ee..e33934a6f59e0b010eccff8d548b7871ed8a14b5 100644 (file)
@@ -306,6 +306,7 @@ enum cxgb4_bar2_qtype { CXGB4_BAR2_QTYPE_EGRESS, CXGB4_BAR2_QTYPE_INGRESS };
 int cxgb4_bar2_sge_qregs(struct net_device *dev,
                         unsigned int qid,
                         enum cxgb4_bar2_qtype qtype,
+                        int user,
                         u64 *pbar2_qoffset,
                         unsigned int *pbar2_qid);
 
index 0d2eddab04efbf7b2a0e1054ea46848273c97933..1b99aecde736067f77278db6be246cc47d23004b 100644 (file)
@@ -2429,8 +2429,8 @@ static void __iomem *bar2_address(struct adapter *adapter,
        u64 bar2_qoffset;
        int ret;
 
-       ret = cxgb4_t4_bar2_sge_qregs(adapter, qid, qtype,
-                               &bar2_qoffset, pbar2_qid);
+       ret = cxgb4_t4_bar2_sge_qregs(adapter, qid, qtype, 0,
+                                     &bar2_qoffset, pbar2_qid);
        if (ret)
                return NULL;
 
index e8578a742f2a29b14a2eaec01216a8e47a68e12a..61d8b3ec959ea1a5d753898f7a438886afc616de 100644 (file)
@@ -5102,6 +5102,7 @@ int t4_prep_adapter(struct adapter *adapter)
  *     @adapter: the adapter
  *     @qid: the Queue ID
  *     @qtype: the Ingress or Egress type for @qid
+ *     @user: true if this request is for a user mode queue
  *     @pbar2_qoffset: BAR2 Queue Offset
  *     @pbar2_qid: BAR2 Queue ID or 0 for Queue ID inferred SGE Queues
  *
@@ -5125,6 +5126,7 @@ int t4_prep_adapter(struct adapter *adapter)
 int cxgb4_t4_bar2_sge_qregs(struct adapter *adapter,
                      unsigned int qid,
                      enum t4_bar2_qtype qtype,
+                     int user,
                      u64 *pbar2_qoffset,
                      unsigned int *pbar2_qid)
 {
@@ -5132,9 +5134,8 @@ int cxgb4_t4_bar2_sge_qregs(struct adapter *adapter,
        u64 bar2_page_offset, bar2_qoffset;
        unsigned int bar2_qid, bar2_qid_offset, bar2_qinferred;
 
-       /* T4 doesn't support BAR2 SGE Queue registers.
-        */
-       if (is_t4(adapter->params.chip))
+       /* T4 doesn't support BAR2 SGE Queue registers for kernel mode queues */
+       if (!user && is_t4(adapter->params.chip))
                return -EINVAL;
 
        /* Get our SGE Page Size parameters.