Hi Matan, On Wed, Dec 13, 2017 at 02:29:30PM +0000, Matan Azrad wrote: > There is time between the physical removal of the device until > sub-device PMDs get a RMV interrupt. At this time DPDK PMDs and > applications still don't know about the removal and may call sub-device > control operation which should return an error. > > In previous code this error is reported to the application contrary to > fail-safe principle that the app should not be aware of device removal. > > Add an removal check in each relevant control command error flow and > prevent an error report to application when the sub-device is removed. > > Fixes: a46f8d5 ("net/failsafe: add fail-safe PMD") > Fixes: b737a1e ("net/failsafe: support flow API") > Cc: sta...@dpdk.org >
This patch is not a fix. It relies on an eth_dev API evolution. Without this evolution, this patch is meaningless and would break compilation if backported in stable branch. Please remove those tags. > Signed-off-by: Matan Azrad <ma...@mellanox.com> > --- > drivers/net/failsafe/failsafe_flow.c | 18 ++++++++++------- > drivers/net/failsafe/failsafe_ops.c | 34 > ++++++++++++++++++++++----------- > drivers/net/failsafe/failsafe_private.h | 10 ++++++++++ > 3 files changed, 44 insertions(+), 18 deletions(-) < ... > > +/* > + * Check if sub device was removed. > + */ > +static inline int > +fs_is_removed(struct sub_device *sdev) > +{ > + if (sdev->remove == 1 || rte_eth_dev_is_removed(PORT_ID(sdev)) != 0) > + return 1; > + return 0; > +} Have you considered adding this check within the subdev iterator itself? I think it would prevent you from having to add it to each return value checks. It is still MT-unsafe anyway. -- Gaëtan Rivet 6WIND