All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] net/tap: UDP/TCP port mask not supported in flow
@ 2017-03-30  8:52 Pascal Mazon
  2017-03-30  8:52 ` [PATCH 2/2] net/tap: remove minimum packet size in Rx Pascal Mazon
  2017-03-30 13:08 ` [PATCH 1/2] net/tap: UDP/TCP port mask not supported in flow Wiles, Keith
  0 siblings, 2 replies; 5+ messages in thread
From: Pascal Mazon @ 2017-03-30  8:52 UTC (permalink / raw)
  To: keith.wiles; +Cc: dev, Pascal Mazon

Only full mask (0xffff) is accepted, there is no way to specify a mask
for layer 4 ports to the kernel using TC rules.

Fixes: 1c71189ab9b7 ("net/tap: add basic flow API patterns and actions")

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
---
 drivers/net/tap/tap_flow.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c
index 514e3fae5c38..cf1c8a26c8ff 100644
--- a/drivers/net/tap/tap_flow.c
+++ b/drivers/net/tap/tap_flow.c
@@ -614,18 +614,20 @@ tap_flow_create_udp(const struct rte_flow_item *item, void *data)
 	/* check that previous ip_proto is compatible with udp */
 	if (info->ip_proto && info->ip_proto != IPPROTO_UDP)
 		return -1;
+	/* TC does not support UDP port masking. Only accept if exact match. */
+	if ((mask->hdr.src_port && mask->hdr.src_port != 0xffff) ||
+	    (mask->hdr.dst_port && mask->hdr.dst_port != 0xffff))
+		return -1;
 	if (!flow)
 		return 0;
 	msg = &flow->msg;
 	nlattr_add8(&msg->nh, TCA_FLOWER_KEY_IP_PROTO, IPPROTO_UDP);
 	if (!spec)
 		return 0;
-	if (spec->hdr.dst_port &&
-	    (spec->hdr.dst_port & mask->hdr.dst_port) == spec->hdr.dst_port)
+	if (spec->hdr.dst_port & mask->hdr.dst_port)
 		nlattr_add16(&msg->nh, TCA_FLOWER_KEY_UDP_DST,
 			     spec->hdr.dst_port);
-	if (spec->hdr.src_port &&
-	    (spec->hdr.src_port & mask->hdr.src_port) == spec->hdr.src_port)
+	if (spec->hdr.src_port & mask->hdr.src_port)
 		nlattr_add16(&msg->nh, TCA_FLOWER_KEY_UDP_SRC,
 			     spec->hdr.src_port);
 	return 0;
@@ -658,18 +660,20 @@ tap_flow_create_tcp(const struct rte_flow_item *item, void *data)
 	/* check that previous ip_proto is compatible with tcp */
 	if (info->ip_proto && info->ip_proto != IPPROTO_TCP)
 		return -1;
+	/* TC does not support TCP port masking. Only accept if exact match. */
+	if ((mask->hdr.src_port && mask->hdr.src_port != 0xffff) ||
+	    (mask->hdr.dst_port && mask->hdr.dst_port != 0xffff))
+		return -1;
 	if (!flow)
 		return 0;
 	msg = &flow->msg;
 	nlattr_add8(&msg->nh, TCA_FLOWER_KEY_IP_PROTO, IPPROTO_TCP);
 	if (!spec)
 		return 0;
-	if (spec->hdr.dst_port &&
-	    (spec->hdr.dst_port & mask->hdr.dst_port) == spec->hdr.dst_port)
+	if (spec->hdr.dst_port & mask->hdr.dst_port)
 		nlattr_add16(&msg->nh, TCA_FLOWER_KEY_TCP_DST,
 			     spec->hdr.dst_port);
-	if (spec->hdr.src_port &&
-	    (spec->hdr.src_port & mask->hdr.src_port) == spec->hdr.src_port)
+	if (spec->hdr.src_port & mask->hdr.src_port)
 		nlattr_add16(&msg->nh, TCA_FLOWER_KEY_TCP_SRC,
 			     spec->hdr.src_port);
 	return 0;
-- 
2.12.0.306.g4a9b9b3

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

* [PATCH 2/2] net/tap: remove minimum packet size in Rx
  2017-03-30  8:52 [PATCH 1/2] net/tap: UDP/TCP port mask not supported in flow Pascal Mazon
