Thread (19 messages) 19 messages, 3 authors, 2018-03-05

Re: [PATCH net-next 1/5] net: mvpp2: use the same buffer pool for all ports

flat view

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: 2018-03-02 16:02:04
Also in: lkml

Hello,

On Fri,  2 Mar 2018 16:40:40 +0100, Antoine Tenart wrote:
quoted hunk ↗ jump to hunk
+static struct {
+	int pkt_size;
+	int buf_num;
+} mvpp2_pools[MVPP2_BM_POOLS_NUM];
Any reason for not doing:

} mvpp2_pools[MVPP2_BM_POOLS_NUM] = {
	[MVPP2_BM_SHORT] = {
		.pkt_size = MVPP2_BM_SHORT_PKT_SIZE,
		.buf_num = MVPP2_BM_SHORT_BUF_NUM
	},
	[MVPP2_BM_LONG] = {
		.pkt_size = MVPP2_BM_LONG_PKT_SIZE,
		.buf_num = MVPP2_BM_LONG_BUF_NUM,
	},
};

And get rid of:
quoted hunk ↗ jump to hunk
+static void mvpp2_setup_bm_pool(void)
+{
+	/* Short pool */
+	mvpp2_pools[MVPP2_BM_SHORT].buf_num  = MVPP2_BM_SHORT_BUF_NUM;
+	mvpp2_pools[MVPP2_BM_SHORT].pkt_size = MVPP2_BM_SHORT_PKT_SIZE;
+
+	/* Long pool */
+	mvpp2_pools[MVPP2_BM_LONG].buf_num  = MVPP2_BM_LONG_BUF_NUM;
+	mvpp2_pools[MVPP2_BM_LONG].pkt_size = MVPP2_BM_LONG_PKT_SIZE;
+}
 ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help