[dpdk-dev] [PATCH v2 06/13] mbuf: add functions to get the name of an ol_flag

Olivier MATZ olivier.matz at 6wind.com
Mon Nov 17 13:51:10 CET 2014


Hi Bruce,

On 11/17/2014 11:39 AM, Bruce Richardson wrote:
>> +/*
>> + * Get the name of a TX offload flag
>> + */
>> +const char *rte_get_tx_ol_flag_name(uint64_t mask)
>> +{
>> +	switch (mask) {
>> +	case PKT_TX_VLAN_PKT: return "PKT_TX_VLAN_PKT";
>> +	case PKT_TX_IP_CKSUM: return "PKT_TX_IP_CKSUM";
>> +	case PKT_TX_TCP_CKSUM: return "PKT_TX_TCP_CKSUM";
>> +	case PKT_TX_SCTP_CKSUM: return "PKT_TX_SCTP_CKSUM";
>> +	case PKT_TX_UDP_CKSUM: return "PKT_TX_UDP_CKSUM";
>> +	case PKT_TX_IEEE1588_TMST: return "PKT_TX_IEEE1588_TMST";
>> +	case PKT_TX_VXLAN_CKSUM: return "PKT_TX_VXLAN_CKSUM";
>> +	default: return NULL;
>> +	}
>> +}
>> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
>> index 68fb988..e76617f 100644
>> --- a/lib/librte_mbuf/rte_mbuf.h
>> +++ b/lib/librte_mbuf/rte_mbuf.h
>> @@ -129,6 +129,28 @@ extern "C" {
>>  /* Use final bit of flags to indicate a control mbuf */
>>  #define CTRL_MBUF_FLAG       (1ULL << 63) /**< Mbuf contains control data */
>>  
> 
> I think this patch should perhaps also add to a comment at the top of the list
> of flags that any new flags added should also be added to the appropriate
> function in rte_mbuf.c. Having the comment in rte_mbuf.h where people would add the flags
> should help remind people to keep the flag lists in sync.

Good idea, I'll add it.

Regards,
Olivier


More information about the dev mailing list