DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/cxgbe: remove unused code in Rx path
@ 2019-03-20 11:49 Rahul Lakkireddy
  2019-03-20 11:49 ` Rahul Lakkireddy
  2019-03-21 19:45 ` Ferruh Yigit
  0 siblings, 2 replies; 4+ messages in thread
From: Rahul Lakkireddy @ 2019-03-20 11:49 UTC (permalink / raw)
  To: dev; +Cc: vishal, nirranjan, indranil

From: Vishal Kulkarni <vishal@chelsio.com>

All Rx packet handling is done in process_responses() and hence
t4_ethrx_handler() never gets called. So, remove it.

Signed-off-by: Vishal Kulkarni <vishal@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/base/adapter.h |  2 -
 drivers/net/cxgbe/cxgbe_ethdev.c |  2 +-
 drivers/net/cxgbe/sge.c          | 92 --------------------------------
 3 files changed, 1 insertion(+), 95 deletions(-)

diff --git a/drivers/net/cxgbe/base/adapter.h b/drivers/net/cxgbe/base/adapter.h
index 17ce60d04..fb8af5250 100644
--- a/drivers/net/cxgbe/base/adapter.h
+++ b/drivers/net/cxgbe/base/adapter.h
@@ -801,8 +801,6 @@ void t4_sge_tx_monitor_stop(struct adapter *adap);
 int t4_eth_xmit(struct sge_eth_txq *txq, struct rte_mbuf *mbuf,
 		uint16_t nb_pkts);
 int t4_mgmt_tx(struct sge_ctrl_txq *txq, struct rte_mbuf *mbuf);
-int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
-		     const struct pkt_gl *gl);
 int t4_sge_init(struct adapter *adap);
 int t4vf_sge_init(struct adapter *adap);
 int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 010a818eb..833dd1f5f 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -633,7 +633,7 @@ int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 			~DEV_RX_OFFLOAD_JUMBO_FRAME;
 
 	err = t4_sge_alloc_rxq(adapter, &rxq->rspq, false, eth_dev, msi_idx,
-			       &rxq->fl, t4_ethrx_handler,
+			       &rxq->fl, NULL,
 			       is_pf4(adapter) ?
 			       t4_get_tp_ch_map(adapter, pi->tx_chan) : 0, mp,
 			       queue_idx, socket_id);
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index 8c26ef2ef..3a0eba5df 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -1495,98 +1495,6 @@ static void *alloc_ring(size_t nelem, size_t elem_size,
 	return tz->addr;
 }
 
