On 3/9/2023 4:21 PM, Stephen Hemminger wrote:
> On Thu,  9 Mar 2023 09:16:33 +0100
> David Marchand <david.march...@redhat.com> wrote:
> 
>> +            RTE_ETHDEV_LOG(ERR, "Ethdev port_id=%u requested Rx offloads 
>> '%s' in %s(). "
>> +                    "Device supports '%s' Rx offloads but does not support 
>> '%s'.\n",
>> +                    port_id, requested != NULL ? requested : "N/A", 
>> __func__,
>> +                    available != NULL ? available : "N/A",
>> +                    unavailable != NULL ? unavailable : "N/A");
>> +            free(requested);
> 
> Please shorten message and make sure it does not cross line boundaries.
> Best to allow users to do simple search for message.

Agree that using offload names are more user friendly.

To keep the log more reasonable length, what would you think to split
into two, one in ERR level other is in info/debug:
ERR, "Ethdev port_id=%u does not support '%s'.\n", unavailable
DEBUG, "Ethdev port_id=%u requested Rx offloads '%s', device supports
'%s'.\n", requested, available

And I think we can drop __func__, we don't use in many other logs anyway.



Other option can be to provide APIs to print all offloads (similar to
'rte_eth_dev_tx_offload_name()'), so application does its own logging,
and ethdev just prints 'unavailable' part of the log.

Reply via email to