@ 2017-03-30  8:52 ` Pascal Mazon
  2017-03-30 13:06   ` Wiles, Keith
  2017-03-30 13:08 ` [PATCH 1/2] net/tap: UDP/TCP port mask not supported in flow Wiles, Keith
  1 sibling, 1 reply; 5+ messages in thread
From: Pascal Mazon @ 2017-03-30  8:52 UTC (permalink / raw)
  To: keith.wiles; +Cc: dev, Pascal Mazon

With support for segmented packets, it is now possible to easily receive
packets of many sizes, given an adequate number of descriptors.

Remove limitation on the minimum size of mbuf: on reception, if a packet
won't fit in the queue's mbufs, it will be detected in the packet info
and the packet will be discarded.

Fixes: 4a6bb33dc67c ("net/tap: support segmented mbufs")

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
---
 drivers/net/tap/rte_eth_tap.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 069200199573..eef6e6cc2828 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -875,7 +875,6 @@ tap_rx_queue_setup(struct rte_eth_dev *dev,
 	struct rte_mbuf **tmp = &rxq->pool;
 	struct iovec (*iovecs)[nb_rx_desc + 1];
 	int data_off = RTE_PKTMBUF_HEADROOM;
-	uint16_t buf_size;
 	int ret = 0;
 	int fd;
 	int i;
@@ -901,18 +900,6 @@ tap_rx_queue_setup(struct rte_eth_dev *dev,
 	}
 	rxq->iovecs = iovecs;
 
-	/* Now get the space available for data in the mbuf */
-	buf_size = (uint16_t)(rte_pktmbuf_data_room_size(mp) -
-				RTE_PKTMBUF_HEADROOM);
-
-	if (buf_size < ETH_FRAME_LEN) {
-		RTE_LOG(WARNING, PMD,
-			"%s: %d bytes will not fit in mbuf (%d bytes)\n",
-			dev->data->name, ETH_FRAME_LEN, buf_size);
-		ret = -ENOMEM;
-		goto error;
-	}
-
 	fd = rx_setup_queue(dev, internals, rx_queue_id);
 	if (fd == -1) {
 		ret = fd;
-- 
2.12.0.306.g4a9b9b3

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

* Re: [PATCH 2/2] net/tap: remove minimum packet size in Rx
  2017-03-30  8:52 ` [PATCH 2/2] net/tap: remove minimum packet size in Rx Pascal Mazon
@ 2017-03-30 13:06   ` Wiles, Keith
  0 siblings, 0 replies; 5+ messages in thread
From: Wiles, Keith @ 2017-03-30 13:06 UTC (permalink / raw)
  To: Pascal Mazon; +Cc: dev


> On Mar 30, 2017, at 3:52 AM, Pascal Mazon <pascal.mazon@6wind.com> wrote:
> 
> With support for segmented packets, it is now possible to easily receive
> packets of many sizes, given an adequate number of descriptors.
> 
> Remove limitation on the minimum size of mbuf: on reception, if a packet
> won't fit in the queue's mbufs, it will be detected in the packet info
> and the packet will be discarded.
> 
> Fixes: 4a6bb33dc67c ("net/tap: support segmented mbufs")
> 
> Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>

Acked-by: Keith Wiles <keith.wiles@intel.com>

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

* Re: [PATCH 1/2] net/tap: UDP/TCP port mask not supported in flow
  2017-03-30  8:52 [PATCH 1/2] net/tap: UDP/TCP port mask not supported in flow Pascal Mazon
  2017-03-30  8:52 ` [PATCH 2/2] net/tap: remove minimum packet size in Rx Pascal Mazon
@ 2017-03-30 13:08 ` Wiles, Keith
  2017-04-03 11:25   ` Ferruh Yigit
  1 sibling, 1 reply; 5+ messages in thread
From: Wiles, Keith @ 2017-03-30 13:08 UTC (permalink / raw)
  To: Pascal Mazon; +Cc: dev


> On Mar 30, 2017, at 3:52 AM, Pascal Mazon <pascal.mazon@6wind.com> wrote:
> 
> Only full mask (0xffff) is accepted, there is no way to specify a mask
> for layer 4 ports to the kernel using TC rules.
> 
> Fixes: 1c71189ab9b7 ("net/tap: add basic flow API patterns and actions")
> 
> Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>

Acked-by: Keith Wiles <keith.wiles@intel.com>

Regards,
Keith

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

* Re: [PATCH 1/2] net/tap: UDP/TCP port mask not supported in flow
  2017-03-30 13:08 ` [PATCH 1/2] net/tap: UDP/TCP port mask not supported in flow Wiles, Keith
@ 2017-04-03 11:25   ` Ferruh Yigit
  0 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2017-04-03 11:25 UTC (permalink / raw)
  To: Wiles, Keith, Pascal Mazon; +Cc: dev

On 3/30/2017 2:08 PM, Wiles, Keith wrote:
> 
>> On Mar 30, 2017, at 3:52 AM, Pascal Mazon <pascal.mazon@6wind.com> wrote:
>>
>> Only full mask (0xffff) is accepted, there is no way to specify a mask
>> for layer 4 ports to the kernel using TC rules.
>>
>> Fixes: 1c71189ab9b7 ("net/tap: add basic flow API patterns and actions")
>>
>> Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
> 
> Acked-by: Keith Wiles <keith.wiles@intel.com>

Series applied to dpdk-next-net/master, thanks.

(This patch fixes commits in next-net, when integrated to main tree
"Fixes:" will be with wrong commit id, please confirm the commit log of
integrated commit.)

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

end of thread, other threads:[~2017-04-03 11:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-30  8:52 [PATCH 1/2] net/tap: UDP/TCP port mask not supported in flow Pascal Mazon
2017-03-30  8:52 ` [PATCH 2/2] net/tap: remove minimum packet size in Rx Pascal Mazon
2017-03-30 13:06   ` Wiles, Keith
2017-03-30 13:08 ` [PATCH 1/2] net/tap: UDP/TCP port mask not supported in flow Wiles, Keith
2017-04-03 11:25   ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.