On 09.10.2017 09:42, Gao Zhenyu wrote:
> But the netdev_dpdk_send__ function may release whole batch packets.
Yes, sure. Look at reply to my previous message.
>
> static inline void
> netdev_dpdk_send__(struct netdev_dpdk *dev, int qid,
> struct dp_packet_batch *batch, bool may_steal,
> bool concurrent_txq)
> {
> .......
> if (OVS_UNLIKELY(!may_steal ||
> batch->packets[0]->source != DPBUF_DPDK)) {
> struct netdev *netdev = &dev->up;
>
> dpdk_do_tx_copy(netdev, qid, batch); <-------your patch releases
> some packets in a batch
> dp_packet_delete_batch(batch, may_steal); <-----------it releases
> all packets in this batch, may hit issue I think
> }
>
> 2017-10-09 14:16 GMT+08:00 Ilya Maximets <[email protected]
> <mailto:[email protected]>>:
>
> On 08.10.2017 12:32, Gao Zhenyu wrote:
> > Hi llya,
> >
> > Thanks for working it. Your patch tried to eliminate the may_steal in
> dpdk qos, because may_steal handled on dpif-netdev layer and always true.
> > But in function dpdk_do_tx_copy, it set the may_steal to false,
> because the packet buffer were not allocated by dpdk side so cannot released
> by netdev_dpdk_policer_run(). Otherwise it may hit coredump. Did you test
> that scenario?
> >
> > Thanks
> > Zhenyu Gao
>
> Good catch. Thanks.
>
> Following incremental can be used to fix the issue:
>
> ----------------------------------------------------------------------------
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 300a0ae..3352ae2 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -1538,7 +1538,9 @@ netdev_dpdk_policer_run(struct rte_meter_srtcm
> *meter,
> }
> cnt++;
> } else {
> - rte_pktmbuf_free(pkt);
> + /* In case of calling from 'dpdk_do_tx_copy' 'pkt' could be
> not
> + * a DPDK allocated mbuf. */
> + dp_packet_delete((struct dp_packet *) pkt);
> }
> }
>
>
> ----------------------------------------------------------------------------
>
>
> Best regards, Ilya Maximets.
>
>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev