mlx5: don't duplicate kvfree()

2014-11-20 Thread Al Viro
Signed-off-by: Al Viro v...@zeniv.linux.org.uk
---
 drivers/infiniband/hw/mlx5/cq.c |8 
 drivers/infiniband/hw/mlx5/mr.c |4 ++--
 drivers/infiniband/hw/mlx5/qp.c |8 
 drivers/infiniband/hw/mlx5/srq.c|6 +++---
 drivers/net/ethernet/mellanox/mlx5/core/eq.c|4 ++--
 drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c |4 ++--
 drivers/net/ethernet/mellanox/mlx5/core/port.c  |4 ++--
 include/linux/mlx5/driver.h |8 
 9 files changed, 21 insertions(+), 35 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
index 10cfce5..c463e7b 100644
--- a/drivers/infiniband/hw/mlx5/cq.c
+++ b/drivers/infiniband/hw/mlx5/cq.c
@@ -805,14 +805,14 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev, 
int entries,
}
 
 
-   mlx5_vfree(cqb);
+   kvfree(cqb);
return cq-ibcq;
 
 err_cmd:
mlx5_core_destroy_cq(dev-mdev, cq-mcq);
 
 err_cqb:
-   mlx5_vfree(cqb);
+   kvfree(cqb);
if (context)
destroy_cq_user(cq, context);
else
@@ -1159,11 +1159,11 @@ int mlx5_ib_resize_cq(struct ib_cq *ibcq, int entries, 
struct ib_udata *udata)
}
mutex_unlock(cq-resize_mutex);
 
-   mlx5_vfree(in);
+   kvfree(in);
return 0;
 
 ex_alloc:
-   mlx5_vfree(in);
+   kvfree(in);
 
 ex_resize:
if (udata)
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index 8ee7cb4..4c89b64 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -853,14 +853,14 @@ static struct mlx5_ib_mr *reg_create(struct ib_pd *pd, 
u64 virt_addr,
goto err_2;
}
mr-umem = umem;
-   mlx5_vfree(in);
+   kvfree(in);
 
mlx5_ib_dbg(dev, mkey = 0x%x\n, mr-mmr.key);
 
return mr;
 
 err_2:
-   mlx5_vfree(in);
+   kvfree(in);
 
 err_1:
kfree(mr);
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index e261a53..0e2ef9f 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -647,7 +647,7 @@ err_unmap:
mlx5_ib_db_unmap_user(context, qp-db);
 
 err_free:
-   mlx5_vfree(*in);
+   kvfree(*in);
 
 err_umem:
if (qp-umem)
@@ -761,7 +761,7 @@ err_wrid:
kfree(qp-rq.wrid);
 
 err_free:
-   mlx5_vfree(*in);
+   kvfree(*in);
 
 err_buf:
mlx5_buf_free(dev-mdev, qp-buf);
@@ -971,7 +971,7 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct 
ib_pd *pd,
goto err_create;
}
 
-   mlx5_vfree(in);
+   kvfree(in);
/* Hardware wants QPN written in big-endian order (after
 * shifting) for send doorbell.  Precompute this value to save
 * a little bit when posting sends.
@@ -988,7 +988,7 @@ err_create:
else if (qp-create_type == MLX5_QP_KERNEL)
destroy_qp_kernel(dev, qp);
 
-   mlx5_vfree(in);
+   kvfree(in);
return err;
 }
 
diff --git a/drivers/infiniband/hw/mlx5/srq.c b/drivers/infiniband/hw/mlx5/srq.c
index 97cc1ba..41fec66 100644
--- a/drivers/infiniband/hw/mlx5/srq.c
+++ b/drivers/infiniband/hw/mlx5/srq.c
@@ -141,7 +141,7 @@ static int create_srq_user(struct ib_pd *pd, struct 
mlx5_ib_srq *srq,
return 0;
 
 err_in:
-   mlx5_vfree(*in);
+   kvfree(*in);
 
 err_umem:
ib_umem_release(srq-umem);
@@ -209,7 +209,7 @@ static int create_srq_kernel(struct mlx5_ib_dev *dev, 
struct mlx5_ib_srq *srq,
return 0;
 
 err_in:
-   mlx5_vfree(*in);
+   kvfree(*in);
 
 err_buf:
mlx5_buf_free(dev-mdev, srq-buf);
@@ -306,7 +306,7 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd,
in-ctx.pd = cpu_to_be32(to_mpd(pd)-pdn);
in-ctx.db_record = cpu_to_be64(srq-db.dma);
err = mlx5_core_create_srq(dev-mdev, srq-msrq, in, inlen);
-   mlx5_vfree(in);
+   kvfree(in);
if (err) {
mlx5_ib_dbg(dev, create SRQ failed, err %d\n, err);
goto err_usr_kern_srq;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c 
b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
index a278238..eb3aa15 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
@@ -391,7 +391,7 @@ int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct 
mlx5_eq *eq, u8 vecidx,
 */
eq_update_ci(eq, 1);
 
-   mlx5_vfree(in);
+   kvfree(in);
return 0;
 
 err_irq:
@@ -401,7 +401,7 @@ err_eq:
mlx5_cmd_destroy_eq(dev, eq-eqn);
 
 err_in:
-   mlx5_vfree(in);
+   kvfree(in);
 
 err_buf:
mlx5_buf_free(dev, eq-buf);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c 
b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
index d476918..4fdaae9 100644
--- 

Re: mlx5: don't duplicate kvfree()

2014-11-20 Thread Al Viro
On Thu, Nov 20, 2014 at 08:13:57AM +, Al Viro wrote:
  9 files changed, 21 insertions(+), 35 deletions(-)

grr... 8 files changed, actually - that was from the diff that included mlx4
bits.  Patch split correctly and sent in two pieces, summary left as is ;-/
Sorry about the confusion it might cause...
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: mlx5: don't duplicate kvfree()

2014-11-20 Thread Eli Cohen
Acked-by: Eli Cohen e...@mellanox.com
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V1 for-next 1/2] IB/uverbs: Enable device removal when there are active user space applications

