Commit 66cf188e authored by Hariprasad S's avatar Hariprasad S Committed by Doug Ledford

cxgb4: Support for user mode bar2 mappings with T4

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: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 0699ee7a
...@@ -1185,6 +1185,7 @@ enum t4_bar2_qtype { T4_BAR2_QTYPE_EGRESS, T4_BAR2_QTYPE_INGRESS }; ...@@ -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, int cxgb4_t4_bar2_sge_qregs(struct adapter *adapter,
unsigned int qid, unsigned int qid,
enum t4_bar2_qtype qtype, enum t4_bar2_qtype qtype,
int user,
u64 *pbar2_qoffset, u64 *pbar2_qoffset,
unsigned int *pbar2_qid); unsigned int *pbar2_qid);
......
...@@ -2145,6 +2145,7 @@ EXPORT_SYMBOL(cxgb4_read_sge_timestamp); ...@@ -2145,6 +2145,7 @@ EXPORT_SYMBOL(cxgb4_read_sge_timestamp);
int cxgb4_bar2_sge_qregs(struct net_device *dev, int cxgb4_bar2_sge_qregs(struct net_device *dev,
unsigned int qid, unsigned int qid,
enum cxgb4_bar2_qtype qtype, enum cxgb4_bar2_qtype qtype,
int user,
u64 *pbar2_qoffset, u64 *pbar2_qoffset,
unsigned int *pbar2_qid) unsigned int *pbar2_qid)
{ {
...@@ -2153,6 +2154,7 @@ int cxgb4_bar2_sge_qregs(struct net_device *dev, ...@@ -2153,6 +2154,7 @@ int cxgb4_bar2_sge_qregs(struct net_device *dev,
(qtype == CXGB4_BAR2_QTYPE_EGRESS (qtype == CXGB4_BAR2_QTYPE_EGRESS
? T4_BAR2_QTYPE_EGRESS ? T4_BAR2_QTYPE_EGRESS
: T4_BAR2_QTYPE_INGRESS), : T4_BAR2_QTYPE_INGRESS),
user,
pbar2_qoffset, pbar2_qoffset,
pbar2_qid); pbar2_qid);
} }
...@@ -2351,7 +2353,7 @@ static void process_db_drop(struct work_struct *work) ...@@ -2351,7 +2353,7 @@ static void process_db_drop(struct work_struct *work)
int ret; int ret;
ret = cxgb4_t4_bar2_sge_qregs(adap, qid, T4_BAR2_QTYPE_EGRESS, ret = cxgb4_t4_bar2_sge_qregs(adap, qid, T4_BAR2_QTYPE_EGRESS,
&bar2_qoffset, &bar2_qid); 0, &bar2_qoffset, &bar2_qid);
if (ret) if (ret)
dev_err(adap->pdev_dev, "doorbell drop recovery: " dev_err(adap->pdev_dev, "doorbell drop recovery: "
"qid=%d, pidx_inc=%d\n", qid, pidx_inc); "qid=%d, pidx_inc=%d\n", qid, pidx_inc);
......
...@@ -306,6 +306,7 @@ enum cxgb4_bar2_qtype { CXGB4_BAR2_QTYPE_EGRESS, CXGB4_BAR2_QTYPE_INGRESS }; ...@@ -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, int cxgb4_bar2_sge_qregs(struct net_device *dev,
unsigned int qid, unsigned int qid,
enum cxgb4_bar2_qtype qtype, enum cxgb4_bar2_qtype qtype,
int user,
u64 *pbar2_qoffset, u64 *pbar2_qoffset,
unsigned int *pbar2_qid); unsigned int *pbar2_qid);
......
...@@ -2429,8 +2429,8 @@ static void __iomem *bar2_address(struct adapter *adapter, ...@@ -2429,8 +2429,8 @@ static void __iomem *bar2_address(struct adapter *adapter,
u64 bar2_qoffset; u64 bar2_qoffset;
int ret; int ret;
ret = cxgb4_t4_bar2_sge_qregs(adapter, qid, qtype, ret = cxgb4_t4_bar2_sge_qregs(adapter, qid, qtype, 0,
&bar2_qoffset, pbar2_qid); &bar2_qoffset, pbar2_qid);
if (ret) if (ret)
return NULL; return NULL;
......
...@@ -5102,6 +5102,7 @@ int t4_prep_adapter(struct adapter *adapter) ...@@ -5102,6 +5102,7 @@ int t4_prep_adapter(struct adapter *adapter)
* @adapter: the adapter * @adapter: the adapter
* @qid: the Queue ID * @qid: the Queue ID
* @qtype: the Ingress or Egress type for @qid * @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_qoffset: BAR2 Queue Offset
* @pbar2_qid: BAR2 Queue ID or 0 for Queue ID inferred SGE Queues * @pbar2_qid: BAR2 Queue ID or 0 for Queue ID inferred SGE Queues
* *
...@@ -5125,6 +5126,7 @@ int t4_prep_adapter(struct adapter *adapter) ...@@ -5125,6 +5126,7 @@ int t4_prep_adapter(struct adapter *adapter)
int cxgb4_t4_bar2_sge_qregs(struct adapter *adapter, int cxgb4_t4_bar2_sge_qregs(struct adapter *adapter,
unsigned int qid, unsigned int qid,
enum t4_bar2_qtype qtype, enum t4_bar2_qtype qtype,
int user,
u64 *pbar2_qoffset, u64 *pbar2_qoffset,
unsigned int *pbar2_qid) unsigned int *pbar2_qid)
{ {
...@@ -5132,9 +5134,8 @@ int cxgb4_t4_bar2_sge_qregs(struct adapter *adapter, ...@@ -5132,9 +5134,8 @@ int cxgb4_t4_bar2_sge_qregs(struct adapter *adapter,
u64 bar2_page_offset, bar2_qoffset; u64 bar2_page_offset, bar2_qoffset;
unsigned int bar2_qid, bar2_qid_offset, bar2_qinferred; unsigned int bar2_qid, bar2_qid_offset, bar2_qinferred;
/* T4 doesn't support BAR2 SGE Queue registers. /* T4 doesn't support BAR2 SGE Queue registers for kernel mode queues */
*/ if (!user && is_t4(adapter->params.chip))
if (is_t4(adapter->params.chip))
return -EINVAL; return -EINVAL;
/* Get our SGE Page Size parameters. /* Get our SGE Page Size parameters.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment