[1/2] net/tap: remove useless offload capa functions
Checks
Commit Message
Since these always return 0, they were doing nothing useful.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/tap/rte_eth_tap.c | 24 ++----------------------
1 file changed, 2 insertions(+), 22 deletions(-)
Comments
On 6/16/21 7:15 AM, Stephen Hemminger wrote:
> Since these always return 0, they were doing nothing useful.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
I have no strong opinion on the patch, but sometimes even
empty functions with comments add value. So, I see no point
to touch it. So, I'll wait for maintainer reply.
On Thu, 1 Jul 2021 17:16:21 +0300
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> wrote:
> On 6/16/21 7:15 AM, Stephen Hemminger wrote:
> > Since these always return 0, they were doing nothing useful.
> >
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>
> I have no strong opinion on the patch, but sometimes even
> empty functions with comments add value. So, I see no point
> to touch it. So, I'll wait for maintainer reply.
There are always many ways to write more obscure and technically correct
code. It is best if the code is the smallest correct way.
“I apologize for such a long letter - I didn't have time to write a short one.”
― Mark Twain
> On Jul 1, 2021, at 12:18 PM, Stephen Hemminger <stephen@networkplumber.org> wrote:
>
> On Thu, 1 Jul 2021 17:16:21 +0300
> Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> wrote:
>
>> On 6/16/21 7:15 AM, Stephen Hemminger wrote:
>>> Since these always return 0, they were doing nothing useful.
>>>
>>> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>>
>> I have no strong opinion on the patch, but sometimes even
>> empty functions with comments add value. So, I see no point
>> to touch it. So, I'll wait for maintainer reply.
>
> There are always many ways to write more obscure and technically correct
> code. It is best if the code is the smallest correct way.
>
> “I apologize for such a long letter - I didn't have time to write a short one.”
> ― Mark Twain
I agree with Stephen, the extra functions provide no useful feature or even the comments are not very useful IMO.
On 7/1/21 10:19 PM, Wiles, Keith wrote:
>
>
>> On Jul 1, 2021, at 12:18 PM, Stephen Hemminger <stephen@networkplumber.org> wrote:
>>
>> On Thu, 1 Jul 2021 17:16:21 +0300
>> Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> wrote:
>>
>>> On 6/16/21 7:15 AM, Stephen Hemminger wrote:
>>>> Since these always return 0, they were doing nothing useful.
>>>>
>>>> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>>>
>>> I have no strong opinion on the patch, but sometimes even
>>> empty functions with comments add value. So, I see no point
>>> to touch it. So, I'll wait for maintainer reply.
>>
>> There are always many ways to write more obscure and technically correct
>> code. It is best if the code is the smallest correct way.
>>
>> “I apologize for such a long letter - I didn't have time to write a short one.”
>> ― Mark Twain
>
> I agree with Stephen, the extra functions provide no useful feature or even the comments are not very useful IMO.
>
It is a bit different here. You're changing the code in an
absolutely equivalent way. IMHO complexity of the code
before and after the patch is absolutely the same.
Anyway, it does not matter a lot. If it think it would be
better in a new way - no problem.
@Keith, could you ack the patch series and I'll happily
apply it.
@@ -373,15 +373,6 @@ tap_verify_csum(struct rte_mbuf *mbuf)
}
}
-static uint64_t
-tap_rx_offload_get_port_capa(void)
-{
- /*
- * No specific port Rx offload capabilities.
- */
- return 0;
-}
-
static uint64_t
tap_rx_offload_get_queue_capa(void)
{
@@ -506,15 +497,6 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
return num_rx;
}
-static uint64_t
-tap_tx_offload_get_port_capa(void)
-{
- /*
- * No specific port Tx offload capabilities.
- */
- return 0;
-}
-
static uint64_t
tap_tx_offload_get_queue_capa(void)
{
@@ -1016,11 +998,9 @@ tap_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
dev_info->min_rx_bufsize = 0;
dev_info->speed_capa = tap_dev_speed_capa();
dev_info->rx_queue_offload_capa = tap_rx_offload_get_queue_capa();
- dev_info->rx_offload_capa = tap_rx_offload_get_port_capa() |
- dev_info->rx_queue_offload_capa;
+ dev_info->rx_offload_capa = dev_info->rx_queue_offload_capa;
dev_info->tx_queue_offload_capa = tap_tx_offload_get_queue_capa();
- dev_info->tx_offload_capa = tap_tx_offload_get_port_capa() |
- dev_info->tx_queue_offload_capa;
+ dev_info->tx_offload_capa = dev_info->tx_queue_offload_capa;
dev_info->hash_key_size = TAP_RSS_HASH_KEY_SIZE;
/*
* limitation: TAP supports all of IP, UDP and TCP hash