* [PATCH] cxgbit: use T6 specific macro to set force bit
@ 2017-01-24 11:37 Varun Prakash
2017-01-24 20:26 ` David Miller
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Varun Prakash @ 2017-01-24 11:37 UTC (permalink / raw)
To: bart.vanassche; +Cc: target-devel, netdev, indranil, varun
For T6 adapters use T6 specific macro to set
force bit.
Signed-off-by: Varun Prakash <varun@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_msg.h | 4 ++++
drivers/target/iscsi/cxgbit/cxgbit_target.c | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
index a267173..21fc2fe 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
@@ -1349,6 +1349,10 @@ struct cpl_tx_data {
#define TX_FORCE_S 13
#define TX_FORCE_V(x) ((x) << TX_FORCE_S)
+#define T6_TX_FORCE_S 20
+#define T6_TX_FORCE_V(x) ((x) << T6_TX_FORCE_S)
+#define T6_TX_FORCE_F T6_TX_FORCE_V(1U)
+
enum {
ULP_TX_MEM_READ = 2,
ULP_TX_MEM_WRITE = 3,
diff --git a/drivers/target/iscsi/cxgbit/cxgbit_target.c b/drivers/target/iscsi/cxgbit/cxgbit_target.c
index 8bcb9b7..bcf94aa 100644
--- a/drivers/target/iscsi/cxgbit/cxgbit_target.c
+++ b/drivers/target/iscsi/cxgbit/cxgbit_target.c
@@ -162,12 +162,14 @@ cxgbit_tx_data_wr(struct cxgbit_sock *csk, struct sk_buff *skb, u32 dlen,
u32 len, u32 credits, u32 compl)
{
struct fw_ofld_tx_data_wr *req;
+ const struct cxgb4_lld_info *lldi = &csk->com.cdev->lldi;
u32 submode = cxgbit_skcb_submode(skb);
u32 wr_ulp_mode = 0;
u32 hdr_size = sizeof(*req);
u32 opcode = FW_OFLD_TX_DATA_WR;
u32 immlen = 0;
- u32 force = TX_FORCE_V(!submode);
+ u32 force = is_t5(lldi->adapter_type) ? TX_FORCE_V(!submode) :
+ T6_TX_FORCE_F;
if (cxgbit_skcb_flags(skb) & SKCBF_TX_ISO) {
opcode = FW_ISCSI_TX_DATA_WR;
--
2.0.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] cxgbit: use T6 specific macro to set force bit
2017-01-24 11:37 [PATCH] cxgbit: use T6 specific macro to set force bit Varun Prakash
@ 2017-01-24 20:26 ` David Miller
2017-01-25 6:21 ` Varun Prakash
2017-01-24 21:11 ` Joe Perches
2017-01-25 23:01 ` Bart Van Assche
2 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2017-01-24 20:26 UTC (permalink / raw)
To: varun; +Cc: bart.vanassche, target-devel, netdev, indranil
From: Varun Prakash <varun@chelsio.com>
Date: Tue, 24 Jan 2017 17:07:02 +0530
> For T6 adapters use T6 specific macro to set
> force bit.
>
> Signed-off-by: Varun Prakash <varun@chelsio.com>
What tree is this for?
You must always indicate this in your PATCH subject text.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] cxgbit: use T6 specific macro to set force bit
2017-01-24 11:37 [PATCH] cxgbit: use T6 specific macro to set force bit Varun Prakash
2017-01-24 20:26 ` David Miller
@ 2017-01-24 21:11 ` Joe Perches
2017-01-25 6:38 ` Varun Prakash
2017-01-25 23:01 ` Bart Van Assche
2 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2017-01-24 21:11 UTC (permalink / raw)
To: Varun Prakash, bart.vanassche; +Cc: target-devel, netdev, indranil
On Tue, 2017-01-24 at 17:07 +0530, Varun Prakash wrote:
> For T6 adapters use T6 specific macro to set
> force bit.
[]
> diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
[]
> @@ -1349,6 +1349,10 @@ struct cpl_tx_data {
> #define TX_FORCE_S 13
> #define TX_FORCE_V(x) ((x) << TX_FORCE_S)
>
> +#define T6_TX_FORCE_S 20
> +#define T6_TX_FORCE_V(x) ((x) << T6_TX_FORCE_S)
> +#define T6_TX_FORCE_F T6_TX_FORCE_V(1U)
> +
> enum {
> ULP_TX_MEM_READ = 2,
> ULP_TX_MEM_WRITE = 3,
> diff --git a/drivers/target/iscsi/cxgbit/cxgbit_target.c b/drivers/target/iscsi/cxgbit/cxgbit_target.c
[]
> @@ -162,12 +162,14 @@ cxgbit_tx_data_wr(struct cxgbit_sock *csk, struct sk_buff *skb, u32 dlen,
> u32 len, u32 credits, u32 compl)
> {
> struct fw_ofld_tx_data_wr *req;
> + const struct cxgb4_lld_info *lldi = &csk->com.cdev->lldi;
> u32 submode = cxgbit_skcb_submode(skb);
> u32 wr_ulp_mode = 0;
> u32 hdr_size = sizeof(*req);
> u32 opcode = FW_OFLD_TX_DATA_WR;
> u32 immlen = 0;
> - u32 force = TX_FORCE_V(!submode);
> + u32 force = is_t5(lldi->adapter_type) ? TX_FORCE_V(!submode) :
> + T6_TX_FORCE_F;
Perhaps it'd be better to add a is_t6() mechanism so this
is written in the positive rather than the negative.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] cxgbit: use T6 specific macro to set force bit
2017-01-24 20:26 ` David Miller
@ 2017-01-25 6:21 ` Varun Prakash
0 siblings, 0 replies; 7+ messages in thread
From: Varun Prakash @ 2017-01-25 6:21 UTC (permalink / raw)
To: David Miller; +Cc: bart.vanassche, target-devel, netdev, Indranil Choudhury
On Wed, Jan 25, 2017 at 01:56:16AM +0530, David Miller wrote:
> From: Varun Prakash <varun@chelsio.com>
> Date: Tue, 24 Jan 2017 17:07:02 +0530
>
> > For T6 adapters use T6 specific macro to set
> > force bit.
> >
> > Signed-off-by: Varun Prakash <varun@chelsio.com>
>
> What tree is this for?
>
> You must always indicate this in your PATCH subject text.
Sorry, I missed it. This patch is for Bart's target tree.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] cxgbit: use T6 specific macro to set force bit
2017-01-24 21:11 ` Joe Perches
@ 2017-01-25 6:38 ` Varun Prakash
2017-01-25 16:06 ` Joe Perches
0 siblings, 1 reply; 7+ messages in thread
From: Varun Prakash @ 2017-01-25 6:38 UTC (permalink / raw)
To: Joe Perches; +Cc: bart.vanassche, target-devel, netdev, Indranil Choudhury
On Wed, Jan 25, 2017 at 02:41:40AM +0530, Joe Perches wrote:
> On Tue, 2017-01-24 at 17:07 +0530, Varun Prakash wrote:
> > For T6 adapters use T6 specific macro to set
> > force bit.
> []
> > diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
> []
> > @@ -1349,6 +1349,10 @@ struct cpl_tx_data {
> > #define TX_FORCE_S 13
> > #define TX_FORCE_V(x) ((x) << TX_FORCE_S)
> >
> > +#define T6_TX_FORCE_S 20
> > +#define T6_TX_FORCE_V(x) ((x) << T6_TX_FORCE_S)
> > +#define T6_TX_FORCE_F T6_TX_FORCE_V(1U)
> > +
> > enum {
> > ULP_TX_MEM_READ = 2,
> > ULP_TX_MEM_WRITE = 3,
> > diff --git a/drivers/target/iscsi/cxgbit/cxgbit_target.c b/drivers/target/iscsi/cxgbit/cxgbit_target.c
> []
> > @@ -162,12 +162,14 @@ cxgbit_tx_data_wr(struct cxgbit_sock *csk, struct sk_buff *skb, u32 dlen,
> > u32 len, u32 credits, u32 compl)
> > {
> > struct fw_ofld_tx_data_wr *req;
> > + const struct cxgb4_lld_info *lldi = &csk->com.cdev->lldi;
> > u32 submode = cxgbit_skcb_submode(skb);
> > u32 wr_ulp_mode = 0;
> > u32 hdr_size = sizeof(*req);
> > u32 opcode = FW_OFLD_TX_DATA_WR;
> > u32 immlen = 0;
> > - u32 force = TX_FORCE_V(!submode);
> > + u32 force = is_t5(lldi->adapter_type) ? TX_FORCE_V(!submode) :
> > + T6_TX_FORCE_F;
>
> Perhaps it'd be better to add a is_t6() mechanism so this
> is written in the positive rather than the negative.
>
At present cxgbit driver supports only T5 and T6 adapters so
if a adapter is not T5 then it is T6.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] cxgbit: use T6 specific macro to set force bit
2017-01-25 6:38 ` Varun Prakash
@ 2017-01-25 16:06 ` Joe Perches
0 siblings, 0 replies; 7+ messages in thread
From: Joe Perches @ 2017-01-25 16:06 UTC (permalink / raw)
To: Varun Prakash; +Cc: bart.vanassche, target-devel, netdev, Indranil Choudhury
On Wed, 2017-01-25 at 12:08 +0530, Varun Prakash wrote:
> On Wed, Jan 25, 2017 at 02:41:40AM +0530, Joe Perches wrote:
> > On Tue, 2017-01-24 at 17:07 +0530, Varun Prakash wrote:
> > > For T6 adapters use T6 specific macro to set
> > > force bit.
> >
> > []
> > > diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
> >
> > []
> > > @@ -1349,6 +1349,10 @@ struct cpl_tx_data {
> > > #define TX_FORCE_S 13
> > > #define TX_FORCE_V(x) ((x) << TX_FORCE_S)
> > >
> > > +#define T6_TX_FORCE_S 20
> > > +#define T6_TX_FORCE_V(x) ((x) << T6_TX_FORCE_S)
> > > +#define T6_TX_FORCE_F T6_TX_FORCE_V(1U)
> > > +
> > > enum {
> > > ULP_TX_MEM_READ = 2,
> > > ULP_TX_MEM_WRITE = 3,
> > > diff --git a/drivers/target/iscsi/cxgbit/cxgbit_target.c b/drivers/target/iscsi/cxgbit/cxgbit_target.c
> >
> > []
> > > @@ -162,12 +162,14 @@ cxgbit_tx_data_wr(struct cxgbit_sock *csk, struct sk_buff *skb, u32 dlen,
> > > u32 len, u32 credits, u32 compl)
> > > {
> > > struct fw_ofld_tx_data_wr *req;
> > > + const struct cxgb4_lld_info *lldi = &csk->com.cdev->lldi;
> > > u32 submode = cxgbit_skcb_submode(skb);
> > > u32 wr_ulp_mode = 0;
> > > u32 hdr_size = sizeof(*req);
> > > u32 opcode = FW_OFLD_TX_DATA_WR;
> > > u32 immlen = 0;
> > > - u32 force = TX_FORCE_V(!submode);
> > > + u32 force = is_t5(lldi->adapter_type) ? TX_FORCE_V(!submode) :
> > > + T6_TX_FORCE_F;
> >
> > Perhaps it'd be better to add a is_t6() mechanism so this
> > is written in the positive rather than the negative.
> >
>
> At present
That's the key phrase that describes the reason why it's
generally better to write code in the positive than the
negative.
> cxgbit driver supports only T5 and T6 adapters so
> if a adapter is not T5 then it is T6.
Your code, your choices...
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] cxgbit: use T6 specific macro to set force bit
2017-01-24 11:37 [PATCH] cxgbit: use T6 specific macro to set force bit Varun Prakash
2017-01-24 20:26 ` David Miller
2017-01-24 21:11 ` Joe Perches
@ 2017-01-25 23:01 ` Bart Van Assche
2 siblings, 0 replies; 7+ messages in thread
From: Bart Van Assche @ 2017-01-25 23:01 UTC (permalink / raw)
To: varun; +Cc: indranil, netdev, target-devel
On Tue, 2017-01-24 at 17:07 +0530, Varun Prakash wrote:
> For T6 adapters use T6 specific macro to set force bit.
Thanks, I have applied this patch.
Bart.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-01-25 23:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-24 11:37 [PATCH] cxgbit: use T6 specific macro to set force bit Varun Prakash
2017-01-24 20:26 ` David Miller
2017-01-25 6:21 ` Varun Prakash
2017-01-24 21:11 ` Joe Perches
2017-01-25 6:38 ` Varun Prakash
2017-01-25 16:06 ` Joe Perches
2017-01-25 23:01 ` Bart Van Assche
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.