2014-11-20 Thread Or Gerlitz

On 11/20/2014 9:52 AM, Yishai Hadas wrote:

can we avoid the fatal_event_raised flag?


We need this flag to prevent generating duplicate event. This may 
happen when a fatal error occurred and just later the remove one was 
called when there were active applications.


If your only concern is not generating duplicate fatal error events, I 
would strongly recommend to go and drop this flag to make the code 
clearer/simpler, object-I_already_did_operation_X flags should be 
avoided in correct system programming IMHO.


Or.
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V1 for-next 1/2] IB/uverbs: Enable device removal when there are active user space applications

2014-11-20 Thread Or Gerlitz

On 11/20/2014 9:52 AM, Yishai Hadas wrote:

can we avoid the fatal_event_raised flag?


We need this flag to prevent generating duplicate event. This may 
happen when a fatal error occurred and just later the remove one was 
called when there were active applications.


If your only concern is not generating duplicate fatal error events, I 
would strongly recommend to go a drop this flag to make the code 
clearer/simpler, object-I_already_did_operation_X flags should be 
avoided in correct system programming IMHO.


Or.
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: mlx5: don't duplicate kvfree()

2014-11-20 Thread Or Gerlitz

On 11/20/2014 10:17 AM, Al Viro wrote:

On Thu, Nov 20, 2014 at 08:13:57AM +, Al Viro wrote:

  9 files changed, 21 insertions(+), 35 deletions(-)

grr... 8 files changed, actually - that was from the diff that included mlx4
bits.  Patch split correctly and sent in two pieces, summary left as is ;-/
Sorry about the confusion it might cause...

Al,

I think the best way to proceed here is to come up with mlx4 and mlx5 
patches and get both of them in through netdev / net-nexttree, don't 
worry about each of these drivers have a part which is also under 
drivers/infiniband/hw -- it doesn't justify splitting in this case


Or.
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


NFSoRDMA developers bi-weekly meeting minutes (11/20)

2014-11-20 Thread Shirley Ma
Attendees:

Jeff Becker (NASA)
Yan Burman (Mellanox)
Wendy Cheng (Intel)
Rupert Dance (Soft Forge)
Steve Dickson (Red Hat)
Chuck Lever (Oracle)
Doug Ledford (RedHat)
Shirley Ma (Oracle)
Sachin Prabhu (RedHat)
Devesh Sharma (Emulex)
Anna Schumaker (Net App)
Steve Wise (OpenGridComputing, Chelsio)

Moderator:
Shirley Ma (Oracle)

NFSoRDMA developers bi-weekly meeting is to help organizing NFSoRDMA 
development and test effort from different resources to speed up NFSoRDMA 
upstream kernel work and NFSoRDMA diagnosing/debugging tools development. 
Hopefully the quality of NFSoRDMA upstream patches can be improved by being 
tested with a quorum of HW vendors.

Today's meeting notes:

NFSoRDMA performance:
-
Even though NFSoRDMA performance seems better than IPoIB-cm, the gap between 
what the IB protocol can provide and what NFS(RDMA,IPoIB-cm) can achieve is 
still big on small I/O block size (focused on 8K IO size for database 
workload). Even large I/O block size(128K above), NFS performance is not 
comparable to RDMA microbenchmark. We are focusing the effort to figure out the 
root cause. Several experimental methods have been used on how to improve 
NFSoRDMA performance.

Yan saw NFS server does RDMA send for small packet size, less than 100bytes, 
which should have used post_send instead.

1. performance experimental investigation: (Shirley, Chuck, Yan)
-- multiple QPs support:
Created multiple subnets with different partition keys, different NFS client 
mount points to stretch single link performance, iozone multiple threading DIO 
8K showed around 17% improvement, still a big gap to link speed

-- completion vector loading balance
Split send queue and completion queue interrupts to different CPUs did not help 
on performance, then created a patch on distributing interrupts among available 
CPUs for different QPs, send and recv completion share the same completion 
vector, iozone multiple threading 8K DIO showed that 10% performance improvement

Yan shared iser performance enhancement ideas:
-- batch recv packet processing
-- batch completion processing, not signaling every completion
-- per CPU connection, cq
iser 8K could reach 4.5GB/s in 56Gb/s link speed, 1.5 million IOPS. 32K could 
reach 1.8 million IOPS
 
-- increasing RPC credit limit from 32 to 64
iozone 8K DIO results doesn't show any gain, which might indicate that we need 
to look at general NFS IO stack.

-- increasing work queue priority to reduce latency
NFS used work_queue not tasklet since it's in cansleep context, changed the 
flags to WQ_HIGHPRI | WQ_CPU_INTENSIVE did help reducing the latency when 
system under heavy workloads. 

-- lock contention
perf top does show lock contention on top five list for both NFS client and NFS 
server. More granularity lock contention investigation is needed.

-- scheduling latency
IO scheduling was developed for high latency devices, there might be some room 
in IO scheduling improvement.

-- wsize, rsize
Chuck is looking at wsize, rsize to 1MB

2. performance analysis tools to use: 
-- perf, lockstat, ftrace, mountstats, nfsiostats... 

3. performance test tools:
-- iozone, fio
-- direct IO, cached IO

Next step for performance analysis:
1. Shirley will collect performance data on NFS IO layer to see any bottlenecks 
there.
2. Someone needs to look at NFS server for RDMA small message size Yan has seen

Feel free to reply here for anything missing. See you 12/4.

12/04/2014
@7:30am PDT
@8:30am MDT
@9:30am CDT
@10:30am EDT
@Bangalore @8:00pm
@Israel @5:30pm

Duration: 1 hour

Call-in number:
Israel: +972 37219638
Bangalore: +91 8039890080 (180030109800)
France  Colombes +33 1 5760 +33 176728936
US: 8666824770,  408-7744073

Conference Code: 2308833
Passcode: 63767362 (it's NFSoRDMA, in case you couldn't remember)

Thanks everyone for joining the call and providing valuable inputs/work to the 
community to make NFSoRDMA better.

