DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  checksum and vlan insertion seem not working on X520
@ 2017-03-08  8:49 Chillance Zen
  2017-03-08  9:20 ` Ananyev, Konstantin
  0 siblings, 1 reply; 3+ messages in thread
From: Chillance Zen @ 2017-03-08  8:49 UTC (permalink / raw)
  To: dev

Hi ,every one

when I was conducting nic offloading exp,I can not make a x520 nic insert
vlan ,nor checksum,
here is my rx/tx capability:
rx offload capability:9f
tx offload capability:203f

with code like this:
while(1){
nr_mbufs=rte_eth_rx_burst(0,queue_id,mbufs,32);
for(idx=0;idx<nr_mbufs;idx++){
#if 0
buffer=rte_pktmbuf_mtod(mbufs[idx],char*);
ip4=(struct ipv4_hdr*)(buffer+14);
ip4->hdr_checksum=0;
mbufs[idx]->l2_len=14;
mbufs[idx]->l3_len=20;
mbufs[idx]->ol_flags=PKT_TX_IP_CKSUM|PKT_TX_IPV4;
#else
mbufs[idx]->vlan_tci=0xef00;
mbufs[idx]->ol_flags=PKT_TX_VLAN_PKT;
#endif
rte_eth_tx_burst(0,queue_id,&mbufs[idx],1);
}
}

does anybody know what;s wrong with my code?
Thanks & regards
Linc

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

* Re: [dpdk-dev] checksum and vlan insertion seem not working on X520
  2017-03-08  8:49 [dpdk-dev] checksum and vlan insertion seem not working on X520 Chillance Zen
@ 2017-03-08  9:20 ` Ananyev, Konstantin
  2017-03-08 11:21   ` Chillance Zen
  0 siblings, 1 reply; 3+ messages in thread
From: Ananyev, Konstantin @ 2017-03-08  9:20 UTC (permalink / raw)
  To: Chillance Zen, dev

Hi Linc,

Wonder what TX function are you using?
Make sure that you are not using simple TX function that doesn’t support any offloads or multiseg packets.
You need something like that at setup phase:

rte_eth_dev_info_get(port_id, &dev_info);
dev_info.default_txconf.txq_flags = 0;
...
rte_eth_tx_queue_setup(…, &dev_info.default_txconf);

Konstantin

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Chillance Zen
> Sent: Wednesday, March 8, 2017 8:50 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] checksum and vlan insertion seem not working on X520
> 
> Hi ,every one
> 
> when I was conducting nic offloading exp,I can not make a x520 nic insert
> vlan ,nor checksum,
> here is my rx/tx capability:
> rx offload capability:9f
> tx offload capability:203f
> 
> with code like this:
> while(1){
> nr_mbufs=rte_eth_rx_burst(0,queue_id,mbufs,32);
> for(idx=0;idx<nr_mbufs;idx++){
> #if 0
> buffer=rte_pktmbuf_mtod(mbufs[idx],char*);
> ip4=(struct ipv4_hdr*)(buffer+14);
> ip4->hdr_checksum=0;
> mbufs[idx]->l2_len=14;
> mbufs[idx]->l3_len=20;
> mbufs[idx]->ol_flags=PKT_TX_IP_CKSUM|PKT_TX_IPV4;
> #else
> mbufs[idx]->vlan_tci=0xef00;
> mbufs[idx]->ol_flags=PKT_TX_VLAN_PKT;
> #endif
> rte_eth_tx_burst(0,queue_id,&mbufs[idx],1);
> }
> }
> 
> does anybody know what;s wrong with my code?
> Thanks & regards
> Linc

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

* Re: [dpdk-dev] checksum and vlan insertion seem not working on X520
  2017-03-08  9:20 ` Ananyev, Konstantin
@ 2017-03-08 11:21   ` Chillance Zen
  0 siblings, 0 replies; 3+ messages in thread
From: Chillance Zen @ 2017-03-08 11:21 UTC (permalink / raw)
  To: Ananyev, Konstantin; +Cc: dev

Hi Konstantin,Thank you sooooooooooooooooooooooooooooo much ,I really
appreciate your suggestion...

it works well now ,I love it.

Linc

On 8 March 2017 at 17:20, Ananyev, Konstantin <konstantin.ananyev@intel.com>
wrote:

> Hi Linc,
>
> Wonder what TX function are you using?
> Make sure that you are not using simple TX function that doesn’t support
> any offloads or multiseg packets.
> You need something like that at setup phase:
>
> rte_eth_dev_info_get(port_id, &dev_info);
> dev_info.default_txconf.txq_flags = 0;
> ...
> rte_eth_tx_queue_setup(…, &dev_info.default_txconf);
>
> Konstantin
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Chillance Zen
> > Sent: Wednesday, March 8, 2017 8:50 AM
> > To: dev@dpdk.org
> > Subject: [dpdk-dev] checksum and vlan insertion seem not working on X520
> >
> > Hi ,every one
> >
> > when I was conducting nic offloading exp,I can not make a x520 nic insert
> > vlan ,nor checksum,
> > here is my rx/tx capability:
> > rx offload capability:9f
> > tx offload capability:203f
> >
> > with code like this:
> > while(1){
> > nr_mbufs=rte_eth_rx_burst(0,queue_id,mbufs,32);
> > for(idx=0;idx<nr_mbufs;idx++){
> > #if 0
> > buffer=rte_pktmbuf_mtod(mbufs[idx],char*);
> > ip4=(struct ipv4_hdr*)(buffer+14);
> > ip4->hdr_checksum=0;
> > mbufs[idx]->l2_len=14;
> > mbufs[idx]->l3_len=20;
> > mbufs[idx]->ol_flags=PKT_TX_IP_CKSUM|PKT_TX_IPV4;
> > #else
> > mbufs[idx]->vlan_tci=0xef00;
> > mbufs[idx]->ol_flags=PKT_TX_VLAN_PKT;
> > #endif
> > rte_eth_tx_burst(0,queue_id,&mbufs[idx],1);
> > }
> > }
> >
> > does anybody know what;s wrong with my code?
> > Thanks & regards
> > Linc
>



-- 
Linc @bjtu

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

end of thread, other threads:[~2017-03-08 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-08  8:49 [dpdk-dev] checksum and vlan insertion seem not working on X520 Chillance Zen
2017-03-08  9:20 ` Ananyev, Konstantin
2017-03-08 11:21   ` Chillance Zen

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