netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iwl-next v2] ice: Reset VF on Tx MDD event
@ 2023-11-02 15:51 Pawel Chmielewski
  2023-11-04 15:33 ` Simon Horman
  2023-12-14  8:37 ` Michal Schmidt
  0 siblings, 2 replies; 5+ messages in thread
From: Pawel Chmielewski @ 2023-11-02 15:51 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: netdev, pmenzel, lukasz.czapnik, Liang-Min Wang,
	Pawel Chmielewski, Michal Swiatkowski

From: Liang-Min Wang <liang-min.wang@intel.com>

In cases when VF sends malformed packets that are classified as malicious,
sometimes it causes Tx queue to freeze. This frozen queue can be stuck
for several minutes being unusable. This behavior can be reproduced with
DPDK application, testpmd.

When Malicious Driver Detection event occurs, perform graceful VF reset
to quickly bring VF back to operational state. Add a log message to
notify about the cause of the reset.

Signed-off-by: Liang-Min Wang <liang-min.wang@intel.com>
Signed-off-by: Pawel Chmielewski <pawel.chmielewski@intel.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
---
Changelog
v1->v2:
Reverted unneeded formatting change, fixed commit message, fixed a log
message with a correct event name.
---

 drivers/net/ethernet/intel/ice/ice_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 3c9419b05a2a..ee9752af6397 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -1839,6 +1839,10 @@ static void ice_handle_mdd_event(struct ice_pf *pf)
 			if (netif_msg_tx_err(pf))
 				dev_info(dev, "Malicious Driver Detection event TX_TCLAN detected on VF %d\n",
 					 vf->vf_id);
+			dev_info(dev,
+				 "PF-to-VF reset on VF %d due to Tx MDD TX_TCLAN event\n",
+				 vf->vf_id);
+			ice_reset_vf(vf, ICE_VF_RESET_NOTIFY);
 		}
 
 		reg = rd32(hw, VP_MDET_TX_TDPU(vf->vf_id));
@@ -1849,6 +1853,10 @@ static void ice_handle_mdd_event(struct ice_pf *pf)
 			if (netif_msg_tx_err(pf))
 				dev_info(dev, "Malicious Driver Detection event TX_TDPU detected on VF %d\n",
 					 vf->vf_id);
+			dev_info(dev,
+				 "PF-to-VF reset on VF %d due to Tx MDD TX_TDPU event\n",
+				 vf->vf_id);
+			ice_reset_vf(vf, ICE_VF_RESET_NOTIFY);
 		}
 
 		reg = rd32(hw, VP_MDET_RX(vf->vf_id));
-- 
2.37.3


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

* Re: [PATCH iwl-next v2] ice: Reset VF on Tx MDD event
  2023-11-02 15:51 [PATCH iwl-next v2] ice: Reset VF on Tx MDD event Pawel Chmielewski
@ 2023-11-04 15:33 ` Simon Horman
  2023-12-14  8:37 ` Michal Schmidt
  1 sibling, 0 replies; 5+ messages in thread
From: Simon Horman @ 2023-11-04 15:33 UTC (permalink / raw)
  To: Pawel Chmielewski
  Cc: intel-wired-lan, netdev, pmenzel, lukasz.czapnik, Liang-Min Wang,
	Michal Swiatkowski

On Thu, Nov 02, 2023 at 04:51:49PM +0100, Pawel Chmielewski wrote:
> From: Liang-Min Wang <liang-min.wang@intel.com>
> 
> In cases when VF sends malformed packets that are classified as malicious,
> sometimes it causes Tx queue to freeze. This frozen queue can be stuck
> for several minutes being unusable. This behavior can be reproduced with
> DPDK application, testpmd.
> 
> When Malicious Driver Detection event occurs, perform graceful VF reset
> to quickly bring VF back to operational state. Add a log message to
> notify about the cause of the reset.
> 
> Signed-off-by: Liang-Min Wang <liang-min.wang@intel.com>
> Signed-off-by: Pawel Chmielewski <pawel.chmielewski@intel.com>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [PATCH iwl-next v2] ice: Reset VF on Tx MDD event
  2023-11-02 15:51 [PATCH iwl-next v2] ice: Reset VF on Tx MDD event Pawel Chmielewski
  2023-11-04 15:33 ` Simon Horman
@ 2023-12-14  8:37 ` Michal Schmidt
  2023-12-14 16:51   ` Pawel Chmielewski
  1 sibling, 1 reply; 5+ messages in thread
From: Michal Schmidt @ 2023-12-14  8:37 UTC (permalink / raw)
  To: Pawel Chmielewski
  Cc: intel-wired-lan, netdev, pmenzel, lukasz.czapnik, Liang-Min Wang,
	Michal Swiatkowski

On Thu, Nov 2, 2023 at 4:56 PM Pawel Chmielewski
<pawel.chmielewski@intel.com> wrote:
> From: Liang-Min Wang <liang-min.wang@intel.com>
>
> In cases when VF sends malformed packets that are classified as malicious,
> sometimes it causes Tx queue to freeze. This frozen queue can be stuck
> for several minutes being unusable. This behavior can be reproduced with
> DPDK application, testpmd.
>
> When Malicious Driver Detection event occurs, perform graceful VF reset
> to quickly bring VF back to operational state. Add a log message to
> notify about the cause of the reset.

Sorry for bringing this up so late, but I have just now realized this:
Wasn't freezing of the queue originally the intended behavior, as a
penalty for being malicious?
Shouldn't these resets at least be guarded by ICE_FLAG_MDD_AUTO_RESET_VF?

Michal

> Signed-off-by: Liang-Min Wang <liang-min.wang@intel.com>
> Signed-off-by: Pawel Chmielewski <pawel.chmielewski@intel.com>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> ---
> Changelog
> v1->v2:
> Reverted unneeded formatting change, fixed commit message, fixed a log
> message with a correct event name.
> ---
>
>  drivers/net/ethernet/intel/ice/ice_main.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index 3c9419b05a2a..ee9752af6397 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -1839,6 +1839,10 @@ static void ice_handle_mdd_event(struct ice_pf *pf)
>                         if (netif_msg_tx_err(pf))
>                                 dev_info(dev, "Malicious Driver Detection event TX_TCLAN detected on VF %d\n",
>                                          vf->vf_id);
> +                       dev_info(dev,
> +                                "PF-to-VF reset on VF %d due to Tx MDD TX_TCLAN event\n",
> +                                vf->vf_id);
> +                       ice_reset_vf(vf, ICE_VF_RESET_NOTIFY);
>                 }
>
>                 reg = rd32(hw, VP_MDET_TX_TDPU(vf->vf_id));
> @@ -1849,6 +1853,10 @@ static void ice_handle_mdd_event(struct ice_pf *pf)
>                         if (netif_msg_tx_err(pf))
>                                 dev_info(dev, "Malicious Driver Detection event TX_TDPU detected on VF %d\n",
>                                          vf->vf_id);
> +                       dev_info(dev,
> +                                "PF-to-VF reset on VF %d due to Tx MDD TX_TDPU event\n",
> +                                vf->vf_id);
> +                       ice_reset_vf(vf, ICE_VF_RESET_NOTIFY);
>                 }
>
>                 reg = rd32(hw, VP_MDET_RX(vf->vf_id));
> --
> 2.37.3
>
>


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

* Re: [PATCH iwl-next v2] ice: Reset VF on Tx MDD event
  2023-12-14  8:37 ` Michal Schmidt
