* [PATCH net-next] Revert "cxgb4: Don't assume LSO only uses SGL path in t4_eth_xmit()"
@ 2014-03-05 10:49 Hariprasad Shenai
2014-03-06 14:51 ` Kumar Sanghvi
2014-03-06 22:00 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Hariprasad Shenai @ 2014-03-05 10:49 UTC (permalink / raw)
To: netdev; +Cc: davem, kumaras, dm, leedom, santosh, hariprasad, nirranjan
Commit 0034b29 (cxgb4: Don't assume LSO only uses SGL path in t4_eth_xmit())
introduced a regression causing chip-hang. This patch needs more debugging and
more work. So reverting for now.
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/sge.c | 32 ++++++++++----------------------
1 file changed, 10 insertions(+), 22 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index af76b25..23dbe28 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -706,17 +706,11 @@ static inline unsigned int flits_to_desc(unsigned int n)
* @skb: the packet
*
* Returns whether an Ethernet packet is small enough to fit as
- * immediate data. Return value corresponds to headroom required.
+ * immediate data.
*/
static inline int is_eth_imm(const struct sk_buff *skb)
{
- int hdrlen = skb_shinfo(skb)->gso_size ?
- sizeof(struct cpl_tx_pkt_lso_core) : 0;
-
- hdrlen += sizeof(struct cpl_tx_pkt);
- if (skb->len <= MAX_IMM_TX_PKT_LEN - hdrlen)
- return hdrlen;
- return 0;
+ return skb->len <= MAX_IMM_TX_PKT_LEN - sizeof(struct cpl_tx_pkt);
}
/**
@@ -729,10 +723,9 @@ static inline int is_eth_imm(const struct sk_buff *skb)
static inline unsigned int calc_tx_flits(const struct sk_buff *skb)
{
unsigned int flits;
- int hdrlen = is_eth_imm(skb);
- if (hdrlen)
- return DIV_ROUND_UP(skb->len + hdrlen, sizeof(__be64));
+ if (is_eth_imm(skb))
+ return DIV_ROUND_UP(skb->len + sizeof(struct cpl_tx_pkt), 8);
flits = sgl_len(skb_shinfo(skb)->nr_frags + 1) + 4;
if (skb_shinfo(skb)->gso_size)
@@ -978,7 +971,6 @@ static inline void txq_advance(struct sge_txq *q, unsigned int n)
*/
netdev_tx_t t4_eth_xmit(struct sk_buff *skb, struct net_device *dev)
{
- int len;
u32 wr_mid;
u64 cntrl, *end;
int qidx, credits;
@@ -990,7 +982,6 @@ netdev_tx_t t4_eth_xmit(struct sk_buff *skb, struct net_device *dev)
struct cpl_tx_pkt_core *cpl;
const struct skb_shared_info *ssi;
dma_addr_t addr[MAX_SKB_FRAGS + 1];
- bool immediate = false;
/*
* The chip min packet length is 10 octets but play safe and reject
@@ -1020,10 +1011,7 @@ out_free: dev_kfree_skb(skb);
return NETDEV_TX_BUSY;
}
- if (is_eth_imm(skb))
- immediate = true;
-
- if (!immediate &&
+ if (!is_eth_imm(skb) &&
unlikely(map_skb(adap->pdev_dev, skb, addr) < 0)) {
q->mapping_err++;
goto out_free;
@@ -1040,8 +1028,6 @@ out_free: dev_kfree_skb(skb);
wr->r3 = cpu_to_be64(0);
end = (u64 *)wr + flits;
- len = immediate ? skb->len : 0;
- len += sizeof(*cpl);
ssi = skb_shinfo(skb);
if (ssi->gso_size) {
struct cpl_tx_pkt_lso *lso = (void *)wr;
@@ -1049,9 +1035,8 @@ out_free: dev_kfree_skb(skb);
int l3hdr_len = skb_network_header_len(skb);
int eth_xtra_len = skb_network_offset(skb) - ETH_HLEN;
- len += sizeof(*lso);
wr->op_immdlen = htonl(FW_WR_OP(FW_ETH_TX_PKT_WR) |
- FW_WR_IMMDLEN(len));
+ FW_WR_IMMDLEN(sizeof(*lso)));
lso->c.lso_ctrl = htonl(LSO_OPCODE(CPL_TX_PKT_LSO) |
LSO_FIRST_SLICE | LSO_LAST_SLICE |
LSO_IPV6(v6) |
@@ -1069,6 +1054,9 @@ out_free: dev_kfree_skb(skb);
q->tso++;
q->tx_cso += ssi->gso_segs;
} else {
+ int len;
+
+ len = is_eth_imm(skb) ? skb->len + sizeof(*cpl) : sizeof(*cpl);
wr->op_immdlen = htonl(FW_WR_OP(FW_ETH_TX_PKT_WR) |
FW_WR_IMMDLEN(len));
cpl = (void *)(wr + 1);
@@ -1090,7 +1078,7 @@ out_free: dev_kfree_skb(skb);
cpl->len = htons(skb->len);
cpl->ctrl1 = cpu_to_be64(cntrl);
- if (immediate) {
+ if (is_eth_imm(skb)) {
inline_tx_skb(skb, &q->q, cpl + 1);
dev_kfree_skb(skb);
} else {
--
1.8.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] Revert "cxgb4: Don't assume LSO only uses SGL path in t4_eth_xmit()"
2014-03-05 10:49 [PATCH net-next] Revert "cxgb4: Don't assume LSO only uses SGL path in t4_eth_xmit()" Hariprasad Shenai
@ 2014-03-06 14:51 ` Kumar Sanghvi
2014-03-06 22:00 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Kumar Sanghvi @ 2014-03-06 14:51 UTC (permalink / raw)
To: davem; +Cc: netdev, dm, leedom, santosh, nirranjan, Hariprasad S
Hi David,
On Wednesday, March 03/05/14, 2014 at 16:19:16 +0530, Hariprasad Shenai wrote:
> Commit 0034b29 (cxgb4: Don't assume LSO only uses SGL path in t4_eth_xmit())
> introduced a regression causing chip-hang. This patch needs more debugging and
> more work. So reverting for now.
>
> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
> ---
[...]
>
I was finally able to root-cause issue, and have prepared a proper fix.
Turns out, the len calculation was not done properly. So, this revert patch is
now no longer required.
If this revert patch is not yet merged in net-next, and if its OK with you then,
could you please drop this revert patch from your patch-queue ?
I will get the proper fix submitted for this regression.
Sorry for the trouble caused by this LSO related patch.
Thanks,
Kumar.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] Revert "cxgb4: Don't assume LSO only uses SGL path in t4_eth_xmit()"
2014-03-05 10:49 [PATCH net-next] Revert "cxgb4: Don't assume LSO only uses SGL path in t4_eth_xmit()" Hariprasad Shenai
2014-03-06 14:51 ` Kumar Sanghvi
@ 2014-03-06 22:00 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-03-06 22:00 UTC (permalink / raw)
To: hariprasad; +Cc: netdev, kumaras, dm, leedom, santosh, nirranjan
From: Hariprasad Shenai <hariprasad@chelsio.com>
Date: Wed, 5 Mar 2014 16:19:16 +0530
> Commit 0034b29 (cxgb4: Don't assume LSO only uses SGL path in t4_eth_xmit())
> introduced a regression causing chip-hang. This patch needs more debugging and
> more work. So reverting for now.
>
> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
As requested I'm skipping this patch.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-03-06 22:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05 10:49 [PATCH net-next] Revert "cxgb4: Don't assume LSO only uses SGL path in t4_eth_xmit()" Hariprasad Shenai
2014-03-06 14:51 ` Kumar Sanghvi
2014-03-06 22:00 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).