Cheers,
Shirley
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: NFSoRDMA developers bi-weekly meeting minutes (11/20)

2014-11-20 Thread Chuck Lever

On Nov 20, 2014, at 1:24 PM, Shirley Ma shirley...@oracle.com wrote:

 Attendees:
 
 Jeff Becker (NASA)
 Yan Burman (Mellanox)
 Wendy Cheng (Intel)
 Rupert Dance (Soft Forge)
 Steve Dickson (Red Hat)
 Chuck Lever (Oracle)
 Doug Ledford (RedHat)
 Shirley Ma (Oracle)
 Sachin Prabhu (RedHat)
 Devesh Sharma (Emulex)
 Anna Schumaker (Net App)
 Steve Wise (OpenGridComputing, Chelsio)
 
 Moderator:
 Shirley Ma (Oracle)
 
 NFSoRDMA developers bi-weekly meeting is to help organizing NFSoRDMA 
 development and test effort from different resources to speed up NFSoRDMA 
 upstream kernel work and NFSoRDMA diagnosing/debugging tools development. 
 Hopefully the quality of NFSoRDMA upstream patches can be improved by being 
 tested with a quorum of HW vendors.
 
 Today's meeting notes:
 
 NFSoRDMA performance:
 -
 Even though NFSoRDMA performance seems better than IPoIB-cm, the gap between 
 what the IB protocol can provide and what NFS(RDMA,IPoIB-cm) can achieve is 
 still big on small I/O block size (focused on 8K IO size for database 
 workload). Even large I/O block size(128K above), NFS performance is not 
 comparable to RDMA microbenchmark. We are focusing the effort to figure out 
 the root cause. Several experimental methods have been used on how to improve 
 NFSoRDMA performance.
 
 Yan saw NFS server does RDMA send for small packet size, less than 100bytes, 
 which should have used post_send instead.

This is an artifact of how NFS/RDMA works.

The client provides a registered area for the server to write
into if an RPC reply is larger than the small pre-posted
buffers that are normally used.

Most of the time, each RPC reply is small enough to use RDMA
SEND, and the server can convey the RPC/RDMA header and the
RPC reply in a single SEND operation.

If the reply is large, the server conveys the RPC/RDMA header
via RDMA send, and the RPC reply via an RDMA WRITE into the
client’s registered buffer.

Solaris server chooses RDMA SEND in nearly every case.

Linux server chooses RDMA SEND then RDMA WRITE whenever
the client offers that choice.

Originally, it was felt that doing the RDMA WRITE is better
for the client because the client doesn’t have to copy the
RPC header from the RDMA receive buffer back into rq_rcv_buf.
Note that the RPC header is generally just a few hundred
bytes.

Several people have claimed that RDMA WRITE for small I/O
is relatively expensive and should be avoided. It’s also
expensive for the client to register and deregister the
receive buffer for the RDMA WRITE if the server doesn’t
use it.

I’ve explored changing the client to offer no registered
buffer if it knows the RPC reply will be small, thus
forcing the server to use RDMA SEND where it’s safe.

Solaris server worked fine. Of course, it already works
this way.

Linux server showed some data and metadata corruption on
complex workloads like kernel builds. There’s a bug in
there somewhere that will need to be addressed before we
can change the client behavior.

The improvement was consistent, but under ten microseconds
per RPC with FRWR (more with FMR because deregistering the
buffer takes longer and is synchronous with RPC execution).

At this stage, there are bigger problems to be addressed,
so this is not a top priority.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com



--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: mlx5: don't duplicate kvfree()

2014-11-20 Thread Al Viro
On Thu, Nov 20, 2014 at 07:09:31PM +0200, Or Gerlitz wrote:
 On 11/20/2014 10:17 AM, Al Viro wrote:
 On Thu, Nov 20, 2014 at 08:13:57AM +, Al Viro wrote:
   9 files changed, 21 insertions(+), 35 deletions(-)
 grr... 8 files changed, actually - that was from the diff that included mlx4
 bits.  Patch split correctly and sent in two pieces, summary left as is ;-/
 Sorry about the confusion it might cause...
 Al,
 
 I think the best way to proceed here is to come up with mlx4 and
 mlx5 patches and get both of them in through netdev / net-nexttree,
 don't worry about each of these drivers have a part which is also
 under drivers/infiniband/hw -- it doesn't justify splitting in this
 case

Both had been sent to netdev today (and ACKed by respective drivers'
maintainers).  I'd certainly prefer not to put them through vfs.git,
but beyond that I really don't care which tree do those go into...
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: NFSoRDMA developers bi-weekly meeting minutes (11/20)

2014-11-20 Thread Cheng, Wendy
 -Original Message-
 From: Shirley Ma [mailto:shirley...@oracle.com]
 Sent: Thursday, November 20, 2014 10:24 AM
 
 
 iser 8K could reach 4.5GB/s in 56Gb/s link speed, 1.5 million IOPS. 32K could
 reach 1.8 million IOPS
 

How did the ISER data get measured ? Was the measure done on ISER layer, block 
layer, or filesystem layer ?

-- Wendy 
 

--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: NFSoRDMA developers bi-weekly meeting minutes (11/20)

2014-11-20 Thread Shirley Ma

On 11/20/2014 12:15 PM, Cheng, Wendy wrote:
 -Original Message-
 From: Shirley Ma [mailto:shirley...@oracle.com]
 Sent: Thursday, November 20, 2014 10:24 AM

 
 iser 8K could reach 4.5GB/s in 56Gb/s link speed, 1.5 million IOPS. 32K could
 reach 1.8 million IOPS

 
 How did the ISER data get measured ? Was the measure done on ISER layer, 
 block layer, or filesystem layer ?

Here is the link on iser how to set up and measure performance:
http://community.mellanox.com/docs/DOC-1483
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next 1/5] RDMA/cxgb4: Cleanup Filter related macros/register defines

2014-11-20 Thread Hariprasad Shenai
This patch cleanups all filter related macros/register defines that are defined
in t4fw_api.h and the affected files.

