DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
* [dpdk-dev]  [patch] net/octeontx2: fix ptype get overflow
@ 2019-08-14  9:41 pbhagavatula
  2019-09-13 14:10 ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: pbhagavatula @ 2019-08-14  9:41 UTC (permalink / raw)
  To: jerinj, Nithin Dabilpuram, Kiran Kumar K; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

The function `rte_eth_dev_get_supported_ptypes` expects the underlying
ethernet device to return array of supported ptypes. The ethernet device
needs to set `RTE_PTYPE_UNKNOWN` as the last element which signifies
thats its the end of the ptype array.
Else the function `rte_eth_dev_get_supported_ptypes` might overflow.

Fixes: 6e892eabce11 ("net/octeontx2: support packet type")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/net/octeontx2/otx2_lookup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/octeontx2/otx2_lookup.c b/drivers/net/octeontx2/otx2_lookup.c
index 99199d08a..3347e7014 100644
--- a/drivers/net/octeontx2/otx2_lookup.c
+++ b/drivers/net/octeontx2/otx2_lookup.c
@@ -53,6 +53,7 @@ otx2_nix_supported_ptypes_get(struct rte_eth_dev *eth_dev)
 		RTE_PTYPE_INNER_L4_UDP,  /* LH */
 		RTE_PTYPE_INNER_L4_SCTP, /* LH */
 		RTE_PTYPE_INNER_L4_ICMP, /* LH */
+		RTE_PTYPE_UNKNOWN,
 	};
 
 	if (dev->rx_offload_flags & NIX_RX_OFFLOAD_PTYPE_F)
-- 
2.17.1


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-14  9:41 [dpdk-dev] [patch] net/octeontx2: fix ptype get overflow pbhagavatula
2019-09-13 14:10 ` Jerin Jacob
2019-09-23  7:48   ` Jerin Jacob

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org dpdk-dev@archiver.kernel.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox