src/dpdk/drivers/common/mlx5/linux/mlx5_nl.c
static int
mlx5_nl_family_id_cb(struct nlmsghdr *nh, void *arg)
{

	struct nlattr *tail = RTE_PTR_ADD(nh, nh->nlmsg_len);
	struct nlattr *nla = RTE_PTR_ADD(nh, NLMSG_ALIGN(sizeof(*nh)) +
					NLMSG_ALIGN(sizeof(struct genlmsghdr)));

	for (; nla->nla_len && nla < tail;
	     nla = RTE_PTR_ADD(nla, NLMSG_ALIGN(nla->nla_len))) {
		if (nla->nla_type == CTRL_ATTR_FAMILY_ID) {
			*(uint16_t *)arg = *(uint16_t *)(nla + 1);
			return 0;
		}
	}
	return -EINVAL;
}
/**
 * Parse Netlink message to retrieve the general family ID.
 *
 * @param nh
 *   Pointer to Netlink Message Header.
 * @param arg
 *   PMD data register with this callback.
 *
 * @return
 *   0 on success, a negative errno value otherwise and rte_errno is set.
 */
Parse Netlink message to retrieve the general family ID.
@param nh
Pointer to Netlink Message Header.
@param arg
PMD data register with this callback.

@return
0 on success, a negative errno value otherwise and rte_errno is set.
Parse Netlink message to retrieve the general family ID . @param nh Pointer to Netlink Message Header . @param arg PMD data register with this callback . @return 0 on success a negative errno value otherwise and rte_errno is set .
static int
mlx5_nl_family_id_cb(struct nlmsghdr *nh, void *arg)
{
	struct nlattr *tail = RTE_PTR_ADD(nh, nh->nlmsg_len);
	struct nlattr *nla = RTE_PTR_ADD(nh, NLMSG_ALIGN(sizeof(*nh)) +
					NLMSG_ALIGN(sizeof(struct genlmsghdr)));
	for (; nla->nla_len && nla < tail;
	     nla = RTE_PTR_ADD(nla, NLMSG_ALIGN(nla->nla_len))) {
		if (nla->nla_type == CTRL_ATTR_FAMILY_ID) {
			*(uint16_t *)arg = *(uint16_t *)(nla + 1);
			return 0;
		}
	}
	return -EINVAL;
}
static int mlx5_nl_family_id_cb ( struct nlmsghdr * nh , void * arg ) { struct nlattr * tail = RTE_PTR_ADD ( nh , nh -> nlmsg_len ) ; struct nlattr * nla = RTE_PTR_ADD ( nh , NLMSG_ALIGN ( sizeof ( * nh ) ) + NLMSG_ALIGN ( sizeof ( struct genlmsghdr ) ) ) ; for ( ; nla -> nla_len && nla < tail ; nla = RTE_PTR_ADD ( nla , NLMSG_ALIGN ( nla -> nla_len ) ) ) { if ( nla -> nla_type == CTRL_ATTR_FAMILY_ID ) { * ( uint16_t * ) arg = * ( uint16_t * ) ( nla + 1 ) ; return 0 ; } } return - EINVAL ; }
Parse Netlink message to retrieve the general family ID.
Parse Netlink message to retrieve the general family ID .