On Thu, Apr 18, 2019 at 05:39:37PM +0200, Thomas Monjalon wrote: > 18/04/2019 17:32, Adrien Mazarguil: > > When passed to the application, Rx packets retain the port ID value > > originally set by slave devices. Unfortunately these IDs have no meaning to > > applications, which are typically unaware of their existence. > > > > This confuses those caring about the source port field in mbufs (m->port) > > which experience issues ranging from traffic drop to crashes. > > > > Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD") > > Cc: stable@dpdk.org > > > > Signed-off-by: Adrien Mazarguil > > Reviewed-by: David Marchand > > Acked-by: Gaetan Rivet > > -- > > v2 changes: > > > > Modified "rxq->priv->dev->data->port_id" (v18.11-style) to > > "rxq->priv->data->port_id" (since v19.05) and checked compilation against > > master this time. > > > > Given the limited scope of that change, reviewed-by/acked-by lines were > > kept. > > --- > > +/* > > + * Override source port in Rx packets. > > + * > > + * Make Rx packets originate from this PMD instance instead of one of its > > + * slaves. This is mandatory to avoid breaking applications. > > "slave" is a wording from bonding. > In failsafe, it is sub-device, isn't it? > Yes, there is however one other comment in failsafe code refering to a sub-device as a slave. I'm not really up-to-par with the LSF CoC[1] and whether it is aligned with the Contributor Covenant also adopted by Linux[2]. I guess you were only referring to using the proper nomenclature and not this subject, but I can't pass on an opportunity to out-nitpick :D . This can be changed on merge as sub-device is more correct. Overall personally I don't really care either way. [1]: https://www.linuxfoundation.org/code-of-conduct/ [2]: https://www.kernel.org/doc/html/latest/process/code-of-conduct.html > > + */ > > +static void > > +failsafe_rx_set_port(struct rte_mbuf **rx_pkts, uint16_t nb_pkts, uint16_t port) > > +{ > > + unsigned int i; > > + > > + for (i = 0; i != nb_pkts; ++i) > > + rx_pkts[i]->port = port; > > +} > > + > > uint16_t > > failsafe_rx_burst(void *queue, > > struct rte_mbuf **rx_pkts, > > @@ -87,6 +102,9 @@ failsafe_rx_burst(void *queue, > > sdev = sdev->next; > > } while (nb_rx == 0 && sdev != rxq->sdev); > > rxq->sdev = sdev; > > + if (nb_rx) > > + failsafe_rx_set_port(rx_pkts, nb_rx, > > + rxq->priv->data->port_id); > > return nb_rx; > > } > > I'm afraid the performance drop to be hard. > How the port id in mbuf is used exactly? What crash are you seeing? > > -- Gaëtan Rivet 6WIND