* [dpdk-dev] [PATCH v2] bonding: 8023ad: fix incorrect typecast of socket
[not found] <bonding: 8023ad: fix incorrect typecast of socket>
@ 2015-08-07 9:33 ` Sergey Balabanov
2015-08-07 9:38 ` De Lara Guarch, Pablo
0 siblings, 1 reply; 3+ messages in thread
From: Sergey Balabanov @ 2015-08-07 9:33 UTC (permalink / raw)
To: dev
On slave activation in LACP (8023AD) SOCKET_ANY_ID (which is -1)
is being casted to unsigned char and then to signed int.
The result is that socket_id has value of 255, not -1.
This results to memory allocation failure.
Signed-off-by: Sergey Balabanov <balabanovsv@ecotelecom.ru>
---
drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 97a828e..c0f0b99 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -849,7 +849,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id)
};
char mem_name[RTE_ETH_NAME_MAX_LEN];
- uint8_t socket_id;
+ int socket_id;
unsigned element_size;
/* Given slave mus not be in active list */
--
2.1.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH v2] bonding: 8023ad: fix incorrect typecast of socket
2015-08-07 9:33 ` [dpdk-dev] [PATCH v2] bonding: 8023ad: fix incorrect typecast of socket Sergey Balabanov
@ 2015-08-07 9:38 ` De Lara Guarch, Pablo
2015-08-09 23:55 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: De Lara Guarch, Pablo @ 2015-08-07 9:38 UTC (permalink / raw)
To: Sergey Balabanov, dev
> -----Original Message-----
> From: Sergey Balabanov [mailto:balabanovsv@ecotelecom.ru]
> Sent: Friday, August 07, 2015 10:33 AM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo; Sergey Balabanov
> Subject: [PATCH v2] bonding: 8023ad: fix incorrect typecast of socket
>
> On slave activation in LACP (8023AD) SOCKET_ANY_ID (which is -1)
> is being casted to unsigned char and then to signed int.
> The result is that socket_id has value of 255, not -1.
> This results to memory allocation failure.
>
> Signed-off-by: Sergey Balabanov <balabanovsv@ecotelecom.ru>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH v2] bonding: 8023ad: fix incorrect typecast of socket
2015-08-07 9:38 ` De Lara Guarch, Pablo
@ 2015-08-09 23:55 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2015-08-09 23:55 UTC (permalink / raw)
To: Sergey Balabanov; +Cc: dev
> > On slave activation in LACP (8023AD) SOCKET_ANY_ID (which is -1)
> > is being casted to unsigned char and then to signed int.
> > The result is that socket_id has value of 255, not -1.
> > This results to memory allocation failure.
> >
> > Signed-off-by: Sergey Balabanov <balabanovsv@ecotelecom.ru>
>
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Fixes: 46fb43683679 ("bond: add mode 4")
Applied, thanks
Please Sergey, do not set the status as "Accepted" yourself in patchwork.
The "Accepted" status means that it has been applied. Setting it before could
result in having your patch forgotten.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-09 23:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bonding: 8023ad: fix incorrect typecast of socket>
2015-08-07 9:33 ` [dpdk-dev] [PATCH v2] bonding: 8023ad: fix incorrect typecast of socket Sergey Balabanov
2015-08-07 9:38 ` De Lara Guarch, Pablo
2015-08-09 23:55 ` Thomas Monjalon
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).