Message ID | 20230313140733.4140757-1-radoslawx.tyl@intel.com |
---|---|
State | Accepted |
Delegated to: | Anthony Nguyen |
Headers | show |
Series | [net,v1] i40e: fix flow director packet filter programming | expand |
On Mon, Mar 13, 2023 at 03:07:33PM +0100, Radoslaw Tyl wrote: > Initialize to zero structures to build a valid > Tx Packet used for the filter programming. > > Fixes: a9219b332f52 ("i40e: VLAN field for flow director") > Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com> > --- > drivers/net/ethernet/intel/i40e/i40e_txrx.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c > index 924f972b91fa..72b091f2509d 100644 > --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c > +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c > @@ -171,10 +171,10 @@ static char *i40e_create_dummy_packet(u8 *dummy_packet, bool ipv4, u8 l4proto, > struct i40e_fdir_filter *data) > { > bool is_vlan = !!data->vlan_tag; > - struct vlan_hdr vlan; > - struct ipv6hdr ipv6; > - struct ethhdr eth; > - struct iphdr ip; > + struct vlan_hdr vlan = {}; > + struct ipv6hdr ipv6 = {}; > + struct ethhdr eth = {}; > + struct iphdr ip = {}; > u8 *tmp; > > if (ipv4) { > -- > 2.31.1 > > _______________________________________________ > Intel-wired-lan mailing list > Intel-wired-lan@osuosl.org > https://lists.osuosl.org/mailman/listinfo/intel-wired-lan Feel free to add review tag when someone paste it on ML (even internal one): Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Michal Swiatkowski > Sent: Monday, March 13, 2023 9:11 PM > To: Tyl, RadoslawX <radoslawx.tyl@intel.com> > Cc: intel-wired-lan@lists.osuosl.org > Subject: Re: [Intel-wired-lan] [PATCH net v1] i40e: fix flow director packet filter programming > > On Mon, Mar 13, 2023 at 03:07:33PM +0100, Radoslaw Tyl wrote: > Initialize to zero structures to build a valid Tx Packet used for the > filter programming. > > Fixes: a9219b332f52 ("i40e: VLAN field for flow director") > Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com> > --- > drivers/net/ethernet/intel/i40e/i40e_txrx.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > Tested-by: Arpana Arland <arpanax.arland@intel.com> (A Contingent worker at Intel)
Dear Radoslaw, Thank you for your patch. Am 13.03.23 um 15:07 schrieb Radoslaw Tyl: > Initialize to zero structures to build a valid > Tx Packet used for the filter programming. Please elaborate what the problem is, and how it can be reproduced. > Fixes: a9219b332f52 ("i40e: VLAN field for flow director") > Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com> > --- > drivers/net/ethernet/intel/i40e/i40e_txrx.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c > index 924f972b91fa..72b091f2509d 100644 > --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c > +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c > @@ -171,10 +171,10 @@ static char *i40e_create_dummy_packet(u8 *dummy_packet, bool ipv4, u8 l4proto, > struct i40e_fdir_filter *data) > { > bool is_vlan = !!data->vlan_tag; > - struct vlan_hdr vlan; > - struct ipv6hdr ipv6; > - struct ethhdr eth; > - struct iphdr ip; > + struct vlan_hdr vlan = {}; > + struct ipv6hdr ipv6 = {}; > + struct ethhdr eth = {}; > + struct iphdr ip = {}; There are opposing views, how to program. One side says to initialize the structs. Others say to not do it, and set the members explicitly, so the compiler can tell you, when you miss setting a member. What members were not set? > u8 *tmp; > > if (ipv4) { Kind regards, Paul
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index 924f972b91fa..72b091f2509d 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c @@ -171,10 +171,10 @@ static char *i40e_create_dummy_packet(u8 *dummy_packet, bool ipv4, u8 l4proto, struct i40e_fdir_filter *data) { bool is_vlan = !!data->vlan_tag; - struct vlan_hdr vlan; - struct ipv6hdr ipv6; - struct ethhdr eth; - struct iphdr ip; + struct vlan_hdr vlan = {}; + struct ipv6hdr ipv6 = {}; + struct ethhdr eth = {}; + struct iphdr ip = {}; u8 *tmp; if (ipv4) {
Initialize to zero structures to build a valid Tx Packet used for the filter programming. Fixes: a9219b332f52 ("i40e: VLAN field for flow director") Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com> --- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)