lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ccc2643-788d-03a9-a022-04045c85da42@intel.com>
Date:   Wed, 19 Apr 2023 16:49:47 +0200
From:   Alexander Lobakin <aleksander.lobakin@...el.com>
To:     Wojciech Drewek <wojciech.drewek@...el.com>
CC:     <intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>,
        <alexandr.lobakin@...el.com>, <david.m.ertman@...el.com>,
        <michal.swiatkowski@...ux.intel.com>,
        <marcin.szycik@...ux.intel.com>, <pawel.chmielewski@...el.com>,
        <sridhar.samudrala@...el.com>
Subject: Re: [PATCH net-next 03/12] ice: Unset src prune on uplink VSI

From: Wojciech Drewek <wojciech.drewek@...el.com>
Date: Mon, 17 Apr 2023 11:34:03 +0200

> In switchdev mode uplink VSI is supposed to receive all packets that
> were not matched by existing filters. If ICE_AQ_VSI_SW_FLAG_LOCAL_LB
> bit is unset and we have a filter associated with uplink VSI
> which matches on dst mac equal to MAC1, then packets with src mac equal
> to MAC1 will be pruned from reaching uplink VSI.

[...]

> diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
> index 3de9556b89ac..60b123d3c9cf 100644
> --- a/drivers/net/ethernet/intel/ice/ice_lib.c
> +++ b/drivers/net/ethernet/intel/ice/ice_lib.c
> @@ -4112,3 +4112,27 @@ void ice_vsi_ctx_clear_allow_override(struct ice_vsi_ctx *ctx)
>  {
>  	ctx->info.sec_flags &= ~ICE_AQ_VSI_SEC_FLAG_ALLOW_DEST_OVRD;
>  }
> +
> +/**
> + * ice_vsi_update_local_lb - update sw block in VSI with local loopback bit
> + * @vsi: pointer to VSI structure
> + * @set: set or unset the bit
> + */
> +int
> +ice_vsi_update_local_lb(struct ice_vsi *vsi, bool set)
> +{
> +	struct ice_vsi_ctx ctx = { 0 };

Nit: prefer `= { }` over `= { 0 }`, the latter may sometimes trigger
Wmissing-field-initializers (I might be wrong here, but anyway).

> +
> +	ctx.info = vsi->info;

Can't it be combined with init on declaration (you either way initialize
@ctx with zeros)?

	struct ice_vsi_ctx ctx = {
		.info	= vsi->info,
	};

> +	ctx.info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_SW_VALID);
> +	if (set)
> +		ctx.info.sw_flags |= ICE_AQ_VSI_SW_FLAG_LOCAL_LB;
> +	else
> +		ctx.info.sw_flags &= ~ICE_AQ_VSI_SW_FLAG_LOCAL_LB;
> +
> +	if (ice_update_vsi(&vsi->back->hw, vsi->idx, &ctx, NULL))
> +		return -ENODEV;
> +
> +	vsi->info = ctx.info;
> +	return 0;
> +}
[...]

Thanks,
Olek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