netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ice: block LAN in case of VF to VF offload
@ 2023-05-03 15:39 Tony Nguyen
  2023-05-04  7:42 ` Leon Romanovsky
  2023-05-05  8:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Tony Nguyen @ 2023-05-03 15:39 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Michal Swiatkowski, anthony.l.nguyen, Sujai Buvaneswaran,
	George Kuruvinakunnel, Simon Horman

From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

VF to VF traffic shouldn't go outside. To enforce it, set only the loopback
enable bit in case of all ingress type rules added via the tc tool.

Fixes: 0d08a441fb1a ("ice: ndo_setup_tc implementation for PF")
Reported-by: Sujai Buvaneswaran <Sujai.Buvaneswaran@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_tc_lib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_tc_lib.c b/drivers/net/ethernet/intel/ice/ice_tc_lib.c
index 76f29a5bf8d7..d1a31f236d26 100644
--- a/drivers/net/ethernet/intel/ice/ice_tc_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_tc_lib.c
@@ -693,17 +693,18 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr)
 	 * results into order of switch rule evaluation.
 	 */
 	rule_info.priority = 7;
+	rule_info.flags_info.act_valid = true;
 
 	if (fltr->direction == ICE_ESWITCH_FLTR_INGRESS) {
 		rule_info.sw_act.flag |= ICE_FLTR_RX;
 		rule_info.sw_act.src = hw->pf_id;
 		rule_info.rx = true;
+		rule_info.flags_info.act = ICE_SINGLE_ACT_LB_ENABLE;
 	} else {
 		rule_info.sw_act.flag |= ICE_FLTR_TX;
 		rule_info.sw_act.src = vsi->idx;
 		rule_info.rx = false;
 		rule_info.flags_info.act = ICE_SINGLE_ACT_LAN_ENABLE;
-		rule_info.flags_info.act_valid = true;
 	}
 
 	/* specify the cookie as filter_rule_id */
-- 
2.38.1


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

* Re: [PATCH net] ice: block LAN in case of VF to VF offload
  2023-05-03 15:39 [PATCH net] ice: block LAN in case of VF to VF offload Tony Nguyen
@ 2023-05-04  7:42 ` Leon Romanovsky
  2023-05-08 11:30   ` Michal Swiatkowski
  2023-05-05  8:40 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2023-05-04  7:42 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: davem, kuba, pabeni, edumazet, netdev, Michal Swiatkowski,
	Sujai Buvaneswaran, George Kuruvinakunnel, Simon Horman

On Wed, May 03, 2023 at 08:39:35AM -0700, Tony Nguyen wrote:
> From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> 
> VF to VF traffic shouldn't go outside. To enforce it, set only the loopback
> enable bit in case of all ingress type rules added via the tc tool.
> 
> Fixes: 0d08a441fb1a ("ice: ndo_setup_tc implementation for PF")
> Reported-by: Sujai Buvaneswaran <Sujai.Buvaneswaran@intel.com>
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>
> Reviewed-by: Simon Horman <simon.horman@corigine.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_tc_lib.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_tc_lib.c b/drivers/net/ethernet/intel/ice/ice_tc_lib.c
> index 76f29a5bf8d7..d1a31f236d26 100644
> --- a/drivers/net/ethernet/intel/ice/ice_tc_lib.c
> +++ b/drivers/net/ethernet/intel/ice/ice_tc_lib.c
> @@ -693,17 +693,18 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr)
>  	 * results into order of switch rule evaluation.
>  	 */
>  	rule_info.priority = 7;
> +	rule_info.flags_info.act_valid = true;

Do you still have path where rule_info.flags_info.act_valid = false?

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

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

* Re: [PATCH net] ice: block LAN in case of VF to VF offload
  2023-05-03 15:39 [PATCH net] ice: block LAN in case of VF to VF offload Tony Nguyen
  2023-05-04  7:42 ` Leon Romanovsky
@ 2023-05-05  8:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-05  8:40 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: davem, kuba, pabeni, edumazet, netdev, michal.swiatkowski,
	Sujai.Buvaneswaran, george.kuruvinakunnel, simon.horman

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Wed,  3 May 2023 08:39:35 -0700 you wrote:
> From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> 
> VF to VF traffic shouldn't go outside. To enforce it, set only the loopback
> enable bit in case of all ingress type rules added via the tc tool.
> 
> Fixes: 0d08a441fb1a ("ice: ndo_setup_tc implementation for PF")
> Reported-by: Sujai Buvaneswaran <Sujai.Buvaneswaran@intel.com>
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>
> Reviewed-by: Simon Horman <simon.horman@corigine.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> 
> [...]

Here is the summary with links:
  - [net] ice: block LAN in case of VF to VF offload
    https://git.kernel.org/netdev/net/c/9f699b71c2f3

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH net] ice: block LAN in case of VF to VF offload
  2023-05-04  7:42 ` Leon Romanovsky
@ 2023-05-08 11:30   ` Michal Swiatkowski
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Swiatkowski @ 2023-05-08 11:30 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Tony Nguyen, davem, kuba, pabeni, edumazet, netdev,
	Sujai Buvaneswaran, George Kuruvinakunnel, Simon Horman

On Thu, May 04, 2023 at 10:42:49AM +0300, Leon Romanovsky wrote:
> On Wed, May 03, 2023 at 08:39:35AM -0700, Tony Nguyen wrote:
> > From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> > 
> > VF to VF traffic shouldn't go outside. To enforce it, set only the loopback
> > enable bit in case of all ingress type rules added via the tc tool.
> > 
> > Fixes: 0d08a441fb1a ("ice: ndo_setup_tc implementation for PF")
> > Reported-by: Sujai Buvaneswaran <Sujai.Buvaneswaran@intel.com>
> > Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> > Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>
> > Reviewed-by: Simon Horman <simon.horman@corigine.com>
> > Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> > ---
> >  drivers/net/ethernet/intel/ice/ice_tc_lib.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/intel/ice/ice_tc_lib.c b/drivers/net/ethernet/intel/ice/ice_tc_lib.c
> > index 76f29a5bf8d7..d1a31f236d26 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_tc_lib.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_tc_lib.c
> > @@ -693,17 +693,18 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr)
> >  	 * results into order of switch rule evaluation.
> >  	 */
> >  	rule_info.priority = 7;
> > +	rule_info.flags_info.act_valid = true;
> 
> Do you still have path where rule_info.flags_info.act_valid = false?
> 

Good point, I will check if it is still needed.

Thanks

> Thanks,
> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

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

end of thread, other threads:[~2023-05-08 11:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-03 15:39 [PATCH net] ice: block LAN in case of VF to VF offload Tony Nguyen
2023-05-04  7:42 ` Leon Romanovsky
2023-05-08 11:30   ` Michal Swiatkowski
2023-05-05  8:40 ` patchwork-bot+netdevbpf

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