-/**
- * t4_pktgl_to_mbuf_usembufs - build an mbuf from a packet gather list
- * @gl: the gather list
- *
- * Builds an mbuf from the given packet gather list.  Returns the mbuf or
- * %NULL if mbuf allocation failed.
- */
-static struct rte_mbuf *t4_pktgl_to_mbuf_usembufs(const struct pkt_gl *gl)
-{
-	/*
-	 * If there's only one mbuf fragment, just return that.
-	 */
-	if (likely(gl->nfrags == 1))
-		return gl->mbufs[0];
-
-	return NULL;
-}
-
-/**
- * t4_pktgl_to_mbuf - build an mbuf from a packet gather list
- * @gl: the gather list
- *
- * Builds an mbuf from the given packet gather list.  Returns the mbuf or
- * %NULL if mbuf allocation failed.
- */
-static struct rte_mbuf *t4_pktgl_to_mbuf(const struct pkt_gl *gl)
-{
-	return t4_pktgl_to_mbuf_usembufs(gl);
-}
-
-/**
- * t4_ethrx_handler - process an ingress ethernet packet
- * @q: the response queue that received the packet
- * @rsp: the response queue descriptor holding the RX_PKT message
- * @si: the gather list of packet fragments
- *
- * Process an ingress ethernet packet and deliver it to the stack.
- */
-int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
-		     const struct pkt_gl *si)
-{
-	struct rte_mbuf *mbuf;
-	const struct cpl_rx_pkt *pkt;
-	const struct rss_header *rss_hdr;
-	bool csum_ok;
-	struct sge_eth_rxq *rxq = container_of(q, struct sge_eth_rxq, rspq);
-	u16 err_vec;
-
-	rss_hdr = (const void *)rsp;
-	pkt = (const void *)&rsp[1];
-	/* Compressed error vector is enabled for T6 only */
-	if (q->adapter->params.tp.rx_pkt_encap)
-		err_vec = G_T6_COMPR_RXERR_VEC(ntohs(pkt->err_vec));
-	else
-		err_vec = ntohs(pkt->err_vec);
-	csum_ok = pkt->csum_calc && !err_vec;
-
-	mbuf = t4_pktgl_to_mbuf(si);
-	if (unlikely(!mbuf)) {
-		rxq->stats.rx_drops++;
-		return 0;
-	}
-
-	mbuf->port = pkt->iff;
-	if (pkt->l2info & htonl(F_RXF_IP)) {
-		mbuf->packet_type = RTE_PTYPE_L3_IPV4;
-		if (unlikely(!csum_ok))
-			mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD;
-
-		if ((pkt->l2info & htonl(F_RXF_UDP | F_RXF_TCP)) && !csum_ok)
-			mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
-	} else if (pkt->l2info & htonl(F_RXF_IP6)) {
-		mbuf->packet_type = RTE_PTYPE_L3_IPV6;
-	}
-
-	mbuf->port = pkt->iff;
-
-	if (!rss_hdr->filter_tid && rss_hdr->hash_type) {
-		mbuf->ol_flags |= PKT_RX_RSS_HASH;
-		mbuf->hash.rss = ntohl(rss_hdr->hash_val);
-	}
-
-	if (pkt->vlan_ex) {
-		mbuf->ol_flags |= PKT_RX_VLAN;
-		mbuf->vlan_tci = ntohs(pkt->vlan);
-	}
-	rxq->stats.pkts++;
-	rxq->stats.rx_bytes += mbuf->pkt_len;
-
-	return 0;
-}
-
 #define CXGB4_MSG_AN ((void *)1)
 
 /**
-- 
2.18.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH] net/cxgbe: remove unused code in Rx path
  2019-03-20 11:49 [dpdk-dev] [PATCH] net/cxgbe: remove unused code in Rx path Rahul Lakkireddy
@ 2019-03-20 11:49 ` Rahul Lakkireddy
  2019-03-21 19:45 ` Ferruh Yigit
  1 sibling, 0 replies; 4+ messages in thread
From: Rahul Lakkireddy @ 2019-03-20 11:49 UTC (permalink / raw)
  To: dev; +Cc: vishal, nirranjan, indranil

From: Vishal Kulkarni <vishal@chelsio.com>

All Rx packet handling is done in process_responses() and hence
t4_ethrx_handler() never gets called. So, remove it.

Signed-off-by: Vishal Kulkarni <vishal@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/base/adapter.h |  2 -
 drivers/net/cxgbe/cxgbe_ethdev.c |  2 +-
 drivers/net/cxgbe/sge.c          | 92 --------------------------------
 3 files changed, 1 insertion(+), 95 deletions(-)

diff --git a/drivers/net/cxgbe/base/adapter.h b/drivers/net/cxgbe/base/adapter.h
index 17ce60d04..fb8af5250 100644
--- a/drivers/net/cxgbe/base/adapter.h
+++ b/drivers/net/cxgbe/base/adapter.h
@@ -801,8 +801,6 @@ void t4_sge_tx_monitor_stop(struct adapter *adap);
 int t4_eth_xmit(struct sge_eth_txq *txq, struct rte_mbuf *mbuf,
 		uint16_t nb_pkts);
 int t4_mgmt_tx(struct sge_ctrl_txq *txq, struct rte_mbuf *mbuf);
-int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
-		     const struct pkt_gl *gl);
 int t4_sge_init(struct adapter *adap);
 int t4vf_sge_init(struct adapter *adap);
 int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 010a818eb..833dd1f5f 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -633,7 +633,7 @@ int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 			~DEV_RX_OFFLOAD_JUMBO_FRAME;
 
 	err = t4_sge_alloc_rxq(adapter, &rxq->rspq, false, eth_dev, msi_idx,
-			       &rxq->fl, t4_ethrx_handler,
+			       &rxq->fl, NULL,
 			       is_pf4(adapter) ?
 			       t4_get_tp_ch_map(adapter, pi->tx_chan) : 0, mp,
 			       queue_idx, socket_id);
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index 8c26ef2ef..3a0eba5df 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -1495,98 +1495,6 @@ static void *alloc_ring(size_t nelem, size_t elem_size,
 	return tz->addr;
 }
 
-/**
- * t4_pktgl_to_mbuf_usembufs - build an mbuf from a packet gather list
- * @gl: the gather list
- *
- * Builds an mbuf from the given packet gather list.  Returns the mbuf or
- * %NULL if mbuf allocation failed.
- */
-static struct rte_mbuf *t4_pktgl_to_mbuf_usembufs(const struct pkt_gl *gl)
-{
-	/*
-	 * If there's only one mbuf fragment, just return that.
-	 */
-	if (likely(gl->nfrags == 1))
-		return gl->mbufs[0];
-
-	return NULL;
-}
-
-/**
- * t4_pktgl_to_mbuf - build an mbuf from a packet gather list
- * @gl: the gather list
- *
- * Builds an mbuf from the given packet gather list.  Returns the mbuf or
- * %NULL if mbuf allocation failed.
- */
-static struct rte_mbuf *t4_pktgl_to_mbuf(const struct pkt_gl *gl)
-{
-	return t4_pktgl_to_mbuf_usembufs(gl);
-}
-
-/**
- * t4_ethrx_handler - process an ingress ethernet packet
- * @q: the response queue that received the packet
- * @rsp: the response queue descriptor holding the RX_PKT message
- * @si: the gather list of packet fragments
- *
- * Process an ingress ethernet packet and deliver it to the stack.
- */
-int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
-		     const struct pkt_gl *si)
-{
-	struct rte_mbuf *mbuf;
-	const struct cpl_rx_pkt *pkt;
-	const struct rss_header *rss_hdr;
-	bool csum_ok;
-	struct sge_eth_rxq *rxq = container_of(q, struct sge_eth_rxq, rspq);
-	u16 err_vec;
-
-	rss_hdr = (const void *)rsp;
-	pkt = (const void *)&rsp[1];
-	/* Compressed error vector is enabled for T6 only */
-	if (q->adapter->params.tp.rx_pkt_encap)
-		err_vec = G_T6_COMPR_RXERR_VEC(ntohs(pkt->err_vec));
-	else
-		err_vec = ntohs(pkt->err_vec);
-	csum_ok = pkt->csum_calc && !err_vec;
-
-	mbuf = t4_pktgl_to_mbuf(si);
-	if (unlikely(!mbuf)) {
-		rxq->stats.rx_drops++;
-		return 0;
-	}
-
-	mbuf->port = pkt->iff;
-	if (pkt->l2info & htonl(F_RXF_IP)) {
-		mbuf->packet_type = RTE_PTYPE_L3_IPV4;
-		if (unlikely(!csum_ok))
-			mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD;
-
-		if ((pkt->l2info & htonl(F_RXF_UDP | F_RXF_TCP)) && !csum_ok)
-			mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
-	} else if (pkt->l2info & htonl(F_RXF_IP6)) {
-		mbuf->packet_type = RTE_PTYPE_L3_IPV6;
-	}
-
-	mbuf->port = pkt->iff;
-
-	if (!rss_hdr->filter_tid && rss_hdr->hash_type) {
-		mbuf->ol_flags |= PKT_RX_RSS_HASH;
-		mbuf->hash.rss = ntohl(rss_hdr->hash_val);
-	}
-
-	if (pkt->vlan_ex) {
-		mbuf->ol_flags |= PKT_RX_VLAN;
-		mbuf->vlan_tci = ntohs(pkt->vlan);
-	}
-	rxq->stats.pkts++;
-	rxq->stats.rx_bytes += mbuf->pkt_len;
-
-	return 0;
-}
-
 #define CXGB4_MSG_AN ((void *)1)
 
 /**
-- 
2.18.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/cxgbe: remove unused code in Rx path
  2019-03-20 11:49 [dpdk-dev] [PATCH] net/cxgbe: remove unused code in Rx path Rahul Lakkireddy
  2019-03-20 11:49 ` Rahul Lakkireddy
@ 2019-03-21 19:45 ` Ferruh Yigit
  2019-03-21 19:45   ` Ferruh Yigit
  1 sibling, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2019-03-21 19:45 UTC (permalink / raw)
  To: Rahul Lakkireddy, dev; +Cc: vishal, nirranjan, indranil

On 3/20/2019 11:49 AM, Rahul Lakkireddy wrote:
> From: Vishal Kulkarni <vishal@chelsio.com>
> 
> All Rx packet handling is done in process_responses() and hence
> t4_ethrx_handler() never gets called. So, remove it.
> 
> Signed-off-by: Vishal Kulkarni <vishal@chelsio.com>
> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/cxgbe: remove unused code in Rx path
  2019-03-21 19:45 ` Ferruh Yigit
@ 2019-03-21 19:45   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2019-03-21 19:45 UTC (permalink / raw)
  To: Rahul Lakkireddy, dev; +Cc: vishal, nirranjan, indranil

On 3/20/2019 11:49 AM, Rahul Lakkireddy wrote:
> From: Vishal Kulkarni <vishal@chelsio.com>
> 
> All Rx packet handling is done in process_responses() and hence
> t4_ethrx_handler() never gets called. So, remove it.
> 
> Signed-off-by: Vishal Kulkarni <vishal@chelsio.com>
> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-21 19:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-20 11:49 [dpdk-dev] [PATCH] net/cxgbe: remove unused code in Rx path Rahul Lakkireddy
2019-03-20 11:49 ` Rahul Lakkireddy
2019-03-21 19:45 ` Ferruh Yigit
2019-03-21 19:45   ` Ferruh Yigit

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).