DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v3] net/af_packet: support Tx scattered mbuf input
@ 2017-08-07  9:45 Wenfeng Liu
  2017-08-18 14:10 ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Wenfeng Liu @ 2017-08-07  9:45 UTC (permalink / raw)
  To: linville; +Cc: dev

Signed-off-by: Wenfeng Liu <liuwf@arraynetworks.com.cn>
---
v3:
* Remove trailing whitespace

v2:
* Fixed coding style issues reported by checkpatch

 drivers/net/af_packet/rte_eth_af_packet.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 9a47852..7aa26e5 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -216,7 +216,7 @@ struct pmd_internals {
 		mbuf = *bufs++;
 
 		/* drop oversized packets */
-		if (rte_pktmbuf_data_len(mbuf) > pkt_q->frame_data_size) {
+		if (mbuf->pkt_len > pkt_q->frame_data_size) {
 			rte_pktmbuf_free(mbuf);
 			continue;
 		}
@@ -237,8 +237,17 @@ struct pmd_internals {
 		/* copy the tx frame data */
 		pbuf = (uint8_t *) ppd + TPACKET2_HDRLEN -
 			sizeof(struct sockaddr_ll);
-		memcpy(pbuf, rte_pktmbuf_mtod(mbuf, void*), rte_pktmbuf_data_len(mbuf));
-		ppd->tp_len = ppd->tp_snaplen = rte_pktmbuf_data_len(mbuf);
+
+		struct rte_mbuf *tmp_mbuf = mbuf;
+		while (tmp_mbuf) {
+			uint16_t data_len = rte_pktmbuf_data_len(tmp_mbuf);
+			memcpy(pbuf, rte_pktmbuf_mtod(tmp_mbuf, void*), data_len);
+			pbuf += data_len;
+			tmp_mbuf = tmp_mbuf->next;
+		}
+
+		ppd->tp_len = mbuf->pkt_len;
+		ppd->tp_snaplen = mbuf->pkt_len;
 
 		/* release incoming frame and advance ring buffer */
 		ppd->tp_status = TP_STATUS_SEND_REQUEST;
-- 
1.8.3.1

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

* Re: [dpdk-dev] [PATCH v3] net/af_packet: support Tx scattered mbuf input
  2017-08-07  9:45 [dpdk-dev] [PATCH v3] net/af_packet: support Tx scattered mbuf input Wenfeng Liu
@ 2017-08-18 14:10 ` Ferruh Yigit
  2017-09-05  9:18   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2017-08-18 14:10 UTC (permalink / raw)
  To: Wenfeng Liu, linville; +Cc: dev

On 8/7/2017 10:45 AM, Wenfeng Liu wrote:
> Signed-off-by: Wenfeng Liu <liuwf@arraynetworks.com.cn>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

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

* Re: [dpdk-dev] [PATCH v3] net/af_packet: support Tx scattered mbuf input
  2017-08-18 14:10 ` Ferruh Yigit
@ 2017-09-05  9:18   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-09-05  9:18 UTC (permalink / raw)
  To: Wenfeng Liu, linville; +Cc: dev

On 8/18/2017 3:10 PM, Ferruh Yigit wrote:
> On 8/7/2017 10:45 AM, Wenfeng Liu wrote:
>> Signed-off-by: Wenfeng Liu <liuwf@arraynetworks.com.cn>
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

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

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

end of thread, other threads:[~2017-09-05  9:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-07  9:45 [dpdk-dev] [PATCH v3] net/af_packet: support Tx scattered mbuf input Wenfeng Liu
2017-08-18 14:10 ` Ferruh Yigit
2017-09-05  9:18   ` 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).