@ 2023-12-14 16:51   ` Pawel Chmielewski
  2023-12-18 23:06     ` Tony Nguyen
  0 siblings, 1 reply; 5+ messages in thread
From: Pawel Chmielewski @ 2023-12-14 16:51 UTC (permalink / raw)
  To: Michal Schmidt
  Cc: intel-wired-lan, netdev, pmenzel, lukasz.czapnik, Liang-Min Wang,
	Michal Swiatkowski

On Thu, Dec 14, 2023 at 09:37:32AM +0100, Michal Schmidt wrote:
> On Thu, Nov 2, 2023 at 4:56 PM Pawel Chmielewski
> <pawel.chmielewski@intel.com> wrote:
> > From: Liang-Min Wang <liang-min.wang@intel.com>
> >
> > In cases when VF sends malformed packets that are classified as malicious,
> > sometimes it causes Tx queue to freeze. This frozen queue can be stuck
> > for several minutes being unusable. This behavior can be reproduced with
> > DPDK application, testpmd.
> >
> > When Malicious Driver Detection event occurs, perform graceful VF reset
> > to quickly bring VF back to operational state. Add a log message to
> > notify about the cause of the reset.
> 
> Sorry for bringing this up so late, but I have just now realized this:
> Wasn't freezing of the queue originally the intended behavior, as a
> penalty for being malicious?
> Shouldn't these resets at least be guarded by ICE_FLAG_MDD_AUTO_RESET_VF?
> 
> Michal

In some cases, the MDD can be caused also by a regular software error
(like the one mentioned in commit message), and not the actual malicious
action. There was decision to change the default behavior to avoid denial
of service. 

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

* Re: [PATCH iwl-next v2] ice: Reset VF on Tx MDD event
  2023-12-14 16:51   ` Pawel Chmielewski
@ 2023-12-18 23:06     ` Tony Nguyen
  0 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2023-12-18 23:06 UTC (permalink / raw)
  To: Pawel Chmielewski, Michal Schmidt
  Cc: intel-wired-lan, netdev, pmenzel, lukasz.czapnik, Liang-Min Wang,
	Michal Swiatkowski



On 12/14/2023 8:51 AM, Pawel Chmielewski wrote:
> On Thu, Dec 14, 2023 at 09:37:32AM +0100, Michal Schmidt wrote:
>> On Thu, Nov 2, 2023 at 4:56 PM Pawel Chmielewski
>> <pawel.chmielewski@intel.com> wrote:
>>> From: Liang-Min Wang <liang-min.wang@intel.com>

...

>>> When Malicious Driver Detection event occurs, perform graceful VF reset
>>> to quickly bring VF back to operational state. Add a log message to
>>> notify about the cause of the reset.
>>
>> Sorry for bringing this up so late, but I have just now realized this:
>> Wasn't freezing of the queue originally the intended behavior, as a
>> penalty for being malicious?
>> Shouldn't these resets at least be guarded by ICE_FLAG_MDD_AUTO_RESET_VF?
>>
>> Michal
> 
> In some cases, the MDD can be caused also by a regular software error
> (like the one mentioned in commit message), and not the actual malicious
> action. There was decision to change the default behavior to avoid denial
> of service.

Michal brings up some valid questions. I'd like to clarify the 
expectations between how the two should work together before moving 
forward with this.

Thanks,
Tony

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

end of thread, other threads:[~2023-12-18 23:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-02 15:51 [PATCH iwl-next v2] ice: Reset VF on Tx MDD event Pawel Chmielewski
2023-11-04 15:33 ` Simon Horman
2023-12-14  8:37 ` Michal Schmidt
2023-12-14 16:51   ` Pawel Chmielewski
2023-12-18 23:06     ` Tony Nguyen

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