Signed-off-by: Hariprasad Shenai haripra...@chelsio.com
---
 drivers/infiniband/hw/cxgb4/cm.c|   14 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |   68 ++--
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c  |8 +-
 drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h   |  584 +++---
 4 files changed, 337 insertions(+), 337 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 83fa16f..0ad8e2a 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -1762,10 +1762,10 @@ static void send_fw_act_open_req(struct c4iw_ep *ep, 
unsigned int atid)
req-le.pport = sin-sin_port;
req-le.u.ipv4.pip = sin-sin_addr.s_addr;
req-tcb.t_state_to_astid =
-   htonl(V_FW_OFLD_CONNECTION_WR_T_STATE(TCP_SYN_SENT) |
-   V_FW_OFLD_CONNECTION_WR_ASTID(atid));
+   htonl(FW_OFLD_CONNECTION_WR_T_STATE_V(TCP_SYN_SENT) |
+   FW_OFLD_CONNECTION_WR_ASTID_V(atid));
req-tcb.cplrxdataack_cplpassacceptrpl =
-   htons(F_FW_OFLD_CONNECTION_WR_CPLRXDATAACK);
+   htons(FW_OFLD_CONNECTION_WR_CPLRXDATAACK_F);
req-tcb.tx_max = (__force __be32) jiffies;
req-tcb.rcv_adv = htons(1);
best_mtu(ep-com.dev-rdev.lldi.mtus, ep-mtu, mtu_idx,
@@ -3539,7 +3539,7 @@ static void send_fw_pass_open_req(struct c4iw_dev *dev, 
struct sk_buff *skb,
memset(req, 0, sizeof(*req));
req-op_compl = htonl(V_WR_OP(FW_OFLD_CONNECTION_WR) | FW_WR_COMPL_F);
req-len16_pkd = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*req), 16)));
-   req-le.version_cpl = htonl(F_FW_OFLD_CONNECTION_WR_CPL);
+   req-le.version_cpl = htonl(FW_OFLD_CONNECTION_WR_CPL_F);
req-le.filter = (__force __be32) filter;
req-le.lport = lport;
req-le.pport = rport;
@@ -3548,9 +3548,9 @@ static void send_fw_pass_open_req(struct c4iw_dev *dev, 
struct sk_buff *skb,
req-tcb.rcv_nxt = htonl(rcv_isn + 1);
req-tcb.rcv_adv = htons(window);
req-tcb.t_state_to_astid =
-htonl(V_FW_OFLD_CONNECTION_WR_T_STATE(TCP_SYN_RECV) |
-   V_FW_OFLD_CONNECTION_WR_RCV_SCALE(cpl-tcpopt.wsf) |
-   V_FW_OFLD_CONNECTION_WR_ASTID(
+htonl(FW_OFLD_CONNECTION_WR_T_STATE_V(TCP_SYN_RECV) |
+   FW_OFLD_CONNECTION_WR_RCV_SCALE_V(cpl-tcpopt.wsf) |
+   FW_OFLD_CONNECTION_WR_ASTID_V(
GET_PASS_OPEN_TID(ntohl(cpl-tos_stid;
 
/*
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c 
b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 19ffe9b..6b6d7e1 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -1342,49 +1342,49 @@ static int set_filter_wr(struct adapter *adapter, int 
fidx)
fwr-op_pkd = htonl(FW_WR_OP_V(FW_FILTER_WR));
fwr-len16_pkd = htonl(FW_WR_LEN16_V(sizeof(*fwr)/16));
fwr-tid_to_iq =
-   htonl(V_FW_FILTER_WR_TID(ftid) |
- V_FW_FILTER_WR_RQTYPE(f-fs.type) |
- V_FW_FILTER_WR_NOREPLY(0) |
- V_FW_FILTER_WR_IQ(f-fs.iq));
+   htonl(FW_FILTER_WR_TID_V(ftid) |
+ FW_FILTER_WR_RQTYPE_V(f-fs.type) |
+ FW_FILTER_WR_NOREPLY_V(0) |
+ FW_FILTER_WR_IQ_V(f-fs.iq));
fwr-del_filter_to_l2tix =
-   htonl(V_FW_FILTER_WR_RPTTID(f-fs.rpttid) |
- V_FW_FILTER_WR_DROP(f-fs.action == FILTER_DROP) |
- V_FW_FILTER_WR_DIRSTEER(f-fs.dirsteer) |
- V_FW_FILTER_WR_MASKHASH(f-fs.maskhash) |
- V_FW_FILTER_WR_DIRSTEERHASH(f-fs.dirsteerhash) |
- V_FW_FILTER_WR_LPBK(f-fs.action == FILTER_SWITCH) |
- V_FW_FILTER_WR_DMAC(f-fs.newdmac) |
- V_FW_FILTER_WR_SMAC(f-fs.newsmac) |
- V_FW_FILTER_WR_INSVLAN(f-fs.newvlan == VLAN_INSERT ||
+   htonl(FW_FILTER_WR_RPTTID_V(f-fs.rpttid) |
+ FW_FILTER_WR_DROP_V(f-fs.action == FILTER_DROP) |
+ FW_FILTER_WR_DIRSTEER_V(f-fs.dirsteer) |
+ FW_FILTER_WR_MASKHASH_V(f-fs.maskhash) |
+ FW_FILTER_WR_DIRSTEERHASH_V(f-fs.dirsteerhash) |
+ FW_FILTER_WR_LPBK_V(f-fs.action == FILTER_SWITCH) |
+ FW_FILTER_WR_DMAC_V(f-fs.newdmac) |
+ FW_FILTER_WR_SMAC_V(f-fs.newsmac) |
+ FW_FILTER_WR_INSVLAN_V(f-fs.newvlan == VLAN_INSERT ||
 f-fs.newvlan == VLAN_REWRITE) |
- V_FW_FILTER_WR_RMVLAN(f-fs.newvlan 

[PATCH net-next 2/5] RDMA/cxgb4/csiostor: Cleansup FW related macros/register defines for PF/VF and LDST

2014-11-20 Thread Hariprasad Shenai
This patch cleanups PF/VF and LDST related macros/register defines that are
defined in t4fw_api.h and the affected files.

Signed-off-by: Hariprasad Shenai haripra...@chelsio.com
---
 drivers/infiniband/hw/cxgb4/cm.c   |2 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c|   61 +++--
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c |   78 +++---
 drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h  |  270 +---
 .../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c|   10 +-
 drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c |   72 +++---
 drivers/scsi/csiostor/csio_hw.c|   20 +-
 drivers/scsi/csiostor/csio_mb.c|   30 +-
 drivers/scsi/csiostor/csio_mb.h|   12 +-
 9 files changed, 327 insertions(+), 228 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 0ad8e2a..4b8c611 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -478,7 +478,7 @@ static void send_flowc(struct c4iw_ep *ep, struct sk_buff 
*skb)
  16)) | FW_WR_FLOWID_V(ep-hwtid));
 
flowc-mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN;
-   flowc-mnemval[0].val = cpu_to_be32(FW_PFVF_CMD_PFN
+   flowc-mnemval[0].val = cpu_to_be32(FW_PFVF_CMD_PFN_V
(ep-com.dev-rdev.lldi.pf));
flowc-mnemval[1].mnemonic = FW_FLOWC_MNEM_CH;
flowc-mnemval[1].val = cpu_to_be32(ep-tx_chan);
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c 
b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 6b6d7e1..4caec41 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -141,7 +141,7 @@ static unsigned int pfvfres_pmask(struct adapter *adapter,
 * Give PF's access to all of the ports.
 */
if (vf == 0)
-   return FW_PFVF_CMD_PMASK_MASK;
+   return FW_PFVF_CMD_PMASK_M;
 
/*
 * For VFs, we'll assign them access to the ports based purely on the
@@ -512,9 +512,10 @@ static void dcb_tx_queue_prio_enable(struct net_device 
*dev, int enable)
u32 name, value;
int err;
 
-   name = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) |
-   FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_DCBPRIO_ETH) |
-   FW_PARAMS_PARAM_YZ(txq-q.cntxt_id));
+   name = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DMAQ) |
+   FW_PARAMS_PARAM_X_V(
+   FW_PARAMS_PARAM_DMAQ_EQ_DCBPRIO_ETH) |
+   FW_PARAMS_PARAM_YZ_V(txq-q.cntxt_id));
value = enable ? i : 0x;
 
/* Since we can be called while atomic (from interrupt
@@ -2717,9 +2718,10 @@ static int set_rspq_intr_params(struct sge_rspq *q,
new_idx = closest_thres(adap-sge, cnt);
if (q-desc  q-pktcnt_idx != new_idx) {
/* the queue has already been created, update it */
-   v = FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) |
-   
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH) |
-   FW_PARAMS_PARAM_YZ(q-cntxt_id);
+   v = FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DMAQ) |
+   FW_PARAMS_PARAM_X_V(
+   FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH) |
+   FW_PARAMS_PARAM_YZ_V(q-cntxt_id);
err = t4_set_params(adap, adap-fn, adap-fn, 0, 1, v,
new_idx);
if (err)
@@ -4870,11 +4872,11 @@ static u32 t4_read_pcie_cfg4(struct adapter *adap, int 
reg)
htonl(FW_CMD_OP_V(FW_LDST_CMD) |
  FW_CMD_REQUEST_F |
  FW_CMD_READ_F |
- FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_FUNC_PCIE));
+ FW_LDST_CMD_ADDRSPACE_V(FW_LDST_ADDRSPC_FUNC_PCIE));
ldst_cmd.cycles_to_len16 = htonl(FW_LEN16(ldst_cmd));
-   ldst_cmd.u.pcie.select_naccess = FW_LDST_CMD_NACCESS(1);
+   ldst_cmd.u.pcie.select_naccess = FW_LDST_CMD_NACCESS_V(1);
ldst_cmd.u.pcie.ctrl_to_fn =
-   (FW_LDST_CMD_LC | FW_LDST_CMD_FN(adap-fn));
+   (FW_LDST_CMD_LC_F | FW_LDST_CMD_FN_V(adap-fn));
ldst_cmd.u.pcie.r = reg;
ret = t4_wr_mbox(adap, adap-mbox, ldst_cmd, sizeof(ldst_cmd),
 ldst_cmd);
@@ -5148,8 +5150,8 @@ static int adap_init0_config(struct adapter *adapter, int 
reset)
if (cf-size = FLASH_CFG_MAX_SIZE)
ret = -ENOMEM;
else {
-   params[0] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) |
-FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_CF));
+   params[0] = 

