[dpdk-dev] enic: fix dma addr of outgoing packets

Message ID 1456355175-3230-1-git-send-email-ydesmouc@cisco.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers

Commit Message

Yoann Desmouceaux Feb. 24, 2016, 11:06 p.m. UTC
  The enic PMD driver send function uses a constant offset instead
of relying on the data_off in the mbuf to find the start of the packet.

Signed-off-by: Yoann Desmouceaux <ydesmouc@cisco.com>
---
 drivers/net/enic/enic_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Bruce Richardson March 10, 2016, 9:32 p.m. UTC | #1
On Thu, Feb 25, 2016 at 12:06:15AM +0100, Yoann Desmouceaux wrote:
> The enic PMD driver send function uses a constant offset instead
> of relying on the data_off in the mbuf to find the start of the packet.
> 
> Signed-off-by: Yoann Desmouceaux <ydesmouc@cisco.com>
> ---
>  drivers/net/enic/enic_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
> index 07a9810..f818c32 100644
> --- a/drivers/net/enic/enic_main.c
> +++ b/drivers/net/enic/enic_main.c
> @@ -166,7 +166,7 @@ void enic_send_pkt(struct enic *enic, struct vnic_wq *wq,
>  	uint16_t mss = 0;
>  	uint8_t vlan_tag_insert = 0;
>  	uint64_t bus_addr = (dma_addr_t)
> -	    (tx_pkt->buf_physaddr + RTE_PKTMBUF_HEADROOM);
> +	    (tx_pkt->buf_physaddr + tx_pkt->data_off);
>  
>  	if (sop) {
>  		if (ol_flags & PKT_TX_VLAN_PKT)
> -- 
> 2.1.4
> 
Fixes: fefed3d1e62c ("enic: new driver")

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Bruce Richardson March 10, 2016, 9:35 p.m. UTC | #2
On Thu, Mar 10, 2016 at 09:32:58PM +0000, Bruce Richardson wrote:
> On Thu, Feb 25, 2016 at 12:06:15AM +0100, Yoann Desmouceaux wrote:
> > The enic PMD driver send function uses a constant offset instead
> > of relying on the data_off in the mbuf to find the start of the packet.
> > 
> > Signed-off-by: Yoann Desmouceaux <ydesmouc@cisco.com>
> > ---
> >  drivers/net/enic/enic_main.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
> > index 07a9810..f818c32 100644
> > --- a/drivers/net/enic/enic_main.c
> > +++ b/drivers/net/enic/enic_main.c
> > @@ -166,7 +166,7 @@ void enic_send_pkt(struct enic *enic, struct vnic_wq *wq,
> >  	uint16_t mss = 0;
> >  	uint8_t vlan_tag_insert = 0;
> >  	uint64_t bus_addr = (dma_addr_t)
> > -	    (tx_pkt->buf_physaddr + RTE_PKTMBUF_HEADROOM);
> > +	    (tx_pkt->buf_physaddr + tx_pkt->data_off);
> >  
> >  	if (sop) {
> >  		if (ol_flags & PKT_TX_VLAN_PKT)
> > -- 
> > 2.1.4
> > 
> Fixes: fefed3d1e62c ("enic: new driver")
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
Applied to dpdk-next-net/rel_16_04

/Bruce
  

Patch

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 07a9810..f818c32 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -166,7 +166,7 @@  void enic_send_pkt(struct enic *enic, struct vnic_wq *wq,
 	uint16_t mss = 0;
 	uint8_t vlan_tag_insert = 0;
 	uint64_t bus_addr = (dma_addr_t)
-	    (tx_pkt->buf_physaddr + RTE_PKTMBUF_HEADROOM);
+	    (tx_pkt->buf_physaddr + tx_pkt->data_off);
 
 	if (sop) {
 		if (ol_flags & PKT_TX_VLAN_PKT)