From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH v2 06/13] mbuf: add functions to get the name of an ol_flag Date: Mon, 17 Nov 2014 13:51:10 +0100 Message-ID: <5469EF3E.9080102@6wind.com> References: <1415635166-1364-1-git-send-email-olivier.matz@6wind.com> <1415984609-2484-1-git-send-email-olivier.matz@6wind.com> <1415984609-2484-7-git-send-email-olivier.matz@6wind.com> <20141117103951.GB2472@bricha3-MOBL3> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: dev-VfR2kkLFssw@public.gmane.org, jigsaw-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org To: Bruce Richardson Return-path: In-Reply-To: <20141117103951.GB2472@bricha3-MOBL3> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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