[PATCH net-next 0/5] RDMA/cxgb4,cxgb4vf,csiostor: Cleanup macros

2014-11-20 Thread Hariprasad Shenai
Hi,

This series continues to cleanup all the macros/register defines related to
filter, port, VI, queue, RSS, LDST, firmware, etc that are defined in t4fw_api.h
and the affected files.

Will post few more series so that we can cover all the macros so that they all
follow the same style to be consistent.

The patches series is created against 'net-next' tree.
And includes patches on cxgb4, cxgb4vf, iw_cxgb4 and csiostor driver.

We have included all the maintainers of respective drivers. Kindly review the
change and let us know in case of any review comments.

Thanks

Hariprasad Shenai (5):
  RDMA/cxgb4: Cleanup Filter related macros/register defines
  RDMA/cxgb4/csiostor: Cleansup FW related macros/register defines for
PF/VF and LDST
  cxgb4/cxgb4vf/csiostor: Cleanup macros/register defines related to
queues
  cxgb4/cxgb4vf/csiostor: Cleanup macros/register defines related to
port and VI
  RDMA/cxgb4/cxgb4vf/csiostor: Cleanup macros/register defines related
to PCIE, RSS and FW

 drivers/infiniband/hw/cxgb4/cm.c   |   16 +-
 drivers/infiniband/hw/cxgb4/provider.c |8 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h |8 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c |   14 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h |4 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c|  193 +-
 drivers/net/ethernet/chelsio/cxgb4/l2t.c   |4 +-
 drivers/net/ethernet/chelsio/cxgb4/sge.c   |  115 +-
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c |  292 ++--
 drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h  | 2121 +---
 .../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c|   26 +-
 drivers/net/ethernet/chelsio/cxgb4vf/sge.c |   63 +-
 drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c |  232 ++--
 drivers/scsi/csiostor/csio_hw.c|   38 +-
 drivers/scsi/csiostor/csio_init.c  |8 +-
 drivers/scsi/csiostor/csio_mb.c|  171 +-
 drivers/scsi/csiostor/csio_mb.h|   12 +-
 17 files changed, 2004 insertions(+), 1321 deletions(-)

--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next 5/5] RDMA/cxgb4/cxgb4vf/csiostor: Cleanup macros/register defines related to PCIE, RSS and FW

2014-11-20 Thread Hariprasad Shenai
This patch cleanups all PCIE, RSS  FW related macros/register defines that are
defined in t4fw_api.h and the affected files.

Signed-off-by: Hariprasad Shenai haripra...@chelsio.com
---
 drivers/infiniband/hw/cxgb4/provider.c |8 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h |8 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c|   56 +++---
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c |   68 +++---
 drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h  |  227 ++--
 .../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c|   16 +-
 drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c |   52 +++---
 drivers/scsi/csiostor/csio_hw.c|   18 +-
 drivers/scsi/csiostor/csio_init.c  |8 +-
 drivers/scsi/csiostor/csio_mb.c|2 +-
 10 files changed, 282 insertions(+), 181 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/provider.c 
b/drivers/infiniband/hw/cxgb4/provider.c
index 72e3b69..66bd6a2 100644
--- a/drivers/infiniband/hw/cxgb4/provider.c
+++ b/drivers/infiniband/hw/cxgb4/provider.c
@@ -408,10 +408,10 @@ static ssize_t show_fw_ver(struct device *dev, struct 
device_attribute *attr,
PDBG(%s dev 0x%p\n, __func__, dev);
 
return sprintf(buf, %u.%u.%u.%u\n,
-   FW_HDR_FW_VER_MAJOR_GET(c4iw_dev-rdev.lldi.fw_vers),
-   FW_HDR_FW_VER_MINOR_GET(c4iw_dev-rdev.lldi.fw_vers),
-   FW_HDR_FW_VER_MICRO_GET(c4iw_dev-rdev.lldi.fw_vers),
-   FW_HDR_FW_VER_BUILD_GET(c4iw_dev-rdev.lldi.fw_vers));
+   FW_HDR_FW_VER_MAJOR_G(c4iw_dev-rdev.lldi.fw_vers),
+   FW_HDR_FW_VER_MINOR_G(c4iw_dev-rdev.lldi.fw_vers),
+   FW_HDR_FW_VER_MICRO_G(c4iw_dev-rdev.lldi.fw_vers),
+   FW_HDR_FW_VER_BUILD_G(c4iw_dev-rdev.lldi.fw_vers));
 }
 
 static ssize_t show_hca(struct device *dev, struct device_attribute *attr,
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h 
b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
index a2196bc..e8b09bb 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
@@ -318,10 +318,10 @@ struct adapter_params {
 #include t4fw_api.h
 
 #define FW_VERSION(chip) ( \
-   FW_HDR_FW_VER_MAJOR_GET(chip##FW_VERSION_MAJOR) | \
-   FW_HDR_FW_VER_MINOR_GET(chip##FW_VERSION_MINOR) | \
-   FW_HDR_FW_VER_MICRO_GET(chip##FW_VERSION_MICRO) | \
-   FW_HDR_FW_VER_BUILD_GET(chip##FW_VERSION_BUILD))
+   FW_HDR_FW_VER_MAJOR_G(chip##FW_VERSION_MAJOR) | \
+   FW_HDR_FW_VER_MINOR_G(chip##FW_VERSION_MINOR) | \
+   FW_HDR_FW_VER_MICRO_G(chip##FW_VERSION_MICRO) | \
+   FW_HDR_FW_VER_BUILD_G(chip##FW_VERSION_BUILD))
 #define FW_INTFVER(chip, intf) (FW_HDR_INTFVER_##intf)
 
 struct fw_info {
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c 
b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 4c663cc..a576da1 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -1616,14 +1616,14 @@ static void get_drvinfo(struct net_device *dev, struct 
ethtool_drvinfo *info)
if (adapter-params.fw_vers)
snprintf(info-fw_version, sizeof(info-fw_version),
%u.%u.%u.%u, TP %u.%u.%u.%u,
-   FW_HDR_FW_VER_MAJOR_GET(adapter-params.fw_vers),
-   FW_HDR_FW_VER_MINOR_GET(adapter-params.fw_vers),
-   FW_HDR_FW_VER_MICRO_GET(adapter-params.fw_vers),
-   FW_HDR_FW_VER_BUILD_GET(adapter-params.fw_vers),
-   FW_HDR_FW_VER_MAJOR_GET(adapter-params.tp_vers),
-   FW_HDR_FW_VER_MINOR_GET(adapter-params.tp_vers),
-   FW_HDR_FW_VER_MICRO_GET(adapter-params.tp_vers),
-   FW_HDR_FW_VER_BUILD_GET(adapter-params.tp_vers));
+   FW_HDR_FW_VER_MAJOR_G(adapter-params.fw_vers),
+   FW_HDR_FW_VER_MINOR_G(adapter-params.fw_vers),
+   FW_HDR_FW_VER_MICRO_G(adapter-params.fw_vers),
+   FW_HDR_FW_VER_BUILD_G(adapter-params.fw_vers),
+   FW_HDR_FW_VER_MAJOR_G(adapter-params.tp_vers),
+   FW_HDR_FW_VER_MINOR_G(adapter-params.tp_vers),
+   FW_HDR_FW_VER_MICRO_G(adapter-params.tp_vers),
+   FW_HDR_FW_VER_BUILD_G(adapter-params.tp_vers));
 }
 
 static void get_strings(struct net_device *dev, u32 stringset, u8 *data)
@@ -2935,7 +2935,7 @@ static int set_flash(struct net_device *netdev, struct 
ethtool_flash *ef)
int ret;
const struct firmware *fw;
struct adapter *adap = netdev2adap(netdev);
-   unsigned int mbox = FW_PCIE_FW_MASTER_MASK + 1;
+   unsigned int mbox = PCIE_FW_MASTER_M + 1;
 

[PATCH net-next 3/5] cxgb4/cxgb4vf/csiostor: Cleanup macros/register defines related to queues

2014-11-20 Thread Hariprasad Shenai
This patch cleanups all queue related macros/register defines that are defined
in t4fw_api.h and the affected files.

Signed-off-by: Hariprasad Shenai haripra...@chelsio.com
---
 drivers/net/ethernet/chelsio/cxgb4/sge.c   |  115 ++--
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c |   32 +-
 drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h  |  690 ++--
 drivers/net/ethernet/chelsio/cxgb4vf/sge.c |   63 ++--
 drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c |8 +-
 drivers/scsi/csiostor/csio_mb.c|  119 ++--
 6 files changed, 684 insertions(+), 343 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c 
b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index 5cc5e19..433560b 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -2299,18 +2299,18 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct 
sge_rspq *iq, bool fwevtq,
memset(c, 0, sizeof(c));
c.op_to_vfn = htonl(FW_CMD_OP_V(FW_IQ_CMD) | FW_CMD_REQUEST_F |
FW_CMD_WRITE_F | FW_CMD_EXEC_F |
-   FW_IQ_CMD_PFN(adap-fn) | FW_IQ_CMD_VFN(0));
-   c.alloc_to_len16 = htonl(FW_IQ_CMD_ALLOC | FW_IQ_CMD_IQSTART(1) |
+   FW_IQ_CMD_PFN_V(adap-fn) | FW_IQ_CMD_VFN_V(0));
+   c.alloc_to_len16 = htonl(FW_IQ_CMD_ALLOC_F | FW_IQ_CMD_IQSTART_F |
 FW_LEN16(c));
-   c.type_to_iqandstindex = htonl(FW_IQ_CMD_TYPE(FW_IQ_TYPE_FL_INT_CAP) |
-   FW_IQ_CMD_IQASYNCH(fwevtq) | FW_IQ_CMD_VIID(pi-viid) |
-   FW_IQ_CMD_IQANDST(intr_idx  0) | FW_IQ_CMD_IQANUD(1) |
-   FW_IQ_CMD_IQANDSTINDEX(intr_idx = 0 ? intr_idx :
+   c.type_to_iqandstindex = htonl(FW_IQ_CMD_TYPE_V(FW_IQ_TYPE_FL_INT_CAP) |
+   FW_IQ_CMD_IQASYNCH_V(fwevtq) | FW_IQ_CMD_VIID_V(pi-viid) |
+   FW_IQ_CMD_IQANDST_V(intr_idx  0) | FW_IQ_CMD_IQANUD_V(1) |
+   FW_IQ_CMD_IQANDSTINDEX_V(intr_idx = 0 ? intr_idx :
-intr_idx - 1));
-   c.iqdroprss_to_iqesize = htons(FW_IQ_CMD_IQPCIECH(pi-tx_chan) |
-   FW_IQ_CMD_IQGTSMODE |
-   FW_IQ_CMD_IQINTCNTTHRESH(iq-pktcnt_idx) |
-   FW_IQ_CMD_IQESIZE(ilog2(iq-iqe_len) - 4));
+   c.iqdroprss_to_iqesize = htons(FW_IQ_CMD_IQPCIECH_V(pi-tx_chan) |
+   FW_IQ_CMD_IQGTSMODE_F |
+   FW_IQ_CMD_IQINTCNTTHRESH_V(iq-pktcnt_idx) |
+   FW_IQ_CMD_IQESIZE_V(ilog2(iq-iqe_len) - 4));
c.iqsize = htons(iq-size);
c.iqaddr = cpu_to_be64(iq-phys_addr);
 
@@ -2323,12 +2323,12 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct 
sge_rspq *iq, bool fwevtq,
goto fl_nomem;
 
flsz = fl-size / 8 + s-stat_len / sizeof(struct tx_desc);
-   c.iqns_to_fl0congen = htonl(FW_IQ_CMD_FL0PACKEN(1) |
-   FW_IQ_CMD_FL0FETCHRO(1) |
-   FW_IQ_CMD_FL0DATARO(1) |
-   FW_IQ_CMD_FL0PADEN(1));
-   c.fl0dcaen_to_fl0cidxfthresh = htons(FW_IQ_CMD_FL0FBMIN(2) |
-   FW_IQ_CMD_FL0FBMAX(3));
+   c.iqns_to_fl0congen = htonl(FW_IQ_CMD_FL0PACKEN_F |
+   FW_IQ_CMD_FL0FETCHRO_F |
+   FW_IQ_CMD_FL0DATARO_F |
+   FW_IQ_CMD_FL0PADEN_F);
+   c.fl0dcaen_to_fl0cidxfthresh = htons(FW_IQ_CMD_FL0FBMIN_V(2) |
+   FW_IQ_CMD_FL0FBMAX_V(3));
c.fl0size = htons(flsz);
c.fl0addr = cpu_to_be64(fl-addr);
}
@@ -2425,19 +2425,20 @@ int t4_sge_alloc_eth_txq(struct adapter *adap, struct 
sge_eth_txq *txq,
memset(c, 0, sizeof(c));
c.op_to_vfn = htonl(FW_CMD_OP_V(FW_EQ_ETH_CMD) | FW_CMD_REQUEST_F |
FW_CMD_WRITE_F | FW_CMD_EXEC_F |
-   FW_EQ_ETH_CMD_PFN(adap-fn) | FW_EQ_ETH_CMD_VFN(0));
-   c.alloc_to_len16 = htonl(FW_EQ_ETH_CMD_ALLOC |
-FW_EQ_ETH_CMD_EQSTART | FW_LEN16(c));
-   c.viid_pkd = htonl(FW_EQ_ETH_CMD_AUTOEQUEQE |
-  FW_EQ_ETH_CMD_VIID(pi-viid));
-   c.fetchszm_to_iqid = htonl(FW_EQ_ETH_CMD_HOSTFCMODE(2) |
-  FW_EQ_ETH_CMD_PCIECHN(pi-tx_chan) |
-  FW_EQ_ETH_CMD_FETCHRO(1) |
-  FW_EQ_ETH_CMD_IQID(iqid));
-   c.dcaen_to_eqsize = htonl(FW_EQ_ETH_CMD_FBMIN(2) |
- FW_EQ_ETH_CMD_FBMAX(3) |
- FW_EQ_ETH_CMD_CIDXFTHRESH(5) |
- FW_EQ_ETH_CMD_EQSIZE(nentries));
+   FW_EQ_ETH_CMD_PFN_V(adap-fn) |
+   FW_EQ_ETH_CMD_VFN_V(0));
+   

[PATCH net-next 4/5] cxgb4/cxgb4vf/csiostor: Cleanup macros/register defines related to port and VI

2014-11-20 Thread Hariprasad Shenai
This patch cleanups all port and VI related macros/register defines that are
defined in t4fw_api.h and the affected files.

Signed-off-by: Hariprasad Shenai haripra...@chelsio.com
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c  |   14 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h  |4 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |8 +-
 drivers/net/ethernet/chelsio/cxgb4/l2t.c|4 +-
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c  |  106 
 drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h   |  350 ---
 drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c  |  100 
 drivers/scsi/csiostor/csio_mb.c |   20 +-
 8 files changed, 374 insertions(+), 232 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c 
b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c
index cca6049..6c1c5dc 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c
@@ -243,7 +243,7 @@ void cxgb4_dcb_handle_fw_update(struct adapter *adap,
const struct fw_port_cmd *pcmd)
 {
const union fw_port_dcb *fwdcb = pcmd-u.dcb;
-   int port = FW_PORT_CMD_PORTID_GET(be32_to_cpu(pcmd-op_to_portid));
+   int port = FW_PORT_CMD_PORTID_G(be32_to_cpu(pcmd-op_to_portid));
struct net_device *dev = adap-port[port];
struct port_info *pi = netdev_priv(dev);
struct port_dcb_info *dcb = pi-dcb;
@@ -256,12 +256,12 @@ void cxgb4_dcb_handle_fw_update(struct adapter *adap,
if (dcb_type == FW_PORT_DCB_TYPE_CONTROL) {
enum cxgb4_dcb_state_input input =
((pcmd-u.dcb.control.all_syncd_pkd 
- FW_PORT_CMD_ALL_SYNCD)
+ FW_PORT_CMD_ALL_SYNCD_F)
 ? CXGB4_DCB_STATE_FW_ALLSYNCED
 : CXGB4_DCB_STATE_FW_INCOMPLETE);
 
if (dcb-dcb_version != FW_PORT_DCB_VER_UNKNOWN) {
-   dcb_running_version = FW_PORT_CMD_DCB_VERSION_GET(
+   dcb_running_version = FW_PORT_CMD_DCB_VERSION_G(
be16_to_cpu(
pcmd-u.dcb.control.dcb_version_to_app_state));
if (dcb_running_version == FW_PORT_DCB_VER_CEE1D01 ||
@@ -519,7 +519,7 @@ static void cxgb4_setpgtccfg_tx(struct net_device *dev, int 
tc,
 
INIT_PORT_DCB_WRITE_CMD(pcmd, pi-port_id);
if (pi-dcb.state == CXGB4_DCB_STATE_HOST)
-   pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY);
+   pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY_F);
 
err = t4_wr_mbox(adap, adap-mbox, pcmd, sizeof(pcmd), pcmd);
if (err != FW_PORT_DCB_CFG_SUCCESS)
@@ -583,7 +583,7 @@ static void cxgb4_setpgbwgcfg_tx(struct net_device *dev, 
int pgid,
 
INIT_PORT_DCB_WRITE_CMD(pcmd, pi-port_id);
if (pi-dcb.state == CXGB4_DCB_STATE_HOST)
-   pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY);
+   pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY_F);
 
err = t4_wr_mbox(adap, adap-mbox, pcmd, sizeof(pcmd), pcmd);
 
@@ -623,7 +623,7 @@ static void cxgb4_setpfccfg(struct net_device *dev, int 
priority, u8 pfccfg)
 
INIT_PORT_DCB_WRITE_CMD(pcmd, pi-port_id);
if (pi-dcb.state == CXGB4_DCB_STATE_HOST)
-   pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY);
+   pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY_F);
 
pcmd.u.dcb.pfc.type = FW_PORT_DCB_TYPE_PFC;
pcmd.u.dcb.pfc.pfcen = pi-dcb.pfcen;
@@ -842,7 +842,7 @@ static int __cxgb4_setapp(struct net_device *dev, u8 
app_idtype, u16 app_id,
/* write out new app table entry */
INIT_PORT_DCB_WRITE_CMD(pcmd, pi-port_id);
if (pi-dcb.state == CXGB4_DCB_STATE_HOST)
-   pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY);
+   pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY_F);
 
pcmd.u.dcb.app_priority.type = FW_PORT_DCB_TYPE_APP_ID;
pcmd.u.dcb.app_priority.protocolid = cpu_to_be16(app_id);
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h 
b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h
index c0724a5..31ce425 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h
@@ -45,9 +45,9 @@
cpu_to_be32(FW_CMD_OP_V(FW_PORT_CMD) | \
FW_CMD_REQUEST_F | \
FW_CMD_##__op##_F | \
-   FW_PORT_CMD_PORTID(__port)); \
+   FW_PORT_CMD_PORTID_V(__port)); \
(__pcmd).action_to_len16 = \
-   cpu_to_be32(FW_PORT_CMD_ACTION(__action) | \
+   cpu_to_be32(FW_PORT_CMD_ACTION_V(__action) | \
FW_LEN16(pcmd)); \
} while (0